I want to make simple IVR using php in Asterisk. when i run php program individually , it works without any problem. but when i call it by AGI command in the Asterisk it does not works. this is my php file :
#!/usr/bin/php -q
<?
set_time_limit(30);
require('phpagi.php');
$agi = new AGI();
$agi->answer();
$file = '/var/www/html/test.txt';
$current = file_get_contents($file);
$current .= "Test\n";
file_put_contents($file, $current);
$agi->say_digits(1234);
$agi->hangup();
?>
and this is Dialplan :
[testphp]
exten => 6565,1,Answer
exten => 6565 2,Playback(Hello-World)
exten => 6565,3,AGI(testphp.php)
exten => 6565 4,Playback(Hello-World)
exten => 6565,5,Hangup
when i call 6565 by my phone , it only plays twice "Hello World" message! php file permission is excutable.
I have installed Elastix(Asterisk) in VirtualBox.
What am I doing wrong?
please help.
Do follwoing:
1) stop asterisk
asterisk -rx "core stop now"
2) start it in ssh console
asterisk -vvvgc
3) enable asterisk AGI debug
agi set debug on
you will see error in your script. also check that selinux is off
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.