\n";
echo "\n";
echo " ".$text['label-voicemail_transcription_enabled']."\n";
@@ -1904,10 +1943,10 @@
echo " ".$text['label-call_group']."\n";
echo " \n";
echo "\n";
- if (!empty($_SESSION['call_group']['name']) && is_array($_SESSION['call_group']['name'])) {
+ if (!empty($settings->get('call_group', 'name')) && is_array($settings->get('call_group', 'name'))) {
echo " \n";
echo " \n";
- foreach ($_SESSION['call_group']['name'] as $name) {
+ foreach ($settings->get('call_group', 'name') as $name) {
if ($name == $call_group) {
echo " ".escape($name)." \n";
}
@@ -2271,7 +2310,7 @@
echo " ".$text['label-enabled']."\n";
echo " \n";
echo "\n";
- if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') {
+ if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') {
echo " \n";
echo " \n";
echo " \n";
@@ -2311,7 +2350,7 @@
echo " \n";
echo " ";
if (!permission_exists('extension_domain')) {
- echo " ";
+ echo " ";
}
echo " ";
echo " ";
diff --git a/app/extensions/extensions.php b/app/extensions/extensions.php
index 12eb539b7d..fac86bdfb3 100644
--- a/app/extensions/extensions.php
+++ b/app/extensions/extensions.php
@@ -339,8 +339,12 @@
if (is_array($extensions) && @sizeof($extensions) != 0) {
$x = 0;
foreach($extensions as $row) {
+ $list_row_url = '';
if (permission_exists('extension_edit')) {
$list_row_url = "extension_edit.php?id=".urlencode($row['extension_uuid']).(is_numeric($page) ? '&page='.urlencode($page) : null);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo "\n";
if (permission_exists('extension_enabled') || permission_exists('extension_delete')) {
@@ -447,3 +451,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/fax/app_config.php b/app/fax/app_config.php
index db9727586e..75f64f9b62 100644
--- a/app/fax/app_config.php
+++ b/app/fax/app_config.php
@@ -312,7 +312,23 @@
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "The information contained in this facsimile is intended for the sole confidential use of the recipient(s) designated above, and may contain confidential and legally privileged information. If you are not the intended recipient, you are hereby notified that the review, disclosure, dissemination, distribution, copying, duplication in any form, and taking of any action in regards to the contents of this document - except with respect to its direct delivery to the intended recipient - is strictly prohibited. Please notify the sender immediately and destroy this cover sheet and all attachments. If stored or viewed electronically, please permanently delete it from your system.";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
- $apps[$x]['default_settings'][$y]['default_setting_description'] = "Notice displayed in the footer of the cover sheet.";
+ $apps[$x]['default_settings'][$y]['default_setting_description'] = "Default text to populate the Footer field of a new fax (displayed below the box on the cover sheet).";
+ $y++;
+ $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "034a7f00-9455-4354-978e-7978d193f675";
+ $apps[$x]['default_settings'][$y]['default_setting_category'] = "fax";
+ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "cover_message";
+ $apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
+ $apps[$x]['default_settings'][$y]['default_setting_value'] = "";
+ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
+ $apps[$x]['default_settings'][$y]['default_setting_description'] = "Default text to populate the Message field of a new fax (displayed inside the box on the cover sheet).";
+ $y++;
+ $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "760eb1ec-249a-4482-bdc4-3fd35d604db9";
+ $apps[$x]['default_settings'][$y]['default_setting_category'] = "fax";
+ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "cover_message_height";
+ $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
+ $apps[$x]['default_settings'][$y]['default_setting_value'] = "6.15";
+ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
+ $apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the default height (inches) of the Message box on the cover sheet.";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "e907df99-6b3a-4864-bd11-681888f20289";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "fax";
@@ -320,7 +336,7 @@
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
- $apps[$x]['default_settings'][$y]['default_setting_description'] = "Default information displayed beneath the logo in the header of the cover sheet.";
+ $apps[$x]['default_settings'][$y]['default_setting_description'] = "Default text to populate the Header field of a new fax (displayed near the top of the cover sheet, beneath the logo).";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "8338a404-3966-416e-b4f9-a1ac36c37bd1";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "fax";
diff --git a/app/fax/fax.php b/app/fax/fax.php
index f87e1e63df..125a7b1305 100644
--- a/app/fax/fax.php
+++ b/app/fax/fax.php
@@ -247,8 +247,12 @@
if (is_array($result) && @sizeof($result) != 0) {
$x = 0;
foreach ($result as $row) {
+ $list_row_url = '';
if (permission_exists('fax_extension_edit')) {
$list_row_url = "fax_edit.php?id=".urlencode($row['fax_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if (permission_exists('fax_extension_add') || permission_exists('fax_extension_delete')) {
@@ -325,3 +329,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php
index fff0a9d60f..9c6b59e9f7 100644
--- a/app/fax/fax_send.php
+++ b/app/fax/fax_send.php
@@ -433,7 +433,7 @@ if (!function_exists('fax_split_dtmf')) {
if (in_array($logo_fileext, ['gif','jpg','jpeg','png','bmp'])) {
if (file_exists($logo_dirname.'/'.$logo_filename)) {
$logo = $logo_dirname.'/'.$logo_filename;
- $display_logo = true;
+ $display_logo = true;
}
else {
$raw = file_get_contents($logo);
@@ -568,7 +568,13 @@ if (!function_exists('fax_split_dtmf')) {
unset($yn);
}
else {
- $pdf->Rect($x + 0.5, $y + 3.4, 7.5, 6.25, 'D');
+ //determine cover message box height, and difference, to adjust footer position accordingly
+ $cover_message_height = $setting->get('fax','cover_message_height');
+ $cover_message_height = (float) ($cover_message_height ?? 6.15);
+ $height_difference = 6.15 - $cover_message_height;
+
+ // draw message box
+ $pdf->Rect($x + 0.5, $y + 3.4, 7.5, $cover_message_height, 'D');
$y = $pdf->GetY();
}
@@ -577,7 +583,7 @@ if (!function_exists('fax_split_dtmf')) {
$pdf->SetAutoPageBreak(true, 0.6);
$pdf->SetTopMargin(0.6);
$pdf->SetFont("helvetica", "", 8);
- $pdf->SetXY($x + 0.5, $y + 0.6);
+ $pdf->SetXY($x + 0.5, $y + 0.6 - (float) ($height_difference ?? 0));
$pdf->MultiCell(7.5, 0.75, $fax_footer, 0, 'C', false);
}
$pdf->SetAutoPageBreak(false);
@@ -669,7 +675,7 @@ if (!function_exists('fax_split_dtmf')) {
}
exit;
}
-
+
//prepare variables send the fax
$mail_from_address = (!empty($setting->get('fax','smtp_from'))) ? $setting->get('fax','smtp_from') : $setting->get('email','smtp_from');
@@ -746,7 +752,7 @@ if (!function_exists('fax_split_dtmf')) {
$fax_file = $dir_fax_sent."/".$fax_instance_uuid.".tif";
$common_variables = "fax_queue_uuid=".$fax_queue_uuid.",";
$common_variables .= "fax_uuid=" . $fax_uuid . ",";
- //$common_variables .= "accountcode='".$fax_accountcode."',";
+ $common_variables .= "accountcode='".$fax_accountcode."',";
$common_variables .= "sip_h_accountcode='".$fax_accountcode."',";
$common_variables .= "domain_uuid=".$domain_uuid.",";
$common_variables .= "domain_name=".$domain_name.",";
@@ -760,6 +766,8 @@ if (!function_exists('fax_split_dtmf')) {
if (!empty($provider_prefix)) {
$common_variables .= "provider_prefix='".$provider_prefix."',";
}
+ $common_variables .= "hangup_after_bridge=true,";
+ $common_variables .= "continue_on_fail=true,";
if (!empty($fax_numbers)) {
foreach ($fax_numbers as $fax_number) {
@@ -940,7 +948,7 @@ if (!defined('STDIN')) {
}
if (is_array($contact_labels)) {
//sort by name(s)
- asort($contact_labels, SORT_NATURAL);
+ asort($contact_labels, SORT_NATURAL);
}
}
@@ -1015,7 +1023,7 @@ if (!defined('STDIN')) {
echo "\n";
echo $text['description-2']." ".(permission_exists('fax_extension_view_domain') ? $text['description-3'] : null)."\n";
echo " \n";
-
+
if ($domain_enabled == false) {
echo "".$text['notice-sending-disabled']."
\n";
}
@@ -1160,7 +1168,7 @@ if (!defined('STDIN')) {
echo " ".$text['label-fax-message']."\n";
echo "\n";
echo "\n";
- echo " \n";
+ echo " \n";
echo " \n";
echo " ".$text['description-fax-message']."\n";
echo " \n";
@@ -1220,4 +1228,4 @@ function showgrid($pdf) {
}
}
*/
-?>
+?>
\ No newline at end of file
diff --git a/app/fax_queue/fax_queue.php b/app/fax_queue/fax_queue.php
index 1822255f86..5e51787f56 100644
--- a/app/fax_queue/fax_queue.php
+++ b/app/fax_queue/fax_queue.php
@@ -332,8 +332,12 @@
if (!empty($fax_queue)) {
$x = 0;
foreach ($fax_queue as $row) {
+ $list_row_url = '';
if ($permission['fax_queue_edit']) {
$list_row_url = "fax_queue_edit.php?id=".urlencode($row['fax_queue_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if ($permission['fax_queue_add'] || $permission['fax_queue_edit'] || $permission['fax_queue_delete']) {
diff --git a/app/fax_queue/resources/job/fax_send.php b/app/fax_queue/resources/job/fax_send.php
index b2fc4d3206..515364fa40 100644
--- a/app/fax_queue/resources/job/fax_send.php
+++ b/app/fax_queue/resources/job/fax_send.php
@@ -224,6 +224,23 @@
//sending the fax
if ($fax_status == 'waiting' || $fax_status == 'trying' || $fax_status == 'busy') {
+ //get the provider_prefix from the domain_variables dialplan
+ $sql = "select dialplan_detail_data from v_dialplan_details ";
+ $sql .= "where dialplan_uuid in ( ";
+ $sql .= " select dialplan_uuid from v_dialplans ";
+ $sql .= " where dialplan_name = 'domain-variables' ";
+ $sql .= " and domain_uuid = :domain_uuid ";
+ $sql .= ") ";
+ $sql .= "and dialplan_detail_data like 'provider_prefix%' ";
+ $sql .= "and dialplan_detail_enabled = 'true' ";
+ $parameters['domain_uuid'] = $domain_uuid;
+ $row = $database->select($sql, $parameters, 'row');
+ $dialplan_detail_data = $row["dialplan_detail_data"];
+ unset($sql, $parameters, $row);
+ if (!empty($dialplan_detail_data)) {
+ $provider_prefix = explode('=', $dialplan_detail_data)[1];
+ }
+
//create event socket handle
$esl = event_socket::create();
if (!$esl->is_connected()) {
@@ -310,6 +327,8 @@
$common_variables .= "fax_ident='" . escape_quote($fax_caller_id_number) . "',";
$common_variables .= "fax_header='" . escape_quote($fax_caller_id_name) . "',";
$common_variables .= "fax_file='" . escape_quote($fax_file) . "',";
+ $common_variables .= "hangup_after_bridge=true,";
+ $common_variables .= "continue_on_fail=true,";
//add the fax destination number variables
if ($local_destination) {
@@ -317,9 +336,13 @@
$common_variables .= "sip_req_user=".$fax_number.",";
}
+
//prepare the fax command
+ $channel_variables["toll_allow"] = !empty($fax_toll_allow) ? $fax_toll_allow : null;
+ $route_array = outbound_route_to_bridge($domain_uuid, $fax_prefix . $fax_number, $channel_variables);
+
if (empty($route_array)) {
- $route_array = outbound_route_to_bridge($domain_uuid, $fax_prefix . $fax_number, $channel_variables);
+ //send the internal call to the registered extension
if (count($route_array) == 0) {
//check for valid extension
$sql = "select count(extension_uuid) ";
@@ -331,18 +354,36 @@
$extension_count = $database->select($sql, $parameters, 'column');
if ($extension_count > 0) {
//send the internal call to the registered extension
- $route_array[] = "user/".$fax_number."@".$domain_name;
+ $fax_uri = "user/".$fax_number."@".$domain_name;
}
else {
+ $fax_uri = '';
$fax_status = 'failed';
}
}
}
+ else {
+ foreach($route_array as $key => $bridge) {
+ //add the bridge to the fax_uri, after first iteration add the delimiter
+ if ($key == 0) {
+ $fax_uri = $bridge;
+ }
+ else {
+ $fax_uri .= '|'.$bridge;
+ }
+
+ //add the provider_prefix
+ if (!empty($provider_prefix)) {
+ $fax_uri = preg_replace('/\${provider_prefix}/', $provider_prefix, $fax_uri);
+ }
+
+ //remove switch ${variables} from the bridge statement
+ $fax_uri = preg_replace('/\${[^}]+}/', '', $fax_uri);
+ }
+ }
//set the origination uuid
- if (!is_uuid($origination_uuid)) {
- $origination_uuid = uuid();
- }
+ $origination_uuid = uuid();
//build a list of fax variables
$dial_string = $common_variables;
@@ -364,21 +405,18 @@
//connect to event socket and send the command
if ($fax_status != 'failed' && file_exists($fax_file)) {
//send the fax and try another route if the fax fails
- foreach($route_array as $route) {
- $fax_command = "originate {" . $dial_string . ",fax_uri=".$route."}" . $route." &txfax('".$fax_file."')";
- $fax_response = event_socket::api($fax_command);
- $response = str_replace("\n", "", $fax_response);
- $response = trim(str_replace("+OK", "", $response));
- if (is_uuid($response)) {
- //originate command accepted
- $uuid = $response;
- echo "uuid: ".$uuid."\n";
- break;
- }
- else {
- //originate command failed (-ERR INVALID_GATEWAY or other errors)
- echo "response: ".$response."\n";
- }
+ $fax_command = "originate {" . $dial_string . ",fax_uri=".$fax_uri."}" . $fax_uri." &txfax('".$fax_file."')";
+ $fax_response = event_socket::api($fax_command);
+ $response = str_replace("\n", "", $fax_response);
+ $response = trim(str_replace("+OK", "", $response));
+ if (is_uuid($response)) {
+ //originate command accepted
+ $uuid = $response;
+ echo "uuid: ".$uuid."\n";
+ }
+ else {
+ //originate command failed (-ERR INVALID_GATEWAY or other errors)
+ echo "response: ".$response."\n";
}
//set the fax file name without the extension
diff --git a/app/fifo/app_config.php b/app/fifo/app_config.php
index f0871a7c7e..8dca1f66ec 100644
--- a/app/fifo/app_config.php
+++ b/app/fifo/app_config.php
@@ -5,7 +5,7 @@
$apps[$x]['uuid'] = '16589224-c876-aeb3-f59f-523a1c0801f7';
$apps[$x]['category'] = 'Switch';
$apps[$x]['subcategory'] = '';
- $apps[$x]['version'] = '2.0';
+ $apps[$x]['version'] = '2.1';
$apps[$x]['license'] = 'Mozilla Public License 1.1';
$apps[$x]['url'] = 'http://www.fusionpbx.com';
$apps[$x]['description']['en-us'] = "Queues are used to setup waiting lines for callers. Also known as FIFO Queues.";
@@ -140,11 +140,31 @@
$apps[$x]['db'][$y]['fields'][$z]['search_by'] = '';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'A feature code for the agent to login or logout of the Queue.';
$z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = "fifo_strategy";
+ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+ $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
+ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the strategy.";
+ $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'fifo_members';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search_by'] = '';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'fifo_timeout_seconds';
+ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+ $apps[$x]['db'][$y]['fields'][$z]['search_by'] = '';
+ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
+ $z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'fifo_exit_key';
+ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
+ $apps[$x]['db'][$y]['fields'][$z]['search_by'] = '';
+ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
+ $z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'fifo_exit_action';
+ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+ $apps[$x]['db'][$y]['fields'][$z]['search_by'] = '';
+ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
+ $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'fifo_music';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search_by'] = '';
@@ -268,4 +288,4 @@
//cache details
$apps[$x]['cache']['key'] = "dialplan.\${domain_name}";
-?>
+?>
\ No newline at end of file
diff --git a/app/fifo/app_languages.php b/app/fifo/app_languages.php
index 4f2a5c1ec2..cba78e315d 100644
--- a/app/fifo/app_languages.php
+++ b/app/fifo/app_languages.php
@@ -324,6 +324,87 @@ $text['description-fifo_agent_queue']['zh-cn'] = "代ēēå¾
å¼å«č
ęę„å¬
$text['description-fifo_agent_queue']['ja-jp'] = "ćØć¼ćøć§ć³ććēŗäæ”č
ćå¾
ę©ćććććć„ć¼ć§å¾
ę©äøć®é話ć«åæēćććććććć®ćć„ć¼ć";
$text['description-fifo_agent_queue']['ko-kr'] = "ģė“ģģ“ ė°ģ ģ넼 źø°ė¤ė¦¬ź±°ė ėźø°ģ“ģ ėźø° ģ¤ģø ģ ķ넼 ė°źø° ģķ ėźø°ģ“ģ
ėė¤.";
+$text['label-strategy']['en-us'] = "Strategy";
+$text['label-strategy']['en-gb'] = "Strategy";
+$text['label-strategy']['ar-eg'] = "Ų§ŁŲ§Ų³ŲŖŲ±Ų§ŲŖŁŲ¬ŁŲ©";
+$text['label-strategy']['de-at'] = "Strategie";
+$text['label-strategy']['de-ch'] = "Strategie";
+$text['label-strategy']['de-de'] = "Strategie";
+$text['label-strategy']['el-gr'] = "Ī£ĻĻαĻηγική";
+$text['label-strategy']['es-cl'] = "Estrategia";
+$text['label-strategy']['es-mx'] = "Estrategia";
+$text['label-strategy']['fr-ca'] = "StratƩgie";
+$text['label-strategy']['fr-fr'] = "StratƩgie";
+$text['label-strategy']['he-il'] = "××”×ר××××";
+$text['label-strategy']['it-it'] = "Strategia";
+$text['label-strategy']['ka-ge'] = "į”į¢į įį¢įįįį";
+$text['label-strategy']['nl-nl'] = "Strategie";
+$text['label-strategy']['pl-pl'] = "Strategia";
+$text['label-strategy']['pt-br'] = "EstratƩgia";
+$text['label-strategy']['pt-pt'] = "EstratƩgia";
+$text['label-strategy']['ro-ro'] = "Strategie";
+$text['label-strategy']['ru-ru'] = "Š”ŃŃŠ°ŃегиŃ";
+$text['label-strategy']['sv-se'] = "Strategi";
+$text['label-strategy']['uk-ua'] = "Š”ŃŃŠ°ŃегŃŃ";
+$text['label-strategy']['tr-tr'] = "Strateji";
+$text['label-strategy']['zh-cn'] = "ęē„";
+$text['label-strategy']['ja-jp'] = "ć¹ćć©ććøć¼";
+$text['label-strategy']['ko-kr'] = "ģ ėµ";
+
+$text['description-strategy']['en-us'] = "Select the ring strategy.";
+$text['description-strategy']['en-gb'] = "Select the ring strategy.";
+$text['description-strategy']['ar-eg'] = "Ų§Ų®ŲŖŁŲ§Ų± Ų§Ų³ŲŖŲ±Ų§ŲŖŁŲ¬ŁŲ© Ų§ŁŲ®Ų§ŲŖŁ
.";
+$text['description-strategy']['de-at'] = "WƤhlen Sie eine Strategie.";
+$text['description-strategy']['de-ch'] = "WƤhlen Sie eine Strategie.";
+$text['description-strategy']['de-de'] = "WƤhlen Sie eine Strategie.";
+$text['description-strategy']['el-gr'] = "ĪĻιλĪξĻε ĻĪ· ĻĻĻαĻηγική ĻĪæĻ
ΓακĻĻ
λίοĻ
.";
+$text['description-strategy']['es-cl'] = "Ingrese la estrategia de llamado.";
+$text['description-strategy']['es-mx'] = "Ingrese la estrategia de llamado.";
+$text['description-strategy']['fr-ca'] = "Choisir la statƩgie de sonnerie.";
+$text['description-strategy']['fr-fr'] = "Choisir la statƩgie de sonnerie.";
+$text['description-strategy']['he-il'] = "××ר ××Ŗ ××”×ר×××××Ŗ ×××××";
+$text['description-strategy']['it-it'] = "Selezionare la strategia di squillo.";
+$text['description-strategy']['ka-ge'] = "įįį į©įįį įįį įį” į”į¢į įį¢įįįį.";
+$text['description-strategy']['nl-nl'] = "Kies de bel strategie.";
+$text['description-strategy']['pl-pl'] = "Wybierz strategiÄ";
+$text['description-strategy']['pt-br'] = "Selecione a estraƩtia da fila";
+$text['description-strategy']['pt-pt'] = "Escolha o tipo de estratƩgia de toque.";
+$text['description-strategy']['ro-ro'] = "SelectaČi strategia de inel.";
+$text['description-strategy']['ru-ru'] = "ŠŃŠ±ŠµŃŠøŃе ŃŃŃŠ°ŃŠµŠ³ŠøŃ Š²ŃŠ·Š¾Š²Š¾Š².";
+$text['description-strategy']['sv-se'] = "VƤlj strategi fƶr ringflƶde.";
+$text['description-strategy']['uk-ua'] = "ŠŠøŠ±ŠµŃŃŃŃ ŃŃŃŠ°ŃегŃŃ ŠŗŃŠ»ŃŃŃ.";
+$text['description-strategy']['tr-tr'] = "Zil stratejisini seƧin.";
+$text['description-strategy']['zh-cn'] = "éę©åéēē„ć";
+$text['description-strategy']['ja-jp'] = "ćŖć³ć°ę¦ē„ćéøęćć¾ćć";
+$text['description-strategy']['ko-kr'] = "ė§ ģ ėµģ ģ ķķ©ėė¤.";
+
+$text['message-strategy']['en-us'] = "Please provide: Strategy";
+$text['message-strategy']['en-gb'] = "Please provide: Strategy";
+$text['message-strategy']['ar-eg'] = "ŁŲ±Ų¬Ł ŲŖŁŲÆŁŁ
Ł
Ų§ ŁŁŁ: Ų§ŁŲ§Ų³ŲŖŲ±Ų§ŲŖŁŲ¬ŁŲ©";
+$text['message-strategy']['de-at'] = "Bitte geben Sie folgendes an: Strategie";
+$text['message-strategy']['de-ch'] = "Bitte geben Sie folgendes an: Strategie";
+$text['message-strategy']['de-de'] = "Bitte geben Sie folgendes an: Strategie";
+$text['message-strategy']['el-gr'] = "ΠαĻĪĻεĻε: Ī£ĻĻαĻηγική";
+$text['message-strategy']['es-cl'] = "Por favor indique: Estrategia";
+$text['message-strategy']['es-mx'] = "Por favor indique: Estrategia";
+$text['message-strategy']['fr-ca'] = "Merci d'indiquer: StratƩgie";
+$text['message-strategy']['fr-fr'] = "Merci d'indiquer: StratƩgie";
+$text['message-strategy']['he-il'] = "× × ×הפק: ××”×ר××××";
+$text['message-strategy']['it-it'] = "Prego fornire: Strategia";
+$text['message-strategy']['ka-ge'] = "įØįįį§įįįįį: į”į¢į įį¢įįįį";
+$text['message-strategy']['nl-nl'] = "Geef aub.: Strategie";
+$text['message-strategy']['pl-pl'] = "WprowadÅŗ strategiÄ";
+$text['message-strategy']['pt-br'] = "Por favor indique: EstratƩgia";
+$text['message-strategy']['pt-pt'] = "Por favor indique: EstratƩgia";
+$text['message-strategy']['ro-ro'] = "VÄ rugÄm sÄ furnizaČi: Strategie";
+$text['message-strategy']['ru-ru'] = "ŠŠ¾Š¶Š°Š»ŃйŃŃŠ° ŃŠŗŠ°Š¶ŠøŃе: Š”ŃŃŠ°ŃегиŃ";
+$text['message-strategy']['sv-se'] = "Ange: Strategi";
+$text['message-strategy']['uk-ua'] = "ŠŃŠ“Ń Š»Š°ŃŠŗŠ°, заповнŃŃŃ: Š”ŃŃŠ°ŃегŃŃ";
+$text['message-strategy']['tr-tr'] = "Lütfen saÄlayın: Strateji";
+$text['message-strategy']['zh-cn'] = "请ęä¾ļ¼ēē„";
+$text['message-strategy']['ja-jp'] = "ęä¾ćć¦ćć ćć: ę¦ē„";
+$text['message-strategy']['ko-kr'] = "ģ ź³µķģģģ¤: ģ ėµ";
+
$text['label-fifo_members']['en-us'] = "Agents";
$text['label-fifo_members']['en-gb'] = "Agents";
$text['label-fifo_members']['ar-eg'] = "Ų¹Ł
ŁŲ§Ų”";
@@ -377,6 +458,7 @@ $text['description-fifo_members']['zh-cn'] = "代ēęÆéåēęåćéå
$text['description-fifo_members']['ja-jp'] = "ćØć¼ćøć§ć³ććÆćć„ć¼ć®ć”ć³ćć¼ć§ćććć„ć¼å
ć®é話ćÆć対åæåÆč½ćŖćØć¼ćøć§ć³ćć«åé
ććć¾ćć";
$text['description-fifo_members']['ko-kr'] = "ģģ“ģ ķøė ėźø°ģ“ģ 멤ė²ģ
ėė¤. ėźø°ģ“ģ ķµķė ģ¬ģ© ź°ė„ķ ģģ“ģ ķøģź² ė¶ė°°ė©ėė¤.";
+
$text['label-fifo_music']['en-us'] = "Music";
$text['label-fifo_music']['en-gb'] = "Music";
$text['label-fifo_music']['ar-eg'] = "Ł
ŁŲ³ŁŁŁ";
@@ -431,6 +513,162 @@ $text['description-fifo_music']['zh-cn'] = "éę©ęéēåę¶åÆä»„å¬å°ē
$text['description-fifo_music']['ja-jp'] = "ćć„ć¼ć§å¾
ę©äøć«čćäæēé³ćéøęćć¾ćć";
$text['description-fifo_music']['ko-kr'] = "ėźø°ģ“ģģ źø°ė¤ė¦¬ė ėģ ė¤ģ ģ ģė ėźø° ģģ
ģ ģ ķķģøģ.";
+$text['label-fifo_timeout_seconds']['en-us'] = 'Timeout';
+$text['label-fifo_timeout_seconds']['en-gb'] = 'Timeout';
+$text['label-fifo_timeout_seconds']['ar-eg'] = '';
+$text['label-fifo_timeout_seconds']['de-at'] = '';
+$text['label-fifo_timeout_seconds']['de-ch'] = '';
+$text['label-fifo_timeout_seconds']['de-de'] = '';
+$text['label-fifo_timeout_seconds']['el-gr'] = '';
+$text['label-fifo_timeout_seconds']['es-cl'] = '';
+$text['label-fifo_timeout_seconds']['es-mx'] = '';
+$text['label-fifo_timeout_seconds']['fr-ca'] = '';
+$text['label-fifo_timeout_seconds']['fr-fr'] = '';
+$text['label-fifo_timeout_seconds']['he-il'] = '';
+$text['label-fifo_timeout_seconds']['it-it'] = '';
+$text['label-fifo_timeout_seconds']['nl-nl'] = '';
+$text['label-fifo_timeout_seconds']['pl-pl'] = '';
+$text['label-fifo_timeout_seconds']['pt-br'] = '';
+$text['label-fifo_timeout_seconds']['pt-pt'] = '';
+$text['label-fifo_timeout_seconds']['ro-ro'] = '';
+$text['label-fifo_timeout_seconds']['ru-ru'] = '';
+$text['label-fifo_timeout_seconds']['sv-se'] = '';
+$text['label-fifo_timeout_seconds']['uk-ua'] = '';
+$text['label-fifo_timeout_seconds']['tr-tr'] = '';
+$text['label-fifo_timeout_seconds']['zh-cn'] = '';
+$text['label-fifo_timeout_seconds']['ja-jp'] = '';
+$text['label-fifo_timeout_seconds']['ko-kr'] = '';
+
+$text['description-fifo_timeout_seconds']['en-us'] = 'Enter the queue timeout seconds. 0 means no queue timeout.';
+$text['description-fifo_timeout_seconds']['en-gb'] = 'Enter the queue timeout seconds. 0 means no queue timeout.';
+$text['description-fifo_timeout_seconds']['ar-eg'] = '';
+$text['description-fifo_timeout_seconds']['de-at'] = '';
+$text['description-fifo_timeout_seconds']['de-ch'] = '';
+$text['description-fifo_timeout_seconds']['de-de'] = '';
+$text['description-fifo_timeout_seconds']['el-gr'] = '';
+$text['description-fifo_timeout_seconds']['es-cl'] = '';
+$text['description-fifo_timeout_seconds']['es-mx'] = '';
+$text['description-fifo_timeout_seconds']['fr-ca'] = '';
+$text['description-fifo_timeout_seconds']['fr-fr'] = '';
+$text['description-fifo_timeout_seconds']['he-il'] = '';
+$text['description-fifo_timeout_seconds']['it-it'] = '';
+$text['description-fifo_timeout_seconds']['nl-nl'] = '';
+$text['description-fifo_timeout_seconds']['pl-pl'] = '';
+$text['description-fifo_timeout_seconds']['pt-br'] = '';
+$text['description-fifo_timeout_seconds']['pt-pt'] = '';
+$text['description-fifo_timeout_seconds']['ro-ro'] = '';
+$text['description-fifo_timeout_seconds']['ru-ru'] = '';
+$text['description-fifo_timeout_seconds']['sv-se'] = '';
+$text['description-fifo_timeout_seconds']['uk-ua'] = '';
+$text['description-fifo_timeout_seconds']['tr-tr'] = '';
+$text['description-fifo_timeout_seconds']['zh-cn'] = '';
+$text['description-fifo_timeout_seconds']['ja-jp'] = '';
+$text['description-fifo_timeout_seconds']['ko-kr'] = '';
+
+$text['label-fifo_exit_key']['en-us'] = 'Exit Key';
+$text['label-fifo_exit_key']['en-gb'] = 'Exit Key';
+$text['label-fifo_exit_key']['ar-eg'] = '';
+$text['label-fifo_exit_key']['de-at'] = '';
+$text['label-fifo_exit_key']['de-ch'] = '';
+$text['label-fifo_exit_key']['de-de'] = '';
+$text['label-fifo_exit_key']['el-gr'] = '';
+$text['label-fifo_exit_key']['es-cl'] = '';
+$text['label-fifo_exit_key']['es-mx'] = '';
+$text['label-fifo_exit_key']['fr-ca'] = '';
+$text['label-fifo_exit_key']['fr-fr'] = '';
+$text['label-fifo_exit_key']['he-il'] = '';
+$text['label-fifo_exit_key']['it-it'] = '';
+$text['label-fifo_exit_key']['nl-nl'] = '';
+$text['label-fifo_exit_key']['pl-pl'] = '';
+$text['label-fifo_exit_key']['pt-br'] = '';
+$text['label-fifo_exit_key']['pt-pt'] = '';
+$text['label-fifo_exit_key']['ro-ro'] = '';
+$text['label-fifo_exit_key']['ru-ru'] = '';
+$text['label-fifo_exit_key']['sv-se'] = '';
+$text['label-fifo_exit_key']['uk-ua'] = '';
+$text['label-fifo_exit_key']['tr-tr'] = '';
+$text['label-fifo_exit_key']['zh-cn'] = '';
+$text['label-fifo_exit_key']['ja-jp'] = '';
+$text['label-fifo_exit_key']['ko-kr'] = '';
+
+$text['description-fifo_exit_key']['en-us'] = 'Enter the number to exit the queue.';
+$text['description-fifo_exit_key']['en-gb'] = 'Enter the number to exit the queue.';
+$text['description-fifo_exit_key']['ar-eg'] = '';
+$text['description-fifo_exit_key']['de-at'] = '';
+$text['description-fifo_exit_key']['de-ch'] = '';
+$text['description-fifo_exit_key']['de-de'] = '';
+$text['description-fifo_exit_key']['el-gr'] = '';
+$text['description-fifo_exit_key']['es-cl'] = '';
+$text['description-fifo_exit_key']['es-mx'] = '';
+$text['description-fifo_exit_key']['fr-ca'] = '';
+$text['description-fifo_exit_key']['fr-fr'] = '';
+$text['description-fifo_exit_key']['he-il'] = '';
+$text['description-fifo_exit_key']['it-it'] = '';
+$text['description-fifo_exit_key']['nl-nl'] = '';
+$text['description-fifo_exit_key']['pl-pl'] = '';
+$text['description-fifo_exit_key']['pt-br'] = '';
+$text['description-fifo_exit_key']['pt-pt'] = '';
+$text['description-fifo_exit_key']['ro-ro'] = '';
+$text['description-fifo_exit_key']['ru-ru'] = '';
+$text['description-fifo_exit_key']['sv-se'] = '';
+$text['description-fifo_exit_key']['uk-ua'] = '';
+$text['description-fifo_exit_key']['tr-tr'] = '';
+$text['description-fifo_exit_key']['zh-cn'] = '';
+$text['description-fifo_exit_key']['ja-jp'] = '';
+$text['description-fifo_exit_key']['ko-kr'] = '';
+
+$text['label-fifo_exit_action']['en-us'] = 'Exit Action';
+$text['label-fifo_exit_action']['en-gb'] = 'Exit Action';
+$text['label-fifo_exit_action']['ar-eg'] = '';
+$text['label-fifo_exit_action']['de-at'] = '';
+$text['label-fifo_exit_action']['de-ch'] = '';
+$text['label-fifo_exit_action']['de-de'] = '';
+$text['label-fifo_exit_action']['el-gr'] = '';
+$text['label-fifo_exit_action']['es-cl'] = '';
+$text['label-fifo_exit_action']['es-mx'] = '';
+$text['label-fifo_exit_action']['fr-ca'] = '';
+$text['label-fifo_exit_action']['fr-fr'] = '';
+$text['label-fifo_exit_action']['he-il'] = '';
+$text['label-fifo_exit_action']['it-it'] = '';
+$text['label-fifo_exit_action']['nl-nl'] = '';
+$text['label-fifo_exit_action']['pl-pl'] = '';
+$text['label-fifo_exit_action']['pt-br'] = '';
+$text['label-fifo_exit_action']['pt-pt'] = '';
+$text['label-fifo_exit_action']['ro-ro'] = '';
+$text['label-fifo_exit_action']['ru-ru'] = '';
+$text['label-fifo_exit_action']['sv-se'] = '';
+$text['label-fifo_exit_action']['uk-ua'] = '';
+$text['label-fifo_exit_action']['tr-tr'] = '';
+$text['label-fifo_exit_action']['zh-cn'] = '';
+$text['label-fifo_exit_action']['ja-jp'] = '';
+$text['label-fifo_exit_action']['ko-kr'] = '';
+
+$text['description-fifo_exit_action']['en-us'] = 'Select where to route the caller when exiting the queue.';
+$text['description-fifo_exit_action']['en-gb'] = 'Select where to route the caller when exiting the queue.';
+$text['description-fifo_exit_action']['ar-eg'] = '';
+$text['description-fifo_exit_action']['de-at'] = '';
+$text['description-fifo_exit_action']['de-ch'] = '';
+$text['description-fifo_exit_action']['de-de'] = '';
+$text['description-fifo_exit_action']['el-gr'] = '';
+$text['description-fifo_exit_action']['es-cl'] = '';
+$text['description-fifo_exit_action']['es-mx'] = '';
+$text['description-fifo_exit_action']['fr-ca'] = '';
+$text['description-fifo_exit_action']['fr-fr'] = '';
+$text['description-fifo_exit_action']['he-il'] = '';
+$text['description-fifo_exit_action']['it-it'] = '';
+$text['description-fifo_exit_action']['nl-nl'] = '';
+$text['description-fifo_exit_action']['pl-pl'] = '';
+$text['description-fifo_exit_action']['pt-br'] = '';
+$text['description-fifo_exit_action']['pt-pt'] = '';
+$text['description-fifo_exit_action']['ro-ro'] = '';
+$text['description-fifo_exit_action']['ru-ru'] = '';
+$text['description-fifo_exit_action']['sv-se'] = '';
+$text['description-fifo_exit_action']['uk-ua'] = '';
+$text['description-fifo_exit_action']['tr-tr'] = '';
+$text['description-fifo_exit_action']['zh-cn'] = '';
+$text['description-fifo_exit_action']['ja-jp'] = '';
+$text['description-fifo_exit_action']['ko-kr'] = '';
+
$text['label-fifo_order']['en-us'] = "Order";
$text['label-fifo_order']['en-gb'] = "Order";
$text['label-fifo_order']['ar-eg'] = "Ų·ŁŲØ";
@@ -755,6 +993,59 @@ $text['description-member_simultaneous']['zh-cn'] = "åę¶č¾å
„ęåć";
$text['description-member_simultaneous']['ja-jp'] = "ć”ć³ćć¼åęå
„åć";
$text['description-member_simultaneous']['ko-kr'] = "ķģģ ėģ ģ
ė „ķģøģ.";
+$text['option-longest_idle_agent']['en-us'] = "Longest Idle Agent";
+$text['option-longest_idle_agent']['en-gb'] = "Longest Idle Agent";
+$text['option-longest_idle_agent']['ar-eg'] = "Ų£Ų·ŁŁ Ų¹Ų§Ł
Ł Ų®Ų§Ł
Ł";
+$text['option-longest_idle_agent']['de-at'] = "Agent mit der hƶchsten Wartezeit";
+$text['option-longest_idle_agent']['de-ch'] = "Agent mit der hƶchsten Wartezeit";
+$text['option-longest_idle_agent']['de-de'] = "Agent mit der hƶchsten Wartezeit";
+$text['option-longest_idle_agent']['el-gr'] = "ΠμακĻĻĻεĻĪæĻ ĻĻάκĻĪæĻĪ±Ļ Ļε αΓĻάνεια";
+$text['option-longest_idle_agent']['es-cl'] = "Agente desocupado por mƔs tiempo";
+$text['option-longest_idle_agent']['es-mx'] = "Agente desocupado por mƔs tiempo";
+$text['option-longest_idle_agent']['fr-ca'] = "Agent inactif le plus longtemps";
+$text['option-longest_idle_agent']['fr-fr'] = "Agent inactif le plus longtemps";
+$text['option-longest_idle_agent']['he-il'] = "×”××× ×הרק ××ר×× ×××תר";
+$text['option-longest_idle_agent']['it-it'] = "Da più tempo libero";
+$text['option-longest_idle_agent']['ka-ge'] = "įįįį įį¢įį į, į įįįįįįŖ į§įįįįįį įįįį®įįį” įį§į į£į„įįį";
+$text['option-longest_idle_agent']['nl-nl'] = "Langst wachtende agent";
+$text['option-longest_idle_agent']['pl-pl'] = "Najdlużej bezczynny agent";
+$text['option-longest_idle_agent']['pt-br'] = "Agente desocupado hĆ” mais tempo";
+$text['option-longest_idle_agent']['pt-pt'] = "Agente desocupado hĆ” mais tempo";
+$text['option-longest_idle_agent']['ro-ro'] = "Cel mai lung agent inactiv";
+$text['option-longest_idle_agent']['ru-ru'] = "ŠŠ°ŠŗŃŠøŠ¼Š°Š»ŃŠ½Š¾ незанŃŃŃŠ¹ Š¾ŠæŠµŃŠ°ŃоŃ";
+$text['option-longest_idle_agent']['sv-se'] = "Agent LƤngst Ledig";
+$text['option-longest_idle_agent']['uk-ua'] = "ŠŠ°Š¹Š“Š¾Š²ŃŠµ безГŃŃŠ»Ńний агенŃ";
+$text['option-longest_idle_agent']['zh-cn'] = "ęéæē©ŗé²ä»£ē";
+$text['option-longest_idle_agent']['ja-jp'] = "ęé·ć¢ć¤ćć« ćØć¼ćøć§ć³ć";
+$text['option-longest_idle_agent']['ko-kr'] = "ź°ģ„ źø“ ģ ķ“ ģģ“ģ ķø";
+
+$text['option-simultaneous']['en-us'] = "Simultaneous";
+$text['option-simultaneous']['en-gb'] = "Simultaneous";
+$text['option-simultaneous']['ar-eg'] = "ŲØŲ³ŁŲ·Ų©";
+$text['option-simultaneous']['de-at'] = "gleichzeitig";
+$text['option-simultaneous']['de-ch'] = "gleichzeitig";
+$text['option-simultaneous']['de-de'] = "gleichzeitig";
+$text['option-simultaneous']['el-gr'] = "ΤαĻ
ĻĻĻĻονοĻ";
+$text['option-simultaneous']['es-cl'] = "Simultaneos";
+$text['option-simultaneous']['es-mx'] = "Simultaneos";
+$text['option-simultaneous']['fr-ca'] = "SimultanƩ";
+$text['option-simultaneous']['fr-fr'] = "SimultanƩ";
+$text['option-simultaneous']['he-il'] = "××××Ŗ× ××××";
+$text['option-simultaneous']['it-it'] = "Parallelo";
+$text['option-simultaneous']['ka-ge'] = "įį įįį įį£įį";
+$text['option-simultaneous']['nl-nl'] = "Gelijktijdig";
+$text['option-simultaneous']['pl-pl'] = "Jednoczesne";
+$text['option-simultaneous']['pt-br'] = "Simultâneo";
+$text['option-simultaneous']['pt-pt'] = "Simultâneo";
+$text['option-simultaneous']['ro-ro'] = "Simultan";
+$text['option-simultaneous']['ru-ru'] = "ŠŠ“Š½Š¾Š²ŃŠµŠ¼ŠµŠ½Š½Š¾Šµ";
+$text['option-simultaneous']['sv-se'] = "Samtidig";
+$text['option-simultaneous']['uk-ua'] = "Š”ŠøŠ¼ŃŠ»ŃŃŠ¾Ń";
+$text['option-simultaneous']['tr-tr'] = "EŠzamanlı";
+$text['option-simultaneous']['zh-cn'] = "åę¶";
+$text['option-simultaneous']['ja-jp'] = "åęć«";
+$text['option-simultaneous']['ko-kr'] = "ėģ";
+
$text['label-member_wrap_up_time']['en-us'] = "Wrap Up Time";
$text['label-member_wrap_up_time']['en-gb'] = "Wrap Up Time";
$text['label-member_wrap_up_time']['ar-eg'] = "ŁŁŲŖ Ų§ŁŲ®ŲŖŲ§Ł
";
@@ -836,4 +1127,4 @@ $text['label-member_enabled']['zh-cn'] = "å·²åÆēØ";
$text['label-member_enabled']['ja-jp'] = "ęå¹";
$text['label-member_enabled']['ko-kr'] = "ķģ±ķėØ";
-?>
+?>
\ No newline at end of file
diff --git a/app/fifo/fifo.php b/app/fifo/fifo.php
index 898a333c82..53f2ed7dc3 100644
--- a/app/fifo/fifo.php
+++ b/app/fifo/fifo.php
@@ -145,8 +145,8 @@
$sql .= "fifo_uuid, ";
$sql .= "fifo_name, ";
$sql .= "fifo_extension, ";
- $sql .= "fifo_agent_queue, ";
$sql .= "fifo_agent_status, ";
+ $sql .= "fifo_agent_queue, ";
$sql .= "fifo_music, ";
$sql .= "u.domain_uuid, ";
$sql .= "d.domain_name, ";
@@ -249,8 +249,8 @@
}
echo th_order_by('fifo_name', $text['label-fifo_name'], $order_by, $order);
echo th_order_by('fifo_extension', $text['label-fifo_extension'], $order_by, $order);
- echo th_order_by('fifo_agent_queue', $text['label-fifo_agent_queue'], $order_by, $order);
echo th_order_by('fifo_agent_status', $text['label-fifo_agent_status'], $order_by, $order);
+ echo th_order_by('fifo_agent_queue', $text['label-fifo_agent_queue'], $order_by, $order);
echo th_order_by('fifo_order', $text['label-fifo_order'], $order_by, $order);
echo th_order_by('fifo_enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
echo " ".$text['label-fifo_description']." \n";
@@ -264,6 +264,9 @@
foreach ($fifo as $row) {
if (permission_exists('fifo_edit')) {
$list_row_url = "fifo_edit.php?id=".urlencode($row['fifo_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if (permission_exists('fifo_add') || permission_exists('fifo_edit') || permission_exists('fifo_delete')) {
@@ -284,8 +287,8 @@
}
echo " \n";
echo " ".escape($row['fifo_extension'])." \n";
- echo " ".escape($row['fifo_agent_queue'])." \n";
echo " ".escape($row['fifo_agent_status'])." \n";
+ echo " ".escape($row['fifo_agent_queue'])." \n";
echo " ".escape($row['fifo_order'])." \n";
if (permission_exists('fifo_edit')) {
echo " \n";
@@ -319,4 +322,4 @@
//include the footer
require_once "resources/footer.php";
-?>
+?>
\ No newline at end of file
diff --git a/app/fifo/fifo_edit.php b/app/fifo/fifo_edit.php
index 0087904d74..e247ab121b 100644
--- a/app/fifo/fifo_edit.php
+++ b/app/fifo/fifo_edit.php
@@ -39,9 +39,15 @@
$language = new text;
$text = $language->get();
+//connect to the database
+ $database = database::new();
+
//add the settings object
$settings = new settings(["domain_uuid" => $_SESSION['domain_uuid'], "user_uuid" => $_SESSION['user_uuid']]);
+//setup the event socket connection
+ $event_socket = event_socket::create();
+
//set from session variables
$button_icon_back = $settings->get('theme', 'button_icon_back', '');
$button_icon_copy = $settings->get('theme', 'button_icon_copy', '');
@@ -66,7 +72,11 @@
$fifo_extension = $_POST["fifo_extension"];
$fifo_agent_status = $_POST["fifo_agent_status"];
$fifo_agent_queue = $_POST["fifo_agent_queue"];
+ $fifo_strategy = $_POST["fifo_strategy"];
$fifo_members = $_POST["fifo_members"];
+ $fifo_timeout_seconds = $_POST["fifo_timeout_seconds"];
+ $fifo_exit_key = $_POST["fifo_exit_key"];
+ $fifo_exit_action = $_POST["fifo_exit_action"];
$fifo_music = $_POST["fifo_music"];
$domain_uuid = $_POST["domain_uuid"];
$fifo_order = $_POST["fifo_order"];
@@ -104,20 +114,17 @@
switch ($_POST['action']) {
case 'copy':
if (permission_exists('fifo_add')) {
- $obj = new database;
- $obj->copy($array);
+ $database->copy($array);
}
break;
case 'delete':
if (permission_exists('fifo_delete')) {
- $obj = new database;
- $obj->delete($array);
+ $database->delete($array);
}
break;
case 'toggle':
if (permission_exists('fifo_update')) {
- $obj = new database;
- $obj->toggle($array);
+ $database->toggle($array);
}
break;
}
@@ -135,7 +142,11 @@
if (strlen($fifo_extension) == 0) { $msg .= $text['message-required']." ".$text['label-fifo_extension']." \n"; }
//if (strlen($fifo_agent_status) == 0) { $msg .= $text['message-required']." ".$text['label-fifo_agent_status']." \n"; }
//if (strlen($fifo_agent_queue) == 0) { $msg .= $text['message-required']." ".$text['label-fifo_agent_queue']." \n"; }
+ if (strlen($fifo_strategy) == 0) { $msg .= $text['message-required']." ".$text['label-fifo_strategy']." \n"; }
//if (strlen($fifo_members) == 0) { $msg .= $text['message-required']." ".$text['label-fifo_members']." \n"; }
+ //if (strlen($fifo_timeout_seconds) == 0) { $msg .= $text['message-required']." ".$text['label-fifo_timeout_seconds']." \n"; }
+ //if (strlen($fifo_exit_key) == 0) { $msg .= $text['message-required']." ".$text['label-fifo_exit_key']." \n"; }
+ //if (strlen($fifo_exit_action) == 0) { $msg .= $text['message-required']." ".$text['label-fifo_exit_action']." \n"; }
//if (strlen($fifo_music) == 0) { $msg .= $text['message-required']." ".$text['label-fifo_music']." \n"; }
if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']." \n"; }
if (strlen($fifo_order) == 0) { $msg .= $text['message-required']." ".$text['label-fifo_order']." \n"; }
@@ -177,6 +188,11 @@
$array['fifo'][0]['fifo_extension'] = $fifo_extension;
$array['fifo'][0]['fifo_agent_status'] = $fifo_agent_status;
$array['fifo'][0]['fifo_agent_queue'] = $fifo_agent_queue;
+ $array['fifo'][0]['fifo_strategy'] = $fifo_strategy;
+ $array['fifo'][0]['fifo_timeout_seconds'] = $fifo_timeout_seconds;
+ $array['fifo'][0]['fifo_exit_key'] = $fifo_exit_key;
+ $array['fifo'][0]['fifo_exit_action'] = $fifo_exit_action;
+ $array['fifo'][0]['fifo_exit_key'] = $fifo_exit_key;
$array['fifo'][0]['fifo_music'] = $fifo_music;
$array['fifo'][0]['fifo_order'] = $fifo_order;
$array['fifo'][0]['fifo_enabled'] = $fifo_enabled;
@@ -197,32 +213,85 @@
}
}
+ //send commands for agent login or agent logout
+ if (is_array($fifo_members)) {
+ foreach ($fifo_members as $row) {
+ //build the command to add or remove the agent from the FIFO queue
+ if ($row["member_enabled"] == 'true') {
+ $command = "fifo_member add ".$fifo_extension."@".$_SESSION['domain_name']." {fifo_member_wait=nowait}".$row["member_contact"]." 5 ".$row['member_call_timeout']." ".$row['member_wrap_up_time'];
+ }
+ else {
+ $command = "fifo_member del ".$fifo_extension."@".$_SESSION['domain_name']." {fifo_member_wait=nowait}".$row["member_contact"];
+ }
+ if ($event_socket->is_connected()) {
+ $response = event_socket::api($command);
+ }
+ }
+ }
+
+ //get the action destination number
+ if (!empty($fifo_exit_action)) {
+ $fifo_exit_destination = explode(':', $fifo_exit_action)[1];
+ $fifo_exit_destination = explode(' ', $fifo_exit_destination)[0];
+ }
+
//add the fifo dialplan
if (!empty($fifo_extension)) {
//escape the * symbol
$fifo_agent_status_xml = str_replace("*", "\*", $fifo_agent_status);
$fifo_agent_queue_xml = str_replace("*", "\*", $fifo_agent_queue);
+ //prepare the fifo orbit extension
+ if (!empty($fifo_exit_destination) && $fifo_timeout_seconds == 0) {
+ $fifo_orbit_exten = $fifo_exit_destination;
+ }
+ else {
+ $fifo_orbit_exten = $fifo_exit_destination.":".$fifo_timeout_seconds;
+ }
+
//build the xml dialplan
$dialplan_xml = "\n";
$dialplan_xml .= " \n";
- $dialplan_xml .= " \n";
- $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
+ if ($fifo_strategy == 'longest_idle_agent') {
+ $dialplan_xml .= " \n";
+ }
+ if ($fifo_strategy == 'simultaneous') {
+ $dialplan_xml .= " \n";
+ }
+ /*
+
+
+
+
+
+ */
+ if (!empty($fifo_exit_key)) {
+ $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
+
+ }
+ if (!empty($fifo_orbit_exten)) {
+ $dialplan_xml .= " \n";
+ }
$dialplan_xml .= " \n";
- $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
$dialplan_xml .= " \n";
- $dialplan_xml .= " \n";
- $dialplan_xml .= " \n";
- $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
$dialplan_xml .= " \n";
$dialplan_xml .= " \n";
$dialplan_xml .= " \n";
$dialplan_xml .= " \n";
- $dialplan_xml .= " \n";
- $dialplan_xml .= " \n";
- $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
$dialplan_xml .= " \n";
- $dialplan_xml .= " \n";
+ $dialplan_xml .= " \n";
$dialplan_xml .= " \n";
$dialplan_xml .= " \n";
@@ -247,7 +316,6 @@
$p->add("dialplan_edit", "temp");
//save the data
- $database = new database;
$database->app_name = 'fifo';
$database->app_uuid = '16589224-c876-aeb3-f59f-523a1c0801f7';
$result = $database->save($array);
@@ -296,6 +364,10 @@
$sql .= " fifo_extension, ";
$sql .= " fifo_agent_status, ";
$sql .= " fifo_agent_queue, ";
+ $sql .= " fifo_strategy, ";
+ $sql .= " fifo_timeout_seconds, ";
+ $sql .= " fifo_exit_key, ";
+ $sql .= " fifo_exit_action, ";
$sql .= " fifo_music, ";
$sql .= " domain_uuid, ";
$sql .= " fifo_order, ";
@@ -306,7 +378,6 @@
//$sql .= "and domain_uuid = :domain_uuid ";
//$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['fifo_uuid'] = $fifo_uuid;
- $database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) {
$dialplan_uuid = $row["dialplan_uuid"];
@@ -314,6 +385,10 @@
$fifo_extension = $row["fifo_extension"];
$fifo_agent_status = $row["fifo_agent_status"];
$fifo_agent_queue = $row["fifo_agent_queue"];
+ $fifo_strategy = $row["fifo_strategy"];
+ $fifo_timeout_seconds = $row["fifo_timeout_seconds"];
+ $fifo_exit_key = $row["fifo_exit_key"];
+ $fifo_exit_action = $row["fifo_exit_action"];
$fifo_music = $row["fifo_music"];
$domain_uuid = $row["domain_uuid"];
$fifo_order = $row["fifo_order"];
@@ -339,7 +414,6 @@
//$sql .= "and domain_uuid = '".$domain_uuid."' ";
//$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['fifo_uuid'] = $fifo_uuid;
- $database = new database;
$fifo_members = $database->select($sql, $parameters, 'all');
unset ($sql, $parameters);
}
@@ -358,16 +432,28 @@
$fifo_member_uuid = uuid();
}
-//add an empty row
- $x = isset($fifo_members) && is_array($fifo_members) ? sizeof($fifo_members) : 0;
- $fifo_members[$x]['domain_uuid'] = $_SESSION['domain_uuid'];
- $fifo_members[$x]['fifo_uuid'] = $fifo_uuid;
- $fifo_members[$x]['fifo_member_uuid'] = uuid();
- $fifo_members[$x]['member_contact'] = '';
- $fifo_members[$x]['member_call_timeout'] = '';
- //$fifo_members[$x]['member_simultaneous'] = '';
- $fifo_members[$x]['member_wrap_up_time'] = '';
- $fifo_members[$x]['member_enabled'] = '';
+//add an empty row to the members array
+ if (count($fifo_members) == 0) {
+ $rows = $settings->get('fifo', 'option_add_rows', '5');
+ $id = 0;
+ $show_option_delete = false;
+ }
+ if (count($fifo_members) > 0) {
+ $rows = $settings->get('fifo', 'option_edit_rows', '1');
+ $id = count($fifo_members)+1;
+ $show_option_delete = true;
+ }
+ for ($x = 0; $x < $rows; $x++) {
+ $fifo_members[$id]['domain_uuid'] = $_SESSION['domain_uuid'];
+ $fifo_members[$id]['fifo_uuid'] = $fifo_uuid;
+ $fifo_members[$id]['fifo_member_uuid'] = uuid();
+ $fifo_members[$id]['member_contact'] = '';
+ $fifo_members[$id]['member_call_timeout'] = '';
+ //$fifo_members[$id]['member_simultaneous'] = '';
+ $fifo_members[$id]['member_wrap_up_time'] = '';
+ $fifo_members[$id]['member_enabled'] = '';
+ $id++;
+ }
//create token
$object = new token;
@@ -377,11 +463,14 @@
$destination = new destinations;
//set the defaults
+ if (empty($fifo_timeout_seconds)) {
+ $fifo_timeout_seconds = 0;
+ }
if (empty($fifo_order)) {
$fifo_order = 50;
}
- if (!isset($fifo_enabled)) {
- // $fifo_enabled = true;
+ if (empty($fifo_enabled)) {
+ $fifo_enabled = true;
}
//show the header
@@ -396,14 +485,11 @@
echo " ".$text['title-fifo']."
\n";
echo " \n";
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$button_icon_back,'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'fifo.php']);
-// if ($action == 'update') {
-// if (permission_exists('fifo_member_add')) {
-// echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$button_icon_copy,'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
-// }
-// if (permission_exists('fifo_member_delete')) {
-// echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$button_icon_delete,'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; margin-right: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
-// }
-// }
+ if ($action == 'update') {
+ if (permission_exists('fifo_member_delete')) {
+ echo button::create(['type'=>'submit','label'=>$text['button-delete'],'icon'=>$button_icon_delete,'id'=>'btn_delete','name'=>'action','value'=>'delete','style'=>'display: none; margin-right: 15px;']);
+ }
+ }
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$button_icon_save,'id'=>'btn_save','collapse'=>'hide-xs']);
echo "
\n";
echo "
\n";
@@ -425,7 +511,7 @@
echo "\n";
echo "\n";
- echo "\n";
+ echo " \n";
echo " ".$text['label-fifo_name']."\n";
echo " \n";
echo "\n";
@@ -468,6 +554,20 @@
echo " \n";
echo " \n";
+ echo "\n";
+ echo "\n";
+ echo " ".$text['label-strategy']."\n";
+ echo " \n";
+ echo "\n";
+ echo " \n";
+ echo " ".$text['option-longest_idle_agent']." \n";
+ echo " ".$text['option-simultaneous']." \n";
+ echo " \n";
+ echo " \n";
+ echo $text['description-strategy']."\n";
+ echo " \n";
+ echo " \n";
+
echo "\n";
echo "\n";
echo " ".$text['label-fifo_members']."\n";
@@ -480,9 +580,9 @@
//echo " ".$text['label-member_simultaneous']." \n";
echo " ".$text['label-member_wrap_up_time']." \n";
echo " ".$text['label-member_enabled']." \n";
- if (is_array($fifo_members) && @sizeof($fifo_members) > 1 && permission_exists('fifo_member_delete')) {
+ if ($show_option_delete && is_array($fifo_members) && @sizeof($fifo_members) > 1 && permission_exists('fifo_member_delete')) {
echo " \n";
- echo " ".$text['label-action']." \n";
+ echo " ".$text['label-delete']." \n";
echo " \n";
echo " \n";
}
@@ -497,9 +597,9 @@
if (empty($row["member_wrap_up_time"])) { $row["member_wrap_up_time"] = '10'; }
echo " \n";
- echo " \n";
- echo " \n";
- echo " \n";
+ echo " \n";
+ echo " \n";
+ echo " \n";
echo " \n";
echo " $member_contact\n";
echo " \n";
@@ -526,7 +626,7 @@
echo " \n";
}
echo " \n";
- if (is_array($fifo_members) && @sizeof($fifo_members) > 1 && permission_exists('fifo_member_delete')) {
+ if ($show_option_delete && is_array($fifo_members) && @sizeof($fifo_members) > 1 && permission_exists('fifo_member_delete')) {
if (is_uuid($row['fifo_member_uuid'])) {
echo " \n";
echo " \n";
@@ -546,16 +646,47 @@
echo " \n";
echo " \n";
+ echo "\n";
+ echo "\n";
+ echo " ".$text['label-fifo_timeout_seconds']."\n";
+ echo " \n";
+ echo "\n";
+ echo " \n";
+ echo " \n";
+ echo $text['description-fifo_timeout_seconds']."\n";
+ echo " \n";
+ echo " \n";
+
+ echo "\n";
+ echo "\n";
+ echo " ".$text['label-fifo_exit_key']."\n";
+ echo " \n";
+ echo "\n";
+ echo " \n";
+ echo " \n";
+ echo $text['description-fifo_exit_key']."\n";
+ echo " \n";
+ echo " \n";
+
+ echo "\n";
+ echo "\n";
+ echo " ".$text['label-fifo_exit_action']."\n";
+ echo " \n";
+ echo "\n";
+ $destination = new destinations;
+ echo $destination->select('dialplan', 'fifo_exit_action', $fifo_exit_action);
+ echo " \n";
+ echo $text['description-fifo_exit_action']."\n";
+ echo " \n";
+ echo " \n";
+
echo "\n";
echo "\n";
echo " ".$text['label-fifo_music']."\n";
echo " \n";
echo "\n";
- //echo " \n";
-
$ringbacks = new ringbacks;
echo $ringbacks->select('fifo_music', $fifo_music ?? null);
-
echo " \n";
echo $text['description-fifo_music']."\n";
echo " \n";
diff --git a/app/flyingvoice/app_config.php b/app/flyingvoice/app_config.php
index 67f9c12630..a2357bb0e4 100644
--- a/app/flyingvoice/app_config.php
+++ b/app/flyingvoice/app_config.php
@@ -980,7 +980,7 @@
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "flyingvoice_voice_vad";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
- $apps[$x]['default_settings'][$y]['default_setting_value'] = "1";
+ $apps[$x]['default_settings'][$y]['default_setting_value'] = "0";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set 1 = On, 0 = Off (default)";
$y++;
diff --git a/app/gateways/gateways.php b/app/gateways/gateways.php
index cd6299c25f..06f3a7bcc7 100644
--- a/app/gateways/gateways.php
+++ b/app/gateways/gateways.php
@@ -286,8 +286,12 @@
if (!empty($gateways)) {
$x = 0;
foreach($gateways as $row) {
+ $list_row_url = '';
if (permission_exists('gateway_edit')) {
$list_row_url = "gateway_edit.php?id=".urlencode($row['gateway_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if (permission_exists('gateway_add') || permission_exists('gateway_edit') || permission_exists('gateway_delete')) {
@@ -391,3 +395,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/ivr_menus/ivr_menus.php b/app/ivr_menus/ivr_menus.php
index 2c4968369d..287a2a66f5 100644
--- a/app/ivr_menus/ivr_menus.php
+++ b/app/ivr_menus/ivr_menus.php
@@ -236,8 +236,12 @@
if (!empty($ivr_menus)) {
$x = 0;
foreach($ivr_menus as $row) {
+ $list_row_url = '';
if (permission_exists('ivr_menu_edit')) {
$list_row_url = "ivr_menu_edit.php?id=".urlencode($row['ivr_menu_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if (permission_exists('ivr_menu_add') || permission_exists('ivr_menu_edit') || permission_exists('ivr_menu_delete')) {
@@ -298,3 +302,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/modules/module_edit.php b/app/modules/module_edit.php
index eb482483b9..296432c1f8 100644
--- a/app/modules/module_edit.php
+++ b/app/modules/module_edit.php
@@ -205,6 +205,7 @@
echo "
\n";
echo "\n";
+ echo "\n";
echo "
\n";
echo "\n";
@@ -297,6 +298,7 @@
echo " \n";
echo "
";
+ echo "
";
echo " ";
if ($action == "update") {
diff --git a/app/modules/modules.php b/app/modules/modules.php
index f2ec07b185..bb3a16a2dc 100644
--- a/app/modules/modules.php
+++ b/app/modules/modules.php
@@ -202,8 +202,12 @@
echo " \n";
write_header($row["module_category"]);
}
+ $list_row_url = '';
if (permission_exists('module_edit')) {
$list_row_url = "module_edit.php?id=".urlencode($row['module_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo "\n";
if (permission_exists('module_edit') || permission_exists('module_delete')) {
@@ -283,3 +287,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/number_translations/app_defaults.php b/app/number_translations/app_defaults.php
index 782d0ac654..3ccd87b9fe 100644
--- a/app/number_translations/app_defaults.php
+++ b/app/number_translations/app_defaults.php
@@ -74,4 +74,3 @@
}
?>
-
diff --git a/app/number_translations/number_translations.php b/app/number_translations/number_translations.php
index bc02e4fef8..3b58216bf3 100644
--- a/app/number_translations/number_translations.php
+++ b/app/number_translations/number_translations.php
@@ -225,8 +225,12 @@
if (!empty($number_translations)) {
$x = 0;
foreach ($number_translations as $row) {
+ $list_row_url = '';
if (permission_exists('number_translation_edit')) {
$list_row_url = "number_translation_edit.php?id=".urlencode($row['number_translation_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if (permission_exists('number_translation_add') || permission_exists('number_translation_edit') || permission_exists('number_translation_delete')) {
@@ -276,3 +280,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/phrases/phrases.php b/app/phrases/phrases.php
index e8b5bd16ab..0edd4f6559 100644
--- a/app/phrases/phrases.php
+++ b/app/phrases/phrases.php
@@ -211,8 +211,12 @@
if (is_array($phrases) && @sizeof($phrases) != 0) {
$x = 0;
foreach($phrases as $row) {
+ $list_row_url = '';
if (permission_exists('phrase_edit')) {
$list_row_url = "phrase_edit.php?id=".urlencode($row['phrase_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if (permission_exists('phrase_add') || permission_exists('phrase_edit') || permission_exists('phrase_delete')) {
@@ -273,3 +277,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/pin_numbers/pin_numbers.php b/app/pin_numbers/pin_numbers.php
index 1740c631a2..e7581cecf7 100644
--- a/app/pin_numbers/pin_numbers.php
+++ b/app/pin_numbers/pin_numbers.php
@@ -189,8 +189,12 @@
if (is_array($pin_numbers) && @sizeof($pin_numbers) != 0) {
$x = 0;
foreach ($pin_numbers as $row) {
+ $list_row_url = '';
if (permission_exists('pin_number_edit')) {
$list_row_url = "pin_number_edit.php?id=".urlencode($row['pin_number_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if (permission_exists('pin_number_add') || permission_exists('pin_number_edit') || permission_exists('pin_number_delete')) {
@@ -241,3 +245,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/provision/resources/classes/provision.php b/app/provision/resources/classes/provision.php
index bd6cc5ea71..53acb6ae90 100644
--- a/app/provision/resources/classes/provision.php
+++ b/app/provision/resources/classes/provision.php
@@ -802,20 +802,11 @@
//set the variables
$line_number = $row['line_number'];
$register_expires = $row['register_expires'];
- $sip_transport = strtolower($row['sip_transport']);
- $sip_port = $row['sip_port'];
+ $sip_transport = strtolower($row['sip_transport'] ?? 'tcp');
+ $sip_port = $row['sip_port'] ?? '5060';
//set defaults
if (empty($register_expires)) { $register_expires = "120"; }
- if (empty($sip_transport)) { $sip_transport = "tcp"; }
- if (!isset($sip_port)) {
- if ($line_number == "" || $line_number == "1") {
- $sip_port = "5060";
- }
- else {
- $sip_port = "506".($line_number + 1);
- }
- }
//convert seconds to minutes for grandstream
if ($device_vendor == 'grandstream') {
diff --git a/app/recordings/recordings.php b/app/recordings/recordings.php
index b429120270..0a8f68b13b 100644
--- a/app/recordings/recordings.php
+++ b/app/recordings/recordings.php
@@ -529,8 +529,12 @@
echo " \n";
echo " \n"; // dummy row to maintain alternating background color
}
+ $list_row_url = '';
if (permission_exists('recording_edit')) {
$list_row_url = "recording_edit.php?id=".urlencode($row['recording_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo "\n";
if (permission_exists('recording_delete')) {
@@ -710,3 +714,4 @@
}
?>
+
diff --git a/app/ring_groups/ring_groups.php b/app/ring_groups/ring_groups.php
index 59473180d1..f995d7cdf0 100644
--- a/app/ring_groups/ring_groups.php
+++ b/app/ring_groups/ring_groups.php
@@ -257,8 +257,12 @@
if (is_array($ring_groups) && @sizeof($ring_groups) != 0) {
$x = 0;
foreach ($ring_groups as $row) {
+ $list_row_url = '';
if (permission_exists('ring_group_edit')) {
$list_row_url = "ring_group_edit.php?id=".urlencode($row['ring_group_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if (permission_exists('ring_group_add') || permission_exists('ring_group_edit') || permission_exists('ring_group_delete')) {
@@ -315,3 +319,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/sip_profiles/sip_profiles.php b/app/sip_profiles/sip_profiles.php
index a18b92c5e5..956d0727ea 100644
--- a/app/sip_profiles/sip_profiles.php
+++ b/app/sip_profiles/sip_profiles.php
@@ -188,8 +188,12 @@
if (!empty($sip_profiles) && @sizeof($sip_profiles) != 0) {
$x = 0;
foreach ($sip_profiles as $row) {
+ $list_row_url = '';
if (permission_exists('sip_profile_edit')) {
$list_row_url = "sip_profile_edit.php?id=".urlencode($row['sip_profile_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if (permission_exists('sip_profile_add') || permission_exists('sip_profile_edit') || permission_exists('sip_profile_delete')) {
@@ -239,3 +243,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/sofia_global_settings/sofia_global_settings.php b/app/sofia_global_settings/sofia_global_settings.php
index deb31716d5..12a40fb1ec 100644
--- a/app/sofia_global_settings/sofia_global_settings.php
+++ b/app/sofia_global_settings/sofia_global_settings.php
@@ -209,8 +209,12 @@
if (!empty($sofia_global_settings) && @sizeof($sofia_global_settings) != 0) {
$x = 0;
foreach ($sofia_global_settings as $row) {
+ $list_row_url = '';
if (permission_exists('sofia_global_setting_edit')) {
$list_row_url = "sofia_global_setting_edit.php?id=".urlencode($row['sofia_global_setting_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if (permission_exists('sofia_global_setting_add') || permission_exists('sofia_global_setting_edit') || permission_exists('sofia_global_setting_delete')) {
@@ -261,3 +265,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/streams/streams.php b/app/streams/streams.php
index 5b872b764a..c065cad90b 100644
--- a/app/streams/streams.php
+++ b/app/streams/streams.php
@@ -248,8 +248,12 @@
if (!empty($streams)) {
$x = 0;
foreach ($streams as $row) {
+ $list_row_url = '';
if (permission_exists('stream_edit')) {
$list_row_url = "stream_edit.php?id=".urlencode($row['stream_uuid']);
+ if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
+ $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
+ }
}
echo " \n";
if (permission_exists('stream_add') || permission_exists('stream_edit') || permission_exists('stream_delete')) {
@@ -315,3 +319,4 @@
require_once "resources/footer.php";
?>
+
diff --git a/app/switch/resources/conf/sip_profiles/internal-ipv6.xml.noload b/app/switch/resources/conf/sip_profiles/internal-ipv6.xml.noload
index 2c376ce0d0..f7bf02d931 100644
--- a/app/switch/resources/conf/sip_profiles/internal-ipv6.xml.noload
+++ b/app/switch/resources/conf/sip_profiles/internal-ipv6.xml.noload
@@ -11,6 +11,8 @@
+
+
diff --git a/app/switch/resources/conf/sip_profiles/internal.xml.noload b/app/switch/resources/conf/sip_profiles/internal.xml.noload
index 872de9f47c..951af3f741 100644
--- a/app/switch/resources/conf/sip_profiles/internal.xml.noload
+++ b/app/switch/resources/conf/sip_profiles/internal.xml.noload
@@ -83,6 +83,8 @@
+
+
diff --git a/app/switch/resources/scripts/app/emergency/index.lua b/app/switch/resources/scripts/app/emergency/index.lua
index f3dc40fde8..f4bffd0936 100644
--- a/app/switch/resources/scripts/app/emergency/index.lua
+++ b/app/switch/resources/scripts/app/emergency/index.lua
@@ -192,9 +192,10 @@ end);
--set event
if (tonumber(destination_number) == 933) then
event = '933 Emergency Address Validation Service';
-else if (tonumber(destination_number) == 911) then
+elseif (tonumber(destination_number) == 922) then
+ event = '922 Emergency Address Validation Service';
+elseif (tonumber(destination_number) == 911) then
event = '911 Emergency Call';
- end
end
--connect to the database
@@ -261,4 +262,3 @@ end
dbh:query(sql, params);
dbh:release();
-
diff --git a/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua b/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua
index eaaa53dbb2..05ed42cb48 100644
--- a/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua
+++ b/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua
@@ -25,364 +25,361 @@
-- POSSIBILITY OF SUCH DAMAGE.
--load libraries
- local send_mail = require 'resources.functions.send_mail'
- local Database = require "resources.functions.database"
- local Settings = require "resources.functions.lazy_settings"
+local send_mail = require 'resources.functions.send_mail'
+local Database = require "resources.functions.database"
+local Settings = require "resources.functions.lazy_settings"
--define a function to send email
- function send_email(id, uuid)
+function send_email(id, uuid)
+ --prepare the database, settings and variables
local db = dbh or Database.new('system');
local settings = Settings.new(db, domain_name, domain_uuid);
local http_protocol = settings:get('domain', 'http_protocol', 'text') or "https";
local email_queue_enabled = "true";
- --get voicemail message details
- local sql = [[SELECT * FROM v_voicemails
- WHERE domain_uuid = :domain_uuid
- AND voicemail_id = :voicemail_id]]
- local params = {domain_uuid = domain_uuid, voicemail_id = id};
- if (debug["sql"]) then
- freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
- end
- dbh:query(sql, params, function(row)
- db_voicemail_uuid = string.lower(row["voicemail_uuid"]);
- --voicemail_password = row["voicemail_password"];
- --greeting_id = row["greeting_id"];
- voicemail_mail_to = row["voicemail_mail_to"];
- voicemail_transcription_enabled = row["voicemail_transcription_enabled"];
- voicemail_file = row["voicemail_file"];
- voicemail_local_after_email = row["voicemail_local_after_email"];
- voicemail_local_after_forward = row["voicemail_local_after_forward"];
- voicemail_description = row["voicemail_description"];
- end);
+ --get voicemail message details
+ local sql = [[SELECT * FROM v_voicemails
+ WHERE domain_uuid = :domain_uuid
+ AND voicemail_id = :voicemail_id]]
+ local params = {domain_uuid = domain_uuid, voicemail_id = id};
+ if (debug["sql"]) then
+ freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
+ end
+ dbh:query(sql, params, function(row)
+ db_voicemail_uuid = string.lower(row["voicemail_uuid"]);
+ --voicemail_password = row["voicemail_password"];
+ --greeting_id = row["greeting_id"];
+ voicemail_mail_to = row["voicemail_mail_to"];
+ voicemail_transcription_enabled = row["voicemail_transcription_enabled"];
+ voicemail_file = row["voicemail_file"];
+ voicemail_local_after_email = row["voicemail_local_after_email"];
+ voicemail_description = row["voicemail_description"];
+ end);
- --set default values
- if (voicemail_file == nil) then
- voicemail_file = "listen";
- end
- if (voicemail_local_after_email == nil) then
- voicemail_local_after_email = "true";
- end
- if (voicemail_local_after_forward == nil) then
- voicemail_local_after_forward = "true";
- end
+ --set default values
+ if (voicemail_file == nil or voicemail_file == '') then
+ voicemail_file = "listen";
+ end
+ if (voicemail_local_after_email == nil or voicemail_local_after_email == '') then
+ voicemail_local_after_email = "true";
+ end
- --require the email address to send the email
- if (string.len(voicemail_mail_to) > 2) then
- --include languages file
- local Text = require "resources.functions.text"
- local text = Text.new("app.voicemail.app_languages")
- local dbh = dbh
+ --require the email address to send the email
+ if (string.len(voicemail_mail_to) > 2) then
+ --include languages file
+ local Text = require "resources.functions.text"
+ local text = Text.new("app.voicemail.app_languages")
+ local dbh = dbh
- --user setting time zone, if set
- local sql = [[
- select
- us.user_setting_value as time_zone
- from
- v_user_settings as us,
- v_extension_users as eu,
- v_extensions as e,
- v_voicemails as v
- where
- v.voicemail_id = :voicemail_id and
- v.domain_uuid = :domain_uuid and
- v.voicemail_id = e.extension and
- e.domain_uuid = :domain_uuid and
- e.extension_uuid = eu.extension_uuid and
- eu.domain_uuid = :domain_uuid and
- eu.user_uuid = us.user_uuid and
- us.domain_uuid = :domain_uuid and
- us.user_setting_category = 'domain' and
- us.user_setting_subcategory = 'time_zone' and
- us.user_setting_name = 'name' and
- us.user_setting_enabled = 'true'
- order by
- eu.insert_date asc
- limit 1
- ]]
- local params = {domain_uuid = domain_uuid, voicemail_id = id};
- if (debug["sql"]) then
- freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
- end
- dbh:query(sql, params, function(row)
- time_zone = row["time_zone"];
- end);
+ --user setting time zone, if set
+ local sql = [[
+ select
+ us.user_setting_value as time_zone
+ from
+ v_user_settings as us,
+ v_extension_users as eu,
+ v_extensions as e,
+ v_voicemails as v
+ where
+ v.voicemail_id = :voicemail_id and
+ v.domain_uuid = :domain_uuid and
+ v.voicemail_id = e.extension and
+ e.domain_uuid = :domain_uuid and
+ e.extension_uuid = eu.extension_uuid and
+ eu.domain_uuid = :domain_uuid and
+ eu.user_uuid = us.user_uuid and
+ us.domain_uuid = :domain_uuid and
+ us.user_setting_category = 'domain' and
+ us.user_setting_subcategory = 'time_zone' and
+ us.user_setting_name = 'name' and
+ us.user_setting_enabled = 'true'
+ order by
+ eu.insert_date asc
+ limit 1
+ ]]
+ local params = {domain_uuid = domain_uuid, voicemail_id = id};
+ if (debug["sql"]) then
+ freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
+ end
+ dbh:query(sql, params, function(row)
+ time_zone = row["time_zone"];
+ end);
- --default/domain setting time zone
- if (time_zone == nil or time_zone == '') then
- time_zone = settings:get('domain', 'time_zone', 'name');
- end
-
- --default time zone
- if (time_zone == nil or time_zone == '') then
- time_zone = 'UTC';
- end
-
- --connect using other backend if needed
- if storage_type == "base64" then
- dbh = Database.new('system', 'base64/read')
- end
-
- --get voicemail message details
- local sql = [[SELECT to_char(timezone(:time_zone, to_timestamp(created_epoch)), 'Day DD Mon YYYY HH:MI:SS PM') as message_date, *
- FROM v_voicemail_messages
- WHERE domain_uuid = :domain_uuid
- AND voicemail_message_uuid = :uuid]]
- local params = {domain_uuid = domain_uuid, uuid = uuid, time_zone = time_zone};
- if (debug["sql"]) then
- freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
- end
- dbh:query(sql, params, function(row)
- --get the values from the database
- --uuid = row["voicemail_message_uuid"];
- created_epoch = row["created_epoch"];
- caller_id_name = row["caller_id_name"];
- caller_id_number = row["caller_id_number"];
- message_date = row["message_date"];
- message_length = row["message_length"];
- --message_status = row["message_status"];
- --message_priority = row["message_priority"];
- --get the recordings from the database
- if (storage_type == "base64") then
- --set the voicemail intro and message paths
- message_location = voicemail_dir.."/"..id.."/msg_"..uuid.."."..vm_message_ext;
- intro_location = voicemail_dir.."/"..id.."/intro_"..uuid.."."..vm_message_ext;
-
- --save the recordings to the file system
- if (string.len(row["message_base64"]) > 32) then
- --save the value to a variable
- voicemail_base64 = row["message_base64"];
-
- --include the file io
- local file = require "resources.functions.file"
-
- --write decoded message string to file
- file.write_base64(message_location, row["message_base64"]);
-
- --write decoded intro string to file, if any
- if (string.len(row["message_intro_base64"]) > 32) then
- file.write_base64(intro_location, row["message_intro_base64"]);
- end
- end
- end
- end);
-
- --close temporary connection
- if storage_type == "base64" then
- dbh:release()
- end
-
- --format the message length and date
- message_length_formatted = format_seconds(message_length);
- if (debug["info"]) then
- freeswitch.consoleLog("notice", "[voicemail] message date: " .. message_date .. "\n");
- freeswitch.consoleLog("notice", "[voicemail] message length: " .. message_length .. "\n");
- end
- --local message_date = os.date("%A, %d %b %Y %I:%M %p", created_epoch);
-
- --connect to the database
- local dbh = Database.new('system');
-
- --get the templates
- local sql = "SELECT * FROM v_email_templates ";
- sql = sql .. "WHERE (domain_uuid = :domain_uuid or domain_uuid is null) ";
- sql = sql .. "AND template_language = :template_language ";
- sql = sql .. "AND template_category = 'voicemail' "
- if (voicemail_transcription_enabled == 'true') then
- sql = sql .. "AND template_subcategory = 'transcription' "
- else
- sql = sql .. "AND template_subcategory = 'default' "
- end
- sql = sql .. "AND template_enabled = 'true' "
- sql = sql .. "ORDER BY domain_uuid DESC "
- local params = {domain_uuid = domain_uuid, template_language = default_language.."-"..default_dialect};
- if (debug["sql"]) then
- freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
- end
- dbh:query(sql, params, function(row)
- subject = row["template_subject"];
- body = row["template_body"];
- end);
-
- --get the link_address
- link_address = http_protocol.."://"..domain_name..project_path;
-
- --set proper delete status
- local local_after_email = '';
- if (voicemail_local_after_email == "false" or voicemail_local_after_forward == "false") then
- local_after_email = "false";
- else
- local_after_email = "true";
- end
-
- --prepare the headers
- local headers = {
- ["X-FusionPBX-Domain-UUID"] = domain_uuid;
- ["X-FusionPBX-Domain-Name"] = domain_name;
- ["X-FusionPBX-Call-UUID"] = uuid;
- ["X-FusionPBX-Email-Type"] = 'voicemail';
- ["X-FusionPBX-local_after_email"] = local_after_email;
- }
-
- --prepare the voicemail_name_formatted
- voicemail_name_formatted = id;
- local display_domain_name = settings:get('voicemail', 'display_domain_name', 'boolean');
-
- if (display_domain_name == 'true') then
- voicemail_name_formatted = id.."@"..domain_name;
- end
- if (voicemail_description ~= nil and voicemail_description ~= "" and voicemail_description ~= id) then
- voicemail_name_formatted = voicemail_name_formatted.." ("..voicemail_description..")";
- end
-
- --prepare file
- file = voicemail_dir.."/"..id.."/msg_"..uuid.."."..vm_message_ext;
-
- --combine intro, if exists, with message for emailing (only)
- intro = voicemail_dir.."/"..id.."/intro_"..uuid.."."..vm_message_ext;
- combined = voicemail_dir.."/"..id.."/intro_msg_"..uuid.."."..vm_message_ext;
- if (file_exists(intro) and file_exists(file)) then
- os.execute("sox "..intro.." "..file.." "..combined);
- end
-
- --prepare the subject
- if (subject ~= nil) then
- subject = subject:gsub("${caller_id_name}", caller_id_name);
- subject = subject:gsub("${caller_id_number}", caller_id_number);
- subject = subject:gsub("${message_date}", message_date);
- subject = subject:gsub("${message_duration}", message_length_formatted);
- subject = subject:gsub("${account}", voicemail_name_formatted);
- subject = subject:gsub("${voicemail_id}", id);
- subject = subject:gsub("${voicemail_description}", voicemail_description);
- subject = subject:gsub("${voicemail_name_formatted}", voicemail_name_formatted);
- subject = subject:gsub("${domain_name}", domain_name);
- subject = subject:gsub("${new_messages}", new_messages);
- subject = trim(subject);
- else
- subject = text['label-voicemail'] .. ' ' .. caller_id_name .. ' <' .. caller_id_number .. '> ' .. message_length_formatted;
- end
- subject = '=?utf-8?B?'..base64.encode(subject)..'?=';
-
- --prepare the body
- if (body ~= nil) then
- body = body:gsub("${caller_id_name}", caller_id_name);
- body = body:gsub("${caller_id_number}", caller_id_number);
- body = body:gsub("${message_date}", message_date);
- if (transcription ~= nil) then
- transcription = transcription:gsub("%%", "*");
- body = body:gsub("${message_text}", transcription);
- end
- body = body:gsub("${message_duration}", message_length_formatted);
- body = body:gsub("${account}", voicemail_name_formatted);
- body = body:gsub("${voicemail_id}", id);
- body = body:gsub("${voicemail_description}", voicemail_description);
- body = body:gsub("${voicemail_name_formatted}", voicemail_name_formatted);
- body = body:gsub("${domain_name}", domain_name);
- body = body:gsub("${sip_to_user}", id);
- if (origination_callee_id_name ~= nil) then
- body = body:gsub("${origination_callee_id_name}", origination_callee_id_name);
- end
- body = body:gsub("${dialed_user}", id);
- if (voicemail_file == "attach" and file) then
- body = body:gsub("${message}", text['label-attached']);
- elseif (voicemail_file == "link") then
- body = body:gsub("${message}", ""..text['label-download'].." ");
- else
- body = body:gsub("${message}", ""..text['label-listen'].." ");
- end
- --body = body:gsub(" ", " ");
- --body = body:gsub("%s+", "");
- --body = body:gsub(" ", " ");
- body = trim(body);
- else
- body = '';
- if (caller_id_name ~= nil and caller_id_name ~= caller_id_number) then
- body = body .. caller_id_name .. ' ';
- end
- body = body .. caller_id_number .. ' ';
- body = body .. message_date .. ' ';
- if (voicemail_file == "attach" and file) then
- body = body .. ' ' .. text['label-attached'];
- elseif (voicemail_file == "link") then
- body = body .. ""..text['label-download'].." ";
- else
- body = body .. ""..text['label-listen'].." ";
- end
- body = body .. '';
- end
-
- --get the smtp from address and name
- smtp_from = settings:get('voicemail', 'smtp_from', 'text');
- smtp_from_name = settings:get('voicemail', 'smtp_from_name', 'text');
- if (smtp_from == nil or smtp_from == '') then
- smtp_from = settings:get('email', 'smtp_from', 'text');
- end
- if (smtp_from_name == nil or smtp_from_name == '') then
- smtp_from_name = settings:get('email', 'smtp_from_name', 'text');
- end
- if (smtp_from_name and string.len(smtp_from_name) > 0 and smtp_from and string.len(smtp_from) > 2) then
- smtp_from = smtp_from_name.."<"..smtp_from..">";
- end
-
- --send the email with, or without, including the intro
- if (file_exists(combined)) then
- voicemail_path = combined
- else
- voicemail_path = file
- end
-
- --send the email
- send_mail(headers,
- smtp_from,
- voicemail_mail_to,
- {subject, body},
- (voicemail_file == "attach") and voicemail_path,
- voicemail_base64
- );
-
- end
-
- --whether to keep the voicemail message and details local after email
- if (string.len(voicemail_mail_to) > 2 and email_queue_enabled == 'false') then
- if (voicemail_local_after_email == "false" and voicemail_local_after_forward == "false") then
- --delete the voicemail message details
- local sql = [[DELETE FROM v_voicemail_messages
- WHERE domain_uuid = :domain_uuid
- AND voicemail_uuid = :voicemail_uuid
- AND voicemail_message_uuid = :uuid]]
- local params = {domain_uuid = domain_uuid,
- voicemail_uuid = db_voicemail_uuid, uuid = uuid};
- if (debug["sql"]) then
- freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
- end
- dbh:query(sql, params);
- --delete voicemail recording files
- if (file_exists(file)) then
- os.remove(file);
- end
- if (file_exists(intro)) then
- os.remove(intro);
- end
- if (file_exists(combined)) then
- os.remove(combined);
- end
- --set message waiting indicator
- message_waiting(id, domain_uuid);
- --clear the variable
- db_voicemail_uuid = '';
- elseif (storage_type == "base64") then
- --delete voicemail recording files
- if (file_exists(file)) then
- os.remove(file);
- end
- if (file_exists(intro)) then
- os.remove(intro);
- end
- if (file_exists(combined)) then
- os.remove(combined);
- end
+ --default/domain setting time zone
+ if (time_zone == nil or time_zone == '') then
+ time_zone = settings:get('domain', 'time_zone', 'name');
end
+ --default time zone
+ if (time_zone == nil or time_zone == '') then
+ time_zone = 'UTC';
+ end
+
+ --connect using other backend if needed
+ if storage_type == "base64" then
+ dbh = Database.new('system', 'base64/read')
+ end
+
+ --get voicemail message details
+ local sql = [[SELECT to_char(timezone(:time_zone, to_timestamp(created_epoch)), 'Day DD Mon YYYY HH:MI:SS PM') as message_date, *
+ FROM v_voicemail_messages
+ WHERE domain_uuid = :domain_uuid
+ AND voicemail_message_uuid = :uuid]]
+ local params = {domain_uuid = domain_uuid, uuid = uuid, time_zone = time_zone};
+ if (debug["sql"]) then
+ freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
+ end
+ dbh:query(sql, params, function(row)
+ --get the values from the database
+ --uuid = row["voicemail_message_uuid"];
+ created_epoch = row["created_epoch"];
+ caller_id_name = row["caller_id_name"];
+ caller_id_number = row["caller_id_number"];
+ message_date = row["message_date"];
+ message_length = row["message_length"];
+ --message_status = row["message_status"];
+ --message_priority = row["message_priority"];
+ --get the recordings from the database
+ if (storage_type == "base64") then
+ --set the voicemail intro and message paths
+ message_location = voicemail_dir.."/"..id.."/msg_"..uuid.."."..vm_message_ext;
+ intro_location = voicemail_dir.."/"..id.."/intro_"..uuid.."."..vm_message_ext;
+
+ --save the recordings to the file system
+ if (string.len(row["message_base64"]) > 32) then
+ --save the value to a variable
+ voicemail_base64 = row["message_base64"];
+
+ --include the file io
+ local file = require "resources.functions.file"
+
+ --write decoded message string to file
+ file.write_base64(message_location, row["message_base64"]);
+
+ --write decoded intro string to file, if any
+ if (string.len(row["message_intro_base64"]) > 32) then
+ file.write_base64(intro_location, row["message_intro_base64"]);
+ end
+ end
+ end
+ end);
+
+ --close temporary connection
+ if storage_type == "base64" then
+ dbh:release()
+ end
+
+ --format the message length and date
+ message_length_formatted = format_seconds(message_length);
+ if (debug["info"]) then
+ freeswitch.consoleLog("notice", "[voicemail] message date: " .. message_date .. "\n");
+ freeswitch.consoleLog("notice", "[voicemail] message length: " .. message_length .. "\n");
+ end
+ --local message_date = os.date("%A, %d %b %Y %I:%M %p", created_epoch);
+
+ --connect to the database
+ local dbh = Database.new('system');
+
+ --get the templates
+ local sql = "SELECT * FROM v_email_templates ";
+ sql = sql .. "WHERE (domain_uuid = :domain_uuid or domain_uuid is null) ";
+ sql = sql .. "AND template_language = :template_language ";
+ sql = sql .. "AND template_category = 'voicemail' "
+ if (voicemail_transcription_enabled == 'true') then
+ sql = sql .. "AND template_subcategory = 'transcription' "
+ else
+ sql = sql .. "AND template_subcategory = 'default' "
+ end
+ sql = sql .. "AND template_enabled = 'true' "
+ sql = sql .. "ORDER BY domain_uuid DESC "
+ local params = {domain_uuid = domain_uuid, template_language = default_language.."-"..default_dialect};
+ if (debug["sql"]) then
+ freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
+ end
+ dbh:query(sql, params, function(row)
+ subject = row["template_subject"];
+ body = row["template_body"];
+ end);
+
+ --get the link_address
+ link_address = http_protocol.."://"..domain_name..project_path;
+
+ --set proper delete status
+ local local_after_email = '';
+ if (voicemail_local_after_email == "false") then
+ local_after_email = "false";
+ else
+ local_after_email = "true";
+ end
+
+ --prepare the headers
+ local headers = {
+ ["X-FusionPBX-Domain-UUID"] = domain_uuid;
+ ["X-FusionPBX-Domain-Name"] = domain_name;
+ ["X-FusionPBX-Call-UUID"] = uuid;
+ ["X-FusionPBX-Email-Type"] = 'voicemail';
+ ["X-FusionPBX-local_after_email"] = local_after_email;
+ }
+
+ --prepare the voicemail_name_formatted
+ voicemail_name_formatted = id;
+ local display_domain_name = settings:get('voicemail', 'display_domain_name', 'boolean');
+
+ if (display_domain_name == 'true') then
+ voicemail_name_formatted = id.."@"..domain_name;
+ end
+ if (voicemail_description ~= nil and voicemail_description ~= "" and voicemail_description ~= id) then
+ voicemail_name_formatted = voicemail_name_formatted.." ("..voicemail_description..")";
+ end
+
+ --prepare file
+ file = voicemail_dir.."/"..id.."/msg_"..uuid.."."..vm_message_ext;
+
+ --combine intro, if exists, with message for emailing (only)
+ intro = voicemail_dir.."/"..id.."/intro_"..uuid.."."..vm_message_ext;
+ combined = voicemail_dir.."/"..id.."/intro_msg_"..uuid.."."..vm_message_ext;
+ if (file_exists(intro) and file_exists(file)) then
+ os.execute("sox "..intro.." "..file.." "..combined);
+ end
+
+ --prepare the subject
+ if (subject ~= nil) then
+ subject = subject:gsub("${caller_id_name}", caller_id_name);
+ subject = subject:gsub("${caller_id_number}", caller_id_number);
+ subject = subject:gsub("${message_date}", message_date);
+ subject = subject:gsub("${message_duration}", message_length_formatted);
+ subject = subject:gsub("${account}", voicemail_name_formatted);
+ subject = subject:gsub("${voicemail_id}", id);
+ subject = subject:gsub("${voicemail_description}", voicemail_description);
+ subject = subject:gsub("${voicemail_name_formatted}", voicemail_name_formatted);
+ subject = subject:gsub("${domain_name}", domain_name);
+ subject = subject:gsub("${new_messages}", new_messages);
+ subject = trim(subject);
+ else
+ subject = text['label-voicemail'] .. ' ' .. caller_id_name .. ' <' .. caller_id_number .. '> ' .. message_length_formatted;
+ end
+ subject = '=?utf-8?B?'..base64.encode(subject)..'?=';
+
+ --prepare the body
+ if (body ~= nil) then
+ body = body:gsub("${caller_id_name}", caller_id_name);
+ body = body:gsub("${caller_id_number}", caller_id_number);
+ body = body:gsub("${message_date}", message_date);
+ if (transcription ~= nil) then
+ transcription = transcription:gsub("%%", "*");
+ body = body:gsub("${message_text}", transcription);
+ end
+ body = body:gsub("${message_duration}", message_length_formatted);
+ body = body:gsub("${account}", voicemail_name_formatted);
+ body = body:gsub("${voicemail_id}", id);
+ body = body:gsub("${voicemail_description}", voicemail_description);
+ body = body:gsub("${voicemail_name_formatted}", voicemail_name_formatted);
+ body = body:gsub("${domain_name}", domain_name);
+ body = body:gsub("${sip_to_user}", id);
+ if (origination_callee_id_name ~= nil) then
+ body = body:gsub("${origination_callee_id_name}", origination_callee_id_name);
+ end
+ body = body:gsub("${dialed_user}", id);
+ if (voicemail_file == "attach" and file) then
+ body = body:gsub("${message}", text['label-attached']);
+ elseif (voicemail_file == "link") then
+ body = body:gsub("${message}", ""..text['label-download'].." ");
+ else
+ body = body:gsub("${message}", ""..text['label-listen'].." ");
+ end
+ --body = body:gsub(" ", " ");
+ --body = body:gsub("%s+", "");
+ --body = body:gsub(" ", " ");
+ body = trim(body);
+ else
+ body = '';
+ if (caller_id_name ~= nil and caller_id_name ~= caller_id_number) then
+ body = body .. caller_id_name .. ' ';
+ end
+ body = body .. caller_id_number .. ' ';
+ body = body .. message_date .. ' ';
+ if (voicemail_file == "attach" and file) then
+ body = body .. ' ' .. text['label-attached'];
+ elseif (voicemail_file == "link") then
+ body = body .. ""..text['label-download'].." ";
+ else
+ body = body .. ""..text['label-listen'].." ";
+ end
+ body = body .. '';
+ end
+
+ --get the smtp from address and name
+ smtp_from = settings:get('voicemail', 'smtp_from', 'text');
+ smtp_from_name = settings:get('voicemail', 'smtp_from_name', 'text');
+ if (smtp_from == nil or smtp_from == '') then
+ smtp_from = settings:get('email', 'smtp_from', 'text');
+ end
+ if (smtp_from_name == nil or smtp_from_name == '') then
+ smtp_from_name = settings:get('email', 'smtp_from_name', 'text');
+ end
+ if (smtp_from_name and string.len(smtp_from_name) > 0 and smtp_from and string.len(smtp_from) > 2) then
+ smtp_from = smtp_from_name.."<"..smtp_from..">";
+ end
+
+ --send the email with, or without, including the intro
+ if (file_exists(combined)) then
+ voicemail_path = combined
+ else
+ voicemail_path = file
+ end
+
+ --send the email
+ send_mail(headers,
+ smtp_from,
+ voicemail_mail_to,
+ {subject, body},
+ (voicemail_file == "attach") and voicemail_path,
+ voicemail_base64
+ );
+
+ end
+
+ --whether to keep the voicemail message and details local after email
+ if (string.len(voicemail_mail_to) > 2 and email_queue_enabled == 'false') then
+ if (voicemail_local_after_email == "false") then
+ --delete the voicemail message details
+ local sql = [[DELETE FROM v_voicemail_messages
+ WHERE domain_uuid = :domain_uuid
+ AND voicemail_uuid = :voicemail_uuid
+ AND voicemail_message_uuid = :uuid]]
+ local params = {domain_uuid = domain_uuid,
+ voicemail_uuid = db_voicemail_uuid, uuid = uuid};
+ if (debug["sql"]) then
+ freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
+ end
+ dbh:query(sql, params);
+ --delete voicemail recording files
+ if (file_exists(file)) then
+ os.remove(file);
+ end
+ if (file_exists(intro)) then
+ os.remove(intro);
+ end
+ if (file_exists(combined)) then
+ os.remove(combined);
+ end
+ --set message waiting indicator
+ message_waiting(id, domain_uuid);
+ --clear the variable
+ db_voicemail_uuid = '';
+ elseif (storage_type == "base64") then
+ --delete voicemail recording files
+ if (file_exists(file)) then
+ os.remove(file);
+ end
+ if (file_exists(intro)) then
+ os.remove(intro);
+ end
+ if (file_exists(combined)) then
+ os.remove(combined);
+ end
end
- end
+ end
+
+end
diff --git a/app/system/resources/dashboard/system_disk_usage.php b/app/system/resources/dashboard/system_disk_usage.php
index 02135183ea..ada15830fd 100644
--- a/app/system/resources/dashboard/system_disk_usage.php
+++ b/app/system/resources/dashboard/system_disk_usage.php
@@ -21,8 +21,8 @@
echo "\n";
$c = 0;
- $row_style["0"] = "row_style0";
- $row_style["1"] = "row_style1";
+ $row_style['0'] = "row_style0";
+ $row_style['1'] = "row_style1";
//disk usage
if (PHP_OS == 'FreeBSD' || PHP_OS == 'Linux') {
@@ -37,16 +37,16 @@
if (!empty($percent_disk_usage)) {
//add half doughnut chart
- echo "
\n";
+ echo "
\n";
echo "
".$text['label-disk_usage']." \n";
if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") {
?>
-
+