From 336d5761682b304a579643e5bc3f2140387be998 Mon Sep 17 00:00:00 2001 From: "Eliel C. Sardanons" Date: Wed, 12 Nov 2008 13:43:46 +0000 Subject: [PATCH] Add XML documentation for AGI commands: - database deltree - database get - exec - get data - get full variable git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156125 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_agi.c | 117 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 81 insertions(+), 36 deletions(-) diff --git a/res/res_agi.c b/res/res_agi.c index 4220e423de..6344cfaffd 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -128,6 +128,37 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") otherwise. + + + Removes database keytree/value + + + + + + + Deletes a family or specific keytree + within a family in the Asterisk database. + Returns 1 if successful, 0 otherwise. + + + + + Gets database value + + + + + + + Retrieves an entry in the Asterisk database for a given family + and key. + Returns 0 if key is not set. + Returns 1 if key is set and returns the variable + in parenthesis. + Example return code: 200 result=1 (testvariable) + + Adds/updates database value @@ -144,6 +175,51 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Returns 1 if successful, 0 otherwise. + + + Executes a given Application + + + + + + + Executes application with given + options. + Returns whatever the application returns, or + -2 on failure to find application. + + + + + Prompts for DTMF on a channel + + + + + + + + Stream the given file, and recieve DTMF data. + Returns the digits received from the channel at the other end. + + + + + Evaluates a channel expression + + + + + + + Returns 0 if variablename is not set + or channel does not exist. Returns 1 if variablename + is set and returns the variable in parenthesis. Understands complex variable names and builtin + variables, unlike GET VARIABLE. + Example return code: 200 result=1 (testvariable) + + Enable/Disable Music on hold generator @@ -2106,20 +2182,6 @@ static int handle_asyncagi_break(struct ast_channel *chan, AGI *agi, int argc, c return AST_PBX_KEEPALIVE; } -static char usage_dbget[] = -" Usage: DATABASE GET \n" -" Retrieves an entry in the Asterisk database for a\n" -" given family and key.\n" -" Returns 0 if is not set. Returns 1 if \n" -" is set and returns the variable in parentheses.\n" -" Example return code: 200 result=1 (testvariable)\n"; - -static char usage_dbdeltree[] = -" Usage: DATABASE DELTREE [keytree]\n" -" Deletes a family or specific keytree within a family\n" -" in the Asterisk database.\n" -" Returns 1 if successful, 0 otherwise.\n"; - static char usage_verbose[] = " Usage: VERBOSE \n" " Sends to the console via verbose message system.\n" @@ -2132,13 +2194,6 @@ static char usage_getvariable[] = " is set and returns the variable in parentheses.\n" " example return code: 200 result=1 (testvariable)\n"; -static char usage_getvariablefull[] = -" Usage: GET FULL VARIABLE []\n" -" Returns 0 if is not set or channel does not exist. Returns 1\n" -"if is set and returns the variable in parenthesis. Understands\n" -"complex variable names and builtin variables, unlike GET VARIABLE.\n" -" example return code: 200 result=1 (testvariable)\n"; - static char usage_setvariable[] = " Usage: SET VARIABLE \n"; @@ -2146,11 +2201,6 @@ static char usage_setcallerid[] = " Usage: SET CALLERID \n" " Changes the callerid of the current channel.\n"; -static char usage_exec[] = -" Usage: EXEC \n" -" Executes with given .\n" -" Returns whatever the application returns, or -2 on failure to find application\n"; - static char usage_hangup[] = " Usage: HANGUP []\n" " Hangs up the specified channel.\n" @@ -2276,11 +2326,6 @@ static char usage_sayphonetic[] = " completes without a digit pressed, the ASCII numerical value of the digit\n" " if one was pressed, or -1 on error/hangup.\n"; -static char usage_getdata[] = -" Usage: GET DATA [timeout] [max digits]\n" -" Stream the given file, and recieve DTMF data. Returns the digits received\n" -"from the channel at the other end.\n"; - static char usage_setcontext[] = " Usage: SET CONTEXT \n" " Sets the context for continuation upon exiting the application.\n"; @@ -2359,12 +2404,12 @@ static struct agi_command commands[] = { { { "answer", NULL }, handle_answer, NULL, NULL, 0 }, { { "channel", "status", NULL }, handle_channelstatus, NULL, NULL, 0 }, { { "database", "del", NULL }, handle_dbdel, NULL, NULL, 1 }, - { { "database", "deltree", NULL }, handle_dbdeltree, "Removes database keytree/value", usage_dbdeltree , 1 }, - { { "database", "get", NULL }, handle_dbget, "Gets database value", usage_dbget , 1 }, + { { "database", "deltree", NULL }, handle_dbdeltree, NULL, NULL, 1 }, + { { "database", "get", NULL }, handle_dbget, NULL, NULL, 1 }, { { "database", "put", NULL }, handle_dbput, NULL, NULL, 1 }, - { { "exec", NULL }, handle_exec, "Executes a given Application", usage_exec , 1 }, - { { "get", "data", NULL }, handle_getdata, "Prompts for DTMF on a channel", usage_getdata , 0 }, - { { "get", "full", "variable", NULL }, handle_getvariablefull, "Evaluates a channel expression", usage_getvariablefull , 1 }, + { { "exec", NULL }, handle_exec, NULL, NULL, 1 }, + { { "get", "data", NULL }, handle_getdata, NULL, NULL, 0 }, + { { "get", "full", "variable", NULL }, handle_getvariablefull, NULL, NULL, 1 }, { { "get", "option", NULL }, handle_getoption, "Stream file, prompt for DTMF, with timeout", usage_getoption , 0 }, { { "get", "variable", NULL }, handle_getvariable, "Gets a channel variable", usage_getvariable , 1 }, { { "hangup", NULL }, handle_hangup, "Hangup the current channel", usage_hangup , 0 },