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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 30 13:05:36 CDT 2008


Author: eliel
Date: Tue Sep 30 13:05:36 2008
New Revision: 145195

URL: http://svn.digium.com/view/asterisk?view=rev&rev=145195
Log:
Implement XML documentation for System() and TrySystem() applications.


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

Modified: team/group/appdocsxml/apps/app_system.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/apps/app_system.c?view=diff&rev=145195&r1=145194&r2=145195
==============================================================================
--- team/group/appdocsxml/apps/app_system.c (original)
+++ team/group/appdocsxml/apps/app_system.c Tue Sep 30 13:05:36 2008
@@ -34,30 +34,67 @@
 #include "asterisk/app.h"
 #include "asterisk/channel.h"	/* autoservice */
 
+/*** DOCUMENTATION
+	<application name="System" language="en_US">
+		<synopsis>
+			Execute a system command.
+		</synopsis>
+		<syntax>
+			<parameter name="command" required="true">
+				<para>Command to execute</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Executes a command  by  using  system(). If the command
+			fails, the console should report a fallthrough.</para>
+			<para>Result of execution is returned in the <variable>SYSTEMSTATUS</variable> channel variable:</para>
+			<variablelist>
+				<variable name="SYSTEMSTATUS">
+					<value name="FAILURE">
+						Could not execute the specified command.
+					</value>
+					<value name="SUCCESS">
+						Specified command successfully executed.
+					</value>
+				</variable>
+			</variablelist>
+		</description>
+	</application>
+	<application name="TrySystem" language="en_US">
+		<synopsis>
+			Try executing a system command.
+		</synopsis>
+		<syntax>
+			<parameter name="command" required="true">
+				<para>Command to execute</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Executes a command  by  using  system().</para>
+			<para>Result of execution is returned in the <variable>SYSTEMSTATUS</variable> channel variable:</para>
+			<variablelist>
+				<variable name="SYSTEMSTATUS">
+					<value name="FAILURE">
+						Could not execute the specified command.
+					</value>
+					<value name="SUCCESS">
+						Specified command successfully executed.
+					</value>
+					<value name="APPERROR">
+						Specified command successfully executed, but returned error code.
+					</value>
+				</variable>
+			</variablelist>
+		</description>
+	</application>
+
+ ***/
+
 static char *app = "System";
 
 static char *app2 = "TrySystem";
 
-static char *synopsis = "Execute a system command";
-
-static char *synopsis2 = "Try executing a system command";
-
 static char *chanvar = "SYSTEMSTATUS";
-
-static char *descrip =
-"  System(command): Executes a command  by  using  system(). If the command\n"
-"fails, the console should report a fallthrough. \n"
-"Result of execution is returned in the SYSTEMSTATUS channel variable:\n"
-"   FAILURE	Could not execute the specified command\n"
-"   SUCCESS	Specified command successfully executed\n";
-
-static char *descrip2 =
-"  TrySystem(command): Executes a command  by  using  system().\n"
-"on any situation.\n"
-"Result of execution is returned in the SYSTEMSTATUS channel variable:\n"
-"   FAILURE	Could not execute the specified command\n"
-"   SUCCESS	Specified command successfully executed\n"
-"   APPERROR	Specified command successfully executed, but returned error code\n";
 
 static int system_exec_helper(struct ast_channel *chan, void *data, int failmode)
 {
@@ -120,8 +157,8 @@
 {
 	int res;
 
-	res = ast_register_application(app2, trysystem_exec, synopsis2, descrip2);
-	res |= ast_register_application(app, system_exec, synopsis, descrip);
+	res = ast_register_application_xml(app2, trysystem_exec);
+	res |= ast_register_application_xml(app, system_exec);
 
 	return res;
 }




More information about the asterisk-commits mailing list