[Kamailio-Users] new feature: re.subst transformation
Daniel-Constantin Mierla
miconda at gmail.com
Mon Dec 8 11:42:57 CET 2008
Hello,
using the latest development work and the newest
pseudo-variable&transformation framework
(http://lists.kamailio.org/pipermail/users/2008-December/020918.html),
the textops module offers a new class of transformation for regular
expressions.
By now, it implements {re.subst,expression} - ability to do Perl-like
substitution of string value pseudo-variables:
http://www.kamailio.org/dokuwiki/doku.php/transformations:devel#re.subst_expression
Here is an example to extract username part from R-URI using this
transformation:
$var(user) = $(ru{re.subst,/^sip:(.*)@(.*)/\1/});
Now, the subst operation becomes very handy, old tricks to copy in R-URI
and use subst*() functions from textops module, or copy in avps and use
avpops module are no longer required.
This implementation can be used as example by developers to learn how to
export new transformations from other modules.
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://www.asipto.com
More information about the Users
mailing list