Hi,
If I have an RURI like this:
INVITE sip:4045551212;param=xyz@domain:port SIP/2.0
which transformations can I best string together in order to remove the ';param=xyz' bit and extract just the core user part value (4045551212)?
{uri.user} returns '4045551212;param=xyz'. There are numerous transformations to help one access the parameters. What if I want to exclude the parameters?
I've already scoured the available transformations, just hoping a second pair of eyes can tell me I've missed something useful.
Cheers,
-- Alex
Alex Balashov writes:
{uri.user} returns '4045551212;param=xyz'. There are numerous transformations to help one access the parameters. What if I want to exclude the parameters?
I've already scoured the available transformations, just hoping a second pair of eyes can tell me I've missed something useful.
{s.select,index,separator} on result of uri.user.
-- juha
Sure, but that presumes that I know the position of the parameter and the number of parameters. I'm looking for a generic approach to lob off all parameters.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry.
You could always to a search replace for the uri based on {uri.params} (replacing with nothing).
Fred Posner The Palner Group, Inc. http://www.palner.com (web) +1-503-914-0999 (direct)
On 06/12/2015 12:24 PM, Alex Balashov wrote:
Sure, but that presumes that I know the position of the parameter and the number of parameters. I'm looking for a generic approach to lob off all parameters.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Could.,.. was just hoping for something less involved.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry.
Alex Balashov writes:
Sure, but that presumes that I know the position of the parameter and the number of parameters. I'm looking for a generic approach to lob off all parameters.
ok, i just thought about your example. in that case perhaps you need to use one of regexp functions in textops module.
-- juha
Could, but that would be a complicated regex since the parameters could, grammatically speaking, precede the user.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. Original Message From: Juha Heinanen Sent: Friday, June 12, 2015 12:37 To: Kamailio (SER) - Users Mailing List Reply To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Removing parameters from user part of URI
Alex Balashov writes:
Sure, but that presumes that I know the position of the parameter and the number of parameters. I'm looking for a generic approach to lob off all parameters.
ok, i just thought about your example. in that case perhaps you need to use one of regexp functions in textops module.
-- juha
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
could, grammatically speaking, precede the user.
So now that I re-read your example... of a bad uri... I apologize for not reading it well the first time.
INVITE sip:4045551212;param=xyz@domain:port SIP/2.0
I think the only way to handle it would be with a regex; hopefully based on parameters starting with a ; and ending with the last @.
The sed for it would be:
sed 's/^sip:(.*);.*@/\1@/'
Fred Posner The Palner Group, Inc. http://www.palner.com (web) +1-503-914-0999 (direct)
On 06/12/2015 12:38 PM, Alex Balashov wrote:
Could, but that would be a complicated regex since the parameters could, grammatically speaking, precede the user.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. Original Message From: Juha Heinanen Sent: Friday, June 12, 2015 12:37 To: Kamailio (SER) - Users Mailing List Reply To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Removing parameters from user part of URI
Alex Balashov writes:
Sure, but that presumes that I know the position of the parameter and the number of parameters. I'm looking for a generic approach to lob off all parameters.
ok, i just thought about your example. in that case perhaps you need to use one of regexp functions in textops module.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
When you say bad URI... why? It's grammatically valid to put parameters in the user part of the URI. If it weren't, it'd be hard to explain RFC 4694.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. Original Message From: Fred Posner Sent: Friday, June 12, 2015 14:07 To: sr-users@lists.sip-router.org Reply To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Removing parameters from user part of URI
could, grammatically speaking, precede the user.
So now that I re-read your example... of a bad uri... I apologize for not reading it well the first time.
INVITE sip:4045551212;param=xyz@domain:port SIP/2.0
I think the only way to handle it would be with a regex; hopefully based on parameters starting with a ; and ending with the last @.
The sed for it would be:
sed 's/^sip:(.*);.*@/\1@/'
Fred Posner The Palner Group, Inc. http://www.palner.com (web) +1-503-914-0999 (direct)
On 06/12/2015 12:38 PM, Alex Balashov wrote:
Could, but that would be a complicated regex since the parameters could, grammatically speaking, precede the user.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. Original Message From: Juha Heinanen Sent: Friday, June 12, 2015 12:37 To: Kamailio (SER) - Users Mailing List Reply To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Removing parameters from user part of URI
Alex Balashov writes:
Sure, but that presumes that I know the position of the parameter and the number of parameters. I'm looking for a generic approach to lob off all parameters.
ok, i just thought about your example. in that case perhaps you need to use one of regexp functions in textops module.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
My understanding of 4694 was that for SIP, it still references 3261, which was :USERNAME:PASSWORD@HOSTPORT;PARAMS, no?
I thought the 4694 use of parameter was only applicable in a tel: or similar field.
Fred Posner The Palner Group, Inc. http://www.palner.com (web) +1-503-914-0999 (direct)
On 06/12/2015 02:09 PM, Alex Balashov wrote:
When you say bad URI... why? It's grammatically valid to put parameters in the user part of the URI. If it weren't, it'd be hard to explain RFC 4694.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. Original Message From: Fred Posner Sent: Friday, June 12, 2015 14:07 To: sr-users@lists.sip-router.org Reply To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Removing parameters from user part of URI
could, grammatically speaking, precede the user.
So now that I re-read your example... of a bad uri... I apologize for not reading it well the first time.
INVITE sip:4045551212;param=xyz@domain:port SIP/2.0
I think the only way to handle it would be with a regex; hopefully based on parameters starting with a ; and ending with the last @.
The sed for it would be:
sed 's/^sip:(.*);.*@/\1@/'
Fred Posner The Palner Group, Inc. http://www.palner.com (web) +1-503-914-0999 (direct)
On 06/12/2015 12:38 PM, Alex Balashov wrote:
Could, but that would be a complicated regex since the parameters could, grammatically speaking, precede the user.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. Original Message From: Juha Heinanen Sent: Friday, June 12, 2015 12:37 To: Kamailio (SER) - Users Mailing List Reply To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Removing parameters from user part of URI
Alex Balashov writes:
Sure, but that presumes that I know the position of the parameter and the number of parameters. I'm looking for a generic approach to lob off all parameters.
ok, i just thought about your example. in that case perhaps you need to use one of regexp functions in textops module.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Another example:
http://www.dialogic.com/webhelp/IMG1010/10.3.3ER2/WebHelp/Description/Interw...
I stand corrected.
Fred Posner The Palner Group, Inc. http://www.palner.com (web) +1-503-914-0999 (direct)
On 06/12/2015 02:41 PM, Alex Balashov wrote:
Another example:
http://www.dialogic.com/webhelp/IMG1010/10.3.3ER2/WebHelp/Description/Interw...
On 06/12/2015 02:43 PM, Fred Posner wrote:
I stand corrected.
I'm not sure if these artefacts are an idiosyncrasy of conversion of tel: URIs to sip:, as 'cic' is also part of the ABNF layout in RFC 4694, which
The following syntax specification uses the Augmented Backus-Naur Form (ABNF) as described in RFC 4234 [RFC4234] and defines the five parameters, rn, npdi, cic, rn-context and cic-context, by extending the "parameter" production rule of the "tel" URI defined in [RFC3966].
-- Alex
Even tel2sip shows it as a valid uri.
http://kamailio.org/docs/modules/4.2.x/modules/siputils.html#siputils.f.tel2...
I again apologize.
Fred Posner The Palner Group, Inc. http://www.palner.com (web) +1-503-914-0999 (direct)
On 06/12/2015 02:52 PM, Alex Balashov wrote:
On 06/12/2015 02:43 PM, Fred Posner wrote:
I stand corrected.
I'm not sure if these artefacts are an idiosyncrasy of conversion of tel: URIs to sip:, as 'cic' is also part of the ABNF layout in RFC 4694, which
The following syntax specification uses the Augmented Backus-Naur Form (ABNF) as described in RFC 4234 [RFC4234] and defines the five parameters, rn, npdi, cic, rn-context and cic-context, by extending the "parameter" production rule of the "tel" URI defined in [RFC3966].
-- Alex
There's nothing to apologise for, but I am curious for grammatical clarification.
What does one call such parameters? They're neither URI parameters nor header parameters. And how does one refer to the core user particle in this case?
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry.
On Friday 12 June 2015, Alex Balashov wrote:
Sure, but that presumes that I know the position of the parameter and the number of parameters.
Why would you need to know that?
I'm looking for a generic approach to lob off all parameters.
$(rU{select,0,;}) will always select the username with all parameters stripped.
On 06/15/2015 04:20 AM, Alex Hermann wrote:
On Friday 12 June 2015, Alex Balashov wrote:
Sure, but that presumes that I know the position of the parameter and the number of parameters.
Why would you need to know that?
I'm looking for a generic approach to lob off all parameters.
$(rU{select,0,;}) will always select the username with all parameters stripped.
Will it? What if the parameters precede the username, i.e.
sip:param1=hyz;param2;abc;user@host
On Monday 15 June 2015, Alex Balashov wrote:
On 06/15/2015 04:20 AM, Alex Hermann wrote:
$(rU{select,0,;}) will always select the username with all parameters stripped.
Will it? What if the parameters precede the username, i.e.
sip:param1=hyz;param2;abc;user@host
I have never heard about that. It is valid syntax according to the ABNF. But the URI ABNF does not specify user-parameters, the whole part between sip: and @ is the 'user' part.
If you want to define that ; in the 'user' part defines parameters, IMHO the only sensible thing to do is put them at the end. Otherwise, what would be the meaning? How would you know what part is a username? What makes 'user' a username and not 'param2' or 'abc', or even 'param1=hyz'?
On 15/06/15 15:18, Alex Hermann wrote:
On Monday 15 June 2015, Alex Balashov wrote:
On 06/15/2015 04:20 AM, Alex Hermann wrote:
$(rU{select,0,;}) will always select the username with all parameters stripped.
Will it? What if the parameters precede the username, i.e.
sip:param1=hyz;param2;abc;user@host
I have never heard about that. It is valid syntax according to the ABNF.
Is it valid to have the parameters before ny ABNF grammar? I'm really surprised (I had no time to look at the grammar, thought)!
Thinking of the natural way of having parameters for something (e.g., think of parameters for functions are after the function name everywhere, or parameters for commands in shell are after the command name).
More over, there can be parameters without value (e.g., 'lr' for URI in Record-/Route headers), so practically if parameters are allowed before, then the value of the field cannot be identified anymore in a predictable way.
Cheers, Daniel
But the URI ABNF does not specify user-parameters, the whole part between sip: and @ is the 'user' part.
If you want to define that ; in the 'user' part defines parameters, IMHO the only sensible thing to do is put them at the end. Otherwise, what would be the meaning? How would you know what part is a username? What makes 'user' a username and not 'param2' or 'abc', or even 'param1=hyz'?
I was under the impression that as long as the parameters have a value (key=value), they can appear anywhere. But I should double-check before making that proclamation.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry.