<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Apparently the string representation for avps via pv framework
used unsigned int. I pushed a patch to master to use signed
version.</p>
<p>What you can do is to use $var(auth_code) instead of
$avp(auth_code).</p>
<p>Cheers,<br>
Daniel<br>
</p>
<br>
<div class="moz-cite-prefix">On 25/05/16 19:33, Henry Fernandes
wrote:<br>
</div>
<blockquote cite="mid:D36B3DF6.B3D6D%25henry@usinternet.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a> - <a class="moz-txt-link-freetext" href="http://www.kamailio.org">http://www.kamailio.org</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
</body>
</html>