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

2017-10-25 Thread Andrew Pogrebennyk
George, Daniel: please have a look here:
https://github.com/kamailio/kamailio/issues/953
Could it be an answer to the George's issue? I didn't check this deeper
but maybe adding the npdi parameter is changing the parser behavior as
pointed on this issue, would have to see the config file to confirm it.

BR,
Andrew

George Diamantopoulos wrote:
> Hello Daniel!
> 
> 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:
> 
> INVITE sip:+30697400@2.2.2.2
> ;user=phone SIP/2.0
> 
> The example code in my original message results in the following (the
> script also replaces the domain part and adds the npdi username parameter):
> 
> INVITE sip:+30697400;n...@my.domain.tld
> ;user=phone;user=phone SIP/2.0
> 
> BR,
> George


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


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

2017-10-24 Thread George Diamantopoulos
Hello Daniel!

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:

INVITE sip:+30697400@2.2.2.2;user=phone SIP/2.0

The example code in my original message results in the following (the
script also replaces the domain part and adds the npdi username parameter):

INVITE sip:+30697400;n...@my.domain.tld;user=phone;user=phone SIP/2.0

BR,
George

On 23 October 2017 at 10:22, Daniel-Constantin Mierla 
wrote:

> Hello,
>
>
> On 13.10.17 17:25, George Diamantopoulos wrote:
> > 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.
> >
> according to the docs, uri_param() should work for this case. Can you
> paste the first line of the request that fails with uri_param() function
> so I can look at the code and see if there is any issue there?
>
> Cheers,
> Daniel
>
> --
> Daniel-Constantin Mierla
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
> Kamailio World Conference - www.kamailioworld.com
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


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

2017-10-23 Thread Daniel-Constantin Mierla
Hello,


On 13.10.17 17:25, George Diamantopoulos wrote:
> 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.
>
according to the docs, uri_param() should work for this case. Can you
paste the first line of the request that fails with uri_param() function
so I can look at the code and see if there is any issue there?

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
Kamailio World Conference - www.kamailioworld.com


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


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

2017-10-13 Thread George Diamantopoulos
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
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users