<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Bogdan,<br><br>The "inversion" is only in the triggered function.<br>The arguments are passed correctly from left to right to the fixup function.<br><br>The triggered function is:<br><br>test_function(struct sip_msg *msg, char *arg1, char *arg2, char* arg3, char* arg4, char* arg5, char* arg6)<br>{<br> str arg1_s = {NULL, 0};<br><br> if(arg1 == NULL || fixup_get_svalue(msg, (gparam_p)arg1, &arg1_s) != 0)<br> {<br> LM_ERR("Invalid arg1 argument\n");<br> return -1;<br> }<br>.........<br>}<br><br>arg1_s.s has the value of arg6_s.s while arg6_s.s has the correct value.<br><br>Thanks,<br>Bogdan<br><br>--- On <b>Wed, 4/6/11, Bogdan-Andrei Iancu <i><bogdan@opensips.org></i></b> wrote:<br><blockquote
style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Bogdan-Andrei Iancu <bogdan@opensips.org><br>Subject: Re: [OpenSIPS-Users] function with 6 parameters<br>To: "OpenSIPS users mailling list" <users@lists.opensips.org><br>Cc: "rad bogdan" <bogdan_rad2004@yahoo.com><br>Date: Wednesday, April 6, 2011, 5:15 PM<br><br><div id="yiv462067739">
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 type="cite">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; -x-system-font: none;" 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>
if (!(param_no >= 1 && param_no <= 6))<br>
{<br>
LM_ERR("invalid parameter number %d\n", param_no);<br>
return E_UNSPEC;<br>
}<br>
<br>
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><fieldset class="yiv462067739mimeAttachmentHeader"></fieldset><br>_______________________________________________<br>Users mailing list<br><a rel="nofollow" class="yiv462067739moz-txt-link-abbreviated" ymailto="mailto:Users@lists.opensips.org" target="_blank" href="/mc/compose?to=Users@lists.opensips.org">Users@lists.opensips.org</a><br><a rel="nofollow" class="yiv462067739moz-txt-link-freetext" target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br></pre>
</blockquote>
<br>
<br>
<pre class="yiv462067739moz-signature">-- <br>Bogdan-Andrei Iancu<br>OpenSIPS eBootcamp - 2nd of May 2011<br>OpenSIPS solutions and "know-how"</pre>
</div></blockquote></td></tr></table>