Don't filter LOSE_RACE of already filtering originating_leg_uuid

It is redundant to filter out LOSE_RACE when originating_leg_uuid is also filtered, there is an overlap where every call with LOSE_RACE also has an originating_leg.
This commit is contained in:
demonspork
2021-02-20 11:14:47 -06:00
parent 77974b71dc
commit b5272984d1
3 changed files with 17 additions and 11 deletions

View File

@@ -280,14 +280,14 @@
$sql_where_ands[] = "leg = :leg";
$parameters['leg'] = $leg;
}
//If you can't see lose_race, don't run stats on it
if (!permission_exists('xml_cdr_lose_race')) {
$sql_where_ands[] = "hangup_cause != 'LOSE_RACE'";
}
//Exclude enterprise ring group legs
if (!permission_exists('xml_cdr_enterprise_leg')) {
$sql_where_ands[] .= "originating_leg_uuid IS NULL";
}
//If you can't see lose_race, don't run stats on it
elseif (!permission_exists('xml_cdr_lose_race')) {
$sql_where_ands[] = "hangup_cause != 'LOSE_RACE'";
}
//if not admin or superadmin, only show own calls