mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
Merged revisions 376658 via svnmerge from
file:///srv/subversion/repos/asterisk/branches/10 ................ r376658 | rmudgett | 2012-11-27 14:36:45 -0600 (Tue, 27 Nov 2012) | 21 lines Remove unnecessary channel module references. * Removed call to ast_module_user_hangup_all() in res_config_mysql.c since it is effectively a noop. No channels can attach a reference to that module. * Removed call to ast_module_user_hangup_all() in app_celgenuserevent.c. The caller of unload_module() has already called it. * Removed redundant channel module references in pbx_dundi.c. The registered dialplan function callback dispatchers for the read/read2/write callbacks already reference the module before calling. * pbx_dundi: Moved unregistering CLI commands, DUNDi switch, and dialplan functions to the first thing the unload_module() does. This will reduce the chance of new channels using DUNDi services while the module is being torn down. ........ Merged revisions 376657 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@376686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1395,9 +1395,6 @@ static int unload_module(void)
|
||||
if (option_verbose > 1)
|
||||
ast_verbose(VERBOSE_PREFIX_2 "MySQL RealTime unloaded.\n");
|
||||
|
||||
ast_module_user_hangup_all();
|
||||
|
||||
usleep(1);
|
||||
AST_RWLIST_WRLOCK(&databases);
|
||||
while ((cur = AST_RWLIST_REMOVE_HEAD(&databases, list))) {
|
||||
mysql_close(&cur->handle);
|
||||
|
@@ -80,13 +80,8 @@ static int celgenuserevent_exec(struct ast_channel *chan, const char *data)
|
||||
|
||||
static int unload_module(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = ast_unregister_application(app);
|
||||
|
||||
ast_module_user_hangup_all();
|
||||
|
||||
return res;
|
||||
ast_unregister_application(app);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int load_module(void)
|
||||
|
@@ -3886,7 +3886,6 @@ static int dundifunc_read(struct ast_channel *chan, const char *cmd, char *num,
|
||||
{
|
||||
int results;
|
||||
int x;
|
||||
struct ast_module_user *u;
|
||||
struct dundi_result dr[MAX_RESULTS];
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(number);
|
||||
@@ -3903,8 +3902,6 @@ static int dundifunc_read(struct ast_channel *chan, const char *cmd, char *num,
|
||||
return -1;
|
||||
}
|
||||
|
||||
u = ast_module_user_add(chan);
|
||||
|
||||
parse = ast_strdupa(num);
|
||||
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
@@ -3927,8 +3924,6 @@ static int dundifunc_read(struct ast_channel *chan, const char *cmd, char *num,
|
||||
}
|
||||
}
|
||||
|
||||
ast_module_user_remove(u);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3967,7 +3962,6 @@ static const struct ast_datastore_info dundi_result_datastore_info = {
|
||||
|
||||
static int dundi_query_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
|
||||
{
|
||||
struct ast_module_user *u;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(number);
|
||||
AST_APP_ARG(context);
|
||||
@@ -3978,17 +3972,13 @@ static int dundi_query_read(struct ast_channel *chan, const char *cmd, char *dat
|
||||
struct dundi_result_datastore *drds;
|
||||
struct ast_datastore *datastore;
|
||||
|
||||
u = ast_module_user_add(chan);
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "DUNDIQUERY requires an argument (number)\n");
|
||||
ast_module_user_remove(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!chan) {
|
||||
ast_log(LOG_ERROR, "DUNDIQUERY can not be used without a channel!\n");
|
||||
ast_module_user_remove(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -4003,7 +3993,6 @@ static int dundi_query_read(struct ast_channel *chan, const char *cmd, char *dat
|
||||
args.context = "e164";
|
||||
|
||||
if (!(drds = ast_calloc(1, sizeof(*drds)))) {
|
||||
ast_module_user_remove(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -4012,7 +4001,6 @@ static int dundi_query_read(struct ast_channel *chan, const char *cmd, char *dat
|
||||
|
||||
if (!(datastore = ast_datastore_alloc(&dundi_result_datastore_info, buf))) {
|
||||
drds_destroy(drds);
|
||||
ast_module_user_remove(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -4028,8 +4016,6 @@ static int dundi_query_read(struct ast_channel *chan, const char *cmd, char *dat
|
||||
ast_channel_datastore_add(chan, datastore);
|
||||
ast_channel_unlock(chan);
|
||||
|
||||
ast_module_user_remove(u);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4040,7 +4026,6 @@ static struct ast_custom_function dundi_query_function = {
|
||||
|
||||
static int dundi_result_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
|
||||
{
|
||||
struct ast_module_user *u;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(id);
|
||||
AST_APP_ARG(resultnum);
|
||||
@@ -4051,8 +4036,6 @@ static int dundi_result_read(struct ast_channel *chan, const char *cmd, char *da
|
||||
struct ast_datastore *datastore;
|
||||
int res = -1;
|
||||
|
||||
u = ast_module_user_add(chan);
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "DUNDIRESULT requires an argument (id and resultnum)\n");
|
||||
goto finish;
|
||||
@@ -4107,8 +4090,6 @@ static int dundi_result_read(struct ast_channel *chan, const char *cmd, char *da
|
||||
ast_log(LOG_WARNING, "Result number %u is not valid for DUNDi query results for ID %s!\n", num, args.id);
|
||||
|
||||
finish:
|
||||
ast_module_user_remove(u);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -4776,7 +4757,12 @@ static int set_config(char *config_file, struct sockaddr_in* sin, int reload)
|
||||
static int unload_module(void)
|
||||
{
|
||||
pthread_t previous_netthreadid = netthreadid, previous_precachethreadid = precachethreadid, previous_clearcachethreadid = clearcachethreadid;
|
||||
ast_module_user_hangup_all();
|
||||
|
||||
ast_cli_unregister_multiple(cli_dundi, ARRAY_LEN(cli_dundi));
|
||||
ast_unregister_switch(&dundi_switch);
|
||||
ast_custom_function_unregister(&dundi_function);
|
||||
ast_custom_function_unregister(&dundi_query_function);
|
||||
ast_custom_function_unregister(&dundi_result_function);
|
||||
|
||||
/* Stop all currently running threads */
|
||||
dundi_shutdown = 1;
|
||||
@@ -4793,11 +4779,6 @@ static int unload_module(void)
|
||||
pthread_join(previous_clearcachethreadid, NULL);
|
||||
}
|
||||
|
||||
ast_cli_unregister_multiple(cli_dundi, ARRAY_LEN(cli_dundi));
|
||||
ast_unregister_switch(&dundi_switch);
|
||||
ast_custom_function_unregister(&dundi_function);
|
||||
ast_custom_function_unregister(&dundi_query_function);
|
||||
ast_custom_function_unregister(&dundi_result_function);
|
||||
close(netsocket);
|
||||
io_context_destroy(io);
|
||||
ast_sched_context_destroy(sched);
|
||||
|
Reference in New Issue
Block a user