summaryrefslogtreecommitdiff
path: root/rest-api-templates/res_ari_resource.c.mustache
diff options
context:
space:
mode:
Diffstat (limited to 'rest-api-templates/res_ari_resource.c.mustache')
-rw-r--r--rest-api-templates/res_ari_resource.c.mustache6
1 files changed, 2 insertions, 4 deletions
diff --git a/rest-api-templates/res_ari_resource.c.mustache b/rest-api-templates/res_ari_resource.c.mustache
index 67a04d898..85948fba1 100644
--- a/rest-api-templates/res_ari_resource.c.mustache
+++ b/rest-api-templates/res_ari_resource.c.mustache
@@ -55,7 +55,7 @@
#if defined(AST_DEVMODE)
#include "ari/ari_model_validators.h"
#endif
-{{^has_websocket}}
+{{#has_websocket}}
{{! Only include http_websocket if necessary. Otherwise we'll do a lot of
* unnecessary optional_api intialization, which makes optional_api harder
* to debug
@@ -278,7 +278,7 @@ static int load_module(void)
{{#apis}}
{{#operations}}
-{{#has_websocket}}
+{{#is_websocket}}
struct ast_websocket_protocol *protocol;
if (ast_ari_websocket_{{c_name}}_{{c_nickname}}_init() == -1) {
@@ -300,8 +300,6 @@ static int load_module(void)
}
protocol->session_attempted = ast_ari_{{c_name}}_{{c_nickname}}_ws_attempted_cb;
protocol->session_established = ast_ari_{{c_name}}_{{c_nickname}}_ws_established_cb;
-{{/has_websocket}}
-{{#is_websocket}}
res |= ast_websocket_server_add_protocol2({{full_name}}.ws_server, protocol);
{{/is_websocket}}
{{/operations}}