[SR-Users] (no subject)

Ilie Soltanici iliusha.md at gmail.com
Wed Jul 10 16:13:25 CEST 2019


Hello,

Could someone help me to set a variable as a string in Kamailio?

At the moment i'm using the following statement:

*$var(account)=$(au{s.substr,0,8}); *
*xlogl("L_INFO", "[1234] Account: $var(* *account*
*)\n");*

which is working fine, but i need to change it into:

*$var(account)=$(au{s.select,0,-}{s.toupper})-$(au{s.select,1,-});*

By doing this I'm getting the error:



*[core/rvalue.c:1007]: rval_get_int(): automatic string to int conversion
for "AT" failed[core/rvalue.c:1912]: rval_expr_eval_int(): rval expression
conversion to int failed (729,30-729,59)*

I tried also:

*$var(account)="" + "$(au{s.select,0,-}{s.toupper})-$(au{s.select,1,-})";*

But, then I'm getting:

*Account = $(au{s.select,0,-}{s.toupper})-$(au{s.select,1,-})*
instead of the value.

What is the correct way to set it?

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190710/5233ada9/attachment.html>


More information about the sr-users mailing list