From: Matt Jordan Date: Fri, 12 Aug 2016 20:53:52 +0000 (-0500) Subject: res_agi: Improve documentation X-Git-Tag: 13.12.0-rc1~132^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9e734974b3718c20885d8023519f3ab64a9dfe0;p=thirdparty%2Fasterisk.git res_agi: Improve documentation * Groups of AGI commands that have similar functionality now reference each other, and all reference the AGI application for ease of wiki reference. * The documentation for the AGI application has been improved, in particular noting the various AGI types and how they are invoked. * A warning message has been added to DeadAGI, noting that it is deprecated. Change-Id: I479ccdee8a7393f01b18692c3d4ab7e6bdd1875d --- diff --git a/res/res_agi.c b/res/res_agi.c index e3839dd6d5..06df75293c 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -22,7 +22,6 @@ * * \author Mark Spencer * - * \todo Convert the rest of the AGI commands over to XML documentation */ /*** MODULEINFO @@ -85,6 +84,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") hangup + AGI @@ -98,6 +98,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") hangup + AGI @@ -138,6 +139,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") + + AGI + @@ -188,6 +192,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") + + get option + control stream file + AGI + @@ -203,6 +212,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Returns 1 if successful, 0 otherwise. + + database get + database put + database deltree + AGI + @@ -217,6 +232,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") within a family in the Asterisk database. Returns 1 if successful, 0 otherwise. + + database get + database put + database del + AGI + @@ -234,6 +255,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") in parenthesis. Example return code: 200 result=1 (testvariable) + + database put + database del + database deltree + AGI + @@ -250,6 +277,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") value. Returns 1 if successful, 0 otherwise. + + database get + database del + database deltree + AGI + @@ -265,6 +298,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Returns whatever the application returns, or -2 on failure to find application. + + AGI + @@ -279,6 +315,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Stream the given file, and receive DTMF data. Returns the digits received from the channel at the other end. + + AGI + @@ -295,6 +334,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") variables, unlike GET VARIABLE. Example return code: 200 result=1 (testvariable) + + get variable + set variable + AGI + @@ -310,6 +354,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") stream file + control stream file + AGI @@ -325,6 +371,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") the variable in parentheses. Example return code: 200 result=1 (testvariable) + + get full variable + set variable + AGI + @@ -337,6 +388,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Hangs up the specified channel. If no channel name is given, hangs up the current channel + + AGI + @@ -346,6 +400,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Does nothing. + + AGI + @@ -363,6 +420,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") if one is received, or 0 if the channel does not support text reception. Returns -1 only on error/hangup. + + receive text + AGI + @@ -379,6 +440,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") do not support the reception of text. Returns -1 for failure or 1 for success, and the string in parenthesis. + + receive char + send text + AGI + @@ -404,6 +470,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") lack of dtmf digits or reaching timeout. silence value must be preceded by s= and is also optional. + + AGI + @@ -419,6 +488,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup. + + say digits + say number + say phonetic + say date + say time + say datetime + AGI + @@ -434,6 +512,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup. + + say alpha + say number + say phonetic + say date + say time + say datetime + AGI + @@ -450,6 +537,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup. + + say alpha + say digits + say phonetic + say date + say time + say datetime + AGI + @@ -465,6 +561,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") playback completes without a digit pressed, the ASCII numerical value of the digit if one was pressed, or -1 on error/hangup. + + say alpha + say digits + say number + say date + say time + say datetime + AGI + @@ -483,6 +588,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup. + + say alpha + say digits + say number + say phonetic + say time + say datetime + AGI + @@ -501,6 +615,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup. + + say alpha + say digits + say number + say phonetic + say date + say datetime + AGI + @@ -528,6 +651,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup. + + say alpha + say digits + say number + say phonetic + say date + say time + AGI + @@ -542,6 +674,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") the channel does not support image transmission. Returns -1 only on error/hangup. Image names should not include extensions. + + AGI + @@ -559,6 +694,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") channel does not support text transmission. Returns -1 only on error/hangup. + + receive text + AGI + @@ -572,6 +711,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") 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. + + AGI + @@ -583,6 +725,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Changes the callerid of the current channel. + + AGI + @@ -594,6 +739,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Sets the context for continuation upon exiting the application. + + set extension + set priority + AGI + @@ -605,6 +755,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Changes the extension for continuation upon exiting the application. + + set context + set priority + AGI + @@ -629,6 +784,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") used. This generator will be stopped automatically when playing a file. Always returns 0. + + AGI + @@ -641,6 +799,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Changes the priority for continuation upon exiting the application. The priority must be a valid priority or label. + + set context + set extension + AGI + @@ -653,6 +816,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Sets a variable to the current channel. + + get variable + get full variable + AGI + @@ -690,6 +858,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") control stream file + get option + AGI @@ -708,6 +878,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Enable/Disable TDD transmission/reception on a channel. Returns 1 if successful, or 0 if channel is not TDD-capable. + + AGI + @@ -722,6 +895,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") message system. level is the verbose level (1-4). Always returns 1 + + AGI + @@ -737,6 +913,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") one is received. Use -1 for the timeout value if you desire the call to block indefinitely. + + AGI + @@ -748,6 +927,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Create a speech object to be used by the other Speech AGI commands. + + speech set + speech destroy + speech load grammar + speech unload grammar + speech activate grammar + speech deactivate grammar + speech recognize + AGI + @@ -760,6 +949,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Set an engine-specific setting. + + speech create + speech destroy + speech load grammar + speech unload grammar + speech activate grammar + speech deactivate grammar + speech recognize + AGI + @@ -772,6 +971,13 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") speech create + speech set + speech load grammar + speech unload grammar + speech activate grammar + speech deactivate grammar + speech recognize + AGI @@ -785,6 +991,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Loads the specified grammar as the specified name. + + speech create + speech set + speech destroy + speech unload grammar + speech activate grammar + speech deactivate grammar + speech recognize + AGI + @@ -796,6 +1012,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Unloads the specified grammar. + + speech create + speech set + speech destroy + speech load grammar + speech activate grammar + speech deactivate grammar + speech recognize + AGI + @@ -807,6 +1033,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Activates the specified grammar on the speech object. + + speech create + speech set + speech destroy + speech load grammar + speech unload grammar + speech deactivate grammar + speech recognize + AGI + @@ -818,6 +1054,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Deactivates the specified grammar on the speech object. + + speech create + speech set + speech destroy + speech load grammar + speech unload grammar + speech activate grammar + speech recognize + AGI + @@ -832,14 +1078,27 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Plays back given prompt while listening for speech and dtmf. + + speech create + speech set + speech destroy + speech load grammar + speech unload grammar + speech activate grammar + speech deactivate grammar + AGI + Executes an AGI compliant application. - + + How AGI should be invoked on the channel. + + Arguments to pass to the AGI script or server. @@ -848,21 +1107,72 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Executes an Asterisk Gateway Interface compliant program on a channel. AGI allows Asterisk to launch external programs written in any language to control a telephony channel, play audio, read DTMF digits, - etc. by communicating with the AGI protocol on stdin and - stdout. As of 1.6.0, this channel will + etc. by communicating with the AGI protocol. + The following variants of AGI exist, and are chosen based on the value + passed to command: + + + The classic variant of AGI, this will launch the script + specified by command as a new process. + Communication with the script occurs on stdin and + stdout. If the full path to the script is not + provided, the astagidir specified in + asterisk.conf will be used. + + + + Connect Asterisk to a FastAGI server using a TCP connection. + The URI to the FastAGI server should be given in the form + [scheme]://host.domain[:port][/script/name], + where scheme is either agi + or hagi. + In the case of hagi, an SRV lookup will be + performed to try to connect to a list of FastAGI servers. The hostname in + the URI must be prefixed with _agi._tcp. prior to the DNS resolution. For + example, if you specify the URI hagi://agi.example.com/foo.agi + the DNS query would be for _agi._tcp.agi.example.com. You + will need to make sure this resolves correctly. + + + Use AMI to control the channel in AGI. AGI commands can be invoked + using the AMI action, with a variety of AGI specific + events passed back over the AMI connection. AsyncAGI should be invoked + by passing agi:async to the command + parameter. + + + + As of 1.6.0, this channel will not stop dialplan execution on hangup inside of this application. Dialplan execution will continue normally, even upon hangup until the AGI application signals a desire to stop (either by exiting or, in the case of a net script, by - closing the connection). A locally executed AGI script will receive SIGHUP on - hangup from the channel except when using DeadAGI. A fast AGI server will - correspondingly receive a HANGUP inline with the command dialog. Both of theses - signals may be disabled by setting the AGISIGHUP channel - variable to no before executing the AGI application. + closing the connection). + A locally executed AGI script will receive SIGHUP on + hangup from the channel except when using DeadAGI + (or when the channel is already hungup). A fast AGI server will + correspondingly receive a HANGUP inline with the command dialog. + Both of these signals may be disabled by setting the AGISIGHUP + channel variable to no before executing the AGI application. Alternatively, if you would like the AGI application to exit immediately after a channel hangup is detected, set the AGIEXITONHANGUP variable to yes. - Use the CLI command agi show commands to list available agi - commands. + + + ; Start the AGI script /tmp/my-cool-script.sh, passing it the contents + ; of the channel variable FOO + same => n,AGI(/tmp/my-cool-script.sh,${FOO}) + + ; Start the AGI script my-cool-script.sh located in the astagidir + ; directory, specified in asterisk.conf + same => n,AGI(my-cool-script.sh) + + ; Connect to the FastAGI server located at 127.0.0.1 and start the script + ; awesome-script + same => n,AGI(agi://127.0.0.1/awesome-script) + + ; Start AsyncAGI + same => n,AGI(agi:async) + This application sets the following channel variable upon completion: @@ -876,8 +1186,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") + AGI + AsyncAGIStart + AsyncAGIEnd EAGI DeadAGI + asterisk.conf @@ -890,8 +1204,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Using 'EAGI' provides enhanced AGI, with incoming audio available out of band - on file descriptor 3. - + on file descriptor 3. In all other respects, it behaves in the same fashion as + AGI. See the documentation for the AGI dialplan application for + more information on invoking AGI on a channel. + This application sets the following channel variable upon completion: @@ -908,7 +1224,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") - + + This application is deprecated and may be removed in a future version + of Asterisk. Use the replacement application AGI instead + of DeadAGI. + + + Execute AGI on a 'dead' or hungup channel. See the documentation for the + AGI dialplan application for more information on invoking + AGI on a channel. + This application sets the following channel variable upon completion: @@ -936,6 +1261,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Add an AGI command to the execute queue of the channel in Async AGI. + + AsyncAGIStart + AsyncAGIExec + AsyncAGIEnd + @@ -946,6 +1276,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") URL encoded string read from the AsyncAGI server. + + AsyncAGIEnd + AsyncAGIExec + AGI + AGI + @@ -954,6 +1290,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") + + AsyncAGIStart + AsyncAGIExec + AGI + AGI + @@ -968,6 +1310,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") URL encoded result string from the executed AGI command. + + AsyncAGIStart + AsyncAGIEnd + AGI + AGI + @@ -982,6 +1330,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Random identification number assigned to the execution of this command. + + AGIExecEnd + AGI + @@ -997,6 +1349,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") The text result reason from AGI + + AGIExecStart + AGI + ***/