This change ensures that the module isn't unloaded when a
WebSocket is open. Previously it was possible to unload the
module manually or during shutdown which could cause a crash
when any active WebSockets were terminated.
ASTERISK-28585
Change-Id: I85c71ab112f99875b586419a34c08c8b34c14c5c
RAII_VAR(struct ast_websocket *, s, ws_session, ast_websocket_unref);
RAII_VAR(struct ast_ari_websocket_session *, session, NULL, ao2_cleanup);
+ SCOPED_MODULE_USE(ast_module_info->self);
+
response = ast_calloc(1, sizeof(*response));
if (!response) {
ast_log(LOG_ERROR, "Failed to create response.\n");
struct ast_variable *path_vars = NULL;
{{/has_path_parameters}}
+ SCOPED_MODULE_USE(ast_module_info->self);
+
{{#has_parameters}}
response = ast_calloc(1, sizeof(*response));
if (!response) {