[SR-Users] Problem with URI transformations

Duarte Rocha duarterocha91 at gmail.com
Fri Nov 15 17:51:25 CET 2019


Greetings,

I'm trying to parse some URI info on Kamailio but i'm having some troubles
the URI transformations.

Here i have two examples of URIS from which i'm trying to extract
username(with user parameters included) and URI Parameters :
- sip:123456789;test=param at 1.1.1.1
- sip:123456789;test=param at 1.1.1.1;user=phone
In order to test this i made the following code :

$var(URI) = "sip:123456789;test=param at 1.1.1.1";
xerr("DEBUG 1 : URI $var(URI)");
$var(User) = $(var(URI){uri.user});
$var(Parameters) = $(var(URI){uri.params});
xerr("DEBUG 1 : User = $var(User)");
xerr("DEBUG 1 : Parameters = $var(Parameters)");
$var(URI) = "sip:123456789;test=param at 1.1.1.1;user=phone";
xerr("DEBUG 2 : URI $var(URI)"); ;
$var(User) = $(var(URI){uri.user});
$var(Parameters) = $(var(URI){uri.params});
xerr("DEBUG 2 : User =  $var(User)");
xerr("DEBUG 2 : Parameters = $var(Parameters)");
The result is the following :
DEBUG 1 : URI sip:123456789;test=param at 1.1.1.1
DEBUG 1 : User = 123456789;test=param
DEBUG 1 : Parameters =

DEBUG 2 : URI sip:123456789;test=param at 1.1.1.1;user=phone
DEBUG 2 : User =  123456789
DEBUG 2 : Parameters = user=phone
If the URI has parameters, the User parameters won't be included in the
User part.

Is this a bug or is it working as intended? I'm running Kamailio 5.2.0 .

Thank you for your time.

Best Regards,

Duarte Rocha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20191115/c9278942/attachment.html>


More information about the sr-users mailing list