[OpenSIPS-Users] NAT fixup question

Jeff Kronlage jeff at data102.com
Tue Oct 20 19:56:40 CEST 2009


Bogdan,

The pertinent part of my config file contains this snippet:

$var(ruriuser) = $rU;
if (has_totag()) {
	xlog("DEBUG1 ru is $ru, du is $du");
	if (loose_route()) {
		xlog("DEBUG2 ru is $ru, du is $du");
		$rU = $var(ruriuser); #Hack job
	....

Between my first xlog and second xlog is where the change happens to the
$rU value.  I reset the $rU value at the bottom in a terrible hack job
that's getting my couple of NAT users by for the moment, but I'm
obviously not happy with the way I'm handling it.

Looking at the documentation for loose_route --
"The name is a little bit confusing, as this function also routes
requests which are in the "strict router" format."

Does loose_route() return true if strict routing?   If not, then I
imagine that's not what's happening, because my 2nd xlog wouldn't even
execute

Also, I don't have my IP address in my local domains, and I'm not using
aliases.

Thanks,

Jeff


-----Original Message-----
From: users-bounces at lists.opensips.org
[mailto:users-bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei
Iancu
Sent: Tuesday, October 20, 2009 10:15 AM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] NAT fixup question

HI Jeff,

Just a wild guess - looking at the RURI and ROUTE hdrs, I would say your

opensips is doing strict routing and not loose routing - this may happen

when the IP in RURI is recognized as local SIP domain....

So, have you added "64.111.17.11" IP as alias in script or in domain 
table ? if so, please remove it!

Regards,
Bogdan



Jeff Kronlage wrote:
> Please also note this only happens on reinvites - the initial invite
is
> fine.
>
> -----Original Message-----
> From: users-bounces at lists.opensips.org
> [mailto:users-bounces at lists.opensips.org] On Behalf Of Jeff Kronlage
> Sent: Monday, October 19, 2009 10:33 PM
> To: OpenSIPS users mailling list
> Subject: Re: [OpenSIPS-Users] NAT fixup question
>
> Bogdan,
>
> I wish I could post something useful.  I've been tinkering with this
all
> evening, the catch is that one of our sip providers does things a tad
> unusual and I have a number of normalization procedures in place that
> make it hard to output something useful for this.
>
> I can provide this information -
>
> The inbound packet is:
> 22:19:32.479151 IP (tos 0x0, ttl 249, id 1369, offset 0, flags [none],
> proto UDP (17), length 539) 64.111.16.10.45463 > 64.YYY.XX.XX.5060:
SIP,
> length: 511
>         ACK sip:719330XXXX at 64.111.17.11:5060 SIP/2.0
>         Via: SIP/2.0/UDP 192.168.1.105:5060;branch=z9hG4bK-c6f3cdea
>         From:
> <sip:719358ZZZZ at proxy.sip.data102.com>;tag=5d371768e81ef5fci0
>         To: <sip:719330XXXX at proxy.sip.data102.com>;tag=3442594C-21D0
>         Call-ID: 948E57D9-BC6611DE-AE38B8A5-3ADA34D9 at 64.111.17.2
>         CSeq: 101 ACK
>         Max-Forwards: 70
>         Route:
> <sip:64.YYY.XX.XX;lr=on;ftag=3442594C-21D0;did=03f.4363e5f6>
>         Contact: 719358ZZZZ <sip:719358ZZZZ at 192.168.1.105:5060>
>         User-Agent: Linksys/SPA2102-3.3.6
>         Content-Length: 0
>
> After I receive this packet and loose_route() is called, the RURI
> (specifically the value of $ru, as confirmed via xlog) is set to:
> sip:64.YYY.XX.XX;lr=on;ftag=3444FCF0-2256;did=10a.beb781a3
> (note this is identical to the "Route" field - not sure how I missed
> that prior to your mentioning it)
>
> A debug value of 4 produces:
> DBG:rr:after_loose: Topmost route URI:
> 'sip:64.YYY.XX.XX;lr=on;ftag=33F412AC-1CD1;did=a35.17b53e66' is me
> (not sure if that is of any use)
>
> I'm certain this is too vague to produce a solid answer, but any idea
> where I might look next?
>
> Thanks,
>
> Jeff
>
> -----Original Message-----
> From: users-bounces at lists.opensips.org
> [mailto:users-bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei
> Iancu
> Sent: Monday, October 19, 2009 9:21 PM
> To: OpenSIPS users mailling list
> Subject: Re: [OpenSIPS-Users] NAT fixup question
>
> RURI has nothing to do with the VIA part..
>
> Also RURI is not to be changed during loose_route(), only if you have
a 
> strict router proxy in front of you....maybe you can post the inbound 
> and outbound request (to see how the loose_route() is done)
>
> Regards,
> Bogdan
>
> Jeff Kronlage wrote:
>   
>> The RURI.
>>
>> Thanks,
>>
>> Jeff
>>
>> -----Original Message-----
>> From: users-bounces at lists.opensips.org
>> [mailto:users-bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei
>> Iancu
>> Sent: Monday, October 19, 2009 9:13 PM
>> To: OpenSIPS users mailling list
>> Subject: Re: [OpenSIPS-Users] NAT fixup question
>>
>> Jeff,
>>
>> the VIA hdr does not require mangling - the addition of the
"received"
>>     
>
>   
>> param is enough to handle nat issues. So the VIA you posted is
correct
>>     
>
>   
>> form NAT traversal point of view.
>>
>> Regarding the user part of the URI - what URI you are talking about? 
>> RURI ? TO / FROM uri? Contact URI ?
>>
>> Regards,
>> Bogdan
>>
>> Jeff Kronlage wrote:
>>   
>>     
>>> Thanks Bogdan,
>>>
>>> An unrelated question:
>>>
>>> Does anything special need to be done with "via" statements when
>>> implementing NAT transversal?
>>>
>>> Fix_nated_contact() takes care of the contact field for me, but I
>>>     
>>>       
>> still
>>   
>>     
>>> end up with:
>>> Via: SIP/2.0/UDP
>>>
>>>     
>>>       
>
192.168.1.105:5060;rport=42080;received=64.YYY.XX.XX;branch=z9hG4bK-e4e5
>   
>>   
>>     
>>> cd84
>>>
>>> I'm having some random problems with the user part of the URI
>>>       
> randomly
>   
>>> vanishing after I call loose_route() when NAT is involved, and I'm
>>> thinking these are related.
>>>
>>> Thanks,
>>>
>>> --
>>> Jeff Kronlage
>>> Senior IT Engineer, Data102
>>> 102 South Tejon, Suite #1250
>>> Colorado Springs, CO 80903
>>> (719) 387-0000 x 1335 direct
>>> (719) 578-8844 fax
>>> jeff at data102.com / http://www.data102.com
>>>
>>>
>>> -----Original Message-----
>>> From: users-bounces at lists.opensips.org
>>> [mailto:users-bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei
>>> Iancu
>>> Sent: Monday, October 19, 2009 4:07 PM
>>> To: OpenSIPS users mailling list
>>> Subject: Re: [OpenSIPS-Users] Additional info on potential
>>>     
>>>       
>> registration
>>   
>>     
>>> issue
>>>
>>> so DB ONLY mode......simply ignore the warning (see its meaning in
my
>>>       
>
>   
>>> previous post) . The contacts will still be shared, but the socket 
>>> information discarded.
>>>
>>> Regards,
>>> Bogdan
>>>
>>> Jeff Kronlage wrote:
>>>   
>>>     
>>>       
>>>> Usrloc mode is 3.  
>>>>
>>>> --
>>>> Jeff Kronlage
>>>> Senior IT Engineer, Data102
>>>> 102 South Tejon, Suite #1250
>>>> Colorado Springs, CO 80903
>>>> (719) 387-0000 x 1335 direct
>>>> (719) 578-8844 fax
>>>> jeff at data102.com / http://www.data102.com
>>>>
>>>> -----Original Message-----
>>>> From: users-bounces at lists.opensips.org
>>>> [mailto:users-bounces at lists.opensips.org] On Behalf Of
Bogdan-Andrei
>>>> Iancu
>>>> Sent: Monday, October 19, 2009 11:32 AM
>>>> To: OpenSIPS users mailling list
>>>> Subject: Re: [OpenSIPS-Users] Additional info on potential
>>>>     
>>>>       
>>>>         
>>> registration
>>>   
>>>     
>>>       
>>>> issue
>>>>
>>>> So, this is the problem - each opensips instance loads only the
>>>>       
>>>>         
>> usrloc
>>   
>>     
>>>>     
>>>>       
>>>>         
>>>   
>>>     
>>>       
>>>> records that have the a local socket corresponding to that
instance.
>>>>     
>>>>       
>>>>         
>>> In 
>>>   
>>>     
>>>       
>>>> other words, if the record was saved by the other instance,
opensips
>>>>         
>
>   
>>>> will not load it.
>>>>
>>>> what db_mode do you use for usrloc?
>>>>
>>>> Regards,
>>>> Bogdan
>>>>
>>>> Jeff Kronlage wrote:
>>>>   
>>>>     
>>>>       
>>>>         
>>>>> Yes, shared location table over multiple servers.
>>>>>
>>>>> -----Original Message-----
>>>>> From: users-bounces at lists.opensips.org
>>>>> [mailto:users-bounces at lists.opensips.org] On Behalf Of
>>>>>           
> Bogdan-Andrei
>   
>>>>> Iancu
>>>>> Sent: Sunday, October 18, 2009 10:33 PM
>>>>> To: OpenSIPS users mailling list
>>>>> Subject: Re: [OpenSIPS-Users] Additional info on potential
>>>>>     
>>>>>       
>>>>>         
>>>>>           
>>>> registration
>>>>   
>>>>     
>>>>       
>>>>         
>>>>> issue
>>>>>
>>>>> Hi Jeff,
>>>>>
>>>>> Do you use a shared location table (via multiple registrar
servers)
>>>>>         
>>>>>           
>> ?
>>   
>>     
>>>>> Regards,
>>>>> Bogdan
>>>>>
>>>>> Jeff Kronlage wrote:
>>>>>   
>>>>>     
>>>>>       
>>>>>         
>>>>>           
>>>>>> I'm getting this over and over in my syslog:
>>>>>>
>>>>>> WARNING:usrloc:get_all_db_ucontacts: non-local socket
>>>>>> <udp:HI.DDE.N.12:5060>...ignoring
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Jeff
>>>>>>
>>>>>>
>>>>>>       
>>>>>>         
>>>>>>           
>>>>>>             


_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



More information about the Users mailing list