MT#61513 prevent duplicates in GET /api/callrecordings

callrecording metakeys such as "uuid" for the involved
call party is present multiple times by nature. the
?subscriber_id= query param will then narrow down the
result. alongside an implicit role filtering
(reseller/subscriber), the sql join and filtering for
the uuid key is present 2 times however, and multiplied
records slip through.

this can be prevented with DISTINCT. to avoid performance
impacts and consider other metakeys orrcuring multiple
times, it will be applied only if a filter is present.

Change-Id: I08047aaee265e2e0a706220e03fd4617da16d33c
(cherry picked from commit 598f7dbaf4)
mr11.5
Rene Krenn 5 months ago
parent 22c5b8ad7e
commit f612ad54d8

@ -113,6 +113,7 @@ sub _item_rs {
);
if ($join_idx > 0) {
$item_rs = $item_rs->search_rs(undef,{
distinct => 1,
join => [ ('recording_metakeys') x $join_idx ],
});
}

Loading…
Cancel
Save