Hi Ive been trying to configure kamailio as a loadbalancer between two transcoders that afterwards send all calls to a softswitch but I currently have two problems.
My first and most important one is a NAT problem or so I think. All calls in UDP work perfectly but when dealing with calls in TCP only outgoing calls work, no incoming calls work. After doing some traces on the network I realized that the transcoder is trying to reach the router in front of the softphone and skipping the Kamailio loadbalancer. The call never reaches the softphone so the phonecall never completes. In UDP exactly the same thing happens, the call skips the Kamailio loadbalancer but the call completes perfectly fine.
The other detail has to do with the actual loadbalancing and failover. I was using the weight distribution and it works great except its sending the same CSeq to both transcoders and then the softswitch is receiving it twice and an error pops up at the softphone Ive been using saying theres a duplicate CSeq. I was using the forward() command after the dispatcher arguments. I changed it to the t_relay() and it works as in it doesnt send the same CSeq twice but instead a unique one to each transcoder so the Softswitch stopped winning but then the failover doesnt work. Whenever it one goes down its till trying to reach it. Im using roundrobin in the dispatcher config because I noticed it doesnt send stuff to both transcoders but only to the transcoder its going to actually use. I started to read that for failover I need the user_avp module which I didnt install but then I wonder how come failover worked before?
Thanks for your help
Cheers
David
On 09/02/2011 08:58 PM, David Zambrano wrote:
After doing some traces on the network I realized that the transcoder is trying to reach the router in front of the softphone and skipping the Kamailio loadbalancer. The call never reaches the softphone so the phonecall never completes. In UDP exactly the same thing happens, the call skips the Kamailio loadbalancer but the call completes perfectly fine.
Well, you can not open the TCP connection to the client behind NAT. You need to reuse the existing connection created during registration, so the request should go via load balancer by record-route or path. I'm not sure why this works for UDP, probably your router is too permissive in this case :-)
Regarding the loadbalancing and failover, I don't understand what is the problem. Could you specify which lb module do you use and preferable post the part of config responsible for failover. I believe you don't need to send request to both transcoders. To skip the transcoder that goes down you need to setup ping checks, if that is the only problem.
Hi andrew. Thanks for your help. What module or config should I use to make sure the connection goes back through the loadbalancer?
For the failover I didnt specify anything ping related. Im using the dispatcher module. Can I specify the ping config in that module or should I use another module for that? On Sep 2, 2011 2:24 PM, "Andrew Pogrebennyk" apogrebennyk@sipwise.com wrote:
On 09/02/2011 08:58 PM, David Zambrano wrote:
After doing some traces on the network I realized that the transcoder is trying to reach the router in front of the softphone and skipping the Kamailio loadbalancer. The call never reaches the softphone so the phonecall never completes. In UDP exactly the same thing happens, the call skips the Kamailio loadbalancer but the call completes perfectly fine.
Well, you can not open the TCP connection to the client behind NAT. You need to reuse the existing connection created during registration, so the request should go via load balancer by record-route or path. I'm not sure why this works for UDP, probably your router is too permissive in this case :-)
Regarding the loadbalancing and failover, I don't understand what is the problem. Could you specify which lb module do you use and preferable post the part of config responsible for failover. I believe you don't need to send request to both transcoders. To skip the transcoder that goes down you need to setup ping checks, if that is the only problem.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hi Heres the config Im using, I was out of the office when I answered the last email. Its a very very simple config as you can see.
# -- dispatcher params --
modparam("dispatcher", "list_file", "/usr/local/etc/kamailio/dispatcher.list") modparam("dispatcher", "flags", 2)
route{ ds_select_dst("2", "4"); t_relay(); }
David Zambrano Reyes
On 2 September 2011 15:33, David Zambrano dzambrano@gmail.com wrote:
Hi andrew. Thanks for your help. What module or config should I use to make sure the connection goes back through the loadbalancer?
For the failover I didnt specify anything ping related. Im using the dispatcher module. Can I specify the ping config in that module or should I use another module for that?
On Sep 2, 2011 2:24 PM, "Andrew Pogrebennyk" apogrebennyk@sipwise.com wrote:
On 09/02/2011 08:58 PM, David Zambrano wrote:
After doing some traces on the network I realized that the transcoder is trying to reach the router in front of the softphone and skipping the Kamailio loadbalancer. The call never reaches the softphone so the phonecall never completes. In UDP exactly the same thing happens, the call skips the Kamailio loadbalancer but the call completes perfectly fine.
Well, you can not open the TCP connection to the client behind NAT. You need to reuse the existing connection created during registration, so the request should go via load balancer by record-route or path. I'm not sure why this works for UDP, probably your router is too permissive in this case :-)
Regarding the loadbalancing and failover, I don't understand what is the problem. Could you specify which lb module do you use and preferable post the part of config responsible for failover. I believe you don't need to send request to both transcoders. To skip the transcoder that goes down you need to setup ping checks, if that is the only problem.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 09/02/2011 10:33 PM, David Zambrano wrote:
Hi andrew. Thanks for your help. What module or config should I use to make sure the connection goes back through the loadbalancer?
That's simply the task for record-route like:
if (is_method("INVITE")) record_route();
But you also need the loose_route for routing new in-dialog requests.
For the failover I didnt specify anything ping related. Im using the dispatcher module. Can I specify the ping config in that module or should I use another module for that?
yes, it's in the documentation of dispatcher module: http://kamailio.org/docs/modules/3.1.x/modules_k/dispatcher.html#id2806108
route{ ds_select_dst("2", "4"); t_relay(); }
well, with such config the chances are that the subsequent BYE may arrive at the different server than the INVITE, so again you need the loose_route section for this. You should get familiar with the default config file to get a feeling of things.
Regards, Andrew
Thanks Andrew Ill deal with the ping config once I resolve the route problem.
So now this is my config: route{
if (method != "REGISTER") loose_route();
if (is_method("INVITE")) record_route();
ds_select_dst("2", "4"); t_relay(); }
Now I can see in the sip headers that it is in fact adding the record-route properly with the correct ip address of the loadbalancer and the transport=tcp tag but the problem for incoming calls still presents itself. The transcoder is still trying to reach the softphone directly skipping the loadbalancer. Any ideas why would this still happen? Or did I just screw up the config and oversimplified it?
Thanks again
David
On 2 September 2011 17:04, Andrew Pogrebennyk apogrebennyk@sipwise.com wrote:
On 09/02/2011 10:33 PM, David Zambrano wrote:
Hi andrew. Thanks for your help. What module or config should I use to make sure the connection goes back through the loadbalancer?
That's simply the task for record-route like:
if (is_method("INVITE")) record_route();
But you also need the loose_route for routing new in-dialog requests.
For the failover I didnt specify anything ping related. Im using the dispatcher module. Can I specify the ping config in that module or should I use another module for that?
yes, it's in the documentation of dispatcher module: http://kamailio.org/docs/modules/3.1.x/modules_k/dispatcher.html#id2806108
route{ ds_select_dst("2", "4"); t_relay(); }
well, with such config the chances are that the subsequent BYE may arrive at the different server than the INVITE, so again you need the loose_route section for this. You should get familiar with the default config file to get a feeling of things.
Regards, Andrew
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Ok so It now includes the record-route but its still not modifying the contact header and the problem persists. ¿Any suggestions as to how to do that?
Cheers
David
On 2 September 2011 21:17, David Zambrano dzambrano@gmail.com wrote:
Thanks Andrew Ill deal with the ping config once I resolve the route problem.
So now this is my config: route{
if (method != "REGISTER") loose_route();
if (is_method("INVITE")) record_route();
ds_select_dst("2", "4"); t_relay(); }
Now I can see in the sip headers that it is in fact adding the record-route properly with the correct ip address of the loadbalancer and the transport=tcp tag but the problem for incoming calls still presents itself. The transcoder is still trying to reach the softphone directly skipping the loadbalancer. Any ideas why would this still happen? Or did I just screw up the config and oversimplified it?
Thanks again
David
On 2 September 2011 17:04, Andrew Pogrebennyk apogrebennyk@sipwise.com wrote:
On 09/02/2011 10:33 PM, David Zambrano wrote:
Hi andrew. Thanks for your help. What module or config should I use to make sure the connection goes back through the loadbalancer?
That's simply the task for record-route like:
if (is_method("INVITE")) record_route();
But you also need the loose_route for routing new in-dialog requests.
For the failover I didnt specify anything ping related. Im using the dispatcher module. Can I specify the ping config in that module or should I use another module for that?
yes, it's in the documentation of dispatcher module: http://kamailio.org/docs/modules/3.1.x/modules_k/dispatcher.html#id2806108
route{ ds_select_dst("2", "4"); t_relay(); }
well, with such config the chances are that the subsequent BYE may arrive at the different server than the INVITE, so again you need the loose_route section for this. You should get familiar with the default config file to get a feeling of things.
Regards, Andrew
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
On 9/7/11 12:49 AM, David Zambrano wrote:
Ok so It now includes the record-route but its still not modifying the contact header and the problem persists. ¿Any suggestions as to how to do that?
for updating the contact header you have to use nathelper module with fix_natted_contact(). Be sure you set the tcp connection lifetime reasonably high to be safe during a call, avoiding a need to reconnect behind nat, which is not possible: http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#tcp_connection...
I recommend you start from default config file for 3.1, strip the part with user auth, location, rtp proxy ... and plug in the dispatcher stuff. You have there proper record routing and nat traversal handling.
A more recent dispatcher config is available at:
http://kamailio.org/docs/modules/devel/modules_k/dispatcher.html#id2522847
It shows serial forking.
Cheers, Daniel
Cheers
David
On 2 September 2011 21:17, David Zambranodzambrano@gmail.com wrote:
Thanks Andrew Ill deal with the ping config once I resolve the route problem.
So now this is my config: route{
if (method != "REGISTER") loose_route();
if (is_method("INVITE")) record_route();
ds_select_dst("2", "4"); t_relay();
}
Now I can see in the sip headers that it is in fact adding the record-route properly with the correct ip address of the loadbalancer and the transport=tcp tag but the problem for incoming calls still presents itself. The transcoder is still trying to reach the softphone directly skipping the loadbalancer. Any ideas why would this still happen? Or did I just screw up the config and oversimplified it?
Thanks again
David
On 2 September 2011 17:04, Andrew Pogrebennykapogrebennyk@sipwise.com wrote:
On 09/02/2011 10:33 PM, David Zambrano wrote:
Hi andrew. Thanks for your help. What module or config should I use to make sure the connection goes back through the loadbalancer?
That's simply the task for record-route like:
if (is_method("INVITE")) record_route();
But you also need the loose_route for routing new in-dialog requests.
For the failover I didnt specify anything ping related. Im using the dispatcher module. Can I specify the ping config in that module or should I use another module for that?
yes, it's in the documentation of dispatcher module: http://kamailio.org/docs/modules/3.1.x/modules_k/dispatcher.html#id2806108
route{ ds_select_dst("2", "4"); t_relay(); }
well, with such config the chances are that the subsequent BYE may arrive at the different server than the INVITE, so again you need the loose_route section for this. You should get familiar with the default config file to get a feeling of things.
Regards, Andrew
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users