<p>George Joseph <strong>uploaded patch set #3</strong> to this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/12825">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_nat: Restore original contact for REGISTER responses<br><br>RFC3261 Section 10 "Registrations", specifically paragraph<br>"10.2.4: Refreshing Bindings", states that a user agent compares<br>each contact address (in a 200 REGISTER response) to see if it<br>created the contact.  If the Asterisk endpoint has the<br>rewrite_contact option set however, the contact host and port sent<br>back in the 200 response will be the rewritten one and not the<br>one sent by the user agent.  This prevents the user agent from<br>matching its own contact.  Some user agents get very upset when<br>this happens and will not consider the registration successful.<br>While this is rare, it is acceptable behavior especially if more<br>than 1 user agent is allowed to register to a single endpoint/aor.<br><br>This commit updates res_pjsip_nat (where rewrite_contact is<br>implemented) to store the original incoming Contact header in<br>the request rdata before rewriting it, and to restore the original<br>host and port to the Contact header in the outgoing response.<br><br>This is only done if the request is a REGISTER and rewrite_contact<br>is enabled.<br><br>ASTERISK-28502<br>Reported-by: Ross Beer<br><br>Change-Id: Idc263ad2d2d7bd8faa047e5804d96a5fe1cd282e<br>---<br>M res/res_pjsip_nat.c<br>1 file changed, 66 insertions(+), 10 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/25/12825/3</pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/12825">change 12825</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/+/12825"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Idc263ad2d2d7bd8faa047e5804d96a5fe1cd282e </div>
<div style="display:none"> Gerrit-Change-Number: 12825 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>