This works for me - key change is full path the "ls" command...
$var(out)="";
$var(err)="";
$avp(env)="a";
exec("/usr/bin/ls -l", , $var(out), $var(err), $avp(env));
xlog("Out: $var(out)");
xlog("Err: $var(err)");
On Thu, 4 Feb 2021 at 11:29, Dragomir Haralambiev <[email protected]>
wrote:
> Hi,
>
> When try to start Opensips with follow settings:
> exec("ls -l", , $var(out), $var(err), $avp(env));
>
> I receive follow error:
> column 12-21: syntax error
>
> bad arguments for command <exec>
>
> На чт, 4.02.2021 г. в 13:15 ч. Mark Allen <[email protected]> написа:
>
>> Hi Dragomir,
>>
>> exec is working for me in OpenSIPS 3.1 with command...
>>
>> exec("/root/scripts/script.sh $si", , $var(out), $var(err));
>>
>> Is it the quotes around $var(err) that is causing the null output??
>>
>>
>>
>> On Thu, 4 Feb 2021 at 10:37, Dragomir Haralambiev <[email protected]>
>> wrote:
>>
>>> Hello,
>>>
>>> I try to run external program like this
>>>
>>> exec("/test/opensips.pl",,,"$var(err)");
>>> xlog("Received the following error $var(err)");
>>>
>>> Here is log record:
>>> Received the following error <null>
>>>
>>> The program is not running.
>>>
>>> Where is the reason?
>>>
>>> Best regards:
>>> Dragomir
>>> _______________________________________________
>>> Users mailing list
>>> [email protected]
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>> _______________________________________________
>> Users mailing list
>> [email protected]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users