summaryrefslogtreecommitdiff
path: root/rest-api-templates
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-04-12 06:47:59 -0600
committerGeorge Joseph <gjoseph@digium.com>2017-04-12 15:57:39 -0600
commit6db0939b96017b468d2d368e67669fd02b2fdecc (patch)
tree31ea93e859375a58e9b2dce6333f24d04b2fcfb3 /rest-api-templates
parent747beb1ed159f89a3b58742e4257740b3d6d6bba (diff)
modules: change module LOAD_FAILUREs to LOAD_DECLINES (14)
Change-Id: If99e3b4fc2d7e86fc3e61182aa6c835b407ed49e
Diffstat (limited to 'rest-api-templates')
-rw-r--r--rest-api-templates/res_ari_resource.c.mustache5
1 files changed, 4 insertions, 1 deletions
diff --git a/rest-api-templates/res_ari_resource.c.mustache b/rest-api-templates/res_ari_resource.c.mustache
index ca4e2f192..3ccafcd08 100644
--- a/rest-api-templates/res_ari_resource.c.mustache
+++ b/rest-api-templates/res_ari_resource.c.mustache
@@ -263,6 +263,7 @@ static int unload_module(void)
{{#has_websocket}}
ao2_cleanup({{full_name}}.ws_server);
{{full_name}}.ws_server = NULL;
+ ast_ari_websocket_events_event_websocket_dtor();
{{/has_websocket}}
{{/apis}}
stasis_app_unref();
@@ -278,11 +279,12 @@ static int load_module(void)
struct ast_websocket_protocol *protocol;
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();
if (!{{full_name}}.ws_server) {
+ ast_ari_websocket_events_event_websocket_dtor();
return AST_MODULE_LOAD_DECLINE;
}
@@ -290,6 +292,7 @@ static int load_module(void)
if (!protocol) {
ao2_ref({{full_name}}.ws_server, -1);
{{full_name}}.ws_server = NULL;
+ ast_ari_websocket_events_event_websocket_dtor();
return AST_MODULE_LOAD_DECLINE;
}
protocol->session_attempted = ast_ari_{{c_name}}_{{c_nickname}}_ws_attempted_cb;