I can’t get Asterisk to properly execute a PHP with the System dial plan function:
exten => 121,1,System('/xml/pushStatusForward.php 667 192.168.1.200')
exten => 121,n,NoOp(Result = ${SYSTEMSTATUS})
results in:
-- Executing System("SIP/7335-0861aa40", "/xml/pushStatusForward.php 667 192.168.1.200") in new stack
-- Executing NoOp("SIP/7335-0861aa40", "Result = SUCCESS") in new stack
However, the PHP script is never executed. The PHP script writes to a log file and that log file never is written when the script is called via Asterisk.
On the Linux command line, [root@hgbn-asterisk xml]# /xml/pushStatusForward.php 667 192.168.1.200
works fine. I have even done [root@hgbn-asterisk xml]# su asterisk
[asterisk@hgbn-asterisk xml]$ /bin/sh -c '/var/www/html/xml/pushStatusForward.php 667 192.168.1.200'
which also works fine.
The only time this script doesn’t work is when called from System in the dial plan. PHP logs errors and no errors appear, it’s like the script isn’t even executed despite Asterisk’s claim of SUCCESS.
Any ideas?