[SR-Users] Nat problems

Daniel-Constantin Mierla miconda at gmail.com
Mon Sep 12 09:43:55 CEST 2011


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_lifetime


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 Zambrano<dzambrano at 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 at 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 at 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 at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda




More information about the sr-users mailing list