From 014adb461bca8fdb65910a9ed827ad539b2dc724 Mon Sep 17 00:00:00 2001 From: chansizzle <14916599+chansizzle@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:13:25 -0700 Subject: [PATCH] add call duration to the active calls page (#7191) * add call duration to the active calls page * add duration label for active calls --- app/calls_active/app_languages.php | 27 +++++++++++++++++++++++++++ app/calls_active/calls_active_inc.php | 19 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/app/calls_active/app_languages.php b/app/calls_active/app_languages.php index f87811d1fc..e5a4eacf47 100644 --- a/app/calls_active/app_languages.php +++ b/app/calls_active/app_languages.php @@ -650,6 +650,33 @@ $text['label-eavesdrop']['zh-cn'] = "窃听"; $text['label-eavesdrop']['ja-jp'] = "盗聴"; $text['label-eavesdrop']['ko-kr'] = "엿듣다"; +$text['label-duration']['en-us'] = "Duration"; +$text['label-duration']['en-gb'] = "Duration"; +$text['label-duration']['ar-eg'] = "المدة"; +$text['label-duration']['de-at'] = "Dauer"; +$text['label-duration']['de-ch'] = "Dauer"; +$text['label-duration']['de-de'] = "Dauer"; +$text['label-duration']['el-gr'] = "Διάρκεια"; +$text['label-duration']['es-cl'] = "Duración"; +$text['label-duration']['es-mx'] = "Duración"; +$text['label-duration']['fr-ca'] = "Durée"; +$text['label-duration']['fr-fr'] = "Durée"; +$text['label-duration']['he-il'] = "משך השיחה"; +$text['label-duration']['it-it'] = "Durata"; +$text['label-duration']['ka-ge'] = "ხანგრძლივობა"; +$text['label-duration']['nl-nl'] = "Duur"; +$text['label-duration']['pl-pl'] = "Czas trwania"; +$text['label-duration']['pt-br'] = "Duração"; +$text['label-duration']['pt-pt'] = "Duração"; +$text['label-duration']['ro-ro'] = "Durată"; +$text['label-duration']['ru-ru'] = "Продолжительность"; +$text['label-duration']['sv-se'] = "Samtalstid"; +$text['label-duration']['uk-ua'] = "Тривалість"; +$text['label-duration']['tr-tr'] = "Süre"; +$text['label-duration']['zh-cn'] = "期间"; +$text['label-duration']['ja-jp'] = "間隔"; +$text['label-duration']['ko-kr'] = "지속"; + $text['description-2']['en-us'] = "Use this to view all extensions and monitor and interact with active calls."; $text['description-2']['en-gb'] = "Use this to view all extensions and monitor and interact with active calls."; $text['description-2']['ar-eg'] = "استخدم هذا لعرض جميع الملحقات ومراقبة المكالمات النشطة والتفاعل معها."; diff --git a/app/calls_active/calls_active_inc.php b/app/calls_active/calls_active_inc.php index ffa00988c4..787af746b3 100644 --- a/app/calls_active/calls_active_inc.php +++ b/app/calls_active/calls_active_inc.php @@ -170,6 +170,7 @@ } echo " ".$text['label-profile']."\n"; echo " ".$text['label-created']."\n"; + echo " ".$text['label-duration']."\n"; if ($show == 'all') { echo " ".$text['label-domain']."\n"; } @@ -229,6 +230,24 @@ } echo " ".escape($sip_profile)." \n"; echo " ".escape($created)." \n"; + // Convert $created to a UNIX timestamp + $created_timestamp = strtotime($created); + + // Get the current timestamp + $now = time(); + + // Calculate elapsed seconds + $elapsed_seconds = $now - $created_timestamp; + + // Convert seconds to hours, minutes, and seconds + $hours = floor($elapsed_seconds / 3600); + $minutes = floor(($elapsed_seconds % 3600) / 60); + $seconds = $elapsed_seconds % 60; + + // Format the elapsed time as HH:MM:SS + $elapsed_time = sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds); + + echo " ".escape($elapsed_time)."\n"; if ($show == 'all') { echo " ".escape($domain_name)." \n"; }