Hello All,
I am working to get Kamilio server as Proxy server with using 2 Asterisk as Voip servers.
The situation is that I connected a SIP phone to the Kamilio server and dispatching calls to Asterisk are going well in the direction to Asterisk but as soon I want to call the SIP phone back it does not work.
I have configured a Kamilio server as dispatcher:
route(DISPATCHER);
route[DISPATCHER] {
round robin dispatching on gateways group ‘1’
if(!ds_select_dst(“1”, “4”))
{
send_reply(“404”, “No destination”);
exit;
}
xlog(“ —— DISPATCH: going to <$ru> via <$du>n");
route(RELAY);
exit;
}
Created 2 dispatcher gateway:
kamctl dispatcher addgw 1 sip:10.2.11.120:5060
kamctl dispatcher addgw 1 sip:10.2.11.121:5060
Registered a SIP phone:
kamctl add 1001 1001
On the Asterisk in SIP.config
[1001]
type=friend
host=dynamic
secret=1001
context=000003
port=5060
insecure=invite
qualify=yes
disallow=all
allow=alaw
allow=ulaw
canreinvite=no
extensions.conf
[000003]
exten => _X!,1,Dial(SIP/outgoingworld/${EXTEN},180)
exten => _X!,2,Hangup
Till so far it works fine, the SIP phone is dispatched to Asterisk via Kamilio and I can call the rest off the world.
For calls to the SIP phone I have configured a channel to Kamilio:
SIP.config
[kamilio]
type=friend
host=172.16.1.94
port=5060
insecure=invite
qualify=yes
in extensions.config
exten => _X!,1,Dial(SIP/Kamailio/1001,180)
I get an ans ware back: congestion
I think that the reasson of this is that Kamailio want to dispatch back because I needed to change the kamailio.cfg
replace #route(PSTN);
new code:
route(DISPATCHER);
Any idea how to fix this