[OpenSIPS-Users] Wrong Contact in location table
Dragomir Haralambiev
goup2010 at gmail.com
Thu Nov 2 17:43:43 EDT 2017
Hi,
Here is part of my script:
....
modparam("registrar", "mcontact_avp", "$avp(register)")
.....
if (t_check_status("2[0-9][0-9]")) {
$log_level = 5;
script_trace( 1, "$rm from $si, ruri=$ru, ct=$ct.fields(uri)
avp(register)=$avp(register)", "me");
route(save_location);
.......
}
You can see log here:
https://pastebin.com/WWQ9Mmh4
Here is the replacement contact:
DBG:registrar:build_contact: created Contact HF: Contact: <
sip:55595009 at 192.168.22.138:5062>;expires=360
DBG:registrar:save: replacing contact uri [sip:55595009 at 188.23.232.10:1043]
with [sip:55595009 at 192.168.22.138:5062]
How to stop replacing contact from 188.23.232.10:1043 to 192.168.22.138:5062
?
2017-11-02 11:31 GMT+02:00 Răzvan Crainea <razvan at opensips.org>:
> Did you put the mcontact_avp parameter I asked you to?
> Can you print the value of the register just before save()? Also, can you
> send over some logs for the reply?
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Developerwww.opensips-solutions.com
>
> On 11/02/2017 12:26 AM, Dragomir Haralambiev wrote:
>
> Hi,
>
> I try this but in location table I not see real IP. Problem exists.
>
> When make save location $avp(register)=sip:55996201 at 192.27.47.139:5060
>
> opensipsctl ul show 55996201 at 192.27.47.139
>
> AOR:: 55996201
> Contact:: sip:57996201 at 192.168.22.201:5060 Q=
> ContactID:: 182005870676967428
>
> Where is problem?
>
>
> 2017-11-01 15:08 GMT+02:00 OpenSIPS Marketing <marketing at opensips.org>:
>
>> OK, I managed to figure out why you get the private IP in the location
>> table - that's because you are saving the registration in the onreply
>> route, where you no longer have access to the fix_nated_contact() value.
>>
>> To fix your issue, you need to do the following:
>> a. specify a mcontact_avp[1] in your script:
>> modparam("registrar", "mcontact_avp", "$avp(register)")
>>
>> b. just after fix_nated_contact() on your REGISTER request, store the
>> changed contact in that AVP:
>> fix_nated_contact();
>> $avp(register) = $ct.fields(uri);
>>
>> Doing these two changes to your script should store the real IP in the
>> location table.
>>
>> [1] http://www.opensips.org/html/docs/modules/2.4.x/registrar.ht
>> ml#idp5598160
>>
>> Best regards,
>>
>> On 11/01/2017 10:24 AM, Răzvan Crainea wrote:
>>
>> Can you print $ct.fields(uri) instead of $ct?
>> Also, please post the output on pastebin.com.
>>
>> Best regards,
>>
>> Răzvan Crainea
>> OpenSIPS Developerwww.opensips-solutions.com
>>
>> On 10/31/2017 03:47 PM, Răzvan Crainea wrote:
>>
>> Hi, Dragomir!
>>
>> Please post the logs I asked you to.
>>
>> Best regards,
>>
>> Răzvan Crainea
>> OpenSIPS Developerwww.opensips-solutions.com
>>
>> On 10/31/2017 03:45 PM, Sumit Birla wrote:
>>
>> X-Lite figures out its public IP and uses that in Via: and Contact:
>> headers unless you set ‘Firewall traversal method’ to ‘None’ in the account
>> settings.
>>
>>
>>
>>
>> On Oct 31, 2017, at 9:14 AM, Dragomir Haralambiev <goup2010 at gmail.com>
>> wrote:
>>
>> When REGISTER received from X-lite all is OK. Here part from REGISTER
>> message:
>>
>> REGISTER sip:OpenSip_IP:Opensips_port;transport=UDP SIP/2.0
>> Via: SIP/2.0/UDP 219.101.241.150:64726;branch=z
>> 9hG4bK-524287-1---39ee8718032a1a5a;rport
>> Contact: <sip:577222 at 219.101.241.150:64726;transport=UDP;rinstance=d6
>> 122d9250e9d0bd>
>>
>> Here "Via" contains real IP (this is Route IP).
>>
>> When REGISTER received from Yealink VoIP phone I have problem. Here part
>> from REGISTER message:
>>
>> REGISTER sip:OpenSip_IP:Opensips_port SIP/2.0
>> Via: SIP/2.0/UDP 192.168.2.207:5062;branch=z9hG4bK77238423
>> Contact: <sip:55896207 at 192.168.2.207:5062>
>>
>> Here "Via" contains not real IP (this is Yealink IP).
>>
>> What I do ?
>>
>>
>> 2017-10-31 14:18 GMT+02:00 Răzvan Crainea <razvan at opensips.org>:
>>
>>> So you did manage to fix your problem?
>>>
>>> Răzvan Crainea
>>> OpenSIPS Developerwww.opensips-solutions.com
>>>
>>> On 10/31/2017 02:17 PM, Dragomir Haralambiev wrote:
>>>
>>> Hi,
>>>
>>> Thanks for your replay.
>>>
>>> I execute fix_nated_contact() after fix_nated_register().
>>>
>>> Here part of my script:
>>> if (isflagset(NAT)) {
>>> if (is_method("REGISTER")) {
>>> fix_nated_register();
>>> setbflag(NAT_BFLAG); # nat register
>>> }
>>> fix_nated_contact();
>>> }
>>>
>>> In this case fix_nated_contact() will be fix contact records in location
>>> table.
>>>
>>>
>>> 2017-10-31 14:02 GMT+02:00 Răzvan Crainea <razvan at opensips.org>:
>>>
>>>> Hi, Dragomir!
>>>>
>>>> fix_nated_register() does not change the contact of the message,
>>>> fix_nated_contact() does that.
>>>> Please print the Contact header as I instructed earlier and send back
>>>> the script trace. Also, please post the logs on pastebin.com or
>>>> something, don't do it directly in the email.
>>>>
>>>> Best regards,
>>>>
>>>> Răzvan Crainea
>>>> OpenSIPS Developerwww.opensips-solutions.com
>>>>
>>>> On 10/31/2017 12:40 AM, Dragomir Haralambiev wrote:
>>>>
>>>> What will I do to solve this problem?
>>>>
>>>> 2017-10-27 11:50 GMT+03:00 Dragomir Haralambiev <goup2010 at gmail.com>:
>>>>
>>>>> 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
>>>>>>
>>>>>>
>>>> _______________________________________________
>>>> 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 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 listUsers at lists.opensips.orghttp://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/20171102/6a09a21e/attachment-0001.html>
More information about the Users
mailing list