System information
Table 21-1. AGI environment variables
Variable Value / Example Description
agi_request hello-world.sh The first argument that was passed to the AGI() or
EAGI() application. For process-based AGI, this is the name
of the AGI application that has been executed. For FastAGI, this
would be the URL that was used to reach the FastAGI server.
agi_channel SIP/
0004F2060EB4-00000009
The name of the channel that has executed the AGI() or
EAGI() application.
agi_language en The language set on agi_channel.
agi_type SIP The channel type for agi_channel.
agi_uniqueid 1284382003.9 The uniqueid of agi_channel.
agi_version 1.8.0-beta4 The Asterisk version in use.
agi_callerid 12565551212 The full caller ID string that is set on agi_channel.
agi_callerid
name
Russell Bryant The caller ID name that is set on agi_channel.
agi_callingpres 0 The caller presentation associated with the caller ID set on
agi_channel. For more information, see the output of core
show function CALLERPRES at the Asterisk CLI.
agi_callingani2 0 The caller ANI2 associated with agi_channel.
agi_callington 0 The caller ID TON (Type of Number) associated with
agi_channel.
agi_callingtns 0 The dialed number TNS (Transit Network Select) associated
with agi_channel.
agi_dnid 7010 The dialed number associated with agi_channel.
agi_rdnis unknown The redirecting number associated with agi_channel.
agi_context phones The context of the dialplan that agi_channel was in when
it executed the AGI() or EAGI() application.
agi_extension 500 The extension in the dialplan that agi_channel was exe-
cuting when it ran the AGI() or EAGI() application.
agi_priority 1 The priority of agi_extension in agi_context that exe-
cuted AGI() or EAGI().
agi_enhanced 0.0 An indication of whether AGI() or EAGI() was used from
the dialplan. 0.0 indicates that AGI() was used. 1.0 indi-
cates that EAGI() was used.
agi_accountcode myaccount The accountcode associated with agi_channel.
agi_threadid 140071216785168 The threadid of the thread in Asterisk that is running the
AGI() or EAGI() application. This may be useful for associ-
ating logs generated by the AGI application with logs generated
by Asterisk, since the Asterisk logs contain thread IDs.
agi_arg_<argu
ment number>
my argument These variables provide the contents of the additional argu-
ments provided to the AGI() or EAGI() application.
AGI Communication Overview | 481