<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
In Kamailio 4.2, I’m having problems converting an AVP integer value into a string. </div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
My Kamailio config stores the return code from auth_check() and outputs it.  </div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<br>
</div>
<div style="color: rgb(0, 0, 0);">
<div><font face="Courier">    $avp(auth_code) = auth_check("$fd", "subscriber", "1");</font></div>
</div>
<div>
<p style="margin: 0px; line-height: normal;"><font face="Courier">    xlog("L_NOTICE", “response = $avp(auth_code)”);</font></p>
<p style="margin: 0px; line-height: normal;"><font face="Courier"><br>
</font></p>
<p style="margin: 0px; line-height: normal;"><font face="Calibri,sans-serif">When I check the AVP against an integer, it behaves normally.  However, I cannot convert it to a string.  The return value -3 (invalid user) gets converted to the string </font><font face="Calibri">“18446744073709551613”
 when outputting it.</font></p>
<p style="margin: 0px; line-height: normal;"><font face="Calibri"><br>
</font></p>
<p style="margin: 0px; line-height: normal;"><font face="Calibri">My hunch is that Kamailio is treating the AVP as an unsigned integer (rather than a signed integer) when it converts it to a string.  If I try this with an AVP with a positive integer, it works
 as expected.</font></p>
<p style="margin: 0px; line-height: normal;"><font face="Calibri"><br>
</font></p>
<p style="margin: 0px; line-height: normal;"><font face="Calibri">Can someone tell me how to convert a negative integer into a string in Kamailio?</font></p>
<p style="margin: 0px; line-height: normal;"><font face="Calibri">-H</font></p>
</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<br>
</div>
</body>
</html>