<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    The transformation internally tries to convert the received input to
    string before applying the hexa encoding. So 3 will be turned to the
    string "3" and then it will be encoded.<br>
    <br>
    Regards,<br>
    <pre class="moz-signature" cols="72">Vlad Paiu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a> </pre>
    <br>
    On 06/28/2012 04:48 PM, Ali Pey wrote:
    <blockquote
cite="mid:CA+q4kRLNaaxgHZWt8Mpp6J5mRAxtjonnNNyt6x05TpcSXSC7-Q@mail.gmail.com"
      type="cite">Thank you Vlad.
      <div><br>
      </div>
      <div>How can I convert my integer value to string?</div>
      <div><br>
      </div>
      <div>Let's say my $avp(id) is 3. How could I convert it to string
        before I use s.encode.hexa?</div>
      <div><br>
      </div>
      <div>
        Regards,</div>
      <div>Ali Pey</div>
      <div><br>
        <br>
        <div class="gmail_quote">On Thu, Jun 28, 2012 at 5:31 AM, Vlad
          Paiu <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:vladpaiu@opensips.org" target="_blank">vladpaiu@opensips.org</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            <div bgcolor="#ffffff" text="#000000"> Hello,<br>
              <br>
              The encode and decode transformations work on strings, not
              on their integer values.<br>
              So do not expect to have 19 encoded to hexa to be 13.<br>
              <br>
              For example, 3 encoded to hexa is 33, because '3' is 51 in
              ascii, thus converted to hexa it is 33 = 16*3+3 = 51.<br>
              <br>
              Regards,<br>
              <pre cols="72">Vlad Paiu
OpenSIPS Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a> </pre>
              <div>
                <div class="h5"> <br>
                  On 06/26/2012 08:19 PM, Ali Pey wrote: </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">Hi There,
                    <div><br>
                    </div>
                    <div>Is there a way to convert an avp variable to
                      hex?</div>
                    <div><br>
                    </div>
                    <div>I've tried the following but it's not working.</div>
                    <div><br>
                    </div>
                    <div>$(avp(id){s.encode.hexa})</div>
                    <div><br>
                    </div>
                    <div>For instance if avp(id) is 11, it returns 3131,
                      if it's 3, it returns 33.</div>
                    <div><br>
                    </div>
                    <div>Am I doing something wrong?&nbsp;</div>
                    <div>Is there a better way?</div>
                    <div><br>
                    </div>
                    <div>Thanks,</div>
                    <div>Ali Pey</div>
                    <div><br>
                    </div>
                  </div>
                </div>
                <pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a moz-do-not-send="true" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
              </blockquote>
            </div>
            <br>
            _______________________________________________<br>
            Users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </body>
</html>