Also, visit my blog
answer
Usage: ANSWER
Asserts answer.
Answers channel if not already in answer state.
RETURNS:
-1 on channel failure
0 if successful
channel status
Usage: CHANNEL STATUS [<channelname>]
Returns the status of the specified or connected channel.
If no channel name is given it returns the status of the current channel.
RETURNS:
0 Channel is down and available
1 Channel is down, but reserved
2 Channel is off hook
3 Digits (or equivalent) have been dialed
4 Line is ringing
5 Remote end is ringing
6 Line is up
7 Line is busy
database del
Usage: DATABASE DEL <family> <key>
Removes database key/value.
Deletes an entry in the Asterisk database for a given family and key.
RETURNS:
1 if successful
0 otherwise
database deltree
Usage: DATABASE DELTREE <family> [keytree]
Removes database keytree/value.
Deletes a family or specific keytree within a family in the Asterisk database.
RETURNS:
1 if successful
0 otherwise
database get
Usage: DATABASE GET <family> <key>
Gets database value.
Retrieves an entry in the Asterisk database for a given family and key.
RETURNS:
0 if <key> is not set
1 if <key> is set and returns the variable in parenthesis
example return code: 200 result=1 (testvariable)
database put
Usage: DATABASE PUT <family> <key> <value>
Adds/updates database value.
Adds or updates an entry in the Asterisk database for a given family, key,
and value.
RETURNS:
1 if successful
0 otherwise
exec
Usage: EXEC <application> <options>
Executes a given application.
Executes <application> with given <options>.
RETURNS:
Whatever the application returns successfully
-2 on failure to find application
get data
Usage: GET DATA <file to be streamed> [timeout] [max digits]
Gets data on a channel.
Stream the given file, and receive DTMF data.
the channel at the other end.
RETURNS:
Digits received from the channel at the other end.
get variable
Usage: GET VARIABLE <variablename>
Gets a channel variable.
RETURNS:
0 if <variablename> is not set
1 if <variablename> is set and returns the variable in parenthesis
example return code: 200 result=1 (testvariable)
hangup
Usage: HANGUP [<channelname>]
Hangs up the current or specified channel.
If no channel name is given, hangs up the current channel
RETURNS:
1 on success
-1 on failure
noop
Usage: NOOP
Does nothing.
RETURNS:
0 - always
receive char
Usage: RECEIVE CHAR <timeout>
Receives text from channels supporting it.
Receives a character of text on a channel. Specify timeout to be the maximum
time to wait for input in milliseconds, or 0 for infinite. Most channels do
not support the reception of text.
RETURNS:
ASCII numerical value of the character if one is received
0 if the channel does not support text reception
-1 only on error/hangup.
record file
Usage: RECORD FILE <filename> <format>
<escape digits> <timeout> [offset samples] [BEEP] [s=silence]
Records to a given file.
Record to a file until a given DTMF digit in the sequence is received.
The format will specify what kind of file will be recorded. The timeout is the
maximum record time in milliseconds, or -1 for no timeout. "offset samples" is
optional, and if provided will seek to the offset without exceeding the end of
the file. "silence" is the number of seconds of silence allowed before the
function returns despite the lack of DTMF digits or reaching timeout. The
"silence" value must be preceded by "s=" and is optional.
RETURNS:
-1 on hangup or error
say digits
Usage: SAY DIGITS <number> <escape digits>
Say a given digit string, returning early if any of the given DTMF digits are
received on the channel.
RETURNS:
0 if playback completes without a digit being pressed
ASCII numerical value of the digit if one was pressed
-1 on error/hangup
say number
Usage: SAY NUMBER <number> <escape digits>
Say a given number, returning early if any of the given DTMF digits are
received on the channel.
RETURNS:
0 if playback completes without a digit being pressed
ASCII numerical value of the digit if one was pressed
-1 on error/hangup
say phonetic
Usage: SAY PHONETIC <string> <escape digits>
Say a given character string with phonetics, returning early if any of the
given DTMF digits are received on the channel.
RETURNS:
0 if playback completes without a digit being pressed
ASCII numerical value of the digit if one was pressed
-1 on error/hangup
say time
Usage: SAY TIME <time> <escape digits>
Say a given time, returning early if any of the given DTMF digits are received
on the channel. <time> is the number of seconds elapsed since 00:00:00
January 1, 1970, Coordinated Universal Time (UTC).
RETURNS:
0 if playback completes without a digit being pressed
ASCII numerical value of the digit if one was pressed
-1 on error/hangup
send image
Usage: SEND IMAGE <image>
Sends the given image on a channel.
Most channels do not support the transmission of images. Image names should not
include extensions.
RETURNS:
0 if image is sent or if the channel does not support image transmission
-1 only on error/hangup
send text
Usage: SEND TEXT "<text to send>"
Sends the given text on a channel.
Most channels do not support the transmission of text. Text consisting of
greater than one word should be placed in quotes since the command only
accepts a single argument.
RETURNS:
0 if text is sent, or if the channel does not support text transmission
-1 only on error/hangup
set autohangup
Usage: SET AUTOHANGUP <time>
Autohangup channel in some time.
Cause the channel to automatically hangup at <time> seconds in the
future. Of course it can be hungup before then as well. Setting to 0 will
cause the autohangup feature to be disabled on this channel.
RETURNS:
0 - always
set callerid
Usage: SET CALLERID <number>
Changes the callerid of the current channel.
RETURNS:
1 - always
set context
Usage: SET CONTEXT <desired context>
Sets the context for continuation upon exiting the application.
RETURNS:
0 - always
set extension
Usage: SET EXTENSION <new extension>
Changes the extension for continuation upon exiting the application.
RETURNS:
0 - always
set music
Usage: SET MUSIC ON <on|off> <class>
Enables/Disables the music on hold generator. If <class> is not
specified then the default music on hold class will be used.
RETURNS:
0 - always
set priority
Usage: SET PRIORITY <num>
Changes the priority for continuation upon exiting the application.
RETURNS:
0 - always
set variable
Usage: SET VARIABLE <variablename> <value>
Sets a channel variable.
RETURNS:
1 - always
stream file
Usage: STREAM FILE <filename> <escape digits> [sample offset]
Sends audio file on channel.
Send the given file, allowing playback to be interrupted by the given digits,
if any. Use double quotes for the digits if you wish none to be permitted. If
sample offset is provided then the audio will seek to sample offset before play
starts. Remember, the file extension must not be included in the filename.
RETURNS:
0 if playback completes without a digit being pressed
ASCII numerical value of the digit if one was pressed
-1 on error or if the channel was disconnected
tdd mode
Usage: TDD MODE <on|off>
Enable/Disable TDD transmission/reception on a channel.
RETURNS:
1 if successful
0 if channel is not TDD-capable
verbose
Usage: VERBOSE <message> <level>
Logs a message to the asterisk verbose log.
Sends <message> to the console via verbose message system.
<level> is the the verbose level (1-4)
RETURNS:
1 - always
wait for digit
Usage: WAIT FOR DIGIT <timeout>
Waits for a digit to be pressed.
Waits up to 'timeout' milliseconds for channel to receive a DTMF digit.
Use -1 for the timeout value if you desire the call to block indefinitely.
RETURNS:
ASCII numerical value of the digit if one is received
-1 on channel failure
0 if no digit is received in the timeout