From 1ebf3d08269c749f445179146caad8d43b6077d6 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 13 Oct 2023 05:07:01 -0600 Subject: [PATCH] Works better for this code block to run after building the primary array. --- app/xml_cdr/xml_cdr_details.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/xml_cdr/xml_cdr_details.php b/app/xml_cdr/xml_cdr_details.php index e58abb5eb2..22baee4f12 100644 --- a/app/xml_cdr/xml_cdr_details.php +++ b/app/xml_cdr/xml_cdr_details.php @@ -253,16 +253,6 @@ $callflow_count = count($array["callflow"]); } -//call flow summary when the count array is 1 then use start_epoch and end_epoch - if ($callflow_count == 1) { - $call_flow_summary[0]["destination_number"] = urldecode($row["caller_profile"]["destination_number"]); - $call_flow_summary[0]["start_epoch"] = $start_epoch; - $call_flow_summary[0]["end_epoch"] = $end_epoch; - $call_flow_summary[0]["start_stamp"] = date("Y-m-d H:i:s", (int) $start_epoch); - $call_flow_summary[0]["end_stamp"] = date("Y-m-d H:i:s", (int) $end_epoch); - $call_flow_summary[0]["duration"] = gmdate("G:i:s", (int) $end_epoch - (int) $start_epoch); - } - //add the final call flow destination to the call flow array //when call_direction is inbound //when destination_number is not same as the last row @@ -339,6 +329,16 @@ } unset($x); +//call flow summary with one row use start_epoch and end_epoch + if ($callflow_count == 1) { + $call_flow_summary[0]["destination_number"] = urldecode($row["caller_profile"]["destination_number"]); + $call_flow_summary[0]["start_epoch"] = $start_epoch; + $call_flow_summary[0]["end_epoch"] = $end_epoch; + $call_flow_summary[0]["start_stamp"] = date("Y-m-d H:i:s", (int) $start_epoch); + $call_flow_summary[0]["end_stamp"] = date("Y-m-d H:i:s", (int) $end_epoch); + $call_flow_summary[0]["duration"] = gmdate("G:i:s", (int) $end_epoch - (int) $start_epoch); + } + //set the year, month and date $tmp_year = date("Y", strtotime($start_stamp)); $tmp_month = date("M", strtotime($start_stamp));