<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 4:</p><p style="white-space: pre-wrap; word-wrap: break-word;">One more issue.<br>I don't know why, but this patch is not working if the active contact record already exists in realtime table ps_contacts.</p><p style="white-space: pre-wrap; word-wrap: break-word;">If contact exists in ps_contacts then debug only<br>Saving contact<br>got contact <br>So when "got contact" the x-ast-orig-host not found and it's not saved into realtime table ps_contacts,<br>the uri field is 'sip:endpoint@endpoint-public-ip:endpoint-public-port'</p><p style="white-space: pre-wrap; word-wrap: break-word;">If contact not  exists in ps_contacts then debug<br>Saving contact<br>got contact<br>Found orig host:<br>The x-ast-orig-host is found and it's saved into realtime table ps_contacts<br>the uri field is 'sip:endpoint@endpoint-public-ip:endpoint-public-port;x-ast-orig-host=endpoint-private-ip:endpoint-private-port'</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;"><br>Could you, please, look at res_pjsip_registrar.c function register_aor_core<br>starting with line 804.<br>It seems if contact URI:PORT from request is found in sorcery then this sorcery's contact will be used in response (so we lost x-ast-orig-host)</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/12824">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/12824">change 12824</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/12824"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: Idc263ad2d2d7bd8faa047e5804d96a5fe1cd282e </div>
<div style="display:none"> Gerrit-Change-Number: 12824 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 13 Sep 2019 19:54:54 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>