diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-21 02:11:39 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-21 02:11:39 +0000 |
commit | 8b0c007ad990aa27d9868da49215fd1076ac77cc (patch) | |
tree | 270b9c46c1e644483d6d2a35b509f43218ba3252 /apps/app_exec.c | |
parent | a42edc84034f91932a3e12d503e07f76a6eb498a (diff) |
merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
- support for embedded modules
- support for static builds
- simpler cross-compilation support
- simpler module/loader interface (no exported symbols)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_exec.c')
-rw-r--r-- | apps/app_exec.c | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/apps/app_exec.c b/apps/app_exec.c index d0c2591df..0aafac343 100644 --- a/apps/app_exec.c +++ b/apps/app_exec.c @@ -45,8 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") /* Maximum length of any variable */ #define MAXRESULT 1024 -static char *tdesc = "Executes dialplan applications"; - /*! Note * * The key difference between these two apps is exit status. In a @@ -90,16 +88,14 @@ static char *execif_descrip = "If <expr> is true, but <app> is not found, then the application\n" "will return a non-zero value.\n"; -LOCAL_USER_DECL; - static int exec_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; char *s, *appname, *endargs, args[MAXRESULT] = ""; struct ast_app *app; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Check and parse arguments */ if (data) { @@ -122,18 +118,18 @@ static int exec_exec(struct ast_channel *chan, void *data) } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } static int tryexec_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; char *s, *appname, *endargs, args[MAXRESULT] = ""; struct ast_app *app; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Check and parse arguments */ if (data) { @@ -157,19 +153,20 @@ static int tryexec_exec(struct ast_channel *chan, void *data) } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int execif_exec(struct ast_channel *chan, void *data) { - int res=0; - struct localuser *u; +static int execif_exec(struct ast_channel *chan, void *data) +{ + int res = 0; + struct ast_module_user *u; char *myapp = NULL; char *mydata = NULL; char *expr = NULL; struct ast_app *app = NULL; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); expr = ast_strdupa(data); @@ -195,11 +192,12 @@ static int execif_exec(struct ast_channel *chan, void *data) { res = -1; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); + return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -207,12 +205,12 @@ static int unload_module(void *mod) res |= ast_unregister_application(app_tryexec); res |= ast_unregister_application(app_execif); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +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); @@ -220,14 +218,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Executes dialplan applications"); |