Sytem Commands not executing

Home » Asterisk Users » Sytem Commands not executing
Asterisk Users 2 Comments

When using the following my sytems commands to not seem to execute.

[outboundfax]
; exten => s,1,NoOp(send a fax)
exten => s,1,Set(FAXOPT(filename)=${FAXFILE})
exten => s,n,Set(FAXOPT(ecm)=yes)
exten => s,n,Set(FAXOPT(headerinfo)=${FAXHEADER})
exten => s,n,Set(FAXOPT(localstationid)=${LOCALID})
exten => s,n,Set(FAXOPT(maxrate)=14400)
exten => s,n,Set(FAXOPT(minrate)=2400)
exten => s,n,SendFAX(${FAXFILE},d)
exten => s,n,System(/usr/bin/php /var/lib/asterisk/bin/faxnotify.php INIT
“${EMAIL}” “${DESTINATION}” “${TIMESTAMP}” “NO_STATUS”
exten => h,1,NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)})
exten => h,n,NoOp(FaxStatus : ${FAXSTATUS})
exten => h,n,NoOp(FaxStatusString : ${FAXSTATUSSTRING})
exten => h,n,NoOp(FaxError : ${FAXERROR})
exten => h,n,NoOp(RemoteStationID : ${REMOTESTATIONID})
exten => h,n,NoOp(FaxPages : ${FAXPAGES})
exten => h,n,NoOp(FaxBitRate : ${FAXBITRATE})
exten => h,n,NoOp(FaxResolution : ${FAXRESOLUTION})
exten => h,n,System(/usr/bin/php /var/lib/asterisk/bin/faxnotify.php NOTIFY
“${EMAIL}” “${DESTINATION}” “${TIMESTAMP}” “${FAXSTAT
; end of outboundfax context
I added this to make sure that it was not permissions.

exten => 777,1,System(/bin/touch /var/lib/asterisk/bin/tesfile.txt)
exten => 777,n,Playback(vm-goodbye)
exten => 777,n,Hangup()
When I dial 777 the test file is created in the folder where faxnotify.php
exists.

If I copy the data I see in the console and paste it to command prompt the
faxnotify script does execute and everything works.
/var/lib/asterisk/bin/faxnotify.php NOTIFY “tim@compnetwork.net”
“6165551212” “20/08/11 : 06:55:11” “FAX_SUCCESS” “1”

2 thoughts on - Sytem Commands not executing

  • do you need the -f option to php?

    exten => h,n,System(/usr/bin/php -f /var/lib/asterisk/bin/faxnotify.php

  • You don’t need the path to the php executable if you use hash tags in
    your script

    #!/usr/bin/php