mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Merged revisions 81523 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 (closes issue #10651) ........ r81523 | qwell | 2007-09-05 10:14:30 -0500 (Wed, 05 Sep 2007) | 5 lines Do not try to unregister a NULL channel tech. Also changed load_module function to use defines rather than numbers for return values. Issue 10651, patch by rbraun_proformatique, with additions by me. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1284,7 +1284,8 @@ static int __unload_module(void)
|
|||||||
{
|
{
|
||||||
struct phone_pvt *p, *pl;
|
struct phone_pvt *p, *pl;
|
||||||
/* First, take us out of the channel loop */
|
/* First, take us out of the channel loop */
|
||||||
ast_channel_unregister(cur_tech);
|
if (cur_tech)
|
||||||
|
ast_channel_unregister(cur_tech);
|
||||||
if (!ast_mutex_lock(&iflock)) {
|
if (!ast_mutex_lock(&iflock)) {
|
||||||
/* Hangup all interfaces if they have an owner */
|
/* Hangup all interfaces if they have an owner */
|
||||||
p = iflist;
|
p = iflist;
|
||||||
@@ -1359,7 +1360,7 @@ static int load_module(void)
|
|||||||
if (ast_mutex_lock(&iflock)) {
|
if (ast_mutex_lock(&iflock)) {
|
||||||
/* It's a little silly to lock it, but we mind as well just to be sure */
|
/* It's a little silly to lock it, but we mind as well just to be sure */
|
||||||
ast_log(LOG_ERROR, "Unable to lock interface list???\n");
|
ast_log(LOG_ERROR, "Unable to lock interface list???\n");
|
||||||
return -1;
|
return AST_MODULE_LOAD_FAILURE;
|
||||||
}
|
}
|
||||||
v = ast_variable_browse(cfg, "interfaces");
|
v = ast_variable_browse(cfg, "interfaces");
|
||||||
while(v) {
|
while(v) {
|
||||||
@@ -1375,7 +1376,7 @@ static int load_module(void)
|
|||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
ast_mutex_unlock(&iflock);
|
ast_mutex_unlock(&iflock);
|
||||||
__unload_module();
|
__unload_module();
|
||||||
return -1;
|
return AST_MODULE_LOAD_FAILURE;
|
||||||
}
|
}
|
||||||
} else if (!strcasecmp(v->name, "silencesupression")) {
|
} else if (!strcasecmp(v->name, "silencesupression")) {
|
||||||
silencesupression = ast_true(v->value);
|
silencesupression = ast_true(v->value);
|
||||||
@@ -1445,12 +1446,12 @@ static int load_module(void)
|
|||||||
ast_log(LOG_ERROR, "Unable to register channel class 'Phone'\n");
|
ast_log(LOG_ERROR, "Unable to register channel class 'Phone'\n");
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
__unload_module();
|
__unload_module();
|
||||||
return -1;
|
return AST_MODULE_LOAD_FAILURE;
|
||||||
}
|
}
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
/* And start the monitor for the first time */
|
/* And start the monitor for the first time */
|
||||||
restart_monitor();
|
restart_monitor();
|
||||||
return 0;
|
return AST_MODULE_LOAD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Linux Telephony API Support");
|
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Linux Telephony API Support");
|
||||||
|
Reference in New Issue
Block a user