summaryrefslogtreecommitdiff
path: root/res/ari/resource_bridges.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/ari/resource_bridges.c')
-rw-r--r--res/ari/resource_bridges.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/res/ari/resource_bridges.c b/res/ari/resource_bridges.c
index ad37053f7..a37b83146 100644
--- a/res/ari/resource_bridges.c
+++ b/res/ari/resource_bridges.c
@@ -297,10 +297,11 @@ static void *bridge_channel_control_thread(void *data)
thread_data = NULL;
stasis_app_control_execute_until_exhausted(bridge_channel, control);
+ stasis_app_control_flush_queue(control);
- ast_hangup(bridge_channel);
- ao2_cleanup(control);
stasis_forward_cancel(forward);
+ ao2_cleanup(control);
+ ast_hangup(bridge_channel);
return NULL;
}
@@ -527,9 +528,7 @@ static enum play_found_result ari_bridges_play_found(const char *args_media,
control = stasis_app_control_find_by_channel(play_channel);
if (!control) {
- ast_ari_response_error(
- response, 500, "Internal Error", "Failed to get control snapshot");
- return PLAY_FOUND_FAILURE;
+ return PLAY_FOUND_CHANNEL_UNAVAILABLE;
}
ao2_lock(control);