Skip to content
Snippets Groups Projects
Commit 2f36cba4 authored by Richard Mudgett's avatar Richard Mudgett
Browse files

res_stasis_recording.c: Cleanup stasis_app_recording_find_by_name().

Change-Id: Ic7d93c402c498677a122505558859c853d4e5ac7
parent 23d2a561
No related branches found
No related tags found
No related merge requests found
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment