AGI commands
* answer: Asserts answer
* asyncagi break: Break Async AGI loop (since Asterisk 1.6)
* channel status: Returns status of the connected channel
* control stream file: Send the given file, allowing playback to be controlled by the given digits, if any. (since Asterisk 1.2)
* database del: Removes database key/value
* database deltree: Removes database keytree/value
* database get: Gets database value
* database put: Adds/updates database value
* exec: Executes a given Application. (Applications are the functions you use to create a dial plan in extensions.conf ).
* get data: Gets data on a channel
* get full variable: Gets a channel variable, but understands complex variable names and builtin variables. (since Asterisk 1.2)
* get option: Behaves similar to STREAM FILE but used with a timeout option. (since Asterisk 1.2)
* get variable: Gets a channel variable
* hangup: Hangup the current channel
* noop: Does nothing
* receive char: Receives one character from channels supporting it
* receive text: Receives text from channels supporting it
* record file: Records to a given file
* say alpha: Says a given character string (since Asterisk 1.2)
* say date: Say a date (since Asterisk 1.2)
* say datetime: Say a formatted date and time (since Asterisk 1.2)
* say digits: Says a given digit string
* say number: Says a given number
* say phonetic: Say the given character string.
* say time: Say a time
* send image: Sends images to channels supporting it
* send text: Sends text to channels supporting it
* set autohangup: Autohangup channel in some time
* set callerid: Sets callerid for the current channel
* set context: Sets channel context
* set extension: Changes channel extension
* set music: Enable/Disable Music on hold generator, example "SET MUSIC ON default"
* set priority: Prioritizes the channel
* set variable: Sets a channel variable
* speech activate grammar: Activates a grammar (since Asterisk 1.6)
* speech create: Creates a speech object (since Asterisk 1.6)
* speech deactivate grammar: Deactivates a grammar (since Asterisk 1.6)
* speech destroy: Destroys a speech object (since Asterisk 1.6)
* speech load grammar: Loads a grammar (since Asterisk 1.6)
* speech recognize: Recognizes speech (since Asterisk 1.6)
* speech set: Sets a speech engine setting (since Asterisk 1.6)
* speech unload grammar: Unloads a grammar (since Asterisk 1.6)
* stream file: Sends audio file on channel
* tdd mode: Activates TDD mode on channels supporting it, to enable communication with TDDs.
* verbose: Logs a message to the asterisk verbose log
* wait for digit: Waits for a digit to be pressed
When Asterisk starts an AGI script, it feeds the channel variables to the script on standard input. The variable names are prefixed with "agi_" and are separated from their values by a colon and a space. Though the actual channel variables may be in the upper case, the names passed to an AGI script are all lower case. Global variables are not passed to the AGI script in this manner.
* agi_request - The filename of your script
* agi_channel - The originating channel (your phone)
* agi_language - The language code (e.g. "en")
* agi_type - The originating channel type (e.g. "SIP" or "ZAP")
* agi_uniqueid - A unique ID for the call
* agi_version - The version of Asterisk (since Asterisk 1.6)
* agi_callerid - The caller ID number (or "unknown")
* agi_calleridname - The caller ID name (or "unknown")
* agi_callingpres - The presentation for the callerid in a ZAP channel
* agi_callingani2 - The number which is defined in ANI2 see Asterisk Detailed Variable List (only for PRI Channels)
* agi_callington - The type of number used in PRI Channels see Asterisk Detailed Variable List
* agi_callingtns - An optional 4 digit number (Transit Network Selector) used in PRI Channels see Asterisk Detailed Variable List
* agi_dnid - The dialed number id (or "unknown")
* agi_rdnis - The referring DNIS number (or "unknown")
* agi_context - Origin context in extensions.conf
* agi_extension - The called number
* agi_priority - The priority it was executed as in the dial plan
* agi_enhanced - The flag value is 1.0 if started as an EAGI script, 0.0 otherwise
* agi_accountcode - Account code of the origin channel
* agi_threadid - Thread ID of the AGI script (since Asterisk 1.6)
Using the "get variable" AGI command to get values above.