<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Elaine,</p>
<p>Unfortunately the documentation is actually misleading and the
function accepts only one extra argument for passing to python.</p>
<p>Regards,<br>
</p>
<pre class="moz-signature" cols="72">--
Vlad Patrascu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 04.12.2020 11:30, Elaine Huang
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CANb3vv-komEO-CvDAz_t4_F=7zME6tvCvmkXuGqcq8SRKrm+ig@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">Hi,
<div dir="auto"><br>
</div>
<div dir="auto">I wrote a python function that takes 3
parameters (excluding msg):</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">class MyClass:</div>
<div dir="auto"> …</div>
<div dir="auto"> my_f(self, msg, param1, param2, param3):</div>
<div dir="auto"> …</div>
<div dir="auto"> …</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">While the python module readme suggests it can
accept extra args (more than 1), opensips fail to start with
error: too many parameters for command <python_exec></div>
<div dir="auto"><br>
</div>
<div dir="auto">my config code:</div>
<div dir="auto">python_exec("my_f", param1, param2, param3)</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">It can start if I change it to:</div>
<div dir="auto">python_exec("my_f", param1)</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Any idea why?</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">OpenSIPS version: 3.1</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Kind Regards,</div>
<div dir="auto">Elaine</div>
<div dir="auto"><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
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>