AsterNet Class Library (Sandcastle documentation)

| 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
System
Object
AsterNET.FastAGI
AGIScript

Namespace: AsterNET.FastAGI
Assembly: AsterNET (in AsterNET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
C++
F#
Copy

    public abstract class AGIScript

    Public MustInherit Class AGIScript

    public ref class AGIScript abstract

    [<AbstractClassAttribute>]
    type AGIScript =  class end

The AGIScript type exposes the following members.

Constructors

| Name | Description
--- | --- | ---
| AGIScript | Initializes a new instance of the AGIScript class

Top
Methods

| Name | Description
--- | --- | ---
| Answer | Answers the channel.

ControlStreamFile(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

ControlStreamFile(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

ControlStreamFile(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

ControlStreamFile(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

| DatabaseDel | Deletes an entry in the Asterisk database for a given family and key.
| DatabaseDelTree(String) | Deletes a whole family of entries in the Asterisk database.
| DatabaseDelTree(String, String) | Deletes all entries of a given family in the Asterisk database that have a key that starts with a given prefix.
| DatabaseGet | Retrieves an entry in the Asterisk database for a given family and key.
| DatabasePut | Adds or updates an entry in the Asterisk database for a given family, key and value.
| Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
| Exec(String) | Executes the given command.
| Exec(String, String) | Executes the given command.
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)

GetChannelStatus

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

| GetData(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.
| GetData(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.
| GetData(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.
| GetFullVariable(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.
| GetFullVariable(String, String) | Returns the value of the given channel variable. Available since Asterisk 1.2.
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
| GetOption(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.
| GetOption(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.
| GetType | Gets the Type of the current instance. (Inherited from Object.)
| GetVariable | Returns the value of the given channel variable.
| Hangup | Hangs the channel up.
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.)
| PlayMusicOnHold | Plays music on hold from the default music on hold class.
| PlayMusicOnHold(String) | Plays music on hold from the given music on hold class.

RecordFile(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.

RecordFile(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.

| SayAlpha(String) | Says the given character string.
| SayAlpha(String, String) | Says the given character string, returning early if any of the given DTMF number are received on the channel.
| SayDateTime(Int64) | Says the given time. Available since Asterisk 1.2.
| SayDateTime(Int64, String) | Says the given time and allows interruption by one of the given escape digits. Available since Asterisk 1.2.
| SayDateTime(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.
| SayDateTime(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.
| SayDigits(String) | Says the given digit string.
| SayDigits(String, String) | Says the given number, returning early if any of the given DTMF number are received on the channel.
| SayNumber(String) | Says the given number.
| SayNumber(String, String) | Says the given number, returning early if any of the given DTMF number are received on the channel.
| SayPhonetic(String) | Says the given character string with phonetics.
| SayPhonetic(String, String) | Says the given character string with phonetics, returning early if any of the given DTMF number are received on the channel.
| SayTime(Int64) | Says the given time.
| SayTime(Int64, String) | Says the given time, returning early if any of the given DTMF number are received on the channel.
| Service |
| SetAutoHangup | Cause the channel to automatically hangup at the given number of seconds in the future. 0 disables the autohangup feature.
| SetCallerId | Sets the caller id on the current channel. The raw caller id to set, for example "John Doe<1234>".
| SetContext | Sets the context for continuation upon exiting the application.
| SetExtension | Sets the extension for continuation upon exiting the application.
| SetPriority(Int32) | Sets the priority for continuation upon exiting the application.
| SetPriority(String) | Sets the label for continuation upon exiting the application.
| SetVariable | Sets the value of the given channel variable to a new value.
| StopMusicOnHold | Stops playing music on hold.
| StreamFile(String) | Plays the given file.
| StreamFile(String, String) | Plays the given file and allows the user to escape by pressing one of the given digit.
| ToString | Returns a string that represents the current object. (Inherited from Object.)
| Verbose | Sends a message to the Asterisk console via the verbose message system.
| WaitForDigit | Waits up to 'timeout' milliseconds to receive a DTMF digit.

Top
Properties

| Name | Description
--- | --- | ---
| Channel |

Top
See Also

#### Reference

AsterNET.FastAGI Namespace