-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Elastix Unified Communications Server Cookbook
By :

Asterisk Gateway Interface is an implementation that allows any external program to control and interact with Asterisk's Dialplan using STDIN (standard input), STDOUT (standard output), and STDERR (standard error) data streams.
We consider as STDIN all the information sent from Asterisk to the program, and as STDOUT all the data sent back to Asterisk. In other words, AGI lets us add more functionality with Asterisk using any program from bash, Perl, PHP, Visual Basic, and so on. We can even write programs that allow us to communicate with databases, open files, and so on.
The way an AGI program is invoked from Dialplan is as follows:
[context] exten => 8888,1,Answer exten => 8888,n,AGI(script.agi, arg1, arg2, …) exten => 8888,n,Hangup()
All the AGI scripts or program are stored in the /var/lib/asterisk/agi-bin
folder.
The most common AGI frameworks are:
Change the font size
Change margin width
Change background colour