[asterisk-commits] eliel: branch group/appdocsxml r147150 - /team/group/appdocsxml/apps/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 7 11:23:57 CDT 2008


Author: eliel
Date: Tue Oct  7 11:23:56 2008
New Revision: 147150

URL: http://svn.digium.com/view/asterisk?view=rev&rev=147150
Log:
Introduce ReadExten() application and VALID_EXTEN() function 
XML documentation.

Modified:
    team/group/appdocsxml/apps/app_readexten.c

Modified: team/group/appdocsxml/apps/app_readexten.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/apps/app_readexten.c?view=diff&rev=147150&r1=147149&r2=147150
==============================================================================
--- team/group/appdocsxml/apps/app_readexten.c (original)
+++ team/group/appdocsxml/apps/app_readexten.c Tue Oct  7 11:23:56 2008
@@ -36,6 +36,82 @@
 #include "asterisk/indications.h"
 #include "asterisk/channel.h"
 
+/*** DOCUMENTATION
+	<application name="ReadExten" language="en_US">
+		<synopsis>
+			Read an extension into a variable.
+		</synopsis>
+		<syntax>
+			<parameter name="variable" required="true" />
+			<parameter name="filename">
+				<para>File to play before reading digits or tone with option <literal>i</literal></para>
+			</parameter>
+			<parameter name="context">
+				<para>Context in which to match extensions.</para>
+			</parameter>
+			<parameter name="option">
+				<optionlist>
+					<option name="s">
+						<para>Return immediately if the channel is not answered.</para>
+					</option>
+					<option name="i">
+						<para>Play <replaceable>filename</replaceable> as an indication tone from your
+						<filename>indications.conf</filename></para>
+					</option>
+					<option name="n">
+						<para>Read digits even if the channel is not answered.</para>
+					</option>
+				</optionlist>
+			</parameter>
+			<parameter name="timeout">
+				<para>An integer number of seconds to wait for a digit response. If
+				greater than <literal>0</literal>, that value will override the default timeout.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Reads a <literal>#</literal> terminated string of digits from the user into the given variable.</para>
+			<para>Will set READEXTENSTATUS on exit with one of the following statuses:</para>
+			<variablelist>
+				<variable name="READEXTENSTATUS">
+					<value name="OK">
+						A valid extension exists in ${variable}.
+					</value>
+					<value name="TIMEOUT">
+						No extension was entered in the specified time.
+					</value>
+					<value name="INVALID">
+						An invalid extension, ${INVALID_EXTEN}, was entered.
+					</value>
+					<value name="SKIP">
+						Line was not up and the option <literal>s</literal> was specified.
+					</value>
+					<value name="ERROR">
+						Invalid arguments were passed.
+					</value>
+				</variable>
+			</variablelist>
+		</description>
+	</application>
+	<function name="VALID_EXTEN">
+		<synopsis>
+			Determine whether an extension exists or not.
+		</synopsis>
+		<syntax>
+			<parameter name="context">
+				<para>Defaults to the current context</para>
+			</parameter>
+			<parameter name="extension" required="true" />
+			<parameter name="priority">
+				<para>Priority defaults to <literal>1</literal>.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Returns a true value if the indicated <replaceable>context</replaceable>,
+			<replaceable>extension</replaceable>, and <replaceable>priority</replaceable> exist.</para>
+		</description>
+	</function>
+ ***/
+
 enum {
 	OPT_SKIP = (1 << 0),
 	OPT_INDICATION = (1 << 1),
@@ -49,28 +125,6 @@
 });
 
 static char *app = "ReadExten";
-
-static char *synopsis = "Read an extension into a variable";
-
-static char *descrip = 
-"  ReadExten(<variable>[,[<filename>][,[<context>][,[<option>][,<timeout>]]]])\n\n"
-"Reads a #-terminated string of digits from the user into the given variable.\n"
-"  filename  file to play before reading digits or tone with option i\n"
-"  context   context in which to match extensions\n"
-"  option    options are:\n"
-"              s - Return immediately if the channel is not answered,\n"
-"              i - Play filename as an indication tone from your\n"
-"                  indications.conf\n"
-"              n - Read digits even if the channel is not answered.\n"
-"  timeout   An integer number of seconds to wait for a digit response. If\n"
-"            greater than 0, that value will override the default timeout.\n\n"
-"ReadExten will set READEXTENSTATUS on exit with one of the following statuses:\n"
-"  OK        A valid extension exists in ${variable}\n"
-"  TIMEOUT   No extension was entered in the specified time\n"
-"  INVALID   An invalid extension, ${INVALID_EXTEN}, was entered\n"
-"  SKIP      Line was not up and the option 's' was specified\n"
-"  ERROR     Invalid arguments were passed\n";
-
 
 static int readexten_exec(struct ast_channel *chan, void *data)
 {
@@ -232,11 +286,6 @@
 
 static struct ast_custom_function acf_isexten = {
 	.name = "VALID_EXTEN",
-	.synopsis = "Determine whether an extension exists or not",
-	.syntax = "VALID_EXTEN([<context>],<extension>[,<priority>])",
-	.desc =
-"Returns a true value if the indicated context, extension, and priority exist.\n"
-"Context defaults to the current context, priority defaults to 1.\n",
 	.read = acf_isexten_exec,
 };
 
@@ -250,7 +299,7 @@
 
 static int load_module(void)
 {
-	int res = ast_register_application(app, readexten_exec, synopsis, descrip);
+	int res = ast_register_application_xml(app, readexten_exec);
 	res |= ast_custom_function_register(&acf_isexten);
 	return res;
 }




More information about the asterisk-commits mailing list