[SR-Users] Removing parameters from user part of URI

Fred Posner fred at palner.com
Fri Jun 12 20:07:02 CEST 2015


> 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 at 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 at 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 at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
> 



More information about the sr-users mailing list