when test.php script runs from asterisk dial plan everything works fine until execution reaches
$agi->get_data('xxx', 1000, 1); statement.
asterisk cli shows this log:
AGI Script test.php completed, returning 0
and script finish its execution without playing requested sound or getting any DTMF digit.
ive tested stream_file function with similar sound file and it worked fine. so the file exists and sound playback module is ok
#!/usr/bin/php -q
<?
require('phpagi.php');
$agi = new AGI();
$ch = $agi->request["agi_channel"];
$callerid = $agi->request["agi_callerid"];
$agi->answer();
$agi->verbose($callerid);
$menu = $agi->get_data('welcome', 1000, 1);
$menu = $agi->get_data('MainMenu', 5000, 1);
Likly you have error.
Unfortanly not way say what it is.
People just forgot to mention(and in book too), that asterisk do NOT sending agi error to CLI.
To get error you should check primary console(need know which one, in most case tty9) or just start asterisk with console in current session.
After that you will see scripts error.