Merge "res_stasis_recording.c: Cleanup stasis_app_recording_find_by_name()." into 13

changes/21/2521/1
Joshua Colp 9 years ago committed by Gerrit Code Review
commit 2b5dfe668a

@ -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(

Loading…
Cancel
Save