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.mustache10
1 files changed, 6 insertions, 4 deletions
diff --git a/rest-api-templates/res_ari_resource.c.mustache b/rest-api-templates/res_ari_resource.c.mustache
index 906d55f0d..e6b2a88f4 100644
--- a/rest-api-templates/res_ari_resource.c.mustache
+++ b/rest-api-templates/res_ari_resource.c.mustache
@@ -174,14 +174,16 @@ fin: __attribute__((unused))
* negotiation. Param parsing should happen earlier, but we
* need a way to pass it through the WebSocket code to the
* callback */
- RAII_VAR(char *, msg, NULL, ast_free);
+ RAII_VAR(char *, msg, NULL, ast_json_free);
if (response->message) {
msg = ast_json_dump_string(response->message);
} else {
- msg = ast_strdup("?");
+ ast_log(LOG_ERROR, "Missing response message\n");
+ }
+ if (msg) {
+ ast_websocket_write(ws_session,
+ AST_WEBSOCKET_OPCODE_TEXT, msg, strlen(msg));
}
- ast_websocket_write(ws_session, AST_WEBSOCKET_OPCODE_TEXT, msg,
- strlen(msg));
}
{{> param_cleanup}}
}