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

Jeff Pyle jeff.pyle at fidelityvoice.com
Thu Jul 7 17:29:30 CEST 2016


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>
wrote:

> Hi Jeff,
>
> I think the difference is a mis. Could you please test the attached patch.
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://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/a8c576bc/attachment.htm>


More information about the Users mailing list