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 16:46:22 -0500
commitf882ca25722b6290dc6e8d786452b0b26adceed1 (patch)
tree98f8862eaf958ea63650ca50900c0d43fce2a541 /funcs
parent2e9f186c179e86316fbe1b43fbda9702bddaa615 (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 e67bca318..12e6f3bfc 100644
--- a/funcs/func_cdr.c
+++ b/funcs/func_cdr.c
@@ -651,7 +651,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);
@@ -667,7 +667,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 56d9a9e83..f4907d102 100644
--- a/funcs/func_holdintercept.c
+++ b/funcs/func_holdintercept.c
@@ -230,7 +230,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 ccc74fd7f..9700a2451 100644
--- a/funcs/func_talkdetect.c
+++ b/funcs/func_talkdetect.c
@@ -399,7 +399,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");