16. Asterisk Gateway Interface

The Asterisk Gateway Interface (AGI) may be compared with CGI (Common Gateway Interface) on a web server. These are external programs called from the within the dialplan (extensions.conf). AGI scripts can interact with Asterisk and execute commands. In principle, an AGI script may be written in any programming or script language that can use the UNIX system sockets. The following are simply implementation examples. For a command reference, see Appendix D, “AGI Commands.”

16.1 Data Streams

To use AGI scripts, understanding the UNIX system’s data stream model is an absolute requirement. You can find more information about this model in Appendix D.

16.1.1 STDIN

The AGI script receives some information from Asterisk ...

Get Practical Asterisk 1.4 and 1.6: From Beginner to Expert now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.