diff options
-rw-r--r-- | res/ari/resource_bridges.c | 4 | ||||
-rw-r--r-- | res/res_stasis_recording.c | 18 |
2 files changed, 9 insertions, 13 deletions
diff --git a/res/ari/resource_bridges.c b/res/ari/resource_bridges.c index 7b9b94665..759947a12 100644 --- a/res/ari/resource_bridges.c +++ b/res/ari/resource_bridges.c @@ -526,9 +526,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); diff --git a/res/res_stasis_recording.c b/res/res_stasis_recording.c index dcabfa699..548212419 100644 --- a/res/res_stasis_recording.c +++ b/res/res_stasis_recording.c @@ -265,7 +265,13 @@ static enum stasis_app_control_channel_result check_rule_recording( return STASIS_APP_CHANNEL_RECORDING; } -struct stasis_app_control_rule rule_recording = { +/* + * XXX This only works because there is one and only one rule in + * the system so it can be added to any number of channels + * without issue. However, as soon as there is another rule then + * watch out for weirdness because of cross linked lists. + */ +static struct stasis_app_control_rule rule_recording = { .check_rule = check_rule_recording }; @@ -465,15 +471,7 @@ const char *stasis_app_recording_get_name( struct stasis_app_recording *stasis_app_recording_find_by_name(const char *name) { - RAII_VAR(struct stasis_app_recording *, recording, NULL, ao2_cleanup); - - recording = ao2_find(recordings, name, OBJ_KEY); - if (recording == NULL) { - return NULL; - } - - ao2_ref(recording, +1); - return recording; + return ao2_find(recordings, name, OBJ_KEY); } struct ast_json *stasis_app_recording_to_json( |