From 642d4cd8d7c3cf0d551b9d88ee5c91fd28efac72 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 2 Dec 2024 11:56:35 -0700 Subject: [PATCH 01/15] Set the Yealink default to 4 PAI-RPID-FROM --- app/yealink/app_config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/yealink/app_config.php b/app/yealink/app_config.php index d09a0784c2..2f5a9f280a 100644 --- a/app/yealink/app_config.php +++ b/app/yealink/app_config.php @@ -228,7 +228,7 @@ $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_cid_source"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "2"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "4"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "The type of SIP header(s) to carry the caller ID; 0-FROM, 1-PAI 2-PAI-FROM (default), 3-PRID-PAI-FROM, 4-PAI-RPID-FROM, 5-RPID-FROM, 6-Preference"; $y++; From 6f1c595b1f278a8cd5d9f4e835ec0f741388c99c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 2 Dec 2024 17:54:49 -0700 Subject: [PATCH 02/15] Use the PHP_BINARY constant --- .../resources/service/email_queue.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/email_queue/resources/service/email_queue.php b/app/email_queue/resources/service/email_queue.php index 5385b77325..06f2c3d6c0 100644 --- a/app/email_queue/resources/service/email_queue.php +++ b/app/email_queue/resources/service/email_queue.php @@ -51,7 +51,7 @@ if (file_exists($file)) { $pid = file_get_contents($file); if (function_exists('posix_getsid')) { - if (posix_getsid($pid) === false) { + if (posix_getsid($pid) === false) { //process is not running $exists = false; } @@ -95,12 +95,12 @@ } //make sure the /var/run/fusionpbx directory exists - if (!file_exists('/var/run/fusionpbx')) { - $result = mkdir('/var/run/fusionpbx', 0777, true); - if (!$result) { - die('Failed to create /var/run/fusionpbx'); - } - } + if (!file_exists('/var/run/fusionpbx')) { + $result = mkdir('/var/run/fusionpbx', 0777, true); + if (!$result) { + die('Failed to create /var/run/fusionpbx'); + } + } //create the process id file if the process doesn't exist if (!$pid_exists) { @@ -152,7 +152,7 @@ //process the messages if (is_array($email_queue) && @sizeof($email_queue) != 0) { foreach($email_queue as $row) { - $command = exec('which php')." ".$_SERVER['DOCUMENT_ROOT']."/app/email_queue/resources/jobs/email_send.php "; + $command = PHP_BINARY." ".$_SERVER['DOCUMENT_ROOT']."/app/email_queue/resources/jobs/email_send.php "; $command .= "'action=send&email_queue_uuid=".$row["email_queue_uuid"]."&hostname=".$hostname."'"; if (isset($debug)) { //run process inline to see debug info @@ -162,7 +162,7 @@ } else { //starts process rapidly doesn't wait for previous process to finish (used for production) - $handle = popen($command." > /dev/null &", 'r'); + $handle = popen($command." > /dev/null &", 'r'); echo "'$handle'; " . gettype($handle) . "\n"; $read = fread($handle, 2096); echo $read; From efdc007eb27a47b5a4d648c75d587c1043236a08 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 2 Dec 2024 17:55:35 -0700 Subject: [PATCH 03/15] Use the PHP_BINARY constant --- app/email_queue/resources/jobs/email_queue.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/email_queue/resources/jobs/email_queue.php b/app/email_queue/resources/jobs/email_queue.php index c5cd45d13b..9e1d3952eb 100644 --- a/app/email_queue/resources/jobs/email_queue.php +++ b/app/email_queue/resources/jobs/email_queue.php @@ -138,9 +138,8 @@ //process the messages if (is_array($email_queue) && @sizeof($email_queue) != 0) { - $which_php = exec('which php'); foreach($email_queue as $row) { - $command = $which_php." ".$_SERVER['DOCUMENT_ROOT']."/app/email_queue/resources/jobs/email_send.php "; + $command = PHP_BINARY." ".$_SERVER['DOCUMENT_ROOT']."/app/email_queue/resources/jobs/email_send.php "; $command .= "'action=send&email_queue_uuid=".$row["email_queue_uuid"]."&hostname=".$hostname."'"; if (isset($debug)) { //run process inline to see debug info From 57a792dccd954054501d2f6d8ddd87adf57dca9d Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 2 Dec 2024 17:58:07 -0700 Subject: [PATCH 04/15] Use the PHP_BINARY constant --- app/fax_queue/resources/job/fax_queue.php | 2 +- app/fax_queue/resources/service/fax_queue.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/fax_queue/resources/job/fax_queue.php b/app/fax_queue/resources/job/fax_queue.php index 60a113b21c..b08ffcde96 100644 --- a/app/fax_queue/resources/job/fax_queue.php +++ b/app/fax_queue/resources/job/fax_queue.php @@ -151,7 +151,7 @@ //process the messages if (is_array($fax_queue) && @sizeof($fax_queue) != 0) { foreach($fax_queue as $row) { - $command = exec('which php')." ".$_SERVER['DOCUMENT_ROOT']."/app/fax_queue/resources/job/fax_send.php "; + $command = PHP_BINARY." ".$_SERVER['DOCUMENT_ROOT']."/app/fax_queue/resources/job/fax_send.php "; $command .= "'action=send&fax_queue_uuid=".$row["fax_queue_uuid"]."&hostname=".$hostname."&debug=true'"; if (isset($debug)) { //run process inline to see debug info diff --git a/app/fax_queue/resources/service/fax_queue.php b/app/fax_queue/resources/service/fax_queue.php index 22df8fd69b..6084254ebf 100644 --- a/app/fax_queue/resources/service/fax_queue.php +++ b/app/fax_queue/resources/service/fax_queue.php @@ -181,7 +181,7 @@ //process the messages if (is_array($fax_queue) && @sizeof($fax_queue) != 0) { foreach($fax_queue as $row) { - $command = exec('which php')." ".$_SERVER['DOCUMENT_ROOT']."/app/fax_queue/resources/job/fax_send.php "; + $command = PHP_BINARY." ".$_SERVER['DOCUMENT_ROOT']."/app/fax_queue/resources/job/fax_send.php "; $command .= "'action=send&fax_queue_uuid=".$row["fax_queue_uuid"]."&hostname=".$hostname."'"; if (isset($debug)) { //run process inline to see debug info From 78306a1a68fca73b47a0d4c60729dd3f78b47daf Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 2 Dec 2024 18:05:26 -0700 Subject: [PATCH 05/15] Add execute permission --- app/email_queue/resources/jobs/email_queue.php | 0 app/email_queue/resources/jobs/email_send.php | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 app/email_queue/resources/jobs/email_queue.php mode change 100644 => 100755 app/email_queue/resources/jobs/email_send.php diff --git a/app/email_queue/resources/jobs/email_queue.php b/app/email_queue/resources/jobs/email_queue.php old mode 100644 new mode 100755 diff --git a/app/email_queue/resources/jobs/email_send.php b/app/email_queue/resources/jobs/email_send.php old mode 100644 new mode 100755 From f0837e173b9101cc0a82c0dd14bb7ba415c77835 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 2 Dec 2024 18:34:49 -0700 Subject: [PATCH 06/15] Add function_exists for posix_getsid Used to support operating systems that don't support posix_getsid --- app/email_queue/resources/jobs/email_send.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/email_queue/resources/jobs/email_send.php b/app/email_queue/resources/jobs/email_send.php index 963b17abe9..0b116a691c 100755 --- a/app/email_queue/resources/jobs/email_send.php +++ b/app/email_queue/resources/jobs/email_send.php @@ -49,12 +49,20 @@ //check to see if the process is running if (file_exists($file)) { $pid = file_get_contents($file); - if (posix_getsid($pid) === false) { - //process is not running - $exists = false; + if (function_exists('posix_getsid')) { + //check if the process is running + $pid = posix_getsid($pid); + if ($pid === null || $pid === 0) { + //process is not running + $exists = false; + } + else { + //process is running + $exists = true; + } } else { - //process is running + //file exists assume the pid is running $exists = true; } } @@ -571,4 +579,3 @@ //fwrite($esl, $content); //fclose($esl); - 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 07/15] 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"; } From f0bc1cfe33e905fccf6f1f981292c0d4464f8e51 Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:55:41 -0700 Subject: [PATCH 08/15] Update contacts path (#7192) * Update contacts path * Update menu.php * Update contact_edit.php * Update contact_relation_edit.php * Update config.php * Update authentication.php * Update database.php * Update totp.php * Update email.php --- core/authentication/resources/classes/authentication.php | 2 +- .../authentication/resources/classes/plugins/database.php | 2 +- core/authentication/resources/classes/plugins/email.php | 4 ++-- core/authentication/resources/classes/plugins/totp.php | 4 ++-- core/contacts/contact_auth.php | 4 ++-- core/contacts/contact_edit.php | 4 ++-- core/contacts/contact_relation_edit.php | 4 ++-- core/contacts/resources/dashboard/config.php | 2 +- resources/classes/menu.php | 8 ++++---- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/authentication/resources/classes/authentication.php b/core/authentication/resources/classes/authentication.php index 5355451606..790f319709 100644 --- a/core/authentication/resources/classes/authentication.php +++ b/core/authentication/resources/classes/authentication.php @@ -79,7 +79,7 @@ class authentication { } //check if contacts app exists - $contacts_exists = file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/contacts/') ? true : false; + $contacts_exists = file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/core/contacts/') ? true : false; //use the authentication plugins foreach ($_SESSION['authentication']['methods'] as $name) { diff --git a/core/authentication/resources/classes/plugins/database.php b/core/authentication/resources/classes/plugins/database.php index bebcd73892..9d61f26379 100644 --- a/core/authentication/resources/classes/plugins/database.php +++ b/core/authentication/resources/classes/plugins/database.php @@ -171,7 +171,7 @@ class plugin_database { $user_authorized = false; //check if contacts app exists - $contacts_exists = file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/contacts/') ? true : false; + $contacts_exists = file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/core/contacts/') ? true : false; //check the username and password if they don't match then redirect to the login $sql = "select "; diff --git a/core/authentication/resources/classes/plugins/email.php b/core/authentication/resources/classes/plugins/email.php index 7db1f98da8..900c467b36 100644 --- a/core/authentication/resources/classes/plugins/email.php +++ b/core/authentication/resources/classes/plugins/email.php @@ -404,7 +404,7 @@ class plugin_email { unset($_POST['authentication_code']); //check if contacts app exists - $contacts_exists = file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/contacts/') ? true : false; + $contacts_exists = file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/core/contacts/') ? true : false; //get the user details if ($auth_valid) { @@ -522,4 +522,4 @@ class plugin_email { } } -?> \ No newline at end of file +?> diff --git a/core/authentication/resources/classes/plugins/totp.php b/core/authentication/resources/classes/plugins/totp.php index 1f7af49e43..0524335a63 100644 --- a/core/authentication/resources/classes/plugins/totp.php +++ b/core/authentication/resources/classes/plugins/totp.php @@ -328,7 +328,7 @@ class plugin_totp { unset($_POST['authentication_code']); //check if contacts app exists - $contacts_exists = file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/contacts/') ? true : false; + $contacts_exists = file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/core/contacts/') ? true : false; //get the user details if ($auth_valid) { @@ -440,4 +440,4 @@ class plugin_totp { } } -?> \ No newline at end of file +?> diff --git a/core/contacts/contact_auth.php b/core/contacts/contact_auth.php index b5c9335960..e43356017f 100644 --- a/core/contacts/contact_auth.php +++ b/core/contacts/contact_auth.php @@ -61,7 +61,7 @@ if ($_SESSION['contact_auth']['source'] == 'google') { if (isset($_REQUEST['signout'])) { unset($_SESSION['contact_auth']['token']); message::add($text['message-google_signed_out']); - header("Location: https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=".(($_SERVER["HTTPS"] == "on") ? "https" : "http")."://".$_SERVER['HTTP_HOST'].PROJECT_PATH."/app/contacts/".$_SESSION['contact_auth']['referer']); + header("Location: https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=".(($_SERVER["HTTPS"] == "on") ? "https" : "http")."://".$_SERVER['HTTP_HOST'].PROJECT_PATH."/core/contacts/".$_SESSION['contact_auth']['referer']); exit; } @@ -117,4 +117,4 @@ else { exit; } -?> \ No newline at end of file +?> diff --git a/core/contacts/contact_edit.php b/core/contacts/contact_edit.php index fe01c2eaeb..d8d1767eab 100644 --- a/core/contacts/contact_edit.php +++ b/core/contacts/contact_edit.php @@ -963,10 +963,10 @@ } }; if (search) { - xhttp.open("GET", "/app/contacts/contact_json.php?search="+search, true); + xhttp.open("GET", "/core/contacts/contact_json.php?search="+search, true); } else { - xhttp.open("GET", "/app/contacts/contact_json.php", true); + xhttp.open("GET", "/core/contacts/contact_json.php", true); } xhttp.send(); } diff --git a/core/contacts/contact_relation_edit.php b/core/contacts/contact_relation_edit.php index 66436d4150..f223e084e5 100644 --- a/core/contacts/contact_relation_edit.php +++ b/core/contacts/contact_relation_edit.php @@ -241,10 +241,10 @@ } }; if (search) { - xhttp.open("GET", "/app/contacts/contact_json.php?search="+search, true); + xhttp.open("GET", "/core/contacts/contact_json.php?search="+search, true); } else { - xhttp.open("GET", "/app/contacts/contact_json.php", true); + xhttp.open("GET", "/core/contacts/contact_json.php", true); } xhttp.send(); } diff --git a/core/contacts/resources/dashboard/config.php b/core/contacts/resources/dashboard/config.php index 09f7ca8b64..4f076d885c 100644 --- a/core/contacts/resources/dashboard/config.php +++ b/core/contacts/resources/dashboard/config.php @@ -5,7 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = '3b0cbb2f-733d-4646-8332-7d108808f2f $array['dashboard'][$x]['dashboard_name'] = 'Contacts'; $array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-regular fa-address-card'; -$array['dashboard'][$x]['dashboard_url'] = '/app/contacts/contacts.php'; +$array['dashboard'][$x]['dashboard_url'] = '/core/contacts/contacts.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; $array['dashboard'][$x]['dashboard_height'] = ''; diff --git a/resources/classes/menu.php b/resources/classes/menu.php index 6c00fa7aa8..9476a69142 100644 --- a/resources/classes/menu.php +++ b/resources/classes/menu.php @@ -1082,7 +1082,7 @@ if (!class_exists('menu')) { $user_graphic = ""; //overwrite user graphic with image from session, if exists if ($this->settings->get('theme', 'body_header_user_image', true) == true && !empty($_SESSION['user']['contact_image']) && is_uuid($_SESSION['user']['contact_image'])) { - $user_graphic = ""; + $user_graphic = ""; } $html .= "