[SR-Users] get first occurrence value of a param in a string

Ali Taher ataher at vanrise.com
Tue Jan 28 10:22:10 CET 2020


Hello,

I need to get the value of first tgrp param in this string :
$var(x) = <sip:xxxxxxxxx;tgrp=0001000;trunk-context=xx.xx.xx.xx at xx.xx.xx.xx:5060;transport=UDP;user=phone;tgrp=237>

I'm trying $var(y) = $(var(x){param.value,tgrp});  but it's getting the last value of tgrp which is "237>".

Noting that first tgrp is not always in the second index , some other parameters can be added to the string.

How to get the value of first occurrence of  tgrp param ?

Regards,
Ali Taher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200128/0b7662af/attachment.html>


More information about the sr-users mailing list