[OpenSIPS-Users] Wrong Contact in location table

Dragomir Haralambiev goup2010 at gmail.com
Fri Oct 27 04:50:40 EDT 2017


Oct 27 11:47:32 web /usr/local/sbin/opensips[30490]: 57995010: REGISTER
before fix_nated_register <sip:57995010 at 192.168.2.196:5060>[1]
Oct 27 11:47:32 web /usr/local/sbin/opensips[30490]: 57995010: REGISTER
after fix_nated_register <sip:57995010 at 192.168.2.196:5060>[1]


2017-10-27 10:41 GMT+03:00 Răzvan Crainea <razvan at opensips.org>:

> Hi, Dragomir!
>
> Can you also print the Contact header ($ct[1]).
>
> [1] http://www.opensips.org/Documentation/Script-CoreVar-2-4#toc26
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Developerwww.opensips-solutions.com
>
> On 10/26/2017 10:32 PM, Dragomir Haralambiev wrote:
>
> Hi Răzvan,
>
> Here is script_trace() for REGISTER:
>
> Oct 26 22:14:30 /opensips[17718]: 57995010: REGISTER start trace
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:245][me][module
> fix_nated_register] -> (REGISTER from 108.203.232.10,
> ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:246][me][core
> setbflag] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:249][me][module
> fix_nated_contact] -> (REGISTER from 108.203.232.10,
> ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:260][me][core
> if] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:262][me][core
> if] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:260][me][module
> is_method] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:269][me][core
> if] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:265][me][module
> is_method] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:276][me][core
> if] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:272][me][module
> is_method] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:368][me][core
> if] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:279][me][module
> is_method] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:289][me][core
> if] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:363][me][core
> if] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:289][me][core
> isflagset] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:329][me][assign
> equal] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:331][me][core
> xlog] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: 57995010: Expires=360
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:346][me][core
> if] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:353][me][core
> if] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:346][me][module
> is_registered] -> (REGISTER from 108.203.232.10,
> ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:351][me][core
> if] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:347][me][module
> remove] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:348][me][core
> xlog] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: 57995010: Remove old registation
> (sip:57995010 at Opensips_IP:Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:353][me][assign
> equal] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:355][me][assign
> equal] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][(null):0][me][core
> set_host] -> (REGISTER from 108.203.232.10, ruri=sip:Opensips_IP:Opensips_
> port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:356][me][assign
> equal] -> (REGISTER from 108.203.232.10, ruri=sip:Registrar_IP:
> Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][(null):0][me][core
> set_port] -> (REGISTER from 108.203.232.10, ruri=sip:Registrar_IP:
> Opensips_port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:357][me][assign
> equal] -> (REGISTER from 108.203.232.10, ruri=sip:Registrar_IP:
> Registrar_Port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:358][me][assign
> equal] -> (REGISTER from 108.203.232.10, ruri=sip:Registrar_IP:
> Registrar_Port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:359][me][core
> xlog] -> (REGISTER from 108.203.232.10, ruri=sip:Registrar_IP:
> Registrar_Port)
> Oct 26 22:14:30 /opensips[17718]: 57995010: Forward REGISTER to REGISTRAR:
> Registrar_IP:Registrar_Port
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:360][me][module
> t_on_reply] -> (REGISTER from 108.203.232.10, ruri=sip:Registrar_IP:
> Registrar_Port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:361][me][module
> t_relay] -> (REGISTER from 108.203.232.10, ruri=sip:Registrar_IP:
> Registrar_Port)
> Oct 26 22:14:30 /opensips[17718]: [Script Trace][/etc/opensips/opensips.cfg:362][me][core
> exit] -> (REGISTER from 108.203.232.10, ruri=sip:Registrar_IP:
> Registrar_Port)
> Oct 26 22:14:30 /opensips[17715]: 57995010: Onreplay register From
> REGISTRAR - Trying (100)
> Oct 26 22:14:30 /opensips[17718]: 57995010: Onreplay register From
> REGISTRAR - REGISTERED (200 OK)
> Oct 26 22:14:30 /opensips[17718]: 57995010: REGISTERED. Save in location.
>
>
> 2017-10-26 10:36 GMT+03:00 Răzvan Crainea <razvan at opensips.org>:
>
>> Hi, Dragomir!
>>
>> Again, I really doubt fix_nated_register() is executed , since I am not
>> seeing the Received: part in the "ul show" output.
>> Can you post the output of the script_trace() function for that REGISTER
>> message? You can find here[1] a tutorial on how to use this function.
>>
>> [1] https://blog.opensips.org/2017/09/20/troubleshooting-opensips-script/
>>
>> Best regards,
>>
>> Răzvan Crainea
>> OpenSIPS Developerwww.opensips-solutions.com
>>
>> On 10/24/2017 12:41 AM, Dragomir Haralambiev wrote:
>>
>> Hi,
>>
>> I made setup like this help:
>>
>> https://blog.opensips.org/2016/12/13/how-to-proxy-sip-registrations/
>>
>>
>> fix_nated_register() is executed.
>>
>> If you like I can send my full script in privet email.
>>
>> Best regards,
>> Dragomir
>>
>>
>>
>>
>> 2017-10-23 10:55 GMT+03:00 Răzvan Crainea <razvan at opensips.org>:
>>
>>> Hi, Dragomir!
>>>
>>> Are you sure the code gets to that save() function? You are also using
>>> fix_nated_register(), but I don't see any register field in the location
>>> table either, so I presume you are not hitting that code at all.
>>>
>>> Best regards,
>>>
>>> Răzvan Crainea
>>> OpenSIPS Developerwww.opensips-solutions.com
>>>
>>> On 10/21/2017 01:40 AM, Dragomir Haralambiev wrote:
>>>
>>> Hello,
>>>
>>>
>>> I have follow line in my script:
>>> if (is_method("REGISTER")) {
>>> fix_nated_register();
>>> fix_nated_contact();
>>> ....
>>> save("location","c1", "$fu");
>>> }
>>> Opensips receive REGISTER  with
>>>
>>> "Contact: <sip:516203 at 192.168.2.203:5060>"
>>>
>>>
>>> I try to see location table
>>> opensipsctl  ul show
>>>
>>>         AOR:: 516203
>>>                 Contact:: sip:516203 at 192.168.2.203:5060 Q=
>>>                         ContactID:: 926418920300655256
>>>                         Expires:: 270
>>>                         Callid:: 509678716 at 192.168.2.203
>>>                         Cseq:: 2
>>>                         User-agent:: Yealink SIP-T19P 31.72.0.75
>>>                         State:: CS_SYNC
>>>                         Flags:: 0
>>>                         Cflags:: NAT_BFLAG
>>>                         Socket:: udp:1.2.3.4:5566
>>>                         Methods:: 16383
>>>
>>> Why after save("location") Contact address in location table is not fix?
>>> How setup Opensips to write into location table fixed Contact?
>>>
>>> Best regards,
>>> Dragomir
>>>
>>>
>>> _______________________________________________
>>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>>
>> _______________________________________________
>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20171027/ab795912/attachment-0001.html>


More information about the Users mailing list