<div dir="ltr"><div><div><div><div>Hello Daniel!<br><br></div>Thanks for the reply. Here's the first line of a request where uri_param() fails to detect user=phone is already present. IPs, phone numbers and domains have been censored, but most properties (number of parts, length etc) have been preserved where possible:<br><br><div style="margin-left:40px">INVITE <a href="mailto:sip%3A%2B306974000000@2.2.2.2">sip:+306974000000@2.2.2.2</a>;user=phone SIP/2.0</div><br></div>The example code in my original message results in the following (the script also replaces the domain part and adds the npdi username parameter):<br><div style="margin-left:40px"><br></div><div style="margin-left:40px">INVITE sip:+306974000000;npdi@my.domain.tld;user=phone;user=phone SIP/2.0</div></div><div><br></div>BR,<br></div>George<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 23 October 2017 at 10:22, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<span class=""><br>
<br>
On 13.10.17 17:25, George Diamantopoulos wrote:<br>
> Hello,<br>
><br>
> In my script I've had to test for the user=phone parameter in URIs. I<br>
> thought uri_param() from siputils would be handy for this operation on<br>
> the RURI, so I did:<br>
><br>
>     if ( !uri_param("user","phone") ) {<br>
>         add_uri_param("user=phone");<br>
>     }<br>
><br>
> Unfortunately this wouldn't work (uri_param returns -1), and I end up<br>
> with double user=phone params in the RURI.<br>
><br>
> I was able to work around this by changing the test to:<br>
><br>
>     if ( !($(ru{uri.uparam}) == "phone") ) {<br>
>         add_uri_param("user=phone");<br>
>     }<br>
><br>
> But I wanted to ask if this is intentional or if I should file a bug<br>
> or something. Thanks.<br>
><br>
</span>according to the docs, uri_param() should work for this case. Can you<br>
paste the first line of the request that fails with uri_param() function<br>
so I can look at the code and see if there is any issue there?<br>
<br>
Cheers,<br>
Daniel<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Daniel-Constantin Mierla<br>
<a href="http://www.twitter.com/miconda" rel="noreferrer" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" rel="noreferrer" target="_blank">www.linkedin.com/in/miconda</a><br>
Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - <a href="http://www.asipto.com" rel="noreferrer" target="_blank">www.asipto.com</a><br>
Kamailio World Conference - <a href="http://www.kamailioworld.com" rel="noreferrer" target="_blank">www.kamailioworld.com</a><br>
<br>
</font></span></blockquote></div><br></div>