Introduction to PHP AGI (Asterisk Gateway Interface)
The (AGI) Asterisk Gateway Interface is an interface for adding functionality to Asterisk with many different programming languages. Perl, PHP, C, Pascal, Bourne Shell, or any other programming language that you like.
To use AGI, create an extension on extension.conf, with this format (example extension number 5151):
exten => 5151,1,AGI(test.php)
Then place the script (for example in PHP, test.php) on the specified AGI folder in asterisk.conf, for example in /var/lib/asterisk/agi-bin.
The script should be executable, so you must first chmod +x to the script.
As an example, let create simple AGI application that fetch the web for a currency data and speak it to the caller. To simplify our self, we are going to use PHP and PHPAGI library.



Recent Comments