Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > by-pkgid > c7095aefea7b97fbd2a596dcbfb9d481 > files > 485

asterisk-docs-1.4.26.1-1mdv2008.1.i586.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 9. The Asterisk Gateway Interface (AGI)</title><link rel="stylesheet" href="styles.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /><link rel="start" href="index.html" title="Asterisk™: The Future of Telephony" /><link rel="up" href="index.html" title="Asterisk™: The Future of Telephony" /><link rel="prev" href="asterisk-CHP-8-SECT-7.html" title="Conclusion" /><link rel="next" href="asterisk-CHP-9-SECT-1.html" title="Fundamentals of AGI Communication" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. The Asterisk Gateway Interface (AGI)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="asterisk-CHP-8-SECT-7.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="asterisk-CHP-9-SECT-1.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="asterisk-CHP-9"></a>Chapter 9. The Asterisk Gateway Interface (AGI)</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="asterisk-CHP-9-SECT-1.html">Fundamentals of AGI Communication</a></span></dt><dd><dl><dt><span class="sect2"><a href="asterisk-CHP-9-SECT-1.html#asterisk-CHP-9-SECT-1.1">What Are STDIN, STDOUT, and STDERR?</a></span></dt><dt><span class="sect2"><a href="asterisk-CHP-9-SECT-1.html#asterisk-CHP-9-SECT-1.2">The Standard Pattern of AGI Communication</a></span></dt><dt><span class="sect2"><a href="asterisk-CHP-9-SECT-1.html#asterisk-CHP-9-SECT-1.3">Calling an AGI Script from the Dialplan</a></span></dt></dl></dd><dt><span class="sect1"><a href="asterisk-CHP-9-SECT-2.html">Writing AGI Scripts in Perl</a></span></dt><dd><dl><dt><span class="sect2"><a href="asterisk-CHP-9-SECT-2.html#asterisk-CHP-9-SECT-2.1">The Perl AGI Library</a></span></dt></dl></dd><dt><span class="sect1"><a href="asterisk-CHP-9-SECT-3.html">Creating AGI Scripts in PHP</a></span></dt><dd><dl><dt><span class="sect2"><a href="asterisk-CHP-9-SECT-3.html#asterisk-CHP-9-SECT-3.1">The PHP AGI Library</a></span></dt></dl></dd><dt><span class="sect1"><a href="asterisk-CHP-9-SECT-4.html">Writing AGI Scripts in Python</a></span></dt><dd><dl><dt><span class="sect2"><a href="asterisk-CHP-9-SECT-4.html#asterisk-CHP-9-SECT-4.1">The Python AGI Library</a></span></dt></dl></dd><dt><span class="sect1"><a href="asterisk-CHP-9-SECT-5.html">Debugging in AGI</a></span></dt><dd><dl><dt><span class="sect2"><a href="asterisk-CHP-9-SECT-5.html#asterisk-CHP-9-SECT-5.1">Debugging from the Operating System</a></span></dt><dt><span class="sect2"><a href="asterisk-CHP-9-SECT-5.html#asterisk-CHP-9-SECT-5.2">Using Asterisk’s agi debug Command</a></span></dt></dl></dd><dt><span class="sect1"><a href="asterisk-CHP-9-SECT-6.html">Conclusion</a></span></dt></dl></div><div class="epigraph"><p>Even he, to whom most things that most people would think were
    pretty smart were pretty dumb, thought it was pretty smart.</p><div class="attribution"><span>--<span class="attribution">Douglas Adams, <span class="emphasis"><em>The Salmon of
    Doubt</em></span></span></span></div></div><p>The <a id="ch09_scriptsagi" class="indexterm"></a><a id="ch09_agiasterisk" class="indexterm"></a><a id="ch09_asteriskagi" class="indexterm"></a>Asterisk Gateway Interface, or AGI, provides a standard
  interface by which external programs may control the Asterisk dialplan.
  Usually, AGI scripts are used to do advanced logic, communicate with
  relational databases (such as PostgreSQL or <a id="I_indexterm9_tt1172" class="indexterm"></a><a id="I_indexterm9_tt1173" class="indexterm"></a>MySQL), and access other external resources. Turning over
  control of the dialplan to an external AGI script enables Asterisk to easily
  perform tasks that would otherwise be difficult or impossible.</p><p>This chapter covers the fundamentals of AGI communication. It will not
  teach you how to be a programmer—rather, we’ll assume that you’re already a
  competent programmer, so that we can show you how to write AGI programs. If
  you don’t know how to do computer programming, this chapter probably isn’t
  for you, and you should skip ahead to the next chapter.</p><p>Over the course of this chapter, we’ll write a sample AGI program in
  each of the Perl, PHP, and Python programming languages. Note, however, that
  because Asterisk provides a standard interface for AGI scripts, these
  scripts can be written in almost any modern programming language. We’ve
  chosen to highlight Perl, PHP, and Python because they’re the languages most
  commonly used for AGI programming.</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="asterisk-CHP-8-SECT-7.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="asterisk-CHP-9-SECT-1.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Conclusion </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Fundamentals of AGI Communication</td></tr></table></div><div xmlns="" id="svn-footer"><hr /><p>You are reading <em>Asterisk: The Future of Telephony</em> (2nd Edition for Asterisk 1.4), by Jim van Meggelen, Jared Smith, and Leif Madsen.<br />
       This work is licensed under the <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons Attribution-Noncommercial-No Derivative Works License v3.0</a>.<br />
       To submit comments, corrections, or other contributions to the text, please visit <a href="http://oreilly.com/catalog/9780596510480/">http://www.oreilly.com/</a>.</p></div></body></html>