<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/en/2172/18/9/_/styles/combined.css?spaceKey=AST&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_AGI">Asterisk 11 Application_AGI</a></h2>
<h4>Page <b>added</b> by <a href="https://wiki.asterisk.org/wiki/display/~wikibot">Wiki Bot</a>
</h4>
<br/>
<div class="notificationGreySide">
<h1><a name="Asterisk11Application_AGI-AGI%28%29"></a>AGI()</h1>
<h3><a name="Asterisk11Application_AGI-Synopsis"></a>Synopsis</h3>
<p>Executes an AGI compliant application.</p>
<h3><a name="Asterisk11Application_AGI-Description"></a>Description</h3>
<p>Executes an Asterisk Gateway Interface compliant program on a channel. AGI allows Asterisk to launch external programs written in any language to control a telephony channel, play audio, read DTMF digits, etc. by communicating with the AGI protocol on <b>stdin</b> and <b>stdout</b>. As of <tt>1.6.0</tt>, this channel will not stop dialplan execution on hangup inside of this application. Dialplan execution will continue normally, even upon hangup until the AGI application signals a desire to stop (either by exiting or, in the case of a net script, by closing the connection). A locally executed AGI script will receive SIGHUP on hangup from the channel except when using DeadAGI. A fast AGI server will correspondingly receive a HANGUP inline with the command dialog. Both of theses signals may be disabled by setting the <tt>AGISIGHUP</tt> channel variable to <tt>no</tt> before executing the AGI application. Alternatively, if you would like the AGI application to exit immediately after a channel hangup is detected, set the <tt>AGIEXITONHANGUP</tt> variable to <tt>yes</tt>.</p>
<p>Use the CLI command <tt>agi show commands</tt> to list available agi commands.</p>
<p>This application sets the following channel variable upon completion:</p>
<ul>
        <li>AGISTATUS - The status of the attempt to the run the AGI script text string, one of:
        <ul>
                <li>SUCCESS</li>
                <li>FAILURE</li>
                <li>NOTFOUND</li>
                <li>HANGUP</li>
        </ul>
        </li>
</ul>
<h3><a name="Asterisk11Application_AGI-Syntax"></a>Syntax</h3>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>AGI(commandarg1arg2[...])</pre>
</div></div>
<h5><a name="Asterisk11Application_AGI-Arguments"></a>Arguments</h5>
<ul>
        <li>command</li>
        <li>args
        <ul>
                <li>arg1</li>
                <li>arg2</li>
        </ul>
        </li>
</ul>
<h3><a name="Asterisk11Application_AGI-SeeAlso"></a>See Also</h3>
<ul>
        <li><a href="/wiki/pages/createpage.action?spaceKey=AST&title=Asterisk+11+Application_EAGI&linkCreation=true&fromPageId=20187395" class="createlink">Asterisk 11 Application_EAGI</a></li>
        <li><a href="/wiki/pages/createpage.action?spaceKey=AST&title=Asterisk+11+Application_DeadAGI&linkCreation=true&fromPageId=20187395" class="createlink">Asterisk 11 Application_DeadAGI</a></li>
</ul>
<h3><a name="Asterisk11Application_AGI-ImportVersion"></a>Import Version</h3>
<p>This documentation was imported from Asterisk Version SVN-trunk-r370322</p>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;" class="grey">
<a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=AST">Stop watching space</a>
<span style="padding: 0px 5px;">|</span>
<a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_AGI">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_AGI?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>