System information

AGI command Description
SPEECH DEACTIVATE
GRAMMAR
Deactivate a grammar.
SPEECH RECOGNIZE Play a prompt and perform speech recognition, as well as wait for digits to be pressed.
GOSUB Execute a dialplan subroutine. This will perform in the same way as the GoSub() dialplan appli-
cation.
a
When the HANGUP AGI command is used, the channel is not immediately hung up. Instead, the channel is marked as needing to be hung
up. Your AGI application must exit first before Asterisk will continue and perform the actual hangup process.
b
While Asterisk includes a core API for handling speech recognition, it does not come with a module that provides a speech recognition
engine. Digium currently provides two commercial options for speech recognition: Lumenvox and Vestec.
Process-based AGI/FastAGI
AGI commands are sent to Asterisk on a single line. The line must end with a single
newline character. Once a command has been sent to Asterisk, no further commands
will be processed until the last command has finished and a response has been sent
back to the AGI application. Here is an example response to an AGI command:
200 result=0
The Asterisk console allows debugging the communications with an
AGI application. To enable AGI communication debugging, run the agi
set debug on command. To turn debugging off, use agi set debug off.
While this debugging mode is on, all communication to and from an
AGI application will be printed out to the Asterisk console. An example
of this output can be found in “Quick Start” on page 475.
Async AGI
When you’re using async AGI, commands are issued by using the AGI manager action.
To see the built-in documentation for the AGI manager action, run manager show
command AGI at the Asterisk CLI. A demonstration will help clarify how AGI com-
mands are executed using the async AGI method. First, an extension is created in the
dialplan that runs an async AGI session on a channel:
exten => 7011,1,AGI(agi:async)
The following shows an example manager action execution and the manager events
that are emitted during async AGI processing. After the initial execution of the AGI
manager action, there is an immediate response to indicate that the command has been
queued up for execution. Later, there is a manager event that indicates that the queued
command has been executed. The CommandID header can be used to associate the initial
request with the event that indicates that the command has been executed:
Action: AGI
Channel: SIP/0004F2060EB4-00000013
ActionID: my-action-id
CommandID: my-command-id
AGI Communication Overview | 485