System information

Additional information on how to use async AGI over the AMI can be found in the next
section.
Pros of async AGI
An existing AMI application can be used to control calls using AGI commands.
Cons of async AGI
It is the most complex method of using AGI to implement.
Setting Up /etc/asterisk/manager.conf for Async AGI
“Configuration” on page 460 discusses the configuration options in manager.conf in
detail. To make use of async AGI, an AMI account must have the agi permission for
both read and write. For example, the following user defined in manager.conf would
be able to both execute AGI manager actions and receive AGI manager events:
;
; Define a user called 'hello', with a password of 'world'.
; Give this user read/write permissions for AGI.
;
[hello]
secret = world
read = agi
write = agi
AGI Communication Overview
The preceding section discussed the variations of AGI that can be used. This section
goes into more detail about how your custom AGI application communicates with
Asterisk once AGI() has been invoked.
Setting Up an AGI Session
Once AGI() or EAGI() has been invoked from the Asterisk dialplan, some information
is passed to the AGI application to set up the AGI session. This section discusses what
steps are taken at the beginning of an AGI session for the different variants of AGI.
Process-based AGI/FastAGI
For a process-based AGI application or a connection to a FastAGI server, the variables
listed in Table 21-1 will be the first pieces of information sent from Asterisk to your
application. Each variable will be on its own line, in the form:
agi_variable: value
480 | Chapter 21:Asterisk Gateway Interface (AGI)