diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index fc2d416f1d..614062045a 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -954,6 +954,9 @@ if (!class_exists('xml_cdr')) { $sql .= "filter ( \n"; $sql .= " where c.extension_uuid = e.extension_uuid \n"; $sql .= " and missed_call = true \n"; + if (!permission_exists('xml_cdr_lose_race')) { + $sql .= " and hangup_cause <> 'LOSE_RACE' \n"; + } if ($this->include_internal) { $sql .= " and (direction = 'inbound' or direction = 'local') "; } else { @@ -1007,6 +1010,9 @@ if (!class_exists('xml_cdr')) { $sql .= "count(*) \n"; $sql .= "filter ( \n"; $sql .= " where c.extension_uuid = e.extension_uuid \n"; + if (!permission_exists('xml_cdr_lose_race')) { + $sql .= " and hangup_cause <> 'LOSE_RACE' \n"; + } if ($this->include_internal) { $sql .= " and (direction = 'inbound' or direction = 'local') \n"; }