summaryrefslogtreecommitdiff
path: root/funcs
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-04-11 10:07:39 -0600
committerGeorge Joseph <gjoseph@digium.com>2017-04-12 15:57:21 -0600
commit747beb1ed159f89a3b58742e4257740b3d6d6bba (patch)
tree3ba17dd62d0270a9ee976f173f948304b1733773 /funcs
parent60fd01f7f4b43515f5d4d915eec701c6054c53cf (diff)
modules: change module LOAD_FAILUREs to LOAD_DECLINES
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed to AST_MODULE_LOAD_DECLINE. This prevents asterisk from exiting if a module can't be loaded. If the user wishes to retain the FAILURE behavior for a specific module, they can use the "require" or "preload-require" keyword in modules.conf. A new API was added to logger: ast_is_logger_initialized(). This allows asterisk.c/check_init() to print to the error log once the logger subsystem is ready instead of just to stdout. If something does fail before the logger is initialized, we now print to stderr instead of stdout. Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_cdr.c5
-rw-r--r--funcs/func_holdintercept.c2
-rw-r--r--funcs/func_talkdetect.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/funcs/func_cdr.c b/funcs/func_cdr.c
index 83942db4c..82ff488b0 100644
--- a/funcs/func_cdr.c
+++ b/funcs/func_cdr.c
@@ -649,7 +649,7 @@ static int load_module(void)
int res = 0;
if (!router) {
- return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_DECLINE;
}
res |= STASIS_MESSAGE_TYPE_INIT(cdr_read_message_type);
@@ -665,7 +665,8 @@ static int load_module(void)
cdr_read_callback, NULL);
if (res) {
- return AST_MODULE_LOAD_FAILURE;
+ unload_module();
+ return AST_MODULE_LOAD_DECLINE;
}
return AST_MODULE_LOAD_SUCCESS;
}
diff --git a/funcs/func_holdintercept.c b/funcs/func_holdintercept.c
index c2435463a..2a1cbb8c1 100644
--- a/funcs/func_holdintercept.c
+++ b/funcs/func_holdintercept.c
@@ -228,7 +228,7 @@ static int unload_module(void)
/*! \internal \brief Load the module */
static int load_module(void)
{
- return ast_custom_function_register(&hold_intercept_function) ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS;
+ return ast_custom_function_register(&hold_intercept_function) ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Hold interception dialplan function");
diff --git a/funcs/func_talkdetect.c b/funcs/func_talkdetect.c
index 02963f20e..5c7f41ab3 100644
--- a/funcs/func_talkdetect.c
+++ b/funcs/func_talkdetect.c
@@ -397,7 +397,7 @@ static int load_module(void)
res |= ast_custom_function_register(&talk_detect_function);
- return res ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS;
+ return res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Talk detection dialplan function");