<p>dtryba has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6671">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip: Prevent "user=phone" being added multiple times to header<br><br>ast_sip_add_usereqphone adds "user=phone" to the header every time is is<br>called without checking whether the param already exists. Preventing<br>this by searching to string representation of header for "user=phone".<br><br>ASTERISK-26988 #close<br><br>Change-Id: Ib84383b07254de357dc6a98d91fc1d2c2c3719e6<br>---<br>M res/res_pjsip.c<br>1 file changed, 7 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/71/6671/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip.c b/res/res_pjsip.c<br>index 3c8f730..e7fc166 100644<br>--- a/res/res_pjsip.c<br>+++ b/res/res_pjsip.c<br>@@ -3021,6 +3021,7 @@<br>  pjsip_param *param;<br>   static const pj_str_t STR_USER = { "user", 4 };<br>     static const pj_str_t STR_PHONE = { "phone", 5 };<br>+  char check_uri[PJSIP_MAX_URL_SIZE];<br> <br>        if (!endpoint || !endpoint->usereqphone || (!PJSIP_URI_SCHEME_IS_SIP(uri) && !PJSIP_URI_SCHEME_IS_SIPS(uri))) {<br>            return;<br>@@ -3047,6 +3048,12 @@<br>               return;<br>       }<br> <br>+ pjsip_uri_print(PJSIP_URI_IN_REQ_URI, sip_uri, check_uri, sizeof(check_uri));<br>+<br>+     if (strcasestr(check_uri,"user=phone")!=NULL) {<br>+            return;<br>+      }<br>+<br>  param = PJ_POOL_ALLOC_T(pool, pjsip_param);<br>   param->name = STR_USER;<br>    param->value = STR_PHONE;<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6671">change 6671</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/6671"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib84383b07254de357dc6a98d91fc1d2c2c3719e6 </div>
<div style="display:none"> Gerrit-Change-Number: 6671 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dtryba <daniel@tryba.nl> </div>