From 5b168ee34babe562be856ec8f1dd14c0abd7c1a5 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Sat, 1 Nov 2008 21:10:07 +0000 Subject: 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: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_exec.c | 107 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 77 insertions(+), 30 deletions(-) (limited to 'apps/app_exec.c') diff --git a/apps/app_exec.c b/apps/app_exec.c index 285b8b2f0..b4a66962e 100644 --- a/apps/app_exec.c +++ b/apps/app_exec.c @@ -36,6 +36,80 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/module.h" #include "asterisk/app.h" +/*** DOCUMENTATION + + + Executes dialplan application. + + + + Application name and arguments of the dialplan application to execute. + + + + + 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. + To invoke external applications, see the application System. + If you would like to catch any error instead, see TryExec. + + + + + Executes dialplan application, always returning. + + + + + + + + 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: + + + + + If the application returned zero. + + + If the application returned non-zero. + + + If the application was not found or was not specified. + + + + + + + + Executes dialplan application, conditionally. + + + + + + + + + + + + + + If expr is true, execute and return the + result of appiftrue(args). + If expr is true, but appiftrue is not found, + then the application will return a non-zero value. + + + ***/ + /* Maximum length of any variable */ #define MAXRESULT 1024 @@ -52,35 +126,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") */ 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 (?()[:()])\n" -"If is true, execute and return the result of ().\n" -"If is true, but 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 +284,9 @@ static int unload_module(void) 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; } -- cgit v1.2.3