[OpenSIPS-Users] perl script abnormal termination handling

Jeff Pyle jpyle at fidelityvoice.com
Mon Nov 11 22:00:21 CET 2013


"return -1" seemed to do the trick.  It caused the perl_exec() function to
return a non-successful code so we can handle it accordingly.  Thanks.


- Jeff


On Fri, Nov 8, 2013 at 2:13 PM, Ali Pey <alipey at gmail.com> wrote:

> Don't do die in the perl script. Try return 0 or 1.
>
> Regards,
> Ali Pey
>
>
> On Fri, Nov 8, 2013 at 10:32 AM, Jeff Pyle <jpyle at fidelityvoice.com>wrote:
>
>> Hello,
>>
>> I run a perl script from an Opensips 1.6 config.  I'm having trouble
>> handling a perl "die" condition in the Opensips script.  For example:
>>
>> if !(perl_exec("dietest1")) {
>>     xlog("L_INFO", "Perl script failed.\n"
>> } else {
>>     xlog("L_INFO", "Perl script succeeded.\n"
>> }
>>
>> where test1.pl ends with:
>>     die "Perl script dying"
>>
>> When the perl script fails, I see only:
>>
>> ERROR:core:XS_OpenSIPS__Message_log: perl error: Perl script dying at
>> /etc/opensips/perl/perltest.pl line 165.#012
>>
>> I never see the "Perl script failed" xlog from the script.  It seems that
>> a dying perl script stops processing on the current message.  Is there a
>> way around this, to handle the perl error?
>>
>>
>> Regards,
>> Jeff
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20131111/04908779/attachment.htm>


More information about the Users mailing list