From 1402c2528466bff44c15c4f760baa83a2f091cdb Mon Sep 17 00:00:00 2001 From: "Eliel C. Sardanons" Date: Wed, 5 Nov 2008 11:26:40 +0000 Subject: - Add Read() application XML documentation. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154507 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_read.c | 100 +++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 73 insertions(+), 27 deletions(-) (limited to 'apps/app_read.c') diff --git a/apps/app_read.c b/apps/app_read.c index 917421010..f03597b2f 100644 --- a/apps/app_read.c +++ b/apps/app_read.c @@ -36,6 +36,78 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/module.h" #include "asterisk/indications.h" +/*** DOCUMENTATION + + + Read a variable. + + + + The input digits will be stored in the given variable + name. + + + + file(s) to play before reading digits or tone with option i + + + + + Maximum acceptable number of digits. Stops reading after + maxdigits have been entered (without + requiring the user to press the # key). + Defaults to 0 - no limit - wait for the + user press the # key. Any value below + 0 means the same. Max accepted value is + 255. + + + + + + + + + + If greater than 1, that many + attempts will be made in the + event no data is entered. + + + The number of seconds to wait for a digit response. If greater + than 0, that value will override the default timeout. + Can be floating point. + + + + Reads a #-terminated string of digits a certain number of times from the + user in to the given variable. + This application sets the following channel variable upon completion: + + + This is the status of the read operation. + + + + + + + + + + + SendDTMF + + + ***/ + enum { OPT_SKIP = (1 << 0), OPT_INDICATION = (1 << 1), @@ -50,32 +122,6 @@ AST_APP_OPTIONS(read_app_options, { static char *app = "Read"; -static char *synopsis = "Read a variable"; - -static char *descrip = -" Read(variable[,filename[&filename2...]][,maxdigits][,option][,attempts][,timeout])\n\n" -"Reads a #-terminated string of digits a certain number of times from the\n" -"user in to the given variable.\n" -" filename -- file(s) to play before reading digits or tone with option i\n" -" maxdigits -- maximum acceptable number of digits. Stops reading after\n" -" maxdigits have been entered (without requiring the user to\n" -" press the '#' key).\n" -" Defaults to 0 - no limit - wait for the user press the '#' key.\n" -" Any value below 0 means the same. Max accepted value is 255.\n" -" option -- options are 's' , 'i', 'n'\n" -" 's' to return immediately if the line is not up,\n" -" 'i' to play filename as an indication tone from your indications.conf\n" -" 'n' to read digits even if the line is not up.\n" -" attempts -- if greater than 1, that many attempts will be made in the \n" -" event no data is entered.\n" -" timeout -- The number of seconds to wait for a digit response. If greater\n" -" than 0, that value will override the default timeout. Can be floating point.\n" -"This application sets the following channel variable upon completion:\n" -" READSTATUS - This is the status of the read operation.\n" -" Possible values are:\n" -" OK | ERROR | HANGUP | INTERRUPTED | SKIPPED | TIMEOUT\n"; - - #define ast_next_data(instr,ptr,delim) if((ptr=strchr(instr,delim))) { *(ptr) = '\0' ; ptr++;} static int read_exec(struct ast_channel *chan, void *data) @@ -225,7 +271,7 @@ static int unload_module(void) static int load_module(void) { - return ast_register_application(app, read_exec, synopsis, descrip); + return ast_register_application_xml(app, read_exec); } AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Read Variable Application"); -- cgit v1.2.3