<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EstiloCorreo17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang="ES-CL" link="#0563C1" vlink="#954F72" style="word-wrap:break-word"><div class="WordSection1"><p class="MsoNormal"><span lang="EN-US">Hi.</span></p><p class="MsoNormal"><span lang="EN-US">I’m facing a weird problem with the NATHELPER module.  I’m using Opensips 3.1.0.</span></p><p class="MsoNormal"><span lang="EN-US">Seems that for certains REGISTER messages the nathelper module can fix the Contact IP address with the fix_nated_register() function.  I don’t know if I’m missing something or maybe is a bug.</span></p><p class="MsoNormal"><span lang="EN-US">So, this is the scenarario.</span></p><p class="MsoNormal"><span lang="EN-US">I have opensips in front of a PBX, using the NATHELPER module for NAT traversal and the MID_REGISTER module for managing the REGISTER messages to the PBX</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">Local PBX – Opensips (NATHELPE + REGISTER) --- UAC</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">The UAC is a softphone in a local WiFi network, when the softphone register for the first time I can see the REGISTER flow OK, NATHELPER module changing the private IP with the public received IP and port.  This is the initial register:</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">2020/11/20 11:05:21.150428 <a href="http://186.106.166.154:44849">186.106.166.154:44849</a> -> 64.76.XXX.133:5060</span></p><p class="MsoNormal"><span lang="EN-US">REGISTER </span><a href="sip:my.domain.com:5060"><span lang="EN-US">sip:my.domain.com:5060</span></a><span lang="EN-US"> SIP/2.0</span></p><p class="MsoNormal"><span lang="EN-US">Via: SIP/2.0/UDP 192.168.1.83:44849;branch=z9hG4bK-524287-1---10f17e71be522f67;rport</span></p><p class="MsoNormal"><span lang="EN-US">Max-Forwards: 70</span></p><p class="MsoNormal"><span lang="EN-US">Contact: <</span><a href="sip:d1.920@192.168.1.83:44849;rinstance=e21f207006bd104d"><span lang="EN-US">sip:d1.920@192.168.1.83:44849;rinstance=e21f207006bd104d</span></a><span lang="EN-US">>;+sip.instance="<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>";reg-id=1</span></p><p class="MsoNormal"><span lang="EN-US">To: "User 920"<</span><a href="sip:d1.920@my.domain.com:5060"><span lang="EN-US">sip:d1.920@my.domain.com:5060</span></a><span lang="EN-US">></span></p><p class="MsoNormal"><span lang="EN-US">From: "User 920"<</span><a href="sip:d1.920@my.domain.com:5060"><span lang="EN-US">sip:d1.920@my.domain.com:5060</span></a><span lang="EN-US">>;tag=4fa4f17b</span></p><p class="MsoNormal"><span lang="EN-US">Call-ID: 186079_mobile-rel120NjE4M2U3MWEzMjFhYjRmZDM0NGQyYWNkYWJjZjliNjA</span></p><p class="MsoNormal"><span lang="EN-US">CSeq: 1 REGISTER</span></p><p class="MsoNormal"><span lang="EN-US">Expires: 300</span></p><p class="MsoNormal"><span lang="EN-US">Allow: OPTIONS, INVITE, ACK, CANCEL, BYE, REFER, INFO, NOTIFY, UPDATE, PRACK, SUBSCRIBE, MESSAGE</span></p><p class="MsoNormal"><span lang="EN-US">Supported: outbound, path</span></p><p class="MsoNormal"><span lang="EN-US">User-Agent: VEX Android 6.3.1.1 build 122490</span></p><p class="MsoNormal"><span lang="EN-US">Content-Length: 0</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">And the output for the command ul_dump</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">[root@sbcar opensips]# opensips-cli -x mi ul_dump</span></p><p class="MsoNormal"><span lang="EN-US">{</span></p><p class="MsoNormal"><span lang="EN-US">    "Domains": [</span></p><p class="MsoNormal"><span lang="EN-US">        {</span></p><p class="MsoNormal"><span lang="EN-US">            "name": "location",</span></p><p class="MsoNormal"><span lang="EN-US">            "hash_size": 4096,</span></p><p class="MsoNormal"><span lang="EN-US">            "AORs": [</span></p><p class="MsoNormal"><span lang="EN-US">                {</span></p><p class="MsoNormal"><span lang="EN-US">                    "AOR": "d1.920-mydomain1",</span></p><p class="MsoNormal"><span lang="EN-US">                    "Contacts": [</span></p><p class="MsoNormal"><span lang="EN-US">                        {</span></p><p class="MsoNormal"><span lang="EN-US">                            "Contact": "</span><a href="sip:d1.920@186.106.166.154:44849;rinstance=e21f207006bd104d"><span lang="EN-US">sip:d1.920@186.106.166.154:44849;rinstance=e21f207006bd104d</span></a><span lang="EN-US">",</span></p><p class="MsoNormal"><span lang="EN-US">                            "ContactID": "933089547795829631",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Expires": 290,</span></p><p class="MsoNormal"><span lang="EN-US">                            "Q": "",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Callid": "186079_mobile-rel120NjE4M2U3MWEzMjFhYjRmZDM0NGQyYWNkYWJjZjliNjA",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Cseq": 10,</span></p><p class="MsoNormal"><span lang="EN-US">                            "User-agent": "VEX Android 6.3.1.1 build 122490",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Received": "</span><a href="sip:186.106.166.154:44849"><span lang="EN-US">sip:186.106.166.154:44849</span></a><span lang="EN-US">",</span></p><p class="MsoNormal"><span lang="EN-US">                            "State": "CS_NEW",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Flags": 0,</span></p><p class="MsoNormal"><span lang="EN-US">                            "Cflags": "SIP_PING NAT",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Socket": "udp:64.76.XXX.133:5060",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Methods": 8063,</span></p><p class="MsoNormal"><span lang="EN-US">                            "SIP_instance": "<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>"</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">So far so good.</span></p><p class="MsoNormal"><span lang="EN-US">But, the softphone is an app in a mobile phone, so at some point the softphone “goes to sleep”, and my “PUSH” server takes control.  So the Push server REGISTERS on behalf of the softphone… the REGISTER arrives at the Opensip, again from a NATED environment, so the uac_nat_test(19) catch the REGISTER, and apply fix_nated_register.  But for some reason I don’t get the stored “Contact” keeps the “private” IP.</span></p><p class="MsoNormal"><span lang="EN-US">This is the “new” REGISTER for the PUSH SERVER….</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">2020/11/20 11:06:21.333836 <a href="http://216.93.246.120:5060">216.93.246.120:5060</a> -> 64.76.XXX.133:5060</span></p><p class="MsoNormal"><span lang="EN-US">REGISTER </span><a href="sip:my.domain.com:5060"><span lang="EN-US">sip:my.domain.com:5060</span></a><span lang="EN-US"> SIP/2.0</span></p><p class="MsoNormal"><span lang="EN-US">Via: SIP/2.0/UDP 10.10.223.107:5060;branch=z9hG4bK-524287-1---4703675abd3a9c18;rport</span></p><p class="MsoNormal"><span lang="EN-US">Max-Forwards: 70</span></p><p class="MsoNormal"><span lang="EN-US">Contact: <</span><a href="sip:d1.920@10.10.223.107:5060;rinstance=d1.920-d789e5c341f8ac524c0a3441cded7ba6"><span lang="EN-US">sip:d1.920@10.10.223.107:5060;rinstance=d1.920-d789e5c341f8ac524c0a3441cded7ba6</span></a><span lang="EN-US">>;+sip.instance="<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>";reg-id=1;expires=600</span></p><p class="MsoNormal"><span lang="EN-US">To: <</span><a href="sip:d1.920@my.domain.com:5060"><span lang="EN-US">sip:d1.920@my.domain.com:5060</span></a><span lang="EN-US">></span></p><p class="MsoNormal"><span lang="EN-US">From: <</span><a href="sip:d1.920@my.domain.com:5060"><span lang="EN-US">sip:d1.920@my.domain.com:5060</span></a><span lang="EN-US">>;tag=cfad065a</span></p><p class="MsoNormal"><span lang="EN-US">Call-ID: </span><a href="mailto:txOBq9Lhk1tSVlM9eOTdzA..@216.93.246.122"><span lang="EN-US">txOBq9Lhk1tSVlM9eOTdzA..@216.93.246.122</span></a><span lang="EN-US"></span></p><p class="MsoNormal"><span lang="EN-US">CSeq: 1 REGISTER</span></p><p class="MsoNormal"><span lang="EN-US">Expires: 600</span></p><p class="MsoNormal"><span lang="EN-US">Allow: ACK, BYE, CANCEL, INVITE, NOTIFY, MESSAGE, OPTIONS, PRACK, REGISTER, UPDATE</span></p><p class="MsoNormal"><span lang="EN-US">User-Agent: CounterPath Bria Push Server 2.3.0 (20980)</span></p><p class="MsoNormal"><span lang="EN-US">Content-Length: 0</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">And this is the locations table.</span></p><p class="MsoNormal"><span lang="EN-US">[root@sbcar opensips]# opensips-cli -x mi ul_dump</span></p><p class="MsoNormal"><span lang="EN-US">{</span></p><p class="MsoNormal"><span lang="EN-US">    "Domains": [</span></p><p class="MsoNormal"><span lang="EN-US">        {</span></p><p class="MsoNormal"><span lang="EN-US">            "name": "location",</span></p><p class="MsoNormal"><span lang="EN-US">            "hash_size": 4096,</span></p><p class="MsoNormal"><span lang="EN-US">            "AORs": [</span></p><p class="MsoNormal"><span lang="EN-US">                {</span></p><p class="MsoNormal"><span lang="EN-US">                    "AOR": "d1.920-mydomain",</span></p><p class="MsoNormal"><span lang="EN-US">                    "Contacts": [</span></p><p class="MsoNormal"><span lang="EN-US">                        {</span></p><p class="MsoNormal"><span lang="EN-US">                            "Contact": "</span><a href="sip:d1.920@10.10.223.107:5060;rinstance=d1.920-d789e5c341f8ac524c0a3441cded7ba6"><span lang="EN-US">sip:d1.920@10.10.223.107:5060;rinstance=d1.920-d789e5c341f8ac524c0a3441cded7ba6</span></a><span lang="EN-US">",</span></p><p class="MsoNormal"><span lang="EN-US">                            "ContactID": "933089547795829633",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Expires": 587,</span></p><p class="MsoNormal"><span lang="EN-US">                            "Q": "",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Callid": "</span><a href="mailto:txOBq9Lhk1tSVlM9eOTdzA..@216.93.246.122"><span lang="EN-US">txOBq9Lhk1tSVlM9eOTdzA..@216.93.246.122</span></a><span lang="EN-US">",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Cseq": 2,</span></p><p class="MsoNormal"><span lang="EN-US">                            "User-agent": "CounterPath Bria Push Server 2.3.0 (20980)",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Received": "</span><a href="sip:216.93.246.120:5060"><span lang="EN-US">sip:216.93.246.120:5060</span></a><span lang="EN-US">",</span></p><p class="MsoNormal"><span lang="EN-US">                            "State": "CS_NEW",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Flags": 0,</span></p><p class="MsoNormal"><span lang="EN-US">                            "Cflags": "SIP_PING NAT",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Socket": "udp:64.76.XXX.133:5060",</span></p><p class="MsoNormal"><span lang="EN-US">                            "Methods": 3567,</span></p><p class="MsoNormal"><span lang="EN-US">                            "SIP_instance": "<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>"</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">Does someone have a clue on this?</span></p><p class="MsoNormal">Thanks!<span lang="EN-US"></span></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black"> </span></b></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">Ricardo Martinez</span></b><span lang="EN-US"></span></p></div></body></html>