Oh, yes — if the hyphen was a string literal it would have the same type conversion effect
as adding an empty string into the mix.
—
Sent from mobile, with due apologies for brevity and errors.
On Jul 10, 2019, at 11:12 AM, Ilie Soltanici
<iliusha.md(a)gmail.com> wrote:
Got it working by setting:
$var(account)=$(au{s.select,0,-}{s.toupper}) + "-" + $(au{s.select,1,-});
Thanks
În mie., 10 iul. 2019 la 15:13, Ilie Soltanici <iliusha.md(a)gmail.com> a scris:
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.
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users(a)lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users