[SR-Users] Testing for user=phone with siputils uri_param() doesn't work

George Diamantopoulos georgediam at gmail.com
Fri Oct 13 17:25:55 CEST 2017


Hello,

In my script I've had to test for the user=phone parameter in URIs. I
thought uri_param() from siputils would be handy for this operation on the
RURI, so I did:

    if ( !uri_param("user","phone") ) {
        add_uri_param("user=phone");
    }

Unfortunately this wouldn't work (uri_param returns -1), and I end up with
double user=phone params in the RURI.

I was able to work around this by changing the test to:

    if ( !($(ru{uri.uparam}) == "phone") ) {
        add_uri_param("user=phone");
    }

But I wanted to ask if this is intentional or if I should file a bug or
something. Thanks.
George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20171013/73497e17/attachment.html>


More information about the sr-users mailing list