Hello,
I am following the instructions in http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb to configure my Kamailio and Asterisk (using PJSIP realtime with MySQL). I am able to get Kamailio register the clients (tested with Zoiper softphone), but having trouble getting any further to load balance a couple of Asterisk servers. Here is a range of issues I have:
(a) The Kamailio server keeps sending UDP SIP messages to the Asterisk server and it is not clear where to control what protocol to use to send SIP messages Asterisk server(s). (b) I followed the instructions for the dispatcher module in the wiki, but it is not clear why I should use the #!define WITH_ASTERISK directive to enumerate the bind IPs and ports (how does this reconcile with the list of Asterisk servers in the dispatcher.list file?):
!ifdef WITH_ASTERISK asterisk.bindip = "192.168.1.102" desc "Asterisk IP Address" asterisk.bindport = "5060" desc "Asterisk Port" kamailio.bindip = "192.168.1.101" desc "Kamailio IP Address" kamailio.bindport = "5060" desc "Kamailio Port"
Also, where do I specify the protocol to use when sending to the Asterisk servers? Is it auto detected? If so, why is Kamailio not detecting that the Asterisk servers are only listening on TCP?
Any help is appreciated. My entire /etc/kamailio/kamailio.cfg file is in here: https://gist.github.com/ticklingcontest/c7437dbc2d8e838834ee4d852753f254. I am using Kamailio 4.0.4 with Asterisk 13.7.2 using TCP for PJSIP.
Thanks!
Am not a expert user of Kamilio. But this looks like, port issue. Kamilio SIP port and Asterisk SIP port not supposed to be same I guess..
Regards, Gopal.
On Thu, 21 Jul 2016 at 02:07 Tickling Contest tickling.contest@gmail.com wrote:
In the cfg file you will note that the IP address of the asterisk server and kamailio server are different, so this should not matter.
On Thu, Jul 21, 2016 at 3:08 AM, Gopalakrishnan N saigop@gmail.com wrote:
On Wed, Jul 20, 2016 at 04:37:42PM -0400, Tickling Contest wrote:
http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb
..
route[TOASTERISK] creates $du in the following way:
$du = "sip:" + $sel(cfg_get.asterisk.bindip) + ":" + $sel(cfg_get.asterisk.bindport);
No mention of transport so it will use the default UDP. Same for the other places where bindip/binport are used. If you want TCP or TLS instead you'll have to add a transport to the URI or use specific function to relay/send messages (like t_relay_to_tcp() instead of t_relay()).
You shouldn't since it doesn't reconcile. The WITH_ASTERISK directive is used to communicate with 1 specific SIP server. http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html contains a full example of a config with dispatcher. But note that the kamailio/asterisk realtime integration does some stuff (sending registers to asterisk) that need to be handled differently (I suggest useing kamailio as registar).