<!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">
    Hi Bogdan,<br>
    <br>
    This "inversion" is visible in the fixup function or is the
    triggered function ?<br>
    <br>
    Regards,<br>
    Bogdan<br>
    <br>
    On 04/06/2011 02:44 PM, rad bogdan wrote:
    <blockquote cite="mid:792262.43471.qm@web130201.mail.mud.yahoo.com"
      type="cite">
      <table border="0" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td style="font: inherit;" valign="top">Hi everyone,<br>
              <br>
              I implemented an OpenSIPS custom module that communicates
              with an external application. From the routing script I
              call a function with 6 parameters:<br>
              <br>
              test_function('$fU', '$tU', '$ci', '$avp(s:name1)',
              '$avp(s:name2)', '$var(name3)')<br>
              <br>
              The problem is that when the corresponding function is
              called in C, the first parameter gets the value of the
              last one.<br>
              <br>
              This doesn't happen when the function is made to take 5
              parameters.<br>
              <br>
              The fixup function that I use is this:<br>
              <br>
              static int pvn_fixup_spve_spve_6(void** param, int
              param_no)<br>
              {<br>
              &nbsp;&nbsp;&nbsp; if (!(param_no &gt;= 1 &amp;&amp; param_no &lt;= 6))<br>
              &nbsp;&nbsp;&nbsp; {<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; LM_ERR("invalid parameter number %d\n", param_no);<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return E_UNSPEC;<br>
              &nbsp;&nbsp;&nbsp; }<br>
              &nbsp;&nbsp;&nbsp; <br>
              &nbsp;&nbsp;&nbsp; return fixup_spve(param);<br>
              }<br>
              <br>
              Is there something wrong with it or the problem is
              elsewhere ?<br>
              <br>
              Thanks,<br>
              Bogdan<br>
            </td>
          </tr>
        </tbody>
      </table>
      <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>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"</pre>
  </body>
</html>