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 /channels/chan_mgcp.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 'channels/chan_mgcp.c')
-rw-r--r-- | channels/chan_mgcp.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 434d2ece0..94cb20f02 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -981,10 +981,7 @@ static int mgcp_hangup(struct ast_channel *ast) sub->rtp = NULL; } - /* Decrement use count */ - ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1); - ast_update_use_count(); - /* Decrement use count */ + ast_module_unref(ast_module_info->self); if ((p->hookstate == MGCP_ONHOOK) && (!sub->next->rtp)) { p->hidecallerid = 0; @@ -1408,8 +1405,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state) if (i->amaflags) tmp->amaflags = i->amaflags; sub->owner = tmp; - ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1); - ast_update_use_count(); + ast_module_ref(ast_module_info->self); tmp->callgroup = i->callgroup; tmp->pickupgroup = i->pickupgroup; ast_string_field_set(tmp, call_forward, i->call_forward); @@ -4222,11 +4218,10 @@ static int reload_config(void) } /*! \brief load_module: PBX load module - initialization ---*/ -static int load_module(void *mod) +static int load_module(void) { int res; - __mod_desc = mod; sched = sched_context_create(); if (!sched) { ast_log(LOG_WARNING, "Unable to create schedule context\n"); @@ -4277,13 +4272,13 @@ static int mgcp_reload(int fd, int argc, char *argv[]) return 0; } -static int reload(void *mod) +static int reload(void) { mgcp_reload(0, 0, NULL); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { struct mgcp_endpoint *e; struct mgcp_gateway *g; @@ -4350,14 +4345,8 @@ static int unload_module(void *mod) return 0; } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -static const char *description(void) -{ - return "Media Gateway Control Protocol (MGCP)"; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Media Gateway Control Protocol (MGCP)", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); |