[SR-Users] Text Operations on a Message
Alex Balashov
abalashov at evaristesys.com
Fri Aug 15 20:48:38 CEST 2014
On 08/15/2014 02:43 PM, AliReza Khoshgoftar Monfared wrote:
> Thanks very much Alex and Hugh,
>
> I think what Hugh mentioned is the best way to process text in Kamailio
> without relying on an external tool and it's good to know it, and Alex's
> suggestion is great for transferring a single number.
It does not have to be a single number. A header can have any value you
like, e.g.
X-AliReza-Custom-Header: param1=x;param2=y;param3=z
Which you could then extract with string transformations[1]:
$var(param1) = $(hdr(X-AliReza-Custom-Header){s.select,0,;});
$var(param2) = $(hdr(X-AliReza-Custom-Header){s.select,1,;});
$var(param3) = $(hdr(X-AliReza-Custom-Header){s.select,2,;});
-- Alex
[1]
http://www.kamailio.org/wiki/cookbooks/4.1.x/transformations#sselect_index_separator
--
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
More information about the sr-users
mailing list