Click or drag to resize
AsterNET.FastAGI.Command Namespace
AsterNet FastAGI Command
Classes
  ClassDescription
Public classAGICommand
Public classAnswerCommand
Public classChannelStatusCommand
Returns the status of the specified channel. If no channel name is given the returns the status of the current channel.
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
Public classControlStreamFileCommand
Plays the given file, allowing playback to be interrupted by the given digits, if any, and allows the listner to control the stream.
If offset is provided then the audio will seek to sample offset 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.
Remember, the file extension must not be included in the filename.
Available since Asterisk 1.2
Public classDatabaseDelCommand
Deletes a family or specific keytree within a family in the Asterisk database.
Returns 1 if successful, 0 otherwise.
Public classDatabaseDelTreeCommand
Deletes an entry in the Asterisk database for a given family and key.
Returns 1 if successful, 0 otherwise.
Public classDatabaseGetCommand
Retrieves an entry in the Asterisk database for a given family and key.
Returns 0 if is not set. Returns 1 if the variable is set and returns the value in parenthesis.
Example return code: 200 result=1 (testvariable)
Public classDatabasePutCommand
Adds or updates an entry in the Asterisk database for a given family, key, and value.
Returns 1 if successful, 0 otherwise.
Public classExecCommand
Executes an application with the given options.
Returns whatever the application returns, or -2 if the application was not found.
Public classGetDataCommand
Stream the given file, and recieve DTMF data. The user may interrupt the streaming by starting to enter digits.
Returns the digits recieved from the channel at the other end.
Input ends when the timeout is reached, the maximum number of digits is read or the user presses #.
Public classGetFullVariableCommand
Returns the value of the given channel varible and understands complex variable names and builtin variables, unlike the GetVariableCommand.
You can also use this command to use custom Asterisk functions. Syntax is "func(args)".
Returns 0 if the variable is not set or channel does not exist. Returns 1 if the variable is set and returns the variable in parenthesis.
Example return code: 200 result=1 (testvariable) Available since Asterisk 1.2
Public classGetOptionCommand
Plays the given file, and waits for the user to press one of the given digits. If none of the esacpe digits is pressed while streaming the file this command waits for the specified timeout still waiting for the user to press a digit. Streaming always begins at the beginning.
Returns 0 if no 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.
Remember, the file extension must not be included in the filename.
Public classGetVariableCommand
Returns the value of the given channel varible.
Since Asterisk 1.2 you can also use this command to use custom Asterisk functions. Syntax is "func(args)".
Returns 0 if the variable is not set. Returns 1 if the variable is set and returns the variable in parenthesis.
Example return code: 200 result=1 (testvariable)
Public classHangupCommand
Hangs up the specified channel. If no channel name is given, hangs up the current channel.
Public classNoopCommand
Does nothing.
Public classReceiveCharCommand
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 the decimal value of the character if one is received, or 0 if the channel does not support text reception. Returns -1 only on error/hangup.
Public classReceiveTextCommand
Receives a string 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 -1 for failure or 1 for success, and the string in parentheses.
Available since Asterisk 1.2.
Public classRecordFileCommand
Record to a file until a given dtmf digit in the sequence is received.
Returns -1 on hangup or error.
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. "maxSilence" is the number of seconds of maxSilence allowed before the function returns despite the lack of dtmf digits or reaching timeout.
Public classSayAlphaCommand
Say a given character 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, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup.
Public classSayDateTimeCommand
Say a given time, returning early if any of the given DTMF digits are pressed.
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/hangup.
Available since Asterisk 1.2.
Public classSayDigitsCommand
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, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup.
Public classSayNumberCommand
Say a given number, returning early if any of the given DTMF number are received on the channel.
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/hangup.
Public classSayPhoneticCommand
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, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup.
Public classSayTimeCommand
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 on January 1, 1970, Coordinated Universal Time (UTC).
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/hangup.
Public classSendImageCommand
Sends the given image on a channel.
Most channels do not support the transmission of images.
Returns 0 if image is sent, or if the channel does not support image transmission. Returns -1 only on error/hangup.
Image names should not include extensions.
Public classSendTextCommand
Sends the given text on a channel.
Most channels do not support the transmission of text.
Returns 0 if text is sent, or if the channel does not support text transmission. Returns -1 only on error/hangup.
Public classSetAutoHangupCommand
Cause the channel to automatically hangup at the given number of 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.
Public classSetCallerIdCommand
Changes the CallerID of the current channel.
Public classSetContextCommand
Sets the context for continuation upon exiting the application.
Public classSetExtensionCommand
Sets the extension for continuation upon exiting the application.
Public classSetMusicOffCommand
Turns off music on hold on the current channel.
Always returns 0.
Public classSetMusicOnCommand
Turns on music on hold on the current channel.
Always returns 0.
Public classSetPriorityCommand
Sets the priority for continuation upon exiting the application.
Since Asterisk 1.2 SetPriorityCommand also supports labels.
Public classSetVariableCommand
Sets the given channel variable to the given value.
Public classStreamFileCommand
Plays the given file, allowing playback to be interrupted by the given digits, if any.
If offset is provided then the audio will seek to sample offset 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.
Remember, the file extension must not be included in the filename.
Public classTDDModeCommand
Enable/Disable TDD transmission/reception on a channel.
Returns 1 if successful, or 0 if channel is not TDD-capable.
Public classVerboseCommand
Sends a message to the console via the verbose message system.
Always returns 1.
Public classWaitForDigitCommand
Waits up to 'timeout' milliseconds for channel to receive a DTMF digit.
Returns -1 on channel failure, 0 if no digit is received in the timeout, or the numerical value of the ascii of the digit if one is received. Use -1 for the timeout value if you desire the call to block indefinitely.