diff --git a/app/call_forward/call_forward.php b/app/call_forward/call_forward.php index e95fa55f1e..cdb478d034 100644 --- a/app/call_forward/call_forward.php +++ b/app/call_forward/call_forward.php @@ -209,6 +209,9 @@ } require_once "resources/header.php"; +//set the back button + $_SESSION['call_forward_back'] = $_SERVER['PHP_SELF']; + //show the content if ($is_included) { echo "
\n"; diff --git a/app/call_forward/call_forward_edit.php b/app/call_forward/call_forward_edit.php index 2683a22901..a1b2bc6e72 100644 --- a/app/call_forward/call_forward_edit.php +++ b/app/call_forward/call_forward_edit.php @@ -533,13 +533,16 @@ $object = new token; $token = $object->create($_SERVER['PHP_SELF']); +//save the back button location using referer + $back_destination = "window.location.href='" . ($_SESSION['call_forward_back'] ?? "/app/call_forward/call_forward.php") . "'"; + //show the content echo "
\n"; echo "
\n"; echo "
".$text['title-call_forward']."
\n"; echo "
\n"; - echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','onclick'=>'history.back();']); + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','onclick'=>$back_destination]); echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','style'=>'margin-left: 15px;']); echo "
\n"; echo "
\n"; diff --git a/app/calls_active/app_languages.php b/app/calls_active/app_languages.php index f87811d1fc..83d93f15a6 100644 --- a/app/calls_active/app_languages.php +++ b/app/calls_active/app_languages.php @@ -468,8 +468,8 @@ $text['label-domain']['zh-cn'] = "领域"; $text['label-domain']['ja-jp'] = "ドメイン"; $text['label-domain']['ko-kr'] = "도메인"; -$text['label-destination']['en-us'] = "Dest"; -$text['label-destination']['en-gb'] = "Dest"; +$text['label-destination']['en-us'] = "Destination"; +$text['label-destination']['en-gb'] = "Destination"; $text['label-destination']['ar-eg'] = "الوجهة"; $text['label-destination']['de-at'] = "Ziel"; $text['label-destination']['de-ch'] = "Ziel"; @@ -546,8 +546,8 @@ $text['label-codec']['zh-cn'] = "读/写编解码器"; $text['label-codec']['ja-jp'] = "読み取り/書き込みコーデック"; $text['label-codec']['ko-kr'] = "읽기/쓰기 코덱"; -$text['label-cid-number']['en-us'] = "CID Number"; -$text['label-cid-number']['en-gb'] = "CID Number"; +$text['label-cid-number']['en-us'] = "Caller Number"; +$text['label-cid-number']['en-gb'] = "Caller Number"; $text['label-cid-number']['ar-eg'] = "رقم CID"; $text['label-cid-number']['de-at'] = "Anrufer Nummer"; $text['label-cid-number']['de-ch'] = "Anrufer Nummer"; @@ -572,8 +572,8 @@ $text['label-cid-number']['zh-cn'] = "来电号码"; $text['label-cid-number']['ja-jp'] = "CID番号"; $text['label-cid-number']['ko-kr'] = "CID 번호"; -$text['label-cid-name']['en-us'] = "CID Name"; -$text['label-cid-name']['en-gb'] = "CID Name"; +$text['label-cid-name']['en-us'] = "Caller Name"; +$text['label-cid-name']['en-gb'] = "Caller Name"; $text['label-cid-name']['ar-eg'] = "اسم CID"; $text['label-cid-name']['de-at'] = "Anrufer Name"; $text['label-cid-name']['de-ch'] = "Anrufer Name"; @@ -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..567951aa52 100644 --- a/app/calls_active/calls_active_inc.php +++ b/app/calls_active/calls_active_inc.php @@ -88,10 +88,8 @@ } $num_rows = @sizeof($rows); - //if the connnection is available then run it and return the results if (!$event_socket) { - $msg = "
".$text['confirm-socket']."
"; echo "
\n"; echo "\n"; @@ -103,172 +101,203 @@ echo "\n"; echo "
\n"; echo "
\n"; - + return; } - else { - //create token - $object = new token; - $token = $object->create('/app/calls_active/calls_active_inc.php'); +//create token + $object = new token; + $token = $object->create('/app/calls_active/calls_active_inc.php'); - //show content - echo "
\n"; - echo "
".$text['title']."
".number_format($num_rows)."
\n"; - echo "
\n"; - echo " ".button::create(['type'=>'button','title'=>$text['label-refresh_pause'],'icon'=>'sync-alt fa-spin','onclick'=>'refresh_stop()']).""; - if (permission_exists('call_active_eavesdrop') && !empty($_SESSION['user']['extensions'])) { - if (sizeof($_SESSION['user']['extensions']) > 1) { - echo " \n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + } + else if (sizeof($_SESSION['user']['extensions']) == 1) { + echo " \n"; + } + } + if (permission_exists('call_active_hangup') && $rows) { + echo button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'phone-slash','id'=>'btn_delete','onclick'=>"refresh_stop(); modal_open('modal-hangup','btn_hangup');"]); + } + if (permission_exists('call_active_all')) { + if ($show == "all") { + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'link'=>'calls_active.php','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + } + else { + echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'calls_active.php?show=all','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + } + } + echo "
\n"; + echo "
\n"; + echo "
\n"; + + if (permission_exists('call_active_hangup') && $rows) { + echo modal::create(['id'=>'modal-hangup','type'=>'general','message'=>$text['confirm-hangups'],'actions'=>button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'check','id'=>'btn_hangup','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('hangup'); list_form_submit('form_list');"])]); + } + + echo $text['description']."\n"; + echo "

\n"; + +//show the results + echo "
\n"; + + echo "\n"; + echo "\n"; + + echo "
\n"; + echo " \n"; + echo " \n"; + if (permission_exists('call_active_hangup')) { + echo " \n"; + } + echo " \n"; + //echo" \n"; + echo " \n"; + if ($show == 'all') { + echo " \n"; + } + //echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) { + echo " \n"; + } + echo " \n"; + + if (is_array($rows)) { + $x = 0; + foreach ($rows as $row) { + + //set the php variables + foreach ($row as $key => $value) { + $$key = $value; + } + + //get the sip profile + $name_array = explode("/", $name); + $sip_profile = $name_array[1]; + $sip_uri = $name_array[2]; + + //get the number + //$temp_array = explode("@", $sip_uri); + //$tmp_number = $temp_array[0]; + //$tmp_number = str_replace("sip:", "", $tmp_number); + + //remove the '+' because it breaks the call recording + $cid_num = str_replace("+", "", $cid_num); + + //replace gateway uuid with name + if (is_array($_SESSION['gateways']) && sizeof($_SESSION['gateways']) > 0) { + foreach ($_SESSION['gateways'] as $gateway_uuid => $gateway_name) { + $application_data = str_replace($gateway_uuid, $gateway_name, $application_data); } - echo " \n"; } - else if (sizeof($_SESSION['user']['extensions']) == 1) { - echo " \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); + + //reduce too long app data + if(strlen($application_data) > 80) { + $application_data = substr($application_data, 0, 80) . '...'; } - } - if (permission_exists('call_active_hangup') && $rows) { - echo button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'phone-slash','id'=>'btn_delete','onclick'=>"refresh_stop(); modal_open('modal-hangup','btn_hangup');"]); - } - if (permission_exists('call_active_all')) { - if ($show == "all") { - echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'link'=>'calls_active.php','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + + //send the html + echo " \n"; + if (permission_exists('call_active_hangup')) { + echo " \n"; } - else { - echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'calls_active.php?show=all','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + echo " \n"; + //echo " \n"; + echo " \n"; + if ($show == 'all') { + echo " \n"; } - } - echo " \n"; - echo "
\n"; - echo "\n"; - - if (permission_exists('call_active_hangup') && $rows) { - echo modal::create(['id'=>'modal-hangup','type'=>'general','message'=>$text['confirm-hangups'],'actions'=>button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'check','id'=>'btn_hangup','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('hangup'); list_form_submit('form_list');"])]); - } - - echo $text['description']."\n"; - echo "

\n"; - - //show the results - echo "
\n"; - - echo "\n"; - echo "\n"; - - echo "
\n"; - echo "
\n"; + echo " \n"; + echo " ".$text['label-profile']."".$text['label-created']."".$text['label-duration']."".$text['label-domain']."".$text['label-number']."".$text['label-cid-name']."".$text['label-cid-number']."".$text['label-destination']."".$text['label-app']."".$text['label-codec']."".$text['label-secure']." 
\n"; + echo " \n"; + echo " \n"; + echo " ".escape($sip_profile)." ".escape($created)." ".escape($elapsed_time)."".escape($domain_name)." 
\n"; - echo "\n"; - if (permission_exists('call_active_hangup')) { - echo " \n"; - } - echo " \n"; - echo " \n"; - if ($show == 'all') { - echo " \n"; - } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) { - echo " \n"; - } - echo "\n"; - - if (is_array($rows)) { - $x = 0; - foreach ($rows as $row) { - - //set the php variables - foreach ($row as $key => $value) { - $$key = $value; - } - - //get the sip profile - $name_array = explode("/", $name); - $sip_profile = $name_array[1]; - $sip_uri = $name_array[2]; - - //get the number - $temp_array = explode("@", $sip_uri); - $tmp_number = $temp_array[0]; - $tmp_number = str_replace("sip:", "", $tmp_number); - - //remove the '+' because it breaks the call recording - $cid_num = str_replace("+", "", $cid_num); - - //replace gateway uuid with name - if (is_array($_SESSION['gateways']) && sizeof($_SESSION['gateways']) > 0) { - foreach ($_SESSION['gateways'] as $gateway_uuid => $gateway_name) { - $application_data = str_replace($gateway_uuid, $gateway_name, $application_data); - } - } - - // reduce too long app data - if(strlen($application_data) > 512) { - $application_data = substr($application_data, 0, 512) . '...'; - } - - //send the html - echo "\n"; - if (permission_exists('call_active_hangup')) { - echo " \n"; - } - echo " \n"; - echo " \n"; - if ($show == 'all') { - echo " \n"; - } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) { - echo " \n"; - } - echo "\n"; - - //unset the domain name - unset($domain_name); - - //increment counter - $x++; + //echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) { + echo " \n"; } - unset($rows); - } + echo " \n"; - echo "
\n"; - echo " \n"; - echo " ".$text['label-profile']."".$text['label-created']."".$text['label-domain']."".$text['label-number']."".$text['label-cid-name']."".$text['label-cid-number']."".$text['label-destination']."".$text['label-app']."".$text['label-codec']."".$text['label-secure']." 
\n"; - echo " \n"; - echo " \n"; - echo " ".escape($sip_profile)." ".escape($created)." ".escape($domain_name)." ".escape($tmp_number)." ".escape($cid_name)." ".escape($cid_num)." ".escape($dest)." ".(!empty($application) ? escape($application).":".escape($application_data) : null)." ".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." ".escape($secure)." \n"; - //eavesdrop - if (permission_exists('call_active_eavesdrop') && $callstate == 'ACTIVE' && !empty($_SESSION['user']['extensions']) && !in_array($cid_num, $_SESSION['user']['extensions'])) { - echo button::create(['type'=>'button','label'=>$text['label-eavesdrop'],'icon'=>'headphones','collapse'=>'hide-lg-dn','onclick'=>"if (confirm('".$text['confirm-eavesdrop']."')) { eavesdrop_call('".escape($cid_num)."','".escape($uuid)."'); } else { this.blur(); return false; }",'onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); - } - //hangup - if (permission_exists('call_active_hangup')) { - echo button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'phone-slash','collapse'=>'hide-lg-dn','onclick'=>"if (confirm('".$text['confirm-hangup']."')) { list_self_check('checkbox_".$x."'); list_action_set('hangup'); list_form_submit('form_list'); } else { this.blur(); return false; }",'onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); - } - echo "
".escape($tmp_number)." ".escape($cid_name)." ".escape($cid_num)." ".escape($dest)." ".(!empty($application) ? escape($application).":".escape($application_data) : null)." ".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." ".escape($secure)." \n"; + //eavesdrop + if (permission_exists('call_active_eavesdrop') && $callstate == 'ACTIVE' && !empty($_SESSION['user']['extensions']) && !in_array($cid_num, $_SESSION['user']['extensions'])) { + echo button::create(['type'=>'button','label'=>$text['label-eavesdrop'],'icon'=>'headphones','collapse'=>'hide-lg-dn','onclick'=>"if (confirm('".$text['confirm-eavesdrop']."')) { eavesdrop_call('".escape($cid_num)."','".escape($uuid)."'); } else { this.blur(); return false; }",'onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + } + //hangup + if (permission_exists('call_active_hangup')) { + echo button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'phone-slash','collapse'=>'hide-lg-dn','onclick'=>"if (confirm('".$text['confirm-hangup']."')) { list_self_check('checkbox_".$x."'); list_action_set('hangup'); list_form_submit('form_list'); } else { this.blur(); return false; }",'onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']); + } + echo "
\n"; - echo "
\n"; - - echo "\n"; - - echo "\n"; + //unset the domain name + unset($domain_name); + //increment counter + $x++; + } } + echo " \n"; + echo "
\n"; + echo "\n"; + echo "\n"; + ?> diff --git a/app/destinations/app_config.php b/app/destinations/app_config.php index 3e9b0f81f2..6f47d1103a 100644 --- a/app/destinations/app_config.php +++ b/app/destinations/app_config.php @@ -167,6 +167,10 @@ $y++; $apps[$x]['permissions'][$y]['name'] = "destination_local"; $y++; + $apps[$x]['permissions'][$y]['name'] = "destination_email"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; //default settings $y = 0; @@ -397,6 +401,10 @@ $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description."; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_email"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to send email notifications of incoming SMS/MMS messages"; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz'; $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date'; diff --git a/app/destinations/app_languages.php b/app/destinations/app_languages.php index 56cd95c73e..b7c72ecba5 100644 --- a/app/destinations/app_languages.php +++ b/app/destinations/app_languages.php @@ -1162,6 +1162,33 @@ $text['label-destination_conditions']['zh-cn'] = "状况"; $text['label-destination_conditions']['ja-jp'] = "条件"; $text['label-destination_conditions']['ko-kr'] = "정황"; +$text['label-destination_email']['en-us'] = "Email Notifications"; +$text['label-destination_email']['en-gb'] = "Email Notifications"; +$text['label-destination_email']['ar-eg'] = "إشعارات البريد الإلكتروني"; +$text['label-destination_email']['de-at'] = "E-Mail-Benachrichtigungen"; +$text['label-destination_email']['de-ch'] = "E-Mail-Benachrichtigungen"; +$text['label-destination_email']['de-de'] = "E-Mail-Benachrichtigungen"; +$text['label-destination_email']['el-gr'] = "Ειδοποιήσεις μέσω ηλεκτρονικού ταχυδρομείου"; +$text['label-destination_email']['es-cl'] = "Notificaciones por correo electrónico"; +$text['label-destination_email']['es-mx'] = "Notificaciones por correo electrónico"; +$text['label-destination_email']['fr-ca'] = "Notifications par courriel"; +$text['label-destination_email']['fr-fr'] = "Notifications par e-mail"; +$text['label-destination_email']['he-il'] = "התראות דוא\"ל"; +$text['label-destination_email']['it-it'] = "Notifiche via email"; +$text['label-destination_email']['ka-ge'] = "ელ.ფოსტით შეტყობინებები"; +$text['label-destination_email']['nl-nl'] = "E-mailmeldingen"; +$text['label-destination_email']['pl-pl'] = "Powiadomienia e-mail"; +$text['label-destination_email']['pt-br'] = "Notificações por e-mail"; +$text['label-destination_email']['pt-pt'] = "Notificações por e-mail"; +$text['label-destination_email']['ro-ro'] = "Notificări prin e-mail"; +$text['label-destination_email']['ru-ru'] = "Уведомления по электронной почте"; +$text['label-destination_email']['sv-se'] = "E-postmeddelanden"; +$text['label-destination_email']['uk-ua'] = "Повідомлення електронною поштою"; +$text['label-destination_email']['tr-tr'] = "E-posta Bildirimleri"; +$text['label-destination_email']['zh-cn'] = "邮件通知"; +$text['label-destination_email']['ja-jp'] = "メール通知"; +$text['label-destination_email']['ko-kr'] = "이메일 알림"; + $text['option-caller_id_number']['en-us'] = "Caller ID Number"; $text['option-caller_id_number']['en-gb'] = "Caller ID Number"; $text['option-caller_id_number']['ar-eg'] = "رقم المتصل"; @@ -2352,6 +2379,33 @@ $text['description-usage']['zh-cn'] = "设置目的地的使用方式。"; $text['description-usage']['ja-jp'] = "宛先の使用方法を設定します。"; $text['description-usage']['ko-kr'] = "대상이 사용되는 방식을 설정합니다."; +$text['description-destination_email']['en-us'] = "Choose whether to send SMS and MMS messages to User's email"; +$text['description-destination_email']['en-gb'] = "Choose whether to send SMS and MMS messages to User's email"; +$text['description-destination_email']['ar-eg'] = "اختر ما إذا كنت ترغب في إرسال رسائل SMS و MMS إلى بريد المستخدم الإلكتروني"; +$text['description-destination_email']['de-at'] = "Wählen Sie, ob SMS- und MMS-Nachrichten an die E-Mail des Benutzers gesendet werden sollen"; +$text['description-destination_email']['de-ch'] = "Wählen Sie, ob SMS- und MMS-Nachrichten an die E-Mail des Benutzers gesendet werden sollen"; +$text['description-destination_email']['de-de'] = "Wählen Sie, ob SMS- und MMS-Nachrichten an die E-Mail des Benutzers gesendet werden sollen"; +$text['description-destination_email']['el-gr'] = "Επιλέξτε αν θέλετε να στείλετε μηνύματα SMS και MMS στο email του χρήστη"; +$text['description-destination_email']['es-cl'] = "Elija si desea enviar mensajes SMS y MMS al correo electrónico del usuario"; +$text['description-destination_email']['es-mx'] = "Elija si desea enviar mensajes SMS y MMS al correo electrónico del usuario"; +$text['description-destination_email']['fr-ca'] = "Choisissez si vous souhaitez envoyer des messages SMS et MMS à l'email de l'utilisateur"; +$text['description-destination_email']['fr-fr'] = "Choisissez si vous souhaitez envoyer des messages SMS et MMS à l'email de l'utilisateur"; +$text['description-destination_email']['he-il'] = "בחר אם לשלוח הודעות SMS ו-MMS לדוא\"ל של המשתמש"; +$text['description-destination_email']['it-it'] = "Scegli se inviare messaggi SMS e MMS all'email dell'utente"; +$text['description-destination_email']['ka-ge'] = "აირჩიეთ, გსურთ თუ არა SMS და MMS შეტყობინებების გაგზავნა მომხმარებლის ელ.ფოსტაზე"; +$text['description-destination_email']['nl-nl'] = "Kies of je SMS- en MMS-berichten naar de e-mail van de gebruiker wilt sturen"; +$text['description-destination_email']['pl-pl'] = "Wybierz, czy chcesz wysłać wiadomości SMS i MMS na adres e-mail użytkownika"; +$text['description-destination_email']['pt-br'] = "Escolha se deseja enviar mensagens SMS e MMS para o e-mail do usuário"; +$text['description-destination_email']['pt-pt'] = "Escolha se deseja enviar mensagens SMS e MMS para o e-mail do usuário"; +$text['description-destination_email']['ro-ro'] = "Alegeți dacă doriți să trimiteți mesaje SMS și MMS la adresa de e-mail a utilizatorului"; +$text['description-destination_email']['ru-ru'] = "Выберите, хотите ли вы отправлять SMS и MMS сообщения на электронную почту пользователя"; +$text['description-destination_email']['sv-se'] = "Välj om du vill skicka SMS- och MMS-meddelanden till användarens e-post"; +$text['description-destination_email']['uk-ua'] = "Виберіть, чи хочете ви надсилати SMS і MMS повідомлення на електронну пошту користувача"; +$text['description-destination_email']['tr-tr'] = "Kullanıcının e-posta adresine SMS ve MMS mesajları gönderilip gönderilmeyeceğini seçin"; +$text['description-destination_email']['zh-cn'] = "选择是否将SMS和MMS消息发送到用户的电子邮件"; +$text['description-destination_email']['ja-jp'] = "ユーザーのメールにSMSおよびMMSメッセージを送信するかどうかを選択してください"; +$text['description-destination_email']['ko-kr'] = "사용자 이메일로 SMS 및 MMS 메시지를 보낼지 선택하세요"; + $text['billing-warning']['en-us'] = "If you are using fusionpbx billing application, make sure to add accountcode and carrier variables."; $text['billing-warning']['en-gb'] = "If you are using fusionpbx billing application, make sure to add accountcode and carrier variables."; $text['billing-warning']['ar-eg'] = "إذا كنت تستخدم تطبيق فواتير الدمج، تأكد من إضافة رمز الحساب والمتغيرات الناقلة."; diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index cfffa03f70..ba185c3c75 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -130,6 +130,7 @@ $destination_type_text = $_POST["destination_type_text"] ?? null; $destination_type_emergency = $_POST["destination_type_emergency"] ?? null; $destination_carrier = $_POST["destination_carrier"] ?? null; + $destination_email = $_POST["destination_email"]; //sanitize the destination conditions if (!empty($destination_conditions)) { @@ -314,6 +315,9 @@ if (!permission_exists('destination_domain')) { $domain_uuid = $row["domain_uuid"] ?? null; } + if (!permission_exists('destination_email')) { + $destination_email = $row["destination_email"] ?? null; + } } unset($row); @@ -1090,6 +1094,7 @@ $array['destinations'][$x]["destination_distinctive_ring"] = $destination_distinctive_ring; } $array['destinations'][$x]["destination_record"] = $destination_record; + $array['destinations'][$x]["destination_email"] = $destination_email; if (!empty($destination_ringback) && $ringbacks->valid($destination_ringback)) { $array['destinations'][$x]["destination_ringback"] = $destination_ringback; } @@ -1270,6 +1275,7 @@ $destination_order = $destination_order ?? ''; $destination_enabled = $destination_enabled ?? ''; $destination_description = $destination_description ?? ''; + $destination_email = $destination_email ?? ''; $select_style = $select_style ?? ''; //pre-populate the form @@ -1316,6 +1322,7 @@ $destination_order = $row["destination_order"]; $destination_enabled = $row["destination_enabled"]; $destination_description = $row["destination_description"]; + $destination_email = $row["destination_email"]; } unset($sql, $parameters, $row); } @@ -1815,6 +1822,34 @@ echo "\n"; } + //destination email + if (permission_exists('destination_email') && permission_exists('message_view')) { + echo "\n"; + echo "\n"; + echo " ".$text['label-destination_email']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-destination_email']."\n"; + echo "\n"; + echo "\n"; + } + //users if (permission_exists('user_edit')) { echo "\n"; diff --git a/app/destinations/resources/classes/destinations.php b/app/destinations/resources/classes/destinations.php index 1c043ba153..6b05c30c64 100644 --- a/app/destinations/resources/classes/destinations.php +++ b/app/destinations/resources/classes/destinations.php @@ -402,7 +402,7 @@ if (!class_exists('destinations')) { } } //application: hangup - if (!empty($data['application'])) { + if (!empty($data['application']) && $data['application'] === 'hangup') { $select_value = str_replace("transfer", $data['application'], $select_value); } } 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 index c5cd45d13b..9e1d3952eb --- 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 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 index 963b17abe9..0b116a691c --- 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); - 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; diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index b04b7a3705..8542c3430b 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -1061,6 +1061,9 @@ $object = new token; $token = $object->create($_SERVER['PHP_SELF']); +//set the back button + $_SESSION['call_forward_back'] = $_SERVER['PHP_SELF'] . "?id=$extension_uuid"; + //begin the page content require_once "resources/header.php"; if ($action == "update") { 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 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++; 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..194956d409 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 .= "