Click or drag to resize
AGIScript Class
The BaseAGIScript provides some convinience methods to make it easier to write custom AGIScripts.
Just extend it by your own AGIScripts.
Inheritance Hierarchy
SystemObject
  AsterNET.FastAGIAGIScript

Namespace: AsterNET.FastAGI
Assembly: AsterNET (in AsterNET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public abstract class AGIScript

The AGIScript type exposes the following members.

Constructors
  NameDescription
Protected methodAGIScript
Initializes a new instance of the AGIScript class
Top
Methods
  NameDescription
Protected methodAnswer
Answers the channel.
Protected methodControlStreamFile(String)
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
Protected methodControlStreamFile(String, String)
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
Protected methodControlStreamFile(String, String, Int32)
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
Protected methodControlStreamFile(String, String, Int32, String, String, String)
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
Protected methodDatabaseDel
Deletes an entry in the Asterisk database for a given family and key.
Protected methodDatabaseDelTree(String)
Deletes a whole family of entries in the Asterisk database.
Protected methodDatabaseDelTree(String, String)
Deletes all entries of a given family in the Asterisk database that have a key that starts with a given prefix.
Protected methodDatabaseGet
Retrieves an entry in the Asterisk database for a given family and key.
Protected methodDatabasePut
Adds or updates an entry in the Asterisk database for a given family, key and value.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodExec(String)
Executes the given command.
Protected methodExec(String, String)
Executes the given command.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodGetChannelStatus
Returns the status of the 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
Protected methodGetData(String)
Plays the given file and waits for the user to enter DTMF digits until he presses '#'. The user may interrupt the streaming by starting to enter digits.
Protected methodGetData(String, Int64)
Plays the given file and waits for the user to enter DTMF digits until he presses '#' or the timeout occurs. The user may interrupt the streaming by starting to enter digits.
Protected methodGetData(String, Int64, Int32)
Plays the given file and waits for the user to enter DTMF digits until he presses '#' or the timeout occurs or the maximum number of digits has been entered. The user may interrupt the streaming by starting to enter digits.
Protected methodGetFullVariable(String)
Returns the value of the current channel variable, unlike getVariable() this method understands complex variable names and builtin variables.
Available since Asterisk 1.2.
Protected methodGetFullVariable(String, String)
Returns the value of the given channel variable.
Available since Asterisk 1.2.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Protected methodGetOption(String, String)
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 it waits for the default timeout of 5 seconds still waiting for the user to press a digit.
Protected methodGetOption(String, String, Int32)
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 it waits for the specified timeout still waiting for the user to press a digit.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodGetVariable
Returns the value of the given channel variable.
Protected methodHangup
Hangs the channel up.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodPlayMusicOnHold
Plays music on hold from the default music on hold class.
Protected methodPlayMusicOnHold(String)
Plays music on hold from the given music on hold class.
Protected methodRecordFile(String, String, String, Int32)
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.
Protected methodRecordFile(String, String, String, Int32, Int32, Boolean, Int32)
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.
Protected methodSayAlpha(String)
Says the given character string.
Protected methodSayAlpha(String, String)
Says the given character string, returning early if any of the given DTMF number are received on the channel.
Protected methodSayDateTime(Int64)
Says the given time.
Available since Asterisk 1.2.
Protected methodSayDateTime(Int64, String)
Says the given time and allows interruption by one of the given escape digits.
Available since Asterisk 1.2.
Protected methodSayDateTime(Int64, String, String)
Says the given time in the given format and allows interruption by one of the given escape digits.
Available since Asterisk 1.2.
Protected methodSayDateTime(Int64, String, String, String)
Says the given time in the given format and timezone and allows interruption by one of the given escape digits.
Available since Asterisk 1.2.
Protected methodSayDigits(String)
Says the given digit string.
Protected methodSayDigits(String, String)
Says the given number, returning early if any of the given DTMF number are received on the channel.
Protected methodSayNumber(String)
Says the given number.
Protected methodSayNumber(String, String)
Says the given number, returning early if any of the given DTMF number are received on the channel.
Protected methodSayPhonetic(String)
Says the given character string with phonetics.
Protected methodSayPhonetic(String, String)
Says the given character string with phonetics, returning early if any of the given DTMF number are received on the channel.
Protected methodSayTime(Int64)
Says the given time.
Protected methodSayTime(Int64, String)
Says the given time, returning early if any of the given DTMF number are received on the channel.
Public methodService
Protected methodSetAutoHangup
Cause the channel to automatically hangup at the given number of seconds in the future.
0 disables the autohangup feature.
Protected methodSetCallerId
Sets the caller id on the current channel.
The raw caller id to set, for example "John Doe<1234>".
Protected methodSetContext
Sets the context for continuation upon exiting the application.
Protected methodSetExtension
Sets the extension for continuation upon exiting the application.
Protected methodSetPriority(Int32)
Sets the priority for continuation upon exiting the application.
Protected methodSetPriority(String)
Sets the label for continuation upon exiting the application.
Protected methodSetVariable
Sets the value of the given channel variable to a new value.
Protected methodStopMusicOnHold
Stops playing music on hold.
Protected methodStreamFile(String)
Plays the given file.
Protected methodStreamFile(String, String)
Plays the given file and allows the user to escape by pressing one of the given digit.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodVerbose
Sends a message to the Asterisk console via the verbose message system.
Protected methodWaitForDigit
Waits up to 'timeout' milliseconds to receive a DTMF digit.
Top
Properties
  NameDescription
Protected propertyChannel
Top
See Also