summaryrefslogtreecommitdiff
path: root/res/ari
diff options
context:
space:
mode:
Diffstat (limited to 'res/ari')
-rw-r--r--res/ari/resource_asterisk.c7
-rw-r--r--res/ari/resource_bridges.h4
-rw-r--r--res/ari/resource_channels.c4
-rw-r--r--res/ari/resource_events.c5
-rw-r--r--res/ari/resource_sounds.c1
5 files changed, 19 insertions, 2 deletions
diff --git a/res/ari/resource_asterisk.c b/res/ari/resource_asterisk.c
index e76eb02bc..5c6a35af6 100644
--- a/res/ari/resource_asterisk.c
+++ b/res/ari/resource_asterisk.c
@@ -433,6 +433,10 @@ void ast_ari_asterisk_list_modules(struct ast_variable *headers,
struct ast_json *json;
json = ast_json_array_create();
+ if (!json) {
+ ast_ari_response_alloc_failed(response);
+ return;
+ }
ast_update_module_list_data(&process_module_list, NULL, json);
ast_ari_response_ok(response, json);
@@ -505,6 +509,7 @@ void ast_ari_asterisk_get_module(struct ast_variable *headers,
ast_ari_response_error(
response, 409, "Conflict",
"Module information could not be retrieved");
+ ast_json_unref(json);
return;
}
@@ -667,10 +672,12 @@ void ast_ari_asterisk_list_log_channels(struct ast_variable *headers,
if (res == AST_LOGGER_FAILURE) {
ast_ari_response_error(response, 500, "Internal Server Error",
"Response body is not valid");
+ ast_json_unref(json);
return;
} else if (res == AST_LOGGER_ALLOC_ERROR) {
ast_ari_response_error(response, 500, "Internal Server Error",
"Allocation Failed");
+ ast_json_unref(json);
return;
}
diff --git a/res/ari/resource_bridges.h b/res/ari/resource_bridges.h
index e75d8e028..a3b6430ac 100644
--- a/res/ari/resource_bridges.h
+++ b/res/ari/resource_bridges.h
@@ -52,7 +52,7 @@ struct ast_ari_bridges_list_args {
void ast_ari_bridges_list(struct ast_variable *headers, struct ast_ari_bridges_list_args *args, struct ast_ari_response *response);
/*! Argument struct for ast_ari_bridges_create() */
struct ast_ari_bridges_create_args {
- /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media). */
+ /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu). */
const char *type;
/*! Unique ID to give to the bridge being created. */
const char *bridge_id;
@@ -82,7 +82,7 @@ int ast_ari_bridges_create_parse_body(
void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response);
/*! Argument struct for ast_ari_bridges_create_with_id() */
struct ast_ari_bridges_create_with_id_args {
- /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set. */
+ /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu) to set. */
const char *type;
/*! Unique ID to give to the bridge being created. */
const char *bridge_id;
diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c
index 6027a8059..6b4f26c25 100644
--- a/res/ari/resource_channels.c
+++ b/res/ari/resource_channels.c
@@ -99,9 +99,13 @@ static int channel_state_invalid(struct stasis_app_control *control,
|| snapshot->state == AST_STATE_RINGING) {
ast_ari_response_error(response, 412, "Precondition Failed",
"Channel in invalid state");
+ ao2_ref(snapshot, -1);
+
return -1;
}
+ ao2_ref(snapshot, -1);
+
return 0;
}
diff --git a/res/ari/resource_events.c b/res/ari/resource_events.c
index ed936f732..4be5d0223 100644
--- a/res/ari/resource_events.c
+++ b/res/ari/resource_events.c
@@ -23,6 +23,11 @@
* \author David M. Lee, II <dlee@digium.com>
*/
+/*** MODULEINFO
+ <depend type="module">res_http_websocket</depend>
+ <support_level>core</support_level>
+ ***/
+
#include "asterisk.h"
#include "resource_events.h"
diff --git a/res/ari/resource_sounds.c b/res/ari/resource_sounds.c
index 59ace5d81..2cb35b620 100644
--- a/res/ari/resource_sounds.c
+++ b/res/ari/resource_sounds.c
@@ -202,6 +202,7 @@ void ast_ari_sounds_list(struct ast_variable *headers,
if (!ast_json_array_size(sounds_blob)) {
ast_ari_response_error(response, 404, "Not Found", "No sounds found that matched the query");
+ ast_json_unref(sounds_blob);
return;
}