diff options
author | George Joseph <gjoseph@digium.com> | 2017-04-11 10:07:39 -0600 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2017-04-12 15:57:21 -0600 |
commit | 747beb1ed159f89a3b58742e4257740b3d6d6bba (patch) | |
tree | 3ba17dd62d0270a9ee976f173f948304b1733773 /channels/chan_sip.c | |
parent | 60fd01f7f4b43515f5d4d915eec701c6054c53cf (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 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 5419a1dd8..affe937e8 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -35287,17 +35287,17 @@ static int load_module(void) if (STASIS_MESSAGE_TYPE_INIT(session_timeout_type)) { unload_module(); - return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_DECLINE; } if (!(sip_tech.capabilities = ast_format_cap_alloc(0))) { unload_module(); - return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_DECLINE; } if (ast_sip_api_provider_register(&chan_sip_api_provider)) { unload_module(); - return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_DECLINE; } /* the fact that ao2_containers can't resize automatically is a major worry! */ @@ -35312,12 +35312,12 @@ static int load_module(void) || !threadt) { ast_log(LOG_ERROR, "Unable to create primary SIP container(s)\n"); unload_module(); - return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_DECLINE; } if (!(sip_cfg.caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) { unload_module(); - return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_DECLINE; } ast_format_cap_append_by_type(sip_tech.capabilities, AST_MEDIA_TYPE_AUDIO); @@ -35328,13 +35328,13 @@ static int load_module(void) if (!(sched = ast_sched_context_create())) { ast_log(LOG_ERROR, "Unable to create scheduler context\n"); unload_module(); - return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_DECLINE; } if (!(io = io_context_create())) { ast_log(LOG_ERROR, "Unable to create I/O context\n"); unload_module(); - return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_DECLINE; } sip_reloadreason = CHANNEL_MODULE_LOAD; @@ -35349,7 +35349,7 @@ static int load_module(void) if (!(bogus_peer = temp_peer("(bogus_peer)"))) { ast_log(LOG_ERROR, "Unable to create bogus_peer for authentication\n"); unload_module(); - return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_DECLINE; } /* Make sure the auth will always fail. */ ast_string_field_set(bogus_peer, md5secret, BOGUS_PEER_MD5SECRET); @@ -35366,14 +35366,14 @@ static int load_module(void) if (ast_msg_tech_register(&sip_msg_tech)) { unload_module(); - return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_DECLINE; } /* Make sure we can register our sip channel type */ if (ast_channel_register(&sip_tech)) { ast_log(LOG_ERROR, "Unable to register channel type 'SIP'\n"); unload_module(); - return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_DECLINE; } #ifdef TEST_FRAMEWORK |