From a3dbdf7b708fde4d59b7313e344788c55d558dfd Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 30 Oct 2023 20:49:21 -0600 Subject: [PATCH] Unset the domain at the before next loop --- app/calls_active/calls_active_inc.php | 32 +++++++++------------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/app/calls_active/calls_active_inc.php b/app/calls_active/calls_active_inc.php index 348bf47894..f7ff147e14 100644 --- a/app/calls_active/calls_active_inc.php +++ b/app/calls_active/calls_active_inc.php @@ -52,7 +52,7 @@ $switch_cmd = 'show channels as json'; //create the event socket connection - $fp = event_socket_create(); + $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); //send the event socket command and get the array if ($fp) { @@ -67,33 +67,27 @@ //get the domain if (!empty($row['context']) && $row['context'] != "public" && $row['context'] != "default") { if (substr_count($row['context'], '@') > 0) { - $context_array = explode('@', $row['context']); - $row['domain_name'] = $context_array[1]; + $row['domain_name'] = explode('@', $row['context'])[1]; } else { $row['domain_name'] = $row['context']; } } else if (substr_count($row['presence_id'], '@') > 0) { - $presence_id_array = explode('@', $row['presence_id']); - $row['domain_name'] = $presence_id_array[1]; + $row['domain_name'] = explode('@', $row['presence_id'])[1]; } //add the row to the array if (($show == 'all' && permission_exists('call_active_all'))) { $rows[] = $row; } - else { - if ($row['domain_name'] == $_SESSION['domain_name']) { - $rows[] = $row; - } + elseif ($row['domain_name'] == $_SESSION['domain_name']) { + $rows[] = $row; } } unset($results); } $num_rows = @sizeof($rows); -//set the time zone - $time_zone = $_SESSION['domain']['time_zone']['name'] ?? date_default_timezone_get(); //if the connnection is available then run it and return the results if (!$fp) { @@ -183,13 +177,6 @@ $$key = $value; } - //adjust created date and time to time zone - if ($time_zone != date_default_timezone_get()) { - $date = new DateTime($created, new DateTimeZone(date_default_timezone_get())); - $date->setTimeZone(new DateTimeZone($time_zone)); - $created = $date->format('Y-m-d H:i:s'); - } - //get the sip profile $name_array = explode("/", $name); $sip_profile = $name_array[1]; @@ -211,7 +198,7 @@ } // reduce too long app data - if (strlen($application_data) > 512) { + if(strlen($application_data) > 512) { $application_data = substr($application_data, 0, 512) . '...'; } @@ -224,7 +211,7 @@ echo " \n"; } echo " ".escape($sip_profile)." \n"; - echo " ".escape($created)." \n"; + echo " ".escape($created)." \n"; if ($show == 'all') { echo " ".escape($domain_name)." \n"; } @@ -232,7 +219,7 @@ echo " ".escape($cid_name)." \n"; echo " ".escape($cid_num)." \n"; echo " ".escape($dest)." \n"; - echo " ".(!empty($application) ? escape($application).":".escape($application_data) : null)." \n"; + echo " ".(!empty($application) ? escape($application).":".escape($application_data) : null)." \n"; echo " ".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." \n"; echo " ".escape($secure)." \n"; if (permission_exists('call_active_hangup')) { @@ -241,6 +228,9 @@ echo " \n"; } echo "\n"; + + //unset the domain name + unset($domain_name); //increment counter $x++;