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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.