Agreed, doesn&#39;t make sense to me either.<div><br></div><div>The code is in the decode2format function in siputils/contact_ops.c:</div><div><br></div><div><div>                        if (((*pos) == &#39;&gt;&#39;)||(*pos == &#39;;&#39;))</div>


<div>                                {</div><div>                                /* invalid chars inside username part */</div><div>                                return -5;</div><div>                                }</div>


<div><br></div><div>The ABNF in RFC3261 makes it clear that a semicolon is ok in the user-info field:</div><div><br></div><div><div>userinfo         =  ( user / telephone-subscriber ) [ &quot;:&quot; password ] &quot;@&quot;</div>


<div>user             =  1*( unreserved / escaped / user-unreserved )</div><div>user-unreserved  =  &quot;&amp;&quot; / &quot;=&quot; / &quot;+&quot; / &quot;$&quot; / &quot;,&quot; / &quot;;&quot; / &quot;?&quot; / &quot;/&quot;</div>


</div><div><br></div><div>The code might be to check for the end of a URI (both those characters terminate a URI under certain circumstances), perhaps for fault tolerance and/or security but I don&#39;t think it&#39;s been done in a way that makes sense, for the following reasons:</div>
<div><br></div><div>1. An angle bracket is not legal in or surrounding a request URI, so it should be picked up by the parser and/or sanity check. </div><div>2. A semicolon is totally legal in the userinfo part, as per ABNF and also as explained in RFC3261:</div>
<div><br></div><div>   ...</div><div>   sip:alice;day=<a href="mailto:tuesday@atlanta.com">tuesday@atlanta.com</a></div><div><br></div><div>   The last sample URI above has a user field value of</div><div>   &quot;alice;day=tuesday&quot;.  The escaping rules defined above allow a</div>
<div>   semicolon to appear unescaped in this field.  For the purposes of</div><div>   this protocol, the field is opaque.  The structure of that value is</div><div>   only useful to the SIP element responsible for the resource.</div>

<div><br></div><div>So I have raised bug FS#263: <a href="http://sip-router.org/tracker/index.php?do=details&amp;task_id=263">http://sip-router.org/tracker/index.php?do=details&amp;task_id=263</a></div><div><br></div><div>
Richard</div><div><br></div><div><br></div><div class="gmail_quote">On 3 January 2013 13:28, Gareth Rylance <span dir="ltr">&lt;<a href="mailto:gareth@rylance.me.uk" target="_blank">gareth@rylance.me.uk</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Anyone?<div><br></div><div>If no one objects I will submit a patch with it removed.</div></div><div>
<div><div class="gmail_extra"><br><br><div class="gmail_quote">On 18 December 2012 09:11, Gareth Rylance <span dir="ltr">&lt;<a href="mailto:gareth@rylance.me.uk" target="_blank">gareth@rylance.me.uk</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>When using the siputils function  encode_contact() on a message that contains a user parameter e.g.</div>



<div><br></div><div>&lt;sip:XXXXX00015;phone-context=national@10.YYY.1.92;user=phone&gt;;tag=88930</div>
</div><div><br></div><div>it encodes fine e.g.</div><div><br></div><div>&lt;sip:natted_ua*sip:XXXXX00015;phone-context=national**192.168.242.102*5080*udp@10.YYY.70.100&gt;<br></div><div><br></div><div>but decode_contact() errors due to the &quot;;&quot; (there is an explicit check for it in the code)</div>




<div><br></div><div>I am currently working round this using</div><div><br></div><div>$rU = $(rU{s.replace,;,:});</div><div><br></div><div>to remove the ; as the user part is not needed for my application.</div>
<div><br></div><div>Would it be safe to remove the check for &quot;;&quot; ?</div><span><font color="#888888"><div><br></div><div>Gareth</div><div><br></div><div><br></div><div> </div><div><span style="white-space:pre-wrap">                        </span></div>




<div><br></div></font></span></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>