[SR-Users] Regex question

Oliver Roth oliver.roth at triotel.ch
Sun Nov 3 22:07:11 CET 2013


Got it - thanks for your help.

$avp(s:fromCLI) = $(ai{re.subst,/^sip:(.*)@(.*)/\1/});



-----Ursprüngliche Nachricht-----
Von: sr-users-bounces at lists.sip-router.org [mailto:sr-users-bounces at lists.sip-router.org] Im Auftrag von Juha Heinanen
Gesendet: Sonntag, 3. November 2013 21:58
An: Kamailio (SER) - Users Mailing List
Cc: kamailio at AaronLux.com
Betreff: [SR-Users] Regex question

Oliver Roth writes:

> I need to do some string operations in kamailio.cfg.
> How can I get the cli from the following string:
> sip:+41523940347 at 195.216.67.103;user=phone
> 
> I only  would need  +41523940347 in a variable
> 
> Something like
> 
> $avp(s:myCli) = ^sip:\+(\d{11})@.{1,40}$
> 
> Any idea?

see if any of these would help:

http://www.kamailio.org/wiki/cookbooks/devel/transformations#uri_transformations

-- 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

-----
E-Mail ist virenfrei.
Von AVG überprüft - www.avg.de
Version: 2014.0.4158 / Virendatenbank: 3615/6804 - Ausgabedatum: 02.11.2013 



More information about the sr-users mailing list