aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_clioriginate.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-21 02:11:39 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-21 02:11:39 +0000
commit8b0c007ad990aa27d9868da49215fd1076ac77cc (patch)
tree270b9c46c1e644483d6d2a35b509f43218ba3252 /res/res_clioriginate.c
parenta42edc84034f91932a3e12d503e07f76a6eb498a (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 'res/res_clioriginate.c')
-rw-r--r--res/res_clioriginate.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/res/res_clioriginate.c b/res/res_clioriginate.c
index 7303d4b67..454dc7815 100644
--- a/res/res_clioriginate.c
+++ b/res/res_clioriginate.c
@@ -43,8 +43,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$");
/*! The timeout for originated calls, in seconds */
#define TIMEOUT 30
-static struct module_symbols *me;
-
static char orig_help[] =
" There are two ways to use this command. A call can be originated between a\n"
"channel and a specific application, or between a channel and an extension in\n"
@@ -127,7 +125,8 @@ static int handle_orig(int fd, int argc, char *argv[])
if (ast_strlen_zero(argv[1]) || ast_strlen_zero(argv[2]))
return RESULT_SHOWUSAGE;
- ast_atomic_fetchadd_int(&me->usecnt, +1);
+ /* ugly, can be removed when CLI entries have ast_module pointers */
+ ast_module_ref(ast_module_info->self);
if (!strcasecmp("application", argv[2])) {
res = orig_app(fd, argv[1], argv[3], argv[4]);
@@ -136,7 +135,7 @@ static int handle_orig(int fd, int argc, char *argv[])
} else
res = RESULT_SHOWUSAGE;
- ast_atomic_fetchadd_int(&me->usecnt, -1);
+ ast_module_unref(ast_module_info->self);
return res;
}
@@ -149,32 +148,22 @@ static char *complete_orig(const char *line, const char *word, int pos, int stat
if (pos != 2)
return NULL;
- ast_atomic_fetchadd_int(&me->usecnt, +1);
+ /* ugly, can be removed when CLI entries have ast_module pointers */
+ ast_module_ref(ast_module_info->self);
ret = ast_cli_complete(word, choices, state);
- ast_atomic_fetchadd_int(&me->usecnt, -1);
+ ast_module_unref(ast_module_info->self);
return ret;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_cli_unregister(&cli_orig);
}
-static int load_module(void *mod)
+static int load_module(void)
{
- me = mod;
return ast_cli_register(&cli_orig);
}
-static const char *description(void)
-{
- return "Call origination from the CLI";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call origination from the CLI");