Executes an AGI compliant application.
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.
The following variants of AGI exist, and are chosen based on the value passed to command:
AGI- The classic variant of AGI, this will launch the script specified by command as a new process. Communication with the script occurs on
stdout. If the full path to the script is not provided, the
asterisk.confwill be used.
FastAGI- Connect Asterisk to a FastAGI server using a TCP connection. The URI to the FastAGI server should be given in the form
[scheme]://host.domain[:port][/script/name], where scheme is either
In the case of
hagi, an SRV lookup will be performed to try to connect to a list of FastAGI servers. The hostname in the URI must be prefixed with
_agi._tcp. prior to the DNS resolution. For example, if you specify the URI
hagi://agi.example.com/foo.agithe DNS query would be for
_agi._tcp.agi.example.com. You will need to make sure this resolves correctly.
AsyncAGI- Use AMI to control the channel in AGI. AGI commands can be invoked using the
AMIaction, with a variety of AGI specific events passed back over the AMI connection. AsyncAGI should be invoked by passing
agi:asyncto the command parameter.Example: Start the AGI script /tmp/my-cool-script.sh, passing it the contents of the channel variable FOOExample: Start the AGI script my-cool-script.sh located in the astagidir directory, specified in asterisk.confExample: Connect to the FastAGI server located at 127.0.0.1 and start the script awesome-scriptThis application sets the following channel variable upon completion:Example: Start AsyncAGI
AGISTATUS- The status of the attempt to the run the AGI script text string, one of:
command- How AGI should be invoked on the channel.
args- Arguments to pass to the AGI script or server.
- Asterisk 18 ManagerAction_AGI
- Asterisk 18 ManagerEvent_AsyncAGIStart
- Asterisk 18 ManagerEvent_AsyncAGIEnd
- Asterisk 18 Application_EAGI
- Asterisk 18 Application_DeadAGI
This documentation was imported from Asterisk Version GIT-18-20d9158