From 0ef2551698754ed7a5348ef82a9d15328b02aa6e Mon Sep 17 00:00:00 2001 From: demonspork Date: Sun, 21 Feb 2021 18:26:24 -0600 Subject: [PATCH] Exclude cc_side agent legs from missed_call Excluded cc_side = agent calls from being marked as missed_call = true Fixed the previous performance issue with adding the cc_side != 'agent' to the SQL and removed its filter from the rendering loop for the xml_cdr. --- app/xml_cdr/resources/classes/xml_cdr.php | 2 +- app/xml_cdr/v_xml_cdr_import.php | 2 +- app/xml_cdr/xml_cdr.php | 4 ---- app/xml_cdr/xml_cdr_inc.php | 4 ++++ 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index a8675eb507..eac992c12d 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -317,7 +317,7 @@ if (!class_exists('xml_cdr')) { //set missed calls $missed_call = 'false'; - if (strlen($xml->variables->originating_leg_uuid) == 0 && $xml->variables->call_direction != 'outbound' && strlen($xml->variables->answer_stamp) == 0) { + if ($xml->variables->cc_side != "agent" && strlen($xml->variables->originating_leg_uuid) == 0 && $xml->variables->call_direction != 'outbound' && strlen($xml->variables->answer_stamp) == 0) { $missed_call = 'true'; } if ($xml->variables->missed_call == 'true') { diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index 0902b4c271..a38985e228 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -211,7 +211,7 @@ //set missed calls $database->fields['missed_call'] = 'false'; - if (strlen($xml->variables->originating_leg_uuid) == 0 && $xml->variables->call_direction != 'outbound' && strlen($xml->variables->answer_stamp) == 0) { + if ($xml->variables->cc_side != "agent" && strlen($xml->variables->originating_leg_uuid) == 0 && $xml->variables->call_direction != 'outbound' && strlen($xml->variables->answer_stamp) == 0) { $database->fields['missed_call'] = 'true'; } if ($xml->variables->missed_call == 'true') { diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index d4a1512645..05d889091b 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -823,10 +823,6 @@ } $content .= "\n"; - //show agent originated legs only to those with the permission - if (!permission_exists('xml_cdr_cc_agent_leg') && $row['cc_side'] == "agent") { - $content = ''; - } //show the leg b only to those with the permission if ($row['leg'] == 'a') { echo $content; diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php index c1151d0f07..3d12d71339 100644 --- a/app/xml_cdr/xml_cdr_inc.php +++ b/app/xml_cdr/xml_cdr_inc.php @@ -515,6 +515,10 @@ $sql .= "and (c.record_path is null or c.record_name is null) "; } } + //show agent originated legs only to those with the permission + if (!permission_exists('xml_cdr_cc_agent_leg')) { + $sql .= "and (cc_side is null or cc_side != 'agent') "; + } //end where if (strlen($order_by) > 0) { $sql .= order_by($order_by, $order);