I have installed asterisk 1.6.2.22 and I have created the php script to call from the dialplan.
testAgi.php script :
[quote] #!/usr/local/bin/php -q
<?php
set_time_limit(0);
require('phpagi.php');
$agi = new AGI();
$agi->answer();
// Play the tt-monkeys file from /var/lib/asterisk/sounds
$agi->stream_file('tt-monkeys');
$agi->hangup();
?>[/quote]
[quote] #!/usr/local/bin/php -q
PHP Warning: include(phpagi.php): failed to open stream: No such file or directory in /var/lib/asterisk/agi-bin/testAgi.php on line 5
PHP Warning: include(): Failed opening ‘phpagi.php’ for inclusion (include_path=’.:/usr/share/pear:/usr/share/php’) in /var/lib/asterisk/agi-bin/testAgi.php on line 5
PHP Fatal error: Class ‘AGI’ not found in /var/lib/asterisk/agi-bin/testAgi.php on line 7[/quote]
[quote=“urmi.l”][quote]PHP Warning: include(): Failed opening ‘phpagi.php’ for inclusion (include_path=’.:/usr/share/pear:/usr/share/php’) in /var/lib/asterisk/agi-bin/testAgi.php on line 5
[/quote][/quote]
Make sure that phpagi.php is installed and that it is in a directory which is in php’s include path.
Download phpagi 2.x files from phpagi.sourceforge.net/
Installed the phpagi-2.20/ and put the source in /home/sources directory.
Then I have added the following line in my .php file
[quote]ini_set( “include_path”, “/home/sources/” );
include(‘phpagi.php’);
$agi = new AGI();
[/quote]