[svn-commits] eliel: branch group/appdocsxml r145838 - /team/group/appdocsxml/apps/app_exec.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 2 11:36:09 CDT 2008


Author: eliel
Date: Thu Oct  2 11:36:09 2008
New Revision: 145838

URL: http://svn.digium.com/view/asterisk?view=rev&rev=145838
Log:
Introduce Exec(), ExecIf() and TryExec() applications XML documentation.

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

Modified: team/group/appdocsxml/apps/app_exec.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/apps/app_exec.c?view=diff&rev=145838&r1=145837&r2=145838
==============================================================================
--- team/group/appdocsxml/apps/app_exec.c (original)
+++ team/group/appdocsxml/apps/app_exec.c Thu Oct  2 11:36:09 2008
@@ -36,6 +36,73 @@
 #include "asterisk/module.h"
 #include "asterisk/app.h"
 
+/*** DOCUMENTATION
+	<application name="Exec" language="en_US">
+		<synopsis>
+			Executes dialplan application.
+		</synopsis>
+		<syntax>
+			<parameter name="appname(arguments)" required="true">
+				<para>Application name and arguments of the dialplan application to execute.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Allows an arbitrary application to be invoked even when not
+			hardcoded into the dialplan.  If the underlying application
+			terminates the dialplan, or if the application cannot be found,
+			Exec will terminate the dialplan.</para>
+			<para>To invoke external applications, see the application System.
+			If you would like to catch any error instead, see TryExec.</para>
+		</description>
+	</application>
+	<application name="TryExec" language="en_US">
+		<synopsis>
+			Executes dialplan application, always returning.
+		</synopsis>
+		<syntax>
+			<parameter name="appname(arguments)" required="true" />
+		</syntax>
+		<description>
+			<para>Allows an arbitrary application to be invoked even when not
+			hardcoded into the dialplan. To invoke external applications
+			see the application System.  Always returns to the dialplan.
+			The channel variable TRYSTATUS will be set to one of:
+			</para>
+			<variablelist>
+				<variable name="TRYSTATUS">
+					<value name="SUCCESS">
+						If the application returned zero.
+					</value>
+					<value name="FAILED">
+						If the application returned non-zero.
+					</value>
+					<value name="NOAPP">
+						If the application was not found or was not specified.
+					</value>
+				</variable>
+			</variablelist>
+		</description>
+	</application>
+	<application name="ExecIf" language="en_US">
+		<synopsis>
+			Executes dialplan application, conditionally.
+		</synopsis>
+		<syntax argsep="?">
+			<parameter name="expression" required="true" />
+			<parameter name="execapp" required="true" argsep=":">
+				<argument name="appiftrue(args)" required="true" />
+				<argument name="appiffalse(args)" required="false" />
+			</parameter>
+		</syntax>
+		<description>
+			<para>If <replaceable>expr</replaceable> is true, execute and return the
+			result of <replaceable>appiftrue(args)</replaceable>.</para>
+			<para>If <replaceable>expr</replaceable> is true, but <replaceable>appiftrue</replaceable> is not found,
+			then the application will return a non-zero value.</para>
+		</description>
+	</application>
+ ***/
+
 /* Maximum length of any variable */
 #define MAXRESULT 1024
 
@@ -52,35 +119,8 @@
  */
 
 static char *app_exec = "Exec";
-static char *exec_synopsis = "Executes dialplan application";
-static char *exec_descrip =
-"  Exec(appname(arguments)):\n"
-"Allows an arbitrary application to be invoked even when not\n"
-"hardcoded into the dialplan.  If the underlying application\n"
-"terminates the dialplan, or if the application cannot be found,\n"
-"Exec will terminate the dialplan.\n"
-"  To invoke external applications, see the application System.\n"
-"  If you would like to catch any error instead, see TryExec.\n";
-
 static char *app_tryexec = "TryExec";
-static char *tryexec_synopsis = "Executes dialplan application, always returning";
-static char *tryexec_descrip =
-"  TryExec(appname(arguments)):\n"
-"Allows an arbitrary application to be invoked even when not\n"
-"hardcoded into the dialplan. To invoke external applications\n"
-"see the application System.  Always returns to the dialplan.\n"
-"The channel variable TRYSTATUS will be set to one of:\n"
-"    SUCCESS   if the application returned zero\n"
-"    FAILED    if the application returned non-zero\n"
-"    NOAPP     if the application was not found or was not specified\n";
-
 static char *app_execif = "ExecIf";
-static char *execif_synopsis = "Executes dialplan application, conditionally";
-static char *execif_descrip =
-"  ExecIF (<expr>?<appiftrue>(<args>)[:<appiffalse>(<args>)])\n"
-"If <expr> is true, execute and return the result of <appiftrue>(<args>).\n"
-"If <expr> is true, but <appiftrue> is not found, then the application\n"
-"will return a non-zero value.\n";
 
 static int exec_exec(struct ast_channel *chan, void *data)
 {
@@ -237,9 +277,9 @@
 
 static int load_module(void)
 {
-	int res = ast_register_application(app_exec, exec_exec, exec_synopsis, exec_descrip);
-	res |= ast_register_application(app_tryexec, tryexec_exec, tryexec_synopsis, tryexec_descrip);
-	res |= ast_register_application(app_execif, execif_exec, execif_synopsis, execif_descrip);
+	int res = ast_register_application_xml(app_exec, exec_exec);
+	res |= ast_register_application_xml(app_tryexec, tryexec_exec);
+	res |= ast_register_application_xml(app_execif, execif_exec);
 	return res;
 }
 




More information about the svn-commits mailing list