mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
modules: change module LOAD_FAILUREs to LOAD_DECLINES (14)
Change-Id: If99e3b4fc2d7e86fc3e61182aa6c835b407ed49e
This commit is contained in:
@@ -312,21 +312,6 @@ static struct ast_format_def speex32_f = {
|
|||||||
.desc_size = sizeof(struct speex_desc),
|
.desc_size = sizeof(struct speex_desc),
|
||||||
};
|
};
|
||||||
|
|
||||||
static int load_module(void)
|
|
||||||
{
|
|
||||||
speex_f.format = ast_format_speex;
|
|
||||||
speex16_f.format = ast_format_speex16;
|
|
||||||
speex32_f.format = ast_format_speex32;
|
|
||||||
|
|
||||||
if (ast_format_def_register(&speex_f) ||
|
|
||||||
ast_format_def_register(&speex16_f) ||
|
|
||||||
ast_format_def_register(&speex32_f)) {
|
|
||||||
return AST_MODULE_LOAD_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return AST_MODULE_LOAD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int unload_module(void)
|
static int unload_module(void)
|
||||||
{
|
{
|
||||||
int res = 0;
|
int res = 0;
|
||||||
@@ -336,6 +321,22 @@ static int unload_module(void)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int load_module(void)
|
||||||
|
{
|
||||||
|
speex_f.format = ast_format_speex;
|
||||||
|
speex16_f.format = ast_format_speex16;
|
||||||
|
speex32_f.format = ast_format_speex32;
|
||||||
|
|
||||||
|
if (ast_format_def_register(&speex_f) ||
|
||||||
|
ast_format_def_register(&speex16_f) ||
|
||||||
|
ast_format_def_register(&speex32_f)) {
|
||||||
|
unload_module();
|
||||||
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return AST_MODULE_LOAD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "OGG/Speex audio",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "OGG/Speex audio",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
|
@@ -422,6 +422,7 @@ static int unload_module(void)
|
|||||||
ast_ari_remove_handler(&events);
|
ast_ari_remove_handler(&events);
|
||||||
ao2_cleanup(events.ws_server);
|
ao2_cleanup(events.ws_server);
|
||||||
events.ws_server = NULL;
|
events.ws_server = NULL;
|
||||||
|
ast_ari_websocket_events_event_websocket_dtor();
|
||||||
stasis_app_unref();
|
stasis_app_unref();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -432,11 +433,12 @@ static int load_module(void)
|
|||||||
struct ast_websocket_protocol *protocol;
|
struct ast_websocket_protocol *protocol;
|
||||||
|
|
||||||
if (ast_ari_websocket_events_event_websocket_init() == -1) {
|
if (ast_ari_websocket_events_event_websocket_init() == -1) {
|
||||||
return AST_MODULE_LOAD_FAILURE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
events.ws_server = ast_websocket_server_create();
|
events.ws_server = ast_websocket_server_create();
|
||||||
if (!events.ws_server) {
|
if (!events.ws_server) {
|
||||||
|
ast_ari_websocket_events_event_websocket_dtor();
|
||||||
return AST_MODULE_LOAD_DECLINE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -444,6 +446,7 @@ static int load_module(void)
|
|||||||
if (!protocol) {
|
if (!protocol) {
|
||||||
ao2_ref(events.ws_server, -1);
|
ao2_ref(events.ws_server, -1);
|
||||||
events.ws_server = NULL;
|
events.ws_server = NULL;
|
||||||
|
ast_ari_websocket_events_event_websocket_dtor();
|
||||||
return AST_MODULE_LOAD_DECLINE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
protocol->session_attempted = ast_ari_events_event_websocket_ws_attempted_cb;
|
protocol->session_attempted = ast_ari_events_event_websocket_ws_attempted_cb;
|
||||||
|
@@ -425,13 +425,13 @@ static int load_module(void)
|
|||||||
if (ast_bucket_scheme_register("http", &http_bucket_wizard, &http_bucket_file_wizard,
|
if (ast_bucket_scheme_register("http", &http_bucket_wizard, &http_bucket_file_wizard,
|
||||||
NULL, NULL)) {
|
NULL, NULL)) {
|
||||||
ast_log(LOG_ERROR, "Failed to register Bucket HTTP wizard scheme implementation\n");
|
ast_log(LOG_ERROR, "Failed to register Bucket HTTP wizard scheme implementation\n");
|
||||||
return AST_MODULE_LOAD_FAILURE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ast_bucket_scheme_register("https", &https_bucket_wizard, &https_bucket_file_wizard,
|
if (ast_bucket_scheme_register("https", &https_bucket_wizard, &https_bucket_file_wizard,
|
||||||
NULL, NULL)) {
|
NULL, NULL)) {
|
||||||
ast_log(LOG_ERROR, "Failed to register Bucket HTTPS wizard scheme implementation\n");
|
ast_log(LOG_ERROR, "Failed to register Bucket HTTPS wizard scheme implementation\n");
|
||||||
return AST_MODULE_LOAD_FAILURE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return AST_MODULE_LOAD_SUCCESS;
|
return AST_MODULE_LOAD_SUCCESS;
|
||||||
|
@@ -263,6 +263,7 @@ static int unload_module(void)
|
|||||||
{{#has_websocket}}
|
{{#has_websocket}}
|
||||||
ao2_cleanup({{full_name}}.ws_server);
|
ao2_cleanup({{full_name}}.ws_server);
|
||||||
{{full_name}}.ws_server = NULL;
|
{{full_name}}.ws_server = NULL;
|
||||||
|
ast_ari_websocket_events_event_websocket_dtor();
|
||||||
{{/has_websocket}}
|
{{/has_websocket}}
|
||||||
{{/apis}}
|
{{/apis}}
|
||||||
stasis_app_unref();
|
stasis_app_unref();
|
||||||
@@ -278,11 +279,12 @@ static int load_module(void)
|
|||||||
struct ast_websocket_protocol *protocol;
|
struct ast_websocket_protocol *protocol;
|
||||||
|
|
||||||
if (ast_ari_websocket_{{c_name}}_{{c_nickname}}_init() == -1) {
|
if (ast_ari_websocket_{{c_name}}_{{c_nickname}}_init() == -1) {
|
||||||
return AST_MODULE_LOAD_FAILURE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
{{full_name}}.ws_server = ast_websocket_server_create();
|
{{full_name}}.ws_server = ast_websocket_server_create();
|
||||||
if (!{{full_name}}.ws_server) {
|
if (!{{full_name}}.ws_server) {
|
||||||
|
ast_ari_websocket_events_event_websocket_dtor();
|
||||||
return AST_MODULE_LOAD_DECLINE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,6 +292,7 @@ static int load_module(void)
|
|||||||
if (!protocol) {
|
if (!protocol) {
|
||||||
ao2_ref({{full_name}}.ws_server, -1);
|
ao2_ref({{full_name}}.ws_server, -1);
|
||||||
{{full_name}}.ws_server = NULL;
|
{{full_name}}.ws_server = NULL;
|
||||||
|
ast_ari_websocket_events_event_websocket_dtor();
|
||||||
return AST_MODULE_LOAD_DECLINE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
protocol->session_attempted = ast_ari_{{c_name}}_{{c_nickname}}_ws_attempted_cb;
|
protocol->session_attempted = ast_ari_{{c_name}}_{{c_nickname}}_ws_attempted_cb;
|
||||||
|
@@ -397,7 +397,7 @@ static int load_module(void)
|
|||||||
if (ast_bucket_scheme_register("httptest", &bucket_test_wizard,
|
if (ast_bucket_scheme_register("httptest", &bucket_test_wizard,
|
||||||
&bucket_file_test_wizard, NULL, NULL)) {
|
&bucket_file_test_wizard, NULL, NULL)) {
|
||||||
ast_log(LOG_ERROR, "Failed to register Bucket HTTP test wizard scheme implementation\n");
|
ast_log(LOG_ERROR, "Failed to register Bucket HTTP test wizard scheme implementation\n");
|
||||||
return AST_MODULE_LOAD_FAILURE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_TEST_REGISTER(exists_nominal);
|
AST_TEST_REGISTER(exists_nominal);
|
||||||
|
Reference in New Issue
Block a user