[SR-Users] Text Operations on a Message

AliReza Khoshgoftar Monfared khoshgoftar at gmail.com
Fri Aug 15 06:13:31 CEST 2014


Thanks very much Alex.
You are right. In general kamailio does not offer much functionality of a
general purpose language.
The other option for the task that I found was "s.rm" transformation.
Although it works the other way :) you need to match what needs to be
removed :)

Now a general question ( or request for a word of advice :) ): if you have
ultimate flexibility and want to send an integer from one proxy to another.
What functions ( modules ) are the best to append and recover it? ( i don't
care where it is appended, body or header, etc )

On Thursday, August 14, 2014, Alex Balashov <abalashov at evaristesys.com>
wrote:

> On 08/14/2014 02:59 PM, AliReza Khoshgoftar Monfared wrote:
>
>> Hi list,
>>
>> How can I extract a specific part of my message body?
>> I know that "textops" has the function "search_body(re)" but it returns
>> True/False upon finding "re" in the body of the text, how can I return
>> the actual text that regular expression matches?
>>
>> As an example, my message body is
>>
>>     rate is 172#012
>>
>>
>> I want to extract the number "172" out of this.
>>
>
> There is no general means of accomplishing that. Your best bet is to feed
> the message body to another language using one of the language interface
> modules, such as Lua, Perl or Python, and parse stuff out of it there.
>
> For all of its features, Kamailio route script is not a general-purpose
> programming runtime.
>
> --
> Alex Balashov - Principal
> Evariste Systems LLC
> Tel: +1-678-954-0670
> Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
>
> Please be kind to the English language:
>
> http://www.entrepreneur.com/article/232906
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140815/df2f1759/attachment.html>


More information about the sr-users mailing list