<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6718">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Sean Bright: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_session: Prevent user=phone being added to anonimized URIs.<br><br>Move ast_sip_add_usereqphone to be called after anonymization of URIs,<br>to prevent the user_eq_phone adding "user=phone" to URIs containing a<br>username that is not a phonenumber (RFC3261 19.1.1). An extra call to<br>ast_sip_add_usereqphone on the saved version before anonymization is<br>added to add user=phone" to the PAI.<br><br>ASTERISK-27047 #close<br><br>Change-Id: Ie5644bc66341b86dc08b1f7442210de2e6acdec6<br>---<br>M res/res_pjsip_session.c<br>1 file changed, 4 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c<br>index 49f2f17..d8789ae 100644<br>--- a/res/res_pjsip_session.c<br>+++ b/res/res_pjsip_session.c<br>@@ -1329,10 +1329,9 @@<br> pj_strdup2(dlg_pool, &dlg_info_uri->host, session->endpoint->fromdomain);<br> }<br> <br>- ast_sip_add_usereqphone(session->endpoint, dlg_pool, dlg_info->uri);<br>-<br> /* We need to save off the non-anonymized From for RPID/PAI generation (for domain) */<br> session->saved_from_hdr = pjsip_hdr_clone(dlg_pool, dlg_info);<br>+ ast_sip_add_usereqphone(session->endpoint, dlg_pool, session->saved_from_hdr->uri);<br> <br> /* In chan_sip, fromuser and fromdomain trump restricted so we only<br> * anonymize if they're not set.<br>@@ -1348,7 +1347,9 @@<br> if (ast_strlen_zero(session->endpoint->fromdomain)) {<br> pj_strdup2(dlg_pool, &dlg_info_uri->host, "anonymous.invalid");<br> }<br>- }<br>+ } else {<br>+ ast_sip_add_usereqphone(session->endpoint, dlg_pool, dlg_info->uri);<br>+ }<br> }<br> <br> int ast_sip_session_refresh(struct ast_sip_session *session,<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6718">change 6718</a>. To unsubscribe, 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/6718"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ie5644bc66341b86dc08b1f7442210de2e6acdec6 </div>
<div style="display:none"> Gerrit-Change-Number: 6718 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: dtryba <daniel@tryba.nl> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>