From 6f2a2a76a1d31966d402bfc8f4e1995d58934962 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 5 Aug 2022 13:46:26 -0600 Subject: [PATCH] Answered calls to exclude missed calls. Determining missed_call is done in the import so the extra originating_leg_uuid is not needed. --- app/xml_cdr/resources/classes/xml_cdr.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index fafa686416..fc3a4254c4 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -1073,14 +1073,13 @@ if (!class_exists('xml_cdr')) { $sql .= "count(*) \n"; $sql .= "filter ( \n"; $sql .= " where c.extension_uuid = e.extension_uuid \n"; + $sql .= " and missed_call = false\n"; if (!permission_exists('xml_cdr_enterprise_leg')) { $sql .= " and originating_leg_uuid is null \n"; } elseif (!permission_exists('xml_cdr_lose_race')) { $sql .= " and hangup_cause <> 'LOSE_RACE' \n"; } - $sql .= " and originating_leg_uuid IS NULL \n"; - $sql .= " and (answer_stamp IS NOT NULL and bridge_uuid IS NOT NULL) \n"; $sql .= " and (cc_side IS NULL or cc_side !='agent')"; if ($this->include_internal) { $sql .= " and (direction = 'inbound' or direction = 'local') \n"; @@ -1096,6 +1095,7 @@ if (!class_exists('xml_cdr')) { $sql .= "filter ( \n"; $sql .= " where c.extension_uuid = e.extension_uuid \n"; $sql .= " and missed_call = true\n"; + $sql .= " and (cc_side is null or cc_side != 'agent') \n"; $sql .= ") \n"; $sql .= "as missed, \n"; @@ -1155,7 +1155,6 @@ if (!class_exists('xml_cdr')) { elseif (!permission_exists('xml_cdr_lose_race')) { $sql .= " and hangup_cause <> 'LOSE_RACE' \n"; } - $sql .= " and originating_leg_uuid IS NULL \n"; $sql .= " and (cc_side is null or cc_side != 'agent') \n"; if ($this->include_internal) { $sql .= " and (direction = 'inbound' or direction = 'local') \n";