From 440584898bf44b006a4b10be4ba0ac59c1b022a7 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 5 Aug 2022 11:18:40 -0600 Subject: [PATCH] Missed calls are marked when the call is imported. Missed calls are marked when the call is imported and in some cases near the end of the call. This simplifies the missed_call in reports and call detail records. --- app/xml_cdr/resources/classes/xml_cdr.php | 31 +---------------------- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 08d24738b3..146d680b31 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -1087,36 +1087,7 @@ 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_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 ( \n"; - $sql .= " ( \n"; - $sql .= " missed_call = '1' \n"; - $sql .= " and (cc_side is null or cc_side != 'agent') \n"; - $sql .= " ) \n"; - - $sql .= " or ( \n"; - $sql .= " (cc_side is null or cc_side != 'agent') \n"; - $sql .= " and (answer_stamp is not null and bridge_uuid is null) \n"; - $sql .= " ) \n"; - - $sql .= " or ( \n"; - $sql .= " ((answer_stamp is null and bridge_uuid is null) \n"; - $sql .= " and sip_hangup_disposition != 'send_refuse' ) \n"; - $sql .= " or ( answer_stamp is not null and bridge_uuid is null and voicemail_message = false )) \n"; - $sql .= " and (cc_side is null or cc_side != 'agent') \n"; - $sql .= " ) \n"; - if ($this->include_internal) { - $sql .= " and (direction = 'inbound' or direction = 'local') "; - } else { - $sql .= " and direction = 'inbound' "; - } + $sql .= " and missed_call = true\n"; $sql .= ") \n"; $sql .= "as missed, \n";