<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15515">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_nat: Don't rewrite Contact on REGISTER responses.<br><br>When sending a SIP response to an incoming REGISTER request<br>we don't want to change the Contact header as it will<br>contain the Contacts registered to the AOR and not our own<br>Contact URI.<br><br>ASTERISK-29235<br><br>Change-Id: I35a0723545281dd01fcd5cae497baab58720478c<br>---<br>M res/res_pjsip_nat.c<br>1 file changed, 10 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/15/15515/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_nat.c b/res/res_pjsip_nat.c</span><br><span>index 3d6f25d..ce0a84b 100644</span><br><span>--- a/res/res_pjsip_nat.c</span><br><span>+++ b/res/res_pjsip_nat.c</span><br><span>@@ -432,8 +432,16 @@</span><br><span> }</span><br><span> </span><br><span> if (!ast_sockaddr_isnull(&transport_state->external_signaling_address)) {</span><br><span style="color: hsl(0, 100%, 40%);">- /* Update the contact header with the external address */</span><br><span style="color: hsl(0, 100%, 40%);">- if (uri || (uri = nat_get_contact_sip_uri(tdata))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ pjsip_cseq_hdr *cseq = PJSIP_MSG_CSEQ_HDR(tdata->msg);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Update the contact header with the external address, however if this is</span><br><span style="color: hsl(120, 100%, 40%);">+ * a response to a REGISTER request we don't want to as the Contact headers</span><br><span style="color: hsl(120, 100%, 40%);">+ * in the response are the registered Contacts and not our own.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if ((!cseq || tdata->msg->type == PJSIP_REQUEST_MSG ||</span><br><span style="color: hsl(120, 100%, 40%);">+ pjsip_method_cmp(&cseq->method, &pjsip_register_method)) &&</span><br><span style="color: hsl(120, 100%, 40%);">+ (uri || (uri = nat_get_contact_sip_uri(tdata)))) {</span><br><span> pj_strdup2(tdata->pool, &uri->host, ast_sockaddr_stringify_host(&transport_state->external_signaling_address));</span><br><span> if (transport->external_signaling_port) {</span><br><span> uri->port = transport->external_signaling_port;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15515">change 15515</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/+/15515"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I35a0723545281dd01fcd5cae497baab58720478c </div>
<div style="display:none"> Gerrit-Change-Number: 15515 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>