<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">I investigated a bit more about this and although the effects might be similar, I'm not sure if my case and yours are triggered by the same reason.<div>This is how this problem can be simulated: the problem of duplicating did part in contact happens when the callee part sends back its contact with the same username as opensip contact.</div><div>In my case, if opensips (during topology hiding) changes contact to <sip:90006969.did.29c.2ed202e@opensips.public.ip> and sends it to callee, if callee (B side) responds with 200 OK and sets its contact to be: <sip:90006969.did.29c.2ed202e@Bside.public.ip:5060> which is the same username as opensips contact, but different ip (which I guess is correct by RFC?) then opensips changes the contact (incorrectly) to <sip:90006969.did.29c.2ed202e.did.29c.2ed202e@opensips.private.ip:5060></div><div>If developers of topology hiding module read this, maybe they have some ideas about why this happens?</div><div><br></div><div>Thanks,</div><div>Mark</div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 18, 2020 at 2:03 PM Ricardo Martinez <<a href="mailto:rmartinez@redvoiss.net">rmartinez@redvoiss.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ES-CL" style="overflow-wrap: break-word;"><div class="gmail-m_7595094470087458675WordSection1"><p class="MsoNormal"><span>Hi.</span></p><p class="MsoNormal"><span lang="EN-US">I have a very similar problem with the topology hiding module and with the mid_registrar module.</span></p><p class="MsoNormal"><span lang="EN-US">I don’t know if maybe I’m doing something wrong or maybe this is the way it has to work?. My scenario is as follows:</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">Private PBX – OpenSIP (Topology Hiding + MidRegistrar) -- UAC</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">When a REGISTER came from the UAC to the PBX I see something like this:</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">2020/11/18 09:49:00.290304 192.XXX.XXX.4:51045 -> 192.XXX.XXX.133:5060</span></p><p class="MsoNormal"><span lang="EN-US">REGISTER <a>sip:my.domain.com:5060</a> SIP/2.0</span></p><p class="MsoNormal"><span lang="EN-US">Via: SIP/2.0/UDP 192.XXX.XXX.4:51045;branch=z9hG4bK-524287-1---300f9ecbae4e0c8d;rport</span></p><p class="MsoNormal"><span lang="EN-US">Max-Forwards: 70</span></p><p class="MsoNormal"><b><i><span lang="EN-US">Contact: <<a>sip:d1.922@192.XXX.XXX.4:51045;rinstance=355eb6c1f6b62875</a>>;+sip.instance="<urn:uuid:4412d6b8-1095-5684-8e50-1e67ee70b6e2>";reg-id=1</span></i></b></p><p class="MsoNormal"><span lang="EN-US">To: "Ricardo Martinez"<<a>sip:d1.922@my.domain.com:5060</a>></span></p><p class="MsoNormal"><span lang="EN-US">From: "Ricardo Martinez"<<a>sip:d1.922@my.domain.com:5060</a>>;tag=7bb10a6e</span></p><p class="MsoNormal"><span lang="EN-US">Call-ID: 104875NWY1NThmMTJmOWMyNTdlNmY3OGIwZjZlNWIzMzk4NDM</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: OPTIONS, SUBSCRIBE, NOTIFY, INVITE, ACK, CANCEL, BYE, REFER, INFO, 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 release 6.2.2.0 stamp 104875</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"> </span></p><p class="MsoNormal"><span lang="EN-US">But then pass through the OpenSIPS with Topology Hiding enabled and Mid_registrar enabled I see:</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">2020/11/18 09:49:00.291478 192.XXX.XXX.134:5060 -> <a href="http://192.141.65.94:5060" target="_blank">192.141.65.94:5060</a></span></p><p class="MsoNormal"><span lang="EN-US">REGISTER <a>sip:my.domain.com:5060</a> SIP/2.0</span></p><p class="MsoNormal"><span lang="EN-US">Via: SIP/2.0/UDP 192.XXX.XXX.134:5060;branch=z9hG4bK4943.c7a48b07.0</span></p><p class="MsoNormal"><span lang="EN-US">Max-Forwards: 69</span></p><p class="MsoNormal"><b><i><span>Contact: <</span></i></b><b><i><span lang="EN-US"><a><span lang="ES-CL">sip:d1.922@192.XXX.XXX.134;thinfo=VG9obzAdIFs3YnpWYl0DRWlTfWJgXn5ZdFpkW2ZiZFtlVDEdPhInMjoMNVJwQWUEMWU3XjZZIUJiWWRmQ28lCzNOYVhhfWVbYUF1QH5QYGBuWmBZcw--</span></a></span></i></b><b><i><span>><</span></i></b><b><i><span lang="EN-US"><a><span lang="ES-CL">sip:2844375008405363167@192.XXX.XXX.134:5060</span></a></span></i></b><b><i><span>>;expires=3600</span></i></b></p><p class="MsoNormal"><span>To: "Ricardo Martinez"<</span><span lang="EN-US"><a><span lang="ES-CL">sip:d1.922@192.141.65.94</span></a></span><span>></span></p><p class="MsoNormal"><span>From: "Ricardo Martinez"<</span><span lang="EN-US"><a><span lang="ES-CL">sip:d1.922@192.XXX.XXX.134:5060</span></a></span><span>>;tag=7bb10a6e</span></p><p class="MsoNormal"><span>Call-ID: 104875NWY1NThmMTJmOWMyNTdlNmY3OGIwZjZlNWIzMzk4NDM</span></p><p class="MsoNormal"><span>CSeq: 1 REGISTER</span></p><p class="MsoNormal"><span>Expires: 3600</span></p><p class="MsoNormal"><span lang="EN-US">Allow: OPTIONS, SUBSCRIBE, NOTIFY, INVITE, ACK, CANCEL, BYE, REFER, INFO, 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 release 6.2.2.0 stamp 104875</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"> </span></p><p class="MsoNormal"><span lang="EN-US">As you can see the CONTACT is duplicated and I’m getting the next error:</span></p><p class="MsoNormal"><span lang="EN-US">ERROR:mid_registrar:save_restore_rpl_contacts: 200 OK reply does not include all req contacts! (ci: 104875NWY1NThmMTJmOWMyNTdlNmY3OGIwZjZlNWIzMzk4NDM)</span></p><p class="MsoNormal"><span lang="EN-US">Nov 18 09:58:00 sbcar /usr/local/sbin/opensips[11924]: ERROR:mid_registrar:mid_reg_resp_in: failed to process rpl contacts for AoR 'd1.922'</span></p><p class="MsoNormal"><span lang="EN-US"> </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"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">Regards,</span></p><p class="MsoNormal"><span lang="EN-US">Ricardo</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm"><p class="MsoNormal"><b><span lang="ES">De:</span></b><span lang="ES"> Users <<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a>> <b>En nombre de </b>M S<br><b>Enviado el:</b> martes, 17 de noviembre de 2020 22:24<br><b>Para:</b> OpenSIPS users mailling list <<a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a>><br><b>Asunto:</b> [OpenSIPS-Users] topology hiding bug?</span></p></div><p class="MsoNormal"> </p><div><div><div><div><div><div><div><p class="MsoNormal">Dear OpenSIPS development team,</p><div><p class="MsoNormal">I have come across a strange case that sometime when I use topology_hiding("UD"), it makes a mistake in changing Contact field.</p></div><div><p class="MsoNormal">Scenario is:</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">A: (Contact: <<a href="http://sip:90006969@172.24.8.5:5060" target="_blank">sip:90006969@172.24.8.5:5060</a>>) sends Invite to private IP of opensips, opensips changes Contact field to: (Contact: <<a>sip:90006969.did.29c.2ed202e@public.ip</a>>) and sends Invite from public IP to B. </p></div><div><p class="MsoNormal">Then B sends 200 OK back to Opensips public IP, with correct Contact: (Contact: <<a>sip:90006969.did.29c.2ed202e@Bpublic.ip:5060</a>>). so far so good.</p></div><div><p class="MsoNormal">Now Opensips sends 200 OK back to A from its private IP, and changes Contact to:</p></div><div><p class="MsoNormal">Contact: <<a href="mailto:sip%3A90006969.did.29c.2ed202e.did.29c.2ed202e@172.24.8.37" target="_blank">sip:90006969.did.29c.2ed202e.did.29c.2ed202e@172.24.8.37</a>></p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">As you see, did part is repeated twice.. and that means when A replies with:</p></div><div><p class="MsoNormal">ACK <a href="mailto:sip%3A90006969.did.29c.2ed202e.did.29c.2ed202e@172.24.8.37" target="_blank">sip:90006969.did.29c.2ed202e.did.29c.2ed202e@172.24.8.37</a> SIP/2.0</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">Opensips throws an error: ERROR:dialog:dlg_onroute: malformed route param [29c.2ed202e.did.29c.2ed202e]</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">Is this a bug? I am using Opensips 3.1.0.</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">Thanks,</p></div><div><p class="MsoNormal">Mark</p></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>