[OpenSIPS-Users] perl_exec parameter variable issue

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Aug 10 10:50:54 CEST 2015


Hi,

yes you can do that, but the exec() has the big disadvantage (as 
performance) of forking (creating a new separate process) each time, 
while running the perl_exec() is running inline the opensips processes.

Regards,

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

On 07.08.2015 21:29, sevpal wrote:
> Could try a round-about way if you don't need the API and function is 
> already written in perl:
> $var(duration) = $DLG_lifetime;
> exec("/bin/perl/update_user_balance 
> $var(duration)",,"$var(out)","$var(err)");
>
>
> -----Original Message----- From: Bogdan-Andrei Iancu
> Sent: Friday, August 07, 2015 1:02 PM
> To: OpenSIPS users mailling list ; smontour at twc.com
> Subject: Re: [OpenSIPS-Users] perl_exec parameter variable issue
>
> Hi,
>
> the perl_exec() function does not support variables for its arguments.
>
> It is not hard to add, but please open a feature request on the GITHUB
> tracker :
> https://github.com/OpenSIPS/opensips/issues?page=1&q=is%3Aopen+is%3Aissue
>
> Best regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
>
> On 07.08.2015 06:04, Admin wrote:
>> Hi,
>>   When passing a variable to perl_exec as a parameter, i received a
>> parsing error in the opensips log and won't start. Here is what I am
>> doing inside the opensips config. file
>>
>> $var(duration) = $DLG_lifetime;
>> perl_exec("update_user_balance", $var(duration));
>>
>> It seems that it wants the parameter in quotes ("$var(duration)") but i
>> don't get the variable value when i pass it in quotes.
>>
>> There was a similar problem posted in the archives but no solution was
>> presented.
>>
>> Any suggestion on how to work this around is very appreciated. May be
>> something similar to dialogue lifetime from the OPENSIPS Perl API.
>>
>> I am running OpenSIPS (2.1.0 (x86_64/linux)).
>>
>> Thanks.
>>
>>
>>
>> _______________________________________________
>> 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
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list