|
|
@ -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;
|
|
|
|