<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">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.<br><br><div id="AppleMailSignature" dir="ltr">—<div>Sent from mobile, with due apologies for brevity and errors.</div></div><div dir="ltr"><br>On Jul 10, 2019, at 11:12 AM, Ilie Soltanici <<a href="mailto:iliusha.md@gmail.com">iliusha.md@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">Got it working by setting:<div><br></div><div> $var(account)=$(au{s.select,0,-}{s.toupper}) + "-" + $(au{s.select,1,-});<br></div><div><br></div><div>Thanks</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">În mie., 10 iul. 2019 la 15:13, Ilie Soltanici <<a href="mailto:iliusha.md@gmail.com">iliusha.md@gmail.com</a>> a scris:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>Could someone help me to set a variable as a string in Kamailio?</div><div><br></div><div>At the moment i'm using the following statement: </div><div><br></div><div><b>$var(account)=$(au{s.substr,0,8}); </b></div><div><b>xlogl("L_INFO", "[1234] Account: $var(</b>

<b>account</b><b>)\n");<br></b></div><div><br></div><div>which is working fine, but i need to change it into:</div><div><br></div><div><b>$var(account)=$(au{s.select,0,-}{s.toupper})-$(au{s.select,1,-});</b>  <br></div><div><br></div><div>By doing this I'm getting the error:</div><div><br></div><div><i>[core/rvalue.c:1007]: rval_get_int(): automatic string to int conversion for "AT" failed<br>[core/rvalue.c:1912]: rval_expr_eval_int(): rval expression conversion to int failed (729,30-729,59)<br></i></div><div><b><br></b></div><div><div>I tried also: </div><div><br></div><div><b>$var(account)="" + "$(au{s.select,0,-}{s.toupper})-$(au{s.select,1,-})";</b><br></div></div><div><br></div><div>But, then I'm getting:</div><div><i>Account = $(au{s.select,0,-}{s.toupper})-$(au{s.select,1,-})<br></i></div><div>instead of the value.</div><div><br></div><div>What is the correct way to set it?</div><div><br></div><div>Thank you.</div></div>
</blockquote></div>
</div></blockquote><blockquote type="cite"><div dir="ltr"><span>_______________________________________________</span><br><span>Kamailio (SER) - Users Mailing List</span><br><span><a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a></span><br><span><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a></span><br></div></blockquote></body></html>