AGI class
Located in /phpagi.php (line 74)
Asterisk Manager
Audio Stream
Config variables
Request variables read in on initialization.
Often contains any/all of the following: agi_request - name of agi script agi_channel - current channel agi_language - current language agi_type - channel type (SIP, ZAP, IAX, ...) agi_uniqueid - unique id based on unix time agi_callerid - callerID string agi_dnid - dialed number id agi_rdnis - referring DNIS number agi_context - current context agi_extension - extension dialed agi_priority - current priority agi_enhanced - value is 1.0 if started as an EAGI script agi_accountcode - set by SetAccount in the dialplan agi_network - value is yes if this is a fastagi agi_network_script - name of the script to execute
NOTE: program arguments are still in $_SERVER['argv'].
Constructor
Answer channel if not already in answer state.
Get the status of the specified channel. If no channel name is specified, return the status of the current channel.
Log to console if debug mode.
Deletes an entry in the Asterisk database for a given family and key.
Deletes a family or specific keytree within a family in the Asterisk database.
Retrieves an entry in the Asterisk database for a given family and key.
Adds or updates an entry in the Asterisk database for a given family, key, and value.
Executes the specified Asterisk application with given options.
Set absolute maximum time of call.
Note that the timeout is set from the current time forward, not counting the number of seconds the call has already been up. Each time you call AbsoluteTimeout(), all previous absolute timeouts are cancelled. Will return the call to the T extension so that you can playback an explanatory note to the calling party (the called party will not hear that)
Executes an AGI compliant application.
Dial.
Dial takes input from ${VXML_URL} to send XML Url to Cisco 7960 Dial takes input from ${ALERT_INFO} to set ring cadence for Cisco phones Dial returns ${CAUSECODE}: If the dial failed, this is the errormessage. Dial returns ${DIALSTATUS}: Text code returning status of last dial attempt.
Do ENUM Lookup.
Note: to retrieve the result, use get_variable('ENUM');
Goto.
This function takes three arguments: context,extension, and priority, but the leading arguments are optional, not the trailing arguments. Thuse goto($z) sets the priority to $z.
Set Language.
Plays the given file and receives DTMF data.
Return early if $buffer is adequate for request.
This is similar to STREAM FILE, but this command can accept and return many DTMF digits, while STREAM FILE returns immediately after the first DTMF digit is detected.
Asterisk looks for the file to play in /var/lib/asterisk/sounds by default.
If the user doesn't press any keys when the message plays, there is $timeout milliseconds of silence then the command ends.
The user has the opportunity to press a key at any time during the message or the post-message silence. If the user presses a key while the message is playing, the message stops playing. When the first key is pressed a timer starts counting for $timeout milliseconds. Every time the user presses another key the timer is restarted. The command ends when the counter goes to zero or the maximum number of digits is entered, whichever happens first.
If you don't specify a time out then a default timeout of 2000 is used following a pressed digit. If no digits are pressed then 6 seconds of silence follow the message.
If you don't specify $max_digits then the user can enter as many digits as they want.
Pressing the # key has the same effect as the timer running out: the command ends and any previously keyed digits are returned. A side effect of this is that there is no way to read a # key using this command.
Say the given digit string, returning early if any of the given DTMF escape digits are received on the channel.
Return early if $buffer is adequate for request.
Say the given number, returning early if any of the given DTMF escape digits are received on the channel.
Return early if $buffer is adequate for request.
Say the given character string, returning early if any of the given DTMF escape digits are received on the channel.
Return early if $buffer is adequate for request.
Say Puncutation in a string.
Return early if $buffer is adequate for request.
Say a given time, returning early if any of the given DTMF escape digits are received on the channel.
Return early if $buffer is adequate for request.
Play the given audio file, allowing playback to be interrupted by a DTMF digit. This command is similar to the GET DATA command but this command returns after the first DTMF digit has been pressed while GET DATA can accumulated any number of digits before returning.
Return early if $buffer is adequate for request.
Use Cepstral Swift to read text.
Return early if $buffer is adequate for request.
Use festival to read text.
Return early if $buffer is adequate for request.
Plays the given file and receives DTMF data.
This is similar to STREAM FILE, but this command can accept and return many DTMF digits, while STREAM FILE returns immediately after the first DTMF digit is detected.
Asterisk looks for the file to play in /var/lib/asterisk/sounds by default.
If the user doesn't press any keys when the message plays, there is $timeout milliseconds of silence then the command ends.
The user has the opportunity to press a key at any time during the message or the post-message silence. If the user presses a key while the message is playing, the message stops playing. When the first key is pressed a timer starts counting for $timeout milliseconds. Every time the user presses another key the timer is restarted. The command ends when the counter goes to zero or the maximum number of digits is entered, whichever happens first.
If you don't specify a time out then a default timeout of 2000 is used following a pressed digit. If no digits are pressed then 6 seconds of silence follow the message.
If you don't specify $max_digits then the user can enter as many digits as they want.
Pressing the # key has the same effect as the timer running out: the command ends and any previously keyed digits are returned. A side effect of this is that there is no way to read a # key using this command.
Fetch the value of a variable.
Does not work with global variables. Does not work with some variables that are generated by modules.
Goto - Set context, extension and priority.
Hangup the specified channel. If no channel name is given, hang up the current channel.
With power comes responsibility. Hanging up channels other than your own isn't something that is done routinely. If you are not sure why you are doing so, then don't.
Menu.
This function presents the user with a menu and reads the response
Create a new AGI_AsteriskManager.
Does nothing.
Parse caller id.
Receive a character of text from a connected channel. Waits up to $timeout milliseconds for a character to arrive, or infinitely if $timeout is zero.
Record sound to a file until an acceptable DTMF digit is received or a specified amount of time has passed. Optionally the file BEEP is played before recording begins.
Say the given digit string, returning early if any of the given DTMF escape digits are received on the channel.
Say the given number, returning early if any of the given DTMF escape digits are received on the channel.
Say the given character string, returning early if any of the given DTMF escape digits are received on the channel.
Say Puncutation in a string.
Say a given time, returning early if any of the given DTMF escape digits are received on the channel.
Send the specified image on a channel.
Most channels do not support the transmission of images.
Send the given text to the connected channel.
Most channels do not support transmission of text.
Cause the channel to automatically hangup at $time seconds in the future.
If $time is 0 then the autohangup feature is disabled on this channel.
If the channel is hungup prior to $time seconds, this setting has no effect.
Changes the caller ID of the current channel.
Sets the context for continuation upon exiting the application.
Setting the context does NOT automatically reset the extension and the priority; if you want to start at the top of the new context you should set extension and priority yourself.
If you specify a non-existent context you receive no error indication (['result'] is still 0) but you do get a warning message on the Asterisk console.
Set the extension to be used for continuation upon exiting the application.
Setting the extension does NOT automatically reset the priority. If you want to start with the first priority of the extension you should set the priority yourself.
If you specify a non-existent extension you receive no error indication (['result'] is still 0) but you do get a warning message on the Asterisk console.
Enable/Disable Music on hold generator.
Set the priority to be used for continuation upon exiting the application.
If you specify a non-existent priority you receive no error indication (['result'] is still 0) and no warning is issued on the Asterisk console.
Sets a variable to the specified value. The variables so created can later be used by later using ${<variablename>} in the dialplan.
These variables live in the channel Asterisk creates when you pickup a phone and as such they are both local and temporary. Variables created in one channel can not be accessed by another channel. When you hang up the phone, the channel is deleted and any variables in that channel are deleted as well.
Play the given audio file, allowing playback to be interrupted by a DTMF digit. This command is similar to the GET DATA command but this command returns after the first DTMF digit has been pressed while GET DATA can accumulated any number of digits before returning.
Use Cepstral Swift to read text.
Enable or disable TDD transmission/reception on the current channel.
Use festival to read text.
Text Input.
Based on ideas found at http://www.voip-info.org/wiki-Asterisk+cmd+DTMFToText
Example: UC H LC i , SP h o w SP a r e SP y o u ? $string = '*8'.'44*'.'*5'.'444*'.'00*'.'0*'.'44*'.'666*'.'9*'.'0*'.'2*'.'777*'.'33*'.'0*'.'999*'.'666*'.'88*'.'0000*';
Sends $message to the Asterisk console via the 'verbose' message system.
If the Asterisk verbosity level is $level or greater, send $message to the console.
The Asterisk verbosity system works as follows. The Asterisk user gets to set the desired verbosity at startup time or later using the console 'set verbose' command. Messages are displayed on the console if their verbose level is less than or equal to desired verbosity set by the user. More important messages should have a low verbose level; less important messages should have a high verbose level.
Waits up to $timeout milliseconds for channel to receive a DTMF digit.
Documentation generated on Wed, 20 Jul 2005 15:21:26 +0000 by phpDocumentor 1.2.3