Antonio Modesto
2011-Jul-20 17:53 UTC
[asterisk-users] "Problems" with System() application
Good afternoon, I am trying to use the System() application but it is always returning APPERROR in the ${SYSTEMSTATUS} variable, I am trying to run this command: System(/bin/sh /var/spool/asterisk/calllog/log.sh ${FromExt} ${exten}); This is the content of the /var/spool/asterisk/calllog/log.sh: #!/bin/sh # # TIME=$(date "+%d-%m-%Y-%HH-%MM") SOURCE="$1" DST="$2" echo "$TIME - $SOURCE - $DST" >> teste.log I tried to insert some info direct into the file using echo but i've got the same error. Is there some secret to use this? haha -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110720/a55c0a2d/attachment.htm>
Jorge GutiƩrrez
2011-Jul-20 18:03 UTC
[asterisk-users] "Problems" with System() application
Are you able to execute: log.sh through the asterisk user? On Wed, 20 Jul 2011 14:53:53 -0300, Antonio Modesto <modesto at isimples.com.br> wrote:> Good afternoon, > > I am trying to use the System() application but it is always > returning APPERROR in the ${SYSTEMSTATUS} variable, I am trying to run > this command: > > System(/bin/sh /var/spool/asterisk/calllog/log.sh ${FromExt} > ${exten}); > > This is the content of the /var/spool/asterisk/calllog/log.sh: > > #!/bin/sh > # > # > > TIME=$(date "+%d-%m-%Y-%HH-%MM") > > SOURCE="$1" > DST="$2" > > echo "$TIME - $SOURCE - $DST" >> teste.log > > I tried to insert some info direct into the file using echo but i've got > the same error. > > Is there some secret to use this? haha-- Jorge Guti?rrez
On Wed, 20 Jul 2011, Antonio Modesto wrote:> System(/bin/sh /var/spool/asterisk/calllog/log.sh ${FromExt} ${exten});Specifying '/bin/sh' is not necessary. The system() dialplan application calls the execl() system function with the command '/bin/sh -c' so specifying '/bin/sh foo' results in sh running sh running foo. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000