text
stringlengths
0
152
Cons of async AGI
It is the most complex way to implement AGI.
Setting Up /etc/asterisk/manager.conf for Async AGI
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 a) execute AGI manager actions, and b) 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 informa‐
tion 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 vari‐
ables listed in Table 18-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
AGI Communication Overview
|
319
Table 18-1. AGI environment variables
Variable
agi_request
Value/example
hello-world.sh
agi_channel
SIP/
0004F2060EB4-00000009
agi_language
agi_type
en
SIP
agi_uniqueid
1284382003.9
agi_version
1.8.0-beta4
agi_callerid
12565551212
agi_callerid
name
Russell Bryant
agi_callingpres 0
agi_callingani2 0
agi_callington
agi_callingtns
0
0
agi_dnid
agi_rdnis
agi_context
7010