aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_system.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-01 21:10:07 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-01 21:10:07 +0000
commitb1f91b97d2085cc845d0f57bd9907de50c995105 (patch)
tree9c836ac808552d20be6bd2baa3a3c29f642eda53 /apps/app_system.c
parentc5d084051f21e943fcbcc347fc80b166885f298d (diff)
Merge changes from team/group/appdocsxml
This commit introduces the first phase of an effort to manage documentation of the interfaces in Asterisk in an XML format. Currently, a new format is available for applications and dialplan functions. A good number of conversions to the new format are also included. For more information, see the following message to asterisk-dev: http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html git-svn-id: http://svn.digium.com/svn/asterisk/trunk@153365 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_system.c')
-rw-r--r--apps/app_system.c79
1 files changed, 58 insertions, 21 deletions
diff --git a/apps/app_system.c b/apps/app_system.c
index 1f39c5a4e..688a649da 100644
--- a/apps/app_system.c
+++ b/apps/app_system.c
@@ -34,31 +34,68 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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)
{
int res = 0;
@@ -120,8 +157,8 @@ static int load_module(void)
{
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;
}