[OpenSIPS-Users] return code from perl_exec() versus perl_exec_simple()

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Jul 7 17:37:34 CEST 2016


Jeff,

Can you replace
     LM_ERR("function %s failed to return anything\n",fnc);
with
     LM_ERR("function %s failed to return anything (reports %d) 
\n",fnc,cnt);

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 07.07.2016 18:29, Jeff Pyle wrote:
> Hi Bogdan,
>
> The patch gives errors.
>
> I have two perl functions:
>
> sub return1 {
> return 1;
> }
>
> sub returnminus1 {
> return -1;
> }
>
> In the OpenSIPS script I have:
>
> route {
>         perl_exec_simple("return1");
>         xlog("L_INFO", "$retcode\n");
>         perl_exec_simple("returnminus1");
>         xlog("L_INFO", "$retcode\n");
>
>         perl_exec("return1");
>         xlog("L_INFO", "$retcode\n");
>         perl_exec("returnminus1");
>         xlog("L_INFO", "$retcode\n");
>
>         sl_send_reply("600", "Road Closed");
>         drop;
>         exit;
> }
>
> Syslog shows:
>
>  /usr/sbin/opensips[22354]: ERROR:perl:perl_exec_simple: function 
> return1 failed to return anything
>  /usr/sbin/opensips[22354]: -1
>  /usr/sbin/opensips[22354]: ERROR:perl:perl_exec_simple: function 
> returnminus1 failed to return anything
>  /usr/sbin/opensips[22354]: -1
>  /usr/sbin/opensips[22354]: 1
>  /usr/sbin/opensips[22354]: -1
>
> perl_exec() still works okay, but perl_exec_simple() gives errors.
>
>
> - Jeff
>
>
>
>
>
> On Thu, Jul 7, 2016 at 5:44 AM, Bogdan-Andrei Iancu 
> <bogdan at opensips.org <mailto:bogdan at opensips.org>> wrote:
>
>     Hi Jeff,
>
>     I think the difference is a mis. Could you please test the
>     attached patch.
>
>     Regards,
>
>     Bogdan-Andrei Iancu
>     OpenSIPS Founder and Developer
>     http://www.opensips-solutions.com
>
>     On 07.07.2016 04:42, Jeff Pyle wrote:
>>     Hello,
>>
>>     I'm using 2.1 cloned from git earlier today.  I notice when I use
>>     perl_exec_simple(), the return code is always 1, regardless of
>>     the return code at the end of the perl function.  With
>>     perl_exec(), however, the return code matches the return code in
>>     the function.  Is this difference intentional?
>>
>>
>>     - Jeff
>>
>>
>>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160707/fc9f888a/attachment.htm>


More information about the Users mailing list