<h3>Description</h3>
<p>If $rU has "params" ( the username should be detected as the whole thing, no matter what chars but ':' for the password ) after calling add_uri_param() $rU points to the value without the "params".</p>
<p>Reading the RFC[0] (19.1 SIP and SIPS Uniform Resource Indicators) nothing seems to avoid the use of '=' and ';' in the username part</p>
<p>[0] <a href="https://www.ietf.org/rfc/rfc3261.txt">https://www.ietf.org/rfc/rfc3261.txt</a></p>
<h3>Example</h3>
<pre><code>route[TEST] {
        xlog("$$ru[$ru] $$rU[$rU]\n");
        $rU = "whatever;rn=0000;npdi";
        xlog("$$ru[$ru] $$rU[$rU]\n");
        add_uri_param("user=phone");
        xlog("$$ru[$ru] $$rU[$rU]\n");
        return;
}
</code></pre>
<h4>Log Messages</h4>
<pre><code>ERROR: <script>: $ru[sip:30@127.0.0.1] $rU[30]
ERROR: <script>: $ru[sip:whatever;rn=0000;npdi@127.0.0.1] $rU[whatever;rn=0000;npdi]
[...]
DEBUG: <core> [core/parser/parse_uri.c:1221]: parse_uri(): parsed uri:
 type=1 user=<whatever;rn=0000;npdi>(21)
 passwd=<>(0)
 host=<127.0.0.1>(9)
 port=<>(0): 0
 params=<>(0)
 headers=<>(0)
ERROR: <script>: $ru[sip:whatever;rn=0000;npdi@127.0.0.1;user=phone] $rU[whatever]
[...]
DEBUG: <core> [core/parser/parse_uri.c:1221]: parse_uri(): parsed uri:
 type=3 user=<whatever>(8)
 passwd=<>(0)
 host=<127.0.0.1>(9)
 port=<>(0): 0
 params=<rn=0000;npdi>(12)
 headers=<>(0)
</code></pre>
<h3>Additional Information</h3>
<p>This is kamailio from trunk but 4.4 is affected too and I would assume previous versions too</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/953">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZU3wqUUXNJ9TdpykawfhQZXPfv0Iks5rWbG9gaJpZM4LvjBd">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZX9BbqEwdtZ6iEiqJ0SJEq7WDSRYks5rWbG9gaJpZM4LvjBd.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/953"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"wrong $rU after add_uri_param() when user has \"params\" (#953)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/953"}}}</script>