Asterisk agi-command

From 탱이의 잡동사니
Jump to navigation Jump to search

Overview

Asterisk AGI(Asterisk Gateway Interface) Command 내용 정리

ANSWER

Answer channel.

Answers channel if not already in answer state. Returns -1 on channel failure, or 0 if successful.

ANSWER

See also

ASYNCAGI BREAK

Interrupts Async AGI.

Interrupts expected flow of Async AGI commands and returns control to previous source(typically, the PBX dialplan).

ASYNCAGI BREAK

See also

CHANNEL STATUS

Returns status of the connected channel.

Returns the status of the specified channelname. If no channel name is given then returns the status of the current channel.

CHANNEL STATUS CHANNELNAME
  • CHANNELNAME: Channel name.

Return values

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.

See also

CONTROL STREAM FILE

Sends audio file on channel and allows the listener to control the stream.

Send the given file, allowing playback to be controlled by the given digits, if any. Use double quotes for the digits if you wish none to be permitted. If offsetms is provided then the audio will seek to offsetms before play starts.

Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed, or -1 on error or if the channel was disconnected. Returns the position where playback was terminated as endpos.

It sets the following channel variables upon completion.

  • CPLAYBACKSTATUS: Contains the status of the attempt as a text string.
SUCCESS
USERSTOPPED
REMOTESTOPPED
ERROR
  • CPLAYBACKOFFSET: Contains the offset in ms into the file where playback was at when it stopped. -1 is end of file.
  • CPLAYBACKSTOPKEY: If the playback is stopped by the user, this variable contains the key that was pressed.
CONTROL STREAM FILE FILENAME ESCAPE_DIGITS SKIPMS FFCHAR REWCHR PAUSECHR OFFSETMS
  • filename: The file extension must not be included in the filename.
  • escape_digits
  • skipms
  • ffchar: Defaults to #
  • rewchr: Defaults to *
  • pausechr
  • offsetms: Offset, in milliseconds, to start the audio playback.

See also

DATABASE DEL

Removes database key/value.

Deletes an entry in the Asterisk database for a given family and key.

Returns 1 if successful, 0 otherwise.

DATABASE DEL FAMILY KEY 
  • family
  • key

See also

DATABASE DELTREE

Removes database keytree/value

Deletes a family or specific keytree within a family in the Asterisk database.

Returns 1 if successful, 0 otherwise.

DATABASE DELTREE FAMILY KEYTREE 
  • family
  • keytree

See also

DATABASE GET

Gets database value.

Retrieves an entry in the Asterisk database for a given family and key.

Returns 0 if key is not set. Returns 1 if key is sest and returns the variable in parenthesis.

DATABASE GET FAMILY KEY
  • family
  • key

See also