Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8564133d7b | ||
|
|
50e222b3e4 | ||
|
|
fff4365b1c | ||
|
|
9f7371659d | ||
|
|
90bae99e3d | ||
|
|
e0b8adf376 | ||
|
|
062c9ec8b8 | ||
|
|
d546c30837 | ||
|
|
d5c54fa4b0 | ||
|
|
9cf8da5a4a | ||
|
|
bde4163c25 | ||
|
|
c75e573e84 | ||
|
|
3ddf6e4df5 | ||
|
|
3ffd58ce26 | ||
|
|
155875b6bf | ||
|
|
0fd4f8ba00 | ||
|
|
5fbc6dcc03 | ||
|
|
db5dcf4a03 | ||
|
|
e88c43c272 | ||
|
|
cea56a7643 | ||
|
|
5db8c82d11 | ||
|
|
60d60a2b1d | ||
|
|
d490d6d5ab | ||
|
|
6163d27962 | ||
|
|
4604509bfd | ||
|
|
a8f0c03746 | ||
|
|
181092d399 | ||
|
|
ff36efcb49 | ||
|
|
f1e981b824 | ||
|
|
a0c112bc7e | ||
|
|
9da6a9b19c | ||
|
|
8ab4b2b6c2 | ||
|
|
76de2bee83 | ||
|
|
7f2f0df9b8 | ||
|
|
73c37b6562 | ||
|
|
97580a057a | ||
|
|
b857f092fa | ||
|
|
1f456c5077 | ||
|
|
62b9f692df | ||
|
|
ce114a4bb2 | ||
|
|
31ec917c64 | ||
|
|
0ac25b2769 | ||
|
|
88197dd51b | ||
|
|
e0ebdaf2b6 | ||
|
|
07639f4cf2 | ||
|
|
2f99b86917 | ||
|
|
4b75567ad8 | ||
|
|
ba1dc820eb | ||
|
|
5ef71889fe | ||
|
|
5815699489 | ||
|
|
5d4d7a0fd6 | ||
|
|
9dbc493844 | ||
|
|
64476fa512 | ||
|
|
e6c89018a1 | ||
|
|
b869123e1c | ||
|
|
df745a2838 | ||
|
|
ca28a06cea | ||
|
|
28040957bd | ||
|
|
9ed10a4dec | ||
|
|
e1729aad3a | ||
|
|
2593b6bd6f | ||
|
|
edac98d8c2 | ||
|
|
d9cd2d84e7 | ||
|
|
933d06d96d | ||
|
|
44983289fa | ||
|
|
8f24b921a9 | ||
|
|
3940fb8219 | ||
|
|
303935b9d2 | ||
|
|
f0d2a80ab7 | ||
|
|
0af94ee1e3 | ||
|
|
d463a7c5b3 | ||
|
|
9815d319e6 | ||
|
|
312c8659af | ||
|
|
c36455e28f | ||
|
|
492b188d0d | ||
|
|
e6a1093a38 | ||
|
|
c3fd2bae2e | ||
|
|
31c8f87c80 | ||
|
|
152881e34c | ||
|
|
8b7bd29456 | ||
|
|
1b675c1b56 | ||
|
|
c836a3b226 | ||
|
|
80c2b9bab2 | ||
|
|
2a9a1229dd | ||
|
|
bbc7dea2f1 | ||
|
|
28f94e1268 | ||
|
|
3ef0f1d593 | ||
|
|
fbafcc438c | ||
|
|
cc3637e248 | ||
|
|
ffd1bbd4fc | ||
|
|
6d37675273 | ||
|
|
8ca1b0d27b | ||
|
|
25c8b93423 | ||
|
|
c273c8021f | ||
|
|
0aaa4829e7 | ||
|
|
50d81556f5 | ||
|
|
8dcebaabc9 | ||
|
|
ec208915f2 | ||
|
|
96d91dde9c | ||
|
|
5464b4451f | ||
|
|
9006dc408f | ||
|
|
6bc2fccbb0 | ||
|
|
b49ebeeaa9 | ||
|
|
2c862bd97e | ||
|
|
bbf53595a7 | ||
|
|
58b8ded449 | ||
|
|
5d8980742b | ||
|
|
7f8ed9037b | ||
|
|
dcde377064 | ||
|
|
1ef51535fb | ||
|
|
8f575fe555 | ||
|
|
d68ffb65c7 | ||
|
|
955439dea3 | ||
|
|
ae2679e97c | ||
|
|
e54d10a4e9 | ||
|
|
273531302e | ||
|
|
9a5271fa92 | ||
|
|
6f4b522e9e | ||
|
|
648385a85c | ||
|
|
33a6a4cd01 | ||
|
|
d91c7b4fe9 | ||
|
|
e83510c426 | ||
|
|
d4b677ce6b | ||
|
|
8d2aefa41e | ||
|
|
55ba425b57 | ||
|
|
7308ae1a52 | ||
|
|
2f16d2bc05 | ||
|
|
000a32ad01 | ||
|
|
b9dd9af354 | ||
|
|
0a08b522f6 | ||
|
|
40fe1e8a43 | ||
|
|
d4cc8600e6 | ||
|
|
16515b1a81 | ||
|
|
e6772deec3 | ||
|
|
d4ca64c2d1 | ||
|
|
8fe2199e82 | ||
|
|
e112cc0a63 | ||
|
|
b490ce7cc0 | ||
|
|
381fd03bd3 | ||
|
|
8ae86bca9f | ||
|
|
9cc6d45772 | ||
|
|
aa4a4bf763 | ||
|
|
b1c24b3843 | ||
|
|
33035d7af2 | ||
|
|
1b02aa0e05 | ||
|
|
391f4c6322 | ||
|
|
a9c37688f1 | ||
|
|
24640276ea | ||
|
|
1393a29607 | ||
|
|
3b61bb645a | ||
|
|
d77e862ac1 | ||
|
|
85d7c8e60c | ||
|
|
4b7e90c3ff | ||
|
|
72470b5863 | ||
|
|
52a320ec54 | ||
|
|
91b845dc71 | ||
|
|
c2107802d8 | ||
|
|
7ed752ef7a | ||
|
|
02ce497e5c | ||
|
|
fbe358816f | ||
|
|
00c0fbe06d | ||
|
|
26530d6fe0 | ||
|
|
c766b5c634 | ||
|
|
5b66aa1aa7 | ||
|
|
fca042e996 | ||
|
|
937b470630 | ||
|
|
4490631485 | ||
|
|
bfa0046dd4 |
@@ -202,7 +202,7 @@
|
||||
//attempt digs
|
||||
if (!empty($digs) && is_array($digs)) {
|
||||
foreach ($digs as $dig) {
|
||||
$response = shell_exec("dig +noall +answer ".$dig['value']." | awk '{ print $5 }'");
|
||||
$response = shell_exec("dig +noall +answer ".escapeshellarg($dig['value'])." | awk '{ print $5 }'");
|
||||
if (!empty($response)) {
|
||||
$lines = explode("\n", $response);
|
||||
foreach ($lines as $l => $line) {
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
$array['access_controls'][0]['access_control_name'] = $access_control_name;
|
||||
$array['access_controls'][0]['access_control_default'] = $access_control_default;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('access_control_add', 'temp');
|
||||
|
||||
$database->app_name = 'access_controls';
|
||||
@@ -106,7 +106,7 @@
|
||||
$array['access_control_nodes'][0]['node_cidr'] = $node_cidr;
|
||||
$array['access_control_nodes'][0]['node_description'] = $node_description;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('access_control_node_add', 'temp');
|
||||
|
||||
$database->app_name = 'access_controls';
|
||||
|
||||
@@ -69,7 +69,7 @@ if (!class_exists('access_controls')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('access_control_node_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
@@ -236,7 +236,7 @@ if (!class_exists('access_controls')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('access_control_node_add', 'temp');
|
||||
|
||||
//save the array
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
//update the status
|
||||
if (permission_exists("user_setting_edit")) {
|
||||
//add the user_edit permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("user_edit", "temp");
|
||||
|
||||
//update the database user_status
|
||||
@@ -153,7 +153,7 @@
|
||||
}
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('extension_edit', 'temp');
|
||||
|
||||
//execute update
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
$array['dialplans'][$index]['dialplan_enabled'] = 'true';
|
||||
}
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
|
||||
$database->save($array);
|
||||
|
||||
@@ -435,7 +435,7 @@ if (!class_exists('call_block')) {
|
||||
unset($rows, $parameters);
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
|
||||
//save the array
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "call_center";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "record_name";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "\${sip_from_user}-\${sip_to_user}-\${strftime(%Y)}\${strftime(%b)}\${strftime(%d)}.\${record_ext}";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "\${sip_from_user}-\${sip_to_user}-\${strftime(%Y)}\${strftime(%b)}\${strftime(%d)}-\${uuid}.\${record_ext}";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Custom name for call recording. Options: \${record_ext}, \${sip_from_user}, \${sip_to_user}, \${caller_id_number}, \${uuid}";
|
||||
$y++;
|
||||
|
||||
@@ -58,7 +58,7 @@ if ($domains_processed == 1) {
|
||||
}
|
||||
|
||||
if (!empty($array)) {
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('call_center_tier_edit', 'temp');
|
||||
|
||||
$database->app_name = 'call_centers';
|
||||
@@ -168,7 +168,7 @@ if ($domains_processed == 1) {
|
||||
//save the array to the database
|
||||
if (!empty($array)) {
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("dialplan_add", "temp");
|
||||
$p->add("dialplan_edit", "temp");
|
||||
|
||||
|
||||
@@ -42,36 +42,14 @@
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//connect to the database
|
||||
$database = new database;
|
||||
|
||||
//set the defaults
|
||||
$agent_id = '';
|
||||
$agent_name = '';
|
||||
$agent_password = '';
|
||||
|
||||
//check for duplicates
|
||||
if (!empty($_GET["check"]) && $_GET["check"] == 'duplicate') {
|
||||
//agent id
|
||||
if (!empty($_GET["agent_id"])) {
|
||||
$sql = "select agent_name ";
|
||||
$sql .= "from v_call_center_agents ";
|
||||
$sql .= "where agent_id = :agent_id ";
|
||||
$sql .= "and domain_uuid = :domain_uuid ";
|
||||
if (!empty($_GET["agent_uuid"]) && is_uuid($_GET["agent_uuid"])) {
|
||||
$sql .= " and call_center_agent_uuid <> :call_center_agent_uuid ";
|
||||
$parameters['call_center_agent_uuid'] = $_GET["agent_uuid"];
|
||||
}
|
||||
$parameters['agent_id'] = $_GET["agent_id"];
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (!empty($row) && !empty($row['agent_name'])) {
|
||||
echo $text['message-duplicate_agent_id'].(if_group("superadmin") ? ": ".$row["agent_name"] : null);
|
||||
}
|
||||
unset($sql, $parameters);
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
//action add or update
|
||||
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
@@ -81,6 +59,14 @@
|
||||
$action = "add";
|
||||
}
|
||||
|
||||
//get the users array
|
||||
$sql = "select * from v_users ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "order by username asc ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$users = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (!empty($_POST)) {
|
||||
$call_center_agent_uuid = $_POST["call_center_agent_uuid"] ?? null;
|
||||
@@ -151,15 +137,6 @@
|
||||
$call_center_agent_uuid = uuid();
|
||||
}
|
||||
|
||||
//get the users array
|
||||
$sql = "select * from v_users ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "order by username asc ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$users = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//change the contact string to loopback - Not recommended added for backwards comptability causes multiple problems
|
||||
if ($_SESSION['call_center']['agent_contact_method']['text'] == 'loopback') {
|
||||
$agent_contact = str_replace("user/", "loopback/", $agent_contact);
|
||||
@@ -193,11 +170,9 @@
|
||||
}
|
||||
|
||||
//save to the data
|
||||
$database = new database;
|
||||
$database->app_name = 'call_center';
|
||||
$database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370';
|
||||
$database->save($array);
|
||||
//$message = $database->message;
|
||||
|
||||
//syncrhonize configuration
|
||||
save_call_center_xml();
|
||||
@@ -295,7 +270,6 @@
|
||||
$sql .= "and call_center_agent_uuid = :call_center_agent_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$parameters['call_center_agent_uuid'] = $call_center_agent_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (!empty($row)) {
|
||||
$call_center_agent_uuid = $row["call_center_agent_uuid"];
|
||||
@@ -338,47 +312,12 @@
|
||||
if ($action == "update") {
|
||||
$document['title'] = $text['title-call_center_agent_edit'];
|
||||
}
|
||||
|
||||
//include the header
|
||||
require_once "resources/header.php";
|
||||
|
||||
//get the list of users for this domain
|
||||
$sql = "select * from v_users ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and user_enabled = 'true' ";
|
||||
$sql .= "order by username asc ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$users = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//javascript to check for duplicates
|
||||
?>
|
||||
<script language="javascript">
|
||||
function check_duplicates() {
|
||||
//check agent id
|
||||
var agent_id = document.getElementById('agent_id').value;
|
||||
$("#duplicate_agent_id_response").load("call_center_agent_edit.php?check=duplicate&agent_id="+agent_id+"&agent_uuid=<?php echo escape($call_center_agent_uuid ?? ''); ?>", function() {
|
||||
var duplicate_agent_id = false;
|
||||
if ($("#duplicate_agent_id_response").html() != '') {
|
||||
$('#agent_id').addClass('formfld_highlight_bad');
|
||||
display_message($("#duplicate_agent_id_response").html(), 'negative'<?php if (if_group("superadmin")) { echo ', 3000'; } ?>);
|
||||
duplicate_agent_id = true;
|
||||
}
|
||||
else {
|
||||
$("#duplicate_agent_id_response").html('');
|
||||
$('#agent_id').removeClass('formfld_highlight_bad');
|
||||
duplicate_agent_id = false;
|
||||
}
|
||||
|
||||
if (duplicate_agent_id == false) {
|
||||
document.getElementById('frm').submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
//show the content
|
||||
echo "<form method='post' name='frm' id='frm' onsubmit='check_duplicates(); return false;'>\n";
|
||||
echo "<form method='post' name='frm' id='frm' onsubmit=''>\n";
|
||||
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'>";
|
||||
@@ -404,21 +343,6 @@
|
||||
echo "</td>\n";
|
||||
echo "<td width='70%' class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='agent_name' maxlength='255' value=\"".escape($agent_name)."\" />\n";
|
||||
/*
|
||||
echo "<select id=\"agent_name\" name=\"agent_name\" class='formfld'>\n";
|
||||
echo "<option value=\"\"></option>\n";
|
||||
if (is_array($users)) {
|
||||
foreach($users as $field) {
|
||||
if ($field[username] == $agent_name) {
|
||||
echo "<option value='".escape($field[username])."' selected='selected'>".escape($field[username])."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo "<option value='".escape($field[username])."'>".escape($field[username])."</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</select>";
|
||||
*/
|
||||
echo "<br />\n";
|
||||
echo $text['description-agent_name']."\n";
|
||||
echo "</td>\n";
|
||||
@@ -467,7 +391,6 @@
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='number' name='agent_id' id='agent_id' maxlength='255' min='1' step='1' value='".escape($agent_id)."'>\n";
|
||||
echo " <div style='display: none;' id='duplicate_agent_id_response'></div>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-agent_id']."\n";
|
||||
echo "</td>\n";
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
$array['users'][0]['user_status'] = $row['agent_status'];
|
||||
$array['users'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('user_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2024
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -42,6 +42,10 @@
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//initialize database and settings
|
||||
$database = database::new();
|
||||
$settings = new settings(['database' => $database, $_SESSION['domain_uuid'] ?? '', $_SESSION['user_uuid'] ?? '']);
|
||||
|
||||
//set the defaults
|
||||
$queue_name = '';
|
||||
$queue_extension = '';
|
||||
@@ -61,24 +65,24 @@
|
||||
$action = "add";
|
||||
}
|
||||
|
||||
//get the domain_uuid
|
||||
//get the domain details
|
||||
$domain_uuid = $_SESSION['domain_uuid'];
|
||||
$domain_name = $_SESSION['domain_name'];
|
||||
|
||||
//initialize the destinations object
|
||||
//initialize the destination object
|
||||
$destination = new destinations;
|
||||
|
||||
//get total call center queues count from the database, check limit, if defined
|
||||
if ($action == 'add') {
|
||||
if (!empty($_SESSION['limit']['call_center_queues']['numeric'])) {
|
||||
if (!empty($settings->get('limit','call_center_queues', ''))) {
|
||||
$sql = "select count(*) from v_call_center_queues ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$total_call_center_queues = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
if ($total_call_center_queues >= $_SESSION['limit']['call_center_queues']['numeric']) {
|
||||
message::add($text['message-maximum_queues'].' '.$_SESSION['limit']['call_center_queues']['numeric'], 'negative');
|
||||
if ($total_call_center_queues >= $settings->get('limit','call_center_queues', 0)) {
|
||||
message::add($text['message-maximum_queues'].' '.$settings->get('limit','call_center_queues', ''), 'negative');
|
||||
header('Location: call_center_queues.php');
|
||||
return;
|
||||
}
|
||||
@@ -124,7 +128,7 @@
|
||||
$queue_context = $_POST["queue_context"];
|
||||
}
|
||||
else if ($action == 'add') {
|
||||
$queue_context = $_SESSION['domain_name'];
|
||||
$queue_context = $domain_name;
|
||||
}
|
||||
|
||||
//remove invalid characters
|
||||
@@ -149,7 +153,6 @@
|
||||
$sql .= "and t.call_center_queue_uuid = q.call_center_queue_uuid; ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$parameters['call_center_tier_uuid'] = $call_center_tier_uuid;
|
||||
$database = new database;
|
||||
$tiers = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
@@ -168,7 +171,7 @@
|
||||
if ($esl->is_connected()) {
|
||||
//callcenter_config tier del [queue_name] [agent_name]
|
||||
if (is_numeric($queue_extension) && is_uuid($call_center_agent_uuid)) {
|
||||
$cmd = "callcenter_config tier del ".$queue_extension."@".$_SESSION['domain_name']." ".$call_center_agent_uuid;
|
||||
$cmd = "callcenter_config tier del ".$queue_extension."@".$domain_name." ".$call_center_agent_uuid;
|
||||
$response = event_socket::api($cmd);
|
||||
}
|
||||
}
|
||||
@@ -178,10 +181,9 @@
|
||||
$array['call_center_tiers'][0]['call_center_tier_uuid'] = $call_center_tier_uuid;
|
||||
$array['call_center_tiers'][0]['domain_uuid'] = $domain_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('call_center_tier_delete', 'temp');
|
||||
|
||||
$database = new database;
|
||||
$database->app_name = 'call_centers';
|
||||
$database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370';
|
||||
$database->delete($array);
|
||||
@@ -205,7 +207,6 @@
|
||||
$sql = "select * from v_call_center_queues ";
|
||||
$sql .= "where call_center_queue_uuid = :call_center_queue_uuid ";
|
||||
$parameters['call_center_queue_uuid'] = $call_center_queue_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (!empty($row)) {
|
||||
//if (!permission_exists('call_center_queue_domain')) {
|
||||
@@ -298,8 +299,8 @@
|
||||
|
||||
//add the recording path if needed
|
||||
if (!empty($queue_greeting)) {
|
||||
if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$queue_greeting)) {
|
||||
$queue_greeting_path = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$queue_greeting;
|
||||
if (file_exists($settings->get('switch','recordings', '').'/'.$domain_name.'/'.$queue_greeting)) {
|
||||
$queue_greeting_path = $settings->get('switch','recordings', '').'/'.$domain_name.'/'.$queue_greeting;
|
||||
}
|
||||
else {
|
||||
$queue_greeting_path = trim($queue_greeting);
|
||||
@@ -371,8 +372,8 @@
|
||||
|
||||
//add definable export variables can be set in default settings
|
||||
$export_variables = 'call_center_queue_uuid,sip_h_Alert-Info';
|
||||
if (!empty($_SESSION['call_center']['export_vars'])) {
|
||||
foreach ($_SESSION['call_center']['export_vars'] as $export_variable) {
|
||||
if (!empty($settings->get('call_center','export_vars', []))) {
|
||||
foreach ($settings->get('call_center','export_vars', []) as $export_variable) {
|
||||
$export_variables .= ','.$export_variable;
|
||||
}
|
||||
}
|
||||
@@ -413,7 +414,7 @@
|
||||
if (!empty($queue_cc_exit_keys)) {
|
||||
$dialplan_xml .= " <action application=\"set\" data=\"cc_exit_keys=".xml::sanitize($queue_cc_exit_keys)."\"/>\n";
|
||||
}
|
||||
$dialplan_xml .= " <action application=\"callcenter\" data=\"".xml::sanitize($queue_extension)."@".$_SESSION["domain_name"]."\"/>\n";
|
||||
$dialplan_xml .= " <action application=\"callcenter\" data=\"".xml::sanitize($queue_extension)."@".$domain_name."\"/>\n";
|
||||
if ($destination->valid($queue_timeout_app.':'.$queue_timeout_data)) {
|
||||
$dialplan_xml .= " <action application=\"".xml::sanitize($queue_timeout_app)."\" data=\"".xml::sanitize($queue_timeout_data)."\"/>\n";
|
||||
}
|
||||
@@ -434,12 +435,11 @@
|
||||
$array['dialplans'][0]["app_uuid"] = "95788e50-9500-079e-2807-fd530b0ea370";
|
||||
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("dialplan_add", "temp");
|
||||
$p->add("dialplan_edit", "temp");
|
||||
|
||||
//save to the data
|
||||
$database = new database;
|
||||
$database->app_name = 'call_centers';
|
||||
$database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370';
|
||||
$database->save($array);
|
||||
@@ -457,7 +457,7 @@
|
||||
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("dialplan:".$_SESSION["domain_name"]);
|
||||
$cache->delete("dialplan:".$domain_name);
|
||||
|
||||
//clear the destinations session array
|
||||
if (isset($_SESSION['destinations']['array'])) {
|
||||
@@ -496,19 +496,19 @@
|
||||
*/
|
||||
//add the agent
|
||||
if (is_numeric($queue_extension) && is_uuid($call_center_agent_uuid) && is_numeric($tier_level) && is_numeric($tier_position)) {
|
||||
$cmd = "callcenter_config tier add ".$queue_extension."@".$_SESSION["domain_name"]." ".$call_center_agent_uuid." ".$tier_level." ".$tier_position;
|
||||
$cmd = "callcenter_config tier add ".$queue_extension."@".$domain_name." ".$call_center_agent_uuid." ".$tier_level." ".$tier_position;
|
||||
$response = event_socket::api($cmd);
|
||||
}
|
||||
usleep(200);
|
||||
//agent set level
|
||||
if (is_numeric($queue_extension) && is_numeric($tier_level)) {
|
||||
$cmd = "callcenter_config tier set level ".$queue_extension."@".$_SESSION["domain_name"]." ".$call_center_agent_uuid." ".$tier_level;
|
||||
$cmd = "callcenter_config tier set level ".$queue_extension."@".$domain_name." ".$call_center_agent_uuid." ".$tier_level;
|
||||
$response = event_socket::api($cmd);
|
||||
}
|
||||
usleep(200);
|
||||
//agent set position
|
||||
if (is_numeric($queue_extension) && is_numeric($tier_position)) {
|
||||
$cmd = "callcenter_config tier set position ".$queue_extension."@".$_SESSION["domain_name"]." ".$tier_position;
|
||||
$cmd = "callcenter_config tier set position ".$queue_extension."@".$domain_name." ".$tier_position;
|
||||
$response = event_socket::api($cmd);
|
||||
}
|
||||
usleep(200);
|
||||
@@ -538,7 +538,6 @@
|
||||
$sql .= "and call_center_queue_uuid = :call_center_queue_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$parameters['call_center_queue_uuid'] = $call_center_queue_uuid;
|
||||
$database = new database;
|
||||
$call_center_queues = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
@@ -587,17 +586,16 @@
|
||||
$sql .= "order by tier_level asc, tier_position asc, a.agent_name asc";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$parameters['call_center_queue_uuid'] = $call_center_queue_uuid ?? null;
|
||||
$database = new database;
|
||||
$tiers = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//add an empty row to the tiers array
|
||||
if (count($tiers) == 0) {
|
||||
$rows = $_SESSION['call_center']['agent_add_rows']['numeric'] ?? null;
|
||||
$rows = $settings->get('call_center','agent_add_rows', null);
|
||||
$id = 0;
|
||||
}
|
||||
if (count($tiers) > 0) {
|
||||
$rows = $_SESSION['call_center']['agent_edit_rows']['numeric'];
|
||||
$rows = $settings->get('call_center','agent_edit_rows', null);
|
||||
$id = count($tiers)+1;
|
||||
}
|
||||
for ($x = 0; $x < $rows; $x++) {
|
||||
@@ -615,7 +613,6 @@
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "order by agent_name asc";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$agents = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
@@ -624,6 +621,7 @@
|
||||
$audio_files[0] = $sounds->get();
|
||||
unset($sounds);
|
||||
|
||||
//get the list of sounds
|
||||
if (permission_exists('call_center_announce_sound')) {
|
||||
$sounds = new sounds;
|
||||
$sounds->sound_types = ['recordings'];
|
||||
@@ -646,7 +644,7 @@
|
||||
if (empty($queue_tier_rule_no_agent_no_wait)) { $queue_tier_rule_no_agent_no_wait = "true"; }
|
||||
if (empty($queue_discard_abandoned_after)) { $queue_discard_abandoned_after = "900"; }
|
||||
if (empty($queue_abandoned_resume_allowed)) { $queue_abandoned_resume_allowed = "false"; }
|
||||
if (empty($queue_context)) { $queue_context = $_SESSION['domain_name']; }
|
||||
if (empty($queue_context)) { $queue_context = $domain_name; }
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
@@ -667,12 +665,8 @@
|
||||
}
|
||||
|
||||
//set the record_template
|
||||
if (empty($_SESSION['call_center']['record_name']['text'])) {
|
||||
$record_template = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/\${strftime(%Y)}/\${strftime(%b)}/\${strftime(%d)}/\${uuid}.\${record_ext}";
|
||||
}
|
||||
else {
|
||||
$record_template = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".$_SESSION['call_center']['record_name']['text'];
|
||||
}
|
||||
$record_template = $settings->get('switch','recordings', '')."/".$domain_name."/archive/";
|
||||
$record_template .= $settings->get('call_center','record_name', "\${strftime(%Y)}/\${strftime(%b)}/\${strftime(%d)}/\${uuid}.\${record_ext}");
|
||||
|
||||
//show the content
|
||||
if (permission_exists('recording_play') || permission_exists('recording_download')) {
|
||||
@@ -757,7 +751,7 @@
|
||||
}
|
||||
echo "</div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'call_center_queues.php']);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$settings->get('theme','button_icon_back', ''),'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'call_center_queues.php']);
|
||||
|
||||
if ($action == "update") {
|
||||
if (permission_exists('call_center_wallboard')) {
|
||||
@@ -765,10 +759,10 @@
|
||||
}
|
||||
//echo button::create(['type'=>'button','label'=>$text['button-stop'],'icon'=>$_SESSION['theme']['button_icon_stop'],'link'=>'cmd.php?cmd=unload&id='.urlencode($call_center_queue_uuid)]);
|
||||
//echo button::create(['type'=>'button','label'=>$text['button-start'],'icon'=>$_SESSION['theme']['button_icon_start'],'link'=>'cmd.php?cmd=load&id='.urlencode($call_center_queue_uuid)]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-reload'],'icon'=>$_SESSION['theme']['button_icon_reload'],'link'=>'cmd.php?cmd=reload&id='.urlencode($call_center_queue_uuid)]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-view'],'icon'=>$_SESSION['theme']['button_icon_view'],'style'=>'margin-right: 15px;','link'=>PROJECT_PATH.'/app/call_center_active/call_center_active.php?queue_name='.urlencode($call_center_queue_uuid)]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-reload'],'icon'=>$settings->get('theme','button_icon_reload', ''),'link'=>'cmd.php?cmd=reload&id='.urlencode($call_center_queue_uuid)]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-view'],'icon'=>$settings->get('theme','button_icon_view', ''),'style'=>'margin-right: 15px;','link'=>PROJECT_PATH.'/app/call_center_active/call_center_active.php?queue_name='.urlencode($call_center_queue_uuid)]);
|
||||
}
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save']);
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$settings->get('theme','button_icon_save', ''),'id'=>'btn_save']);
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
@@ -791,7 +785,7 @@
|
||||
echo " ".$text['label-extension']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='number' name='queue_extension' maxlength='255' min='0' step='1' value=\"".escape($queue_extension)."\" required='required' placeholder=\"".($_SESSION['call_center']['extension_range']['text'] ?? '')."\">\n";
|
||||
echo " <input class='formfld' type='number' name='queue_extension' maxlength='255' min='0' step='1' value=\"".escape($queue_extension)."\" required='required' placeholder=\"".$settings->get('call_center','extension_range', '')."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-extension']."\n";
|
||||
echo "</td>\n";
|
||||
@@ -818,8 +812,8 @@
|
||||
if ($key == 'recordings') {
|
||||
if (
|
||||
!empty($instance_value) &&
|
||||
($instance_value == $row["value"] || $instance_value == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].'/'.$row["value"]) &&
|
||||
file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].'/'.pathinfo($row["value"], PATHINFO_BASENAME))
|
||||
($instance_value == $row["value"] || $instance_value == $settings->get('switch','recordings', '')."/".$domain_name.'/'.$row["value"]) &&
|
||||
file_exists($settings->get('switch','recordings', '')."/".$domain_name.'/'.pathinfo($row["value"], PATHINFO_BASENAME))
|
||||
) {
|
||||
$selected = "selected='selected'";
|
||||
$playable = '../recordings/recordings.php?action=download&type=rec&filename='.pathinfo($row["value"], PATHINFO_BASENAME);
|
||||
@@ -862,7 +856,7 @@
|
||||
case 'ogg' : $mime_type = 'audio/ogg'; break;
|
||||
}
|
||||
echo "<audio id='recording_audio_".$instance_id."' style='display: none;' preload='none' ontimeupdate=\"update_progress('".$instance_id."')\" onended=\"recording_reset('".$instance_id."');\" src='".($playable ?? '')."' type='".($mime_type ?? '')."'></audio>";
|
||||
echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'],'icon'=>$_SESSION['theme']['button_icon_play'],'id'=>'recording_button_'.$instance_id,'style'=>'display: '.(!empty($mime_type) ? 'inline' : 'none'),'onclick'=>"recording_play('".$instance_id."', document.getElementById('".$instance_id."').value, document.getElementById('".$instance_id."').options[document.getElementById('".$instance_id."').selectedIndex].parentNode.getAttribute('data-type'))"]);
|
||||
echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'],'icon'=>$settings->get('theme','button_icon_play', ''),'id'=>'recording_button_'.$instance_id,'style'=>'display: '.(!empty($mime_type) ? 'inline' : 'none'),'onclick'=>"recording_play('".$instance_id."', document.getElementById('".$instance_id."').value, document.getElementById('".$instance_id."').options[document.getElementById('".$instance_id."').selectedIndex].parentNode.getAttribute('data-type'))"]);
|
||||
unset($playable, $mime_type);
|
||||
}
|
||||
echo "<br />\n";
|
||||
@@ -1318,8 +1312,8 @@
|
||||
if ($key == 'recordings') {
|
||||
if (
|
||||
!empty($instance_value) &&
|
||||
($instance_value == $row["value"] || $instance_value == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].'/'.$row["value"]) &&
|
||||
file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].'/'.pathinfo($row["value"], PATHINFO_BASENAME))
|
||||
($instance_value == $row["value"] || $instance_value == $settings->get('switch','recordings', '')."/".$domain_name.'/'.$row["value"]) &&
|
||||
file_exists($settings->get('switch','recordings', '')."/".$domain_name.'/'.pathinfo($row["value"], PATHINFO_BASENAME))
|
||||
) {
|
||||
$selected = "selected='selected'";
|
||||
$playable = '../recordings/recordings.php?action=download&type=rec&filename='.pathinfo($row["value"], PATHINFO_BASENAME);
|
||||
@@ -1362,7 +1356,7 @@
|
||||
case 'ogg' : $mime_type = 'audio/ogg'; break;
|
||||
}
|
||||
echo "<audio id='recording_audio_".$instance_id."' style='display: none;' preload='none' ontimeupdate=\"update_progress('".$instance_id."')\" onended=\"recording_reset('".$instance_id."');\" src='".($playable ?? '')."' type='".($mime_type ?? '')."'></audio>";
|
||||
echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'],'icon'=>$_SESSION['theme']['button_icon_play'],'id'=>'recording_button_'.$instance_id,'style'=>'display: '.(!empty($mime_type) ? 'inline' : 'none'),'onclick'=>"recording_play('".$instance_id."', document.getElementById('".$instance_id."').value, document.getElementById('".$instance_id."').options[document.getElementById('".$instance_id."').selectedIndex].parentNode.getAttribute('data-type'))"]);
|
||||
echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'],'icon'=>$settings->get('theme','button_icon_play', ''),'id'=>'recording_button_'.$instance_id,'style'=>'display: '.(!empty($mime_type) ? 'inline' : 'none'),'onclick'=>"recording_play('".$instance_id."', document.getElementById('".$instance_id."').value, document.getElementById('".$instance_id."').options[document.getElementById('".$instance_id."').selectedIndex].parentNode.getAttribute('data-type'))"]);
|
||||
unset($playable, $mime_type);
|
||||
}
|
||||
echo "<br />\n";
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
$array['dialplan_details'][0]['domain_uuid'] = $this->domain_uuid;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_delete', 'temp');
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
$array["dialplans"][0] = $dialplan;
|
||||
|
||||
//add temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("dialplan_add", 'temp');
|
||||
$p->add("dialplan_detail_add", 'temp');
|
||||
$p->add("dialplan_edit", 'temp');
|
||||
@@ -242,7 +242,7 @@
|
||||
$array['call_center_queues'][0]['dialplan_uuid'] = $this->dialplan_uuid;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('call_center_queue_edit', 'temp');
|
||||
|
||||
//execute update
|
||||
@@ -349,7 +349,7 @@
|
||||
}
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('call_center_tier_delete', 'temp');
|
||||
$p->add('dialplan_delete', 'temp');
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
@@ -446,7 +446,7 @@
|
||||
}
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('call_center_tier_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
@@ -578,7 +578,7 @@
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('call_center_tier_add', 'temp');
|
||||
$p->add('dialplan_add', 'temp');
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
$array["call_flows"][$i]["call_flow_description"] = $call_flow_description;
|
||||
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("dialplan_add", "temp");
|
||||
$p->add("dialplan_edit", "temp");
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ if (!class_exists('call_flows')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_delete', 'temp');
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
|
||||
@@ -223,7 +223,7 @@ if (!class_exists('call_flows')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
|
||||
//save the array
|
||||
@@ -374,7 +374,7 @@ if (!class_exists('call_flows')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_add', 'temp');
|
||||
|
||||
//save the array
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
}
|
||||
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("extension_edit", "temp");
|
||||
|
||||
//save the data
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
}
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('extension_add', 'temp');
|
||||
|
||||
//execute update
|
||||
@@ -214,7 +214,7 @@
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('extension_edit', 'temp');
|
||||
|
||||
//save the array
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
$array['extensions'][0]['do_not_disturb'] = $this->enabled;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('extension_edit', 'temp');
|
||||
|
||||
//execute update
|
||||
@@ -226,7 +226,7 @@
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('extension_edit', 'temp');
|
||||
|
||||
//save the array
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
$array['follow_me'][0]['follow_me_enabled'] = $this->follow_me_enabled;
|
||||
$array['follow_me'][0]['follow_me_ignore_busy'] = $this->follow_me_ignore_busy;
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('follow_me_add', 'temp');
|
||||
//execute insert
|
||||
$database = new database;
|
||||
@@ -115,7 +115,7 @@
|
||||
$array['follow_me'][0]['follow_me_enabled'] = $this->follow_me_enabled;
|
||||
$array['follow_me'][0]['follow_me_ignore_busy'] = $this->follow_me_ignore_busy;
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('follow_me_add', 'temp');
|
||||
//execute update
|
||||
$database = new database;
|
||||
@@ -135,7 +135,7 @@
|
||||
//delete related follow me destinations
|
||||
$array['follow_me_destinations'][0]['follow_me_uuid'] = $this->follow_me_uuid;
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('follow_me_destination_delete', 'temp');
|
||||
//execute delete
|
||||
$database = new database;
|
||||
@@ -210,7 +210,7 @@
|
||||
}
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('follow_me_destination_add', 'temp');
|
||||
//execute insert
|
||||
$database = new database;
|
||||
@@ -234,7 +234,7 @@
|
||||
$extension_uuid = $result[0]['extension_uuid'];
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("follow_me_edit", 'temp');
|
||||
$p->add("extension_edit", 'temp');
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('extension_edit', 'temp');
|
||||
$p->add('follow_me_edit', 'temp');
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'call_recording_download';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'call_recording_transcribe';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "95cb740e-e377-4852-8894-06441c61e78b";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "call_recordings";
|
||||
@@ -42,4 +45,13 @@
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "90";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Number of days to retain the maintenance logs in the database.";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "e329db05-2967-422a-a71f-d0175b083828";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "call_recordings";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "record_extension";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "mp3";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Call recording file format options: wav, mp3";
|
||||
|
||||
?>
|
||||
|
||||
@@ -38,13 +38,16 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//create the database connection
|
||||
$database = new database;
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//add the settings object
|
||||
$settings = new settings(["domain_uuid" => $_SESSION['domain_uuid'], "user_uuid" => $_SESSION['user_uuid']]);
|
||||
$transcribe_enabled = $settings->get('transcribe', 'enabled', 'false');
|
||||
$transcribe_enabled = $settings->get('transcribe', 'enabled', false);
|
||||
$transcribe_engine = $settings->get('transcribe', 'engine', '');
|
||||
|
||||
//set additional variables
|
||||
@@ -68,7 +71,7 @@
|
||||
}
|
||||
break;
|
||||
case 'transcribe':
|
||||
if (permission_exists('call_recording_download')) {
|
||||
if (permission_exists('call_recording_transcribe')) {
|
||||
$obj = new call_recordings;
|
||||
$obj->transcribe($call_recordings);
|
||||
}
|
||||
@@ -104,24 +107,6 @@
|
||||
}
|
||||
$parameters['time_zone'] = $time_zone;
|
||||
|
||||
//get the count
|
||||
//$sql = "select count(*) ";
|
||||
//$sql .= "from view_call_recordings ";
|
||||
//$sql .= "where true ";
|
||||
//if ($_GET['show'] != "all" || !permission_exists('call_recording_all')) {
|
||||
// $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
// $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
//}
|
||||
//if (isset($search)) {
|
||||
// $sql .= "and (";
|
||||
// $sql .= " lower(call_recording_name) like :search ";
|
||||
// $sql .= " or lower(call_recording_path) like :search ";
|
||||
// $sql .= ") ";
|
||||
// $parameters['search'] = '%'.$search.'%';
|
||||
//}
|
||||
//$database = new database;
|
||||
//$num_rows = $database->select($sql, $parameters, 'column');
|
||||
|
||||
//prepare some of the paging values
|
||||
$rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$page = $_GET['page'] ?? '';
|
||||
@@ -138,7 +123,7 @@
|
||||
//$sql .= "from v_call_recordings as r, v_domains as d ";
|
||||
$sql .= "where true ";
|
||||
if ($show != "all" || !permission_exists('call_recording_all')) {
|
||||
$sql .= "and (r.domain_uuid = :domain_uuid or r.domain_uuid is null) ";
|
||||
$sql .= "and r.domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
}
|
||||
$sql .= "and r.domain_uuid = d.domain_uuid ";
|
||||
@@ -156,21 +141,17 @@
|
||||
}
|
||||
$sql .= order_by($order_by, $order, 'r.call_recording_date', 'desc');
|
||||
$sql .= limit_offset($rows_per_page, $offset);
|
||||
$database = new database;
|
||||
$call_recordings = $database->select($sql, $parameters ?? null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//detect if any transcriptions available
|
||||
if ($transcribe_enabled == 'true' && !empty($transcribe_engine) && !empty($call_recordings) && is_array($call_recordings)) {
|
||||
if ($transcribe_enabled && !empty($transcribe_engine) && !empty($call_recordings) && is_array($call_recordings)) {
|
||||
$transcriptions_exists = false;
|
||||
foreach ($call_recordings as $row) {
|
||||
if (!empty($row['call_recording_transcription'])) { $transcriptions_exists = true; }
|
||||
}
|
||||
}
|
||||
|
||||
//count the results
|
||||
$result_count = is_array($call_recordings) ? sizeof($call_recordings) : 0;
|
||||
|
||||
//limit the number of results
|
||||
if (!empty($_SESSION['cdr']['limit']['numeric']) && $_SESSION['cdr']['limit']['numeric'] > 0) {
|
||||
$num_rows = $_SESSION['cdr']['limit']['numeric'];
|
||||
@@ -199,7 +180,7 @@
|
||||
if (permission_exists('call_recording_download') && !empty($call_recordings)) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'id'=>'btn_download','name'=>'btn_download','style'=>'display: none;','collapse'=>'hide-xs','onclick'=>"list_action_set('download'); list_form_submit('form_list');"]);
|
||||
}
|
||||
if ($transcribe_enabled == 'true' && !empty($transcribe_engine) && !empty($call_recordings)) {
|
||||
if (permission_exists('call_recording_transcribe') && $transcribe_enabled && !empty($transcribe_engine) && !empty($call_recordings)) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-transcribe'],'icon'=>'quote-right','id'=>'btn_transcribe','name'=>'btn_transcribe','style'=>'display: none;','collapse'=>'hide-xs','onclick'=>"list_action_set('transcribe'); list_form_submit('form_list');"]);
|
||||
}
|
||||
if (permission_exists('call_recording_delete') && !empty($call_recordings)) {
|
||||
@@ -272,12 +253,9 @@
|
||||
if (is_array($call_recordings) && @sizeof($call_recordings) != 0) {
|
||||
$x = 0;
|
||||
foreach ($call_recordings as $row) {
|
||||
//add padding to the call recording length
|
||||
$call_recording_length_padding = (!empty($row['call_recording_length'])) ? str_pad($row['call_recording_length'], 2, '0', STR_PAD_LEFT) : '';
|
||||
|
||||
//playback progress bar
|
||||
if (permission_exists('call_recording_play')) {
|
||||
echo "<tr class='list-row' id='recording_progress_bar_".escape($row['call_recording_uuid'])."' style='display: none;' onclick=\"recording_play('".escape($row['call_recording_uuid'])."')\"><td id='playback_progress_bar_background_".escape($row['call_recording_uuid'])."' class='playback_progress_bar_background' colspan='".$col_count."'><span class='playback_progress_bar' id='recording_progress_".escape($row['call_recording_uuid'])."'></span></td>".(permission_exists('xml_cdr_details') ? "<td class='action-button' style='border-bottom: none !important;'></td>" : null)."</tr>\n";
|
||||
echo "<tr class='list-row' id='recording_progress_bar_".escape($row['call_recording_uuid'])."' style='display: none;' onclick=\"recording_seek(event,'".escape($row['call_recording_uuid'])."')\"><td id='playback_progress_bar_background_".escape($row['call_recording_uuid'])."' class='playback_progress_bar_background' colspan='".$col_count."'><span class='playback_progress_bar' id='recording_progress_".escape($row['call_recording_uuid'])."'></span></td>".(permission_exists('xml_cdr_details') ? "<td class='action-button' style='border-bottom: none !important;'></td>" : null)."</tr>\n";
|
||||
echo "<tr class='list-row' style='display: none;'><td></td></tr>\n"; // dummy row to maintain alternating background color
|
||||
}
|
||||
if (permission_exists('call_recording_play')) {
|
||||
@@ -314,13 +292,13 @@
|
||||
if (permission_exists('call_recording_download')) {
|
||||
echo button::create(['type'=>'button','title'=>$text['label-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'link'=>'download.php?id='.urlencode($row['call_recording_uuid']).'&binary']);
|
||||
}
|
||||
if ($transcribe_enabled == 'true' && !empty($transcribe_engine) && $transcriptions_exists === true) {
|
||||
if (permission_exists('call_recording_transcribe') && $transcribe_enabled && !empty($transcribe_engine) && $transcriptions_exists === true) {
|
||||
echo button::create(['type'=>'button','title'=>$text['label-transcription'],'icon'=>'quote-right','style'=>(empty($row['call_recording_transcription']) ? 'visibility:hidden;' : null),'onclick'=>"document.getElementById('transcription_".$row['call_recording_uuid']."').style.display = document.getElementById('transcription_".$row['call_recording_uuid']."').style.display == 'none' ? 'table-row' : 'none'; this.blur(); return false;"]);
|
||||
}
|
||||
}
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo " <td class='right overflow hide-sm-dn shrink'>".($row['call_recording_length'] <= 59 ? '0:' : null).escape($call_recording_length_padding)."</td>\n";
|
||||
echo " <td class='right overflow hide-sm-dn shrink'>".escape(gmdate("G:i:s", $row['call_recording_length']))."</td>\n";
|
||||
echo " <td class='overflow center no-wrap'>".escape($row['call_recording_date_formatted'])." <span class='hide-sm-dn'>".escape($row['call_recording_time_formatted'])."</span></td>\n";
|
||||
echo " <td class='left hide-sm-dn shrink'>".($row['call_direction'] != '' ? escape($text['label-'.$row['call_direction']]) : null)."</td>\n";
|
||||
if (permission_exists('xml_cdr_details')) {
|
||||
@@ -329,7 +307,7 @@
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
if ($transcribe_enabled == 'true' && !empty($transcribe_engine) && !empty($row['call_recording_transcription'])) {
|
||||
if (permission_exists('call_recording_transcribe') && $transcribe_enabled && !empty($transcribe_engine) && !empty($row['call_recording_transcription'])) {
|
||||
echo "<tr style='display: none;'><td></td></tr>\n"; // dummy row to maintain same background color for transcription row
|
||||
echo "<tr id='transcription_".$row['call_recording_uuid']."' class='list-row' style='display: none;'>\n";
|
||||
echo " <td style='padding: 10px 20px 15px 20px;' colspan='".$col_count."'>\n";
|
||||
|
||||
@@ -110,7 +110,7 @@ if (!class_exists('call_recordings')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//add temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('xml_cdr_edit', 'temp');
|
||||
|
||||
//remove record_path, record_name and record_length
|
||||
@@ -152,11 +152,11 @@ if (!class_exists('call_recordings')) {
|
||||
|
||||
//add the settings object
|
||||
$settings = new settings(["domain_uuid" => $_SESSION['domain_uuid'], "user_uuid" => $_SESSION['user_uuid']]);
|
||||
$transcribe_enabled = $settings->get('transcribe', 'enabled', 'false');
|
||||
$transcribe_enabled = $settings->get('transcribe', 'enabled', false);
|
||||
$transcribe_engine = $settings->get('transcribe', 'engine', '');
|
||||
|
||||
//transcribe multiple recordings
|
||||
if ($transcribe_enabled == 'true' && !empty($transcribe_engine) && is_array($records) && @sizeof($records) != 0) {
|
||||
if ($transcribe_enabled && !empty($transcribe_engine) && is_array($records) && @sizeof($records) != 0) {
|
||||
//add the transcribe object
|
||||
$transcribe = new transcribe($settings);
|
||||
|
||||
@@ -200,7 +200,7 @@ if (!class_exists('call_recordings')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//add temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('xml_cdr_edit', 'temp');
|
||||
|
||||
//remove record_path, record_name and record_length
|
||||
@@ -482,7 +482,7 @@ if (!class_exists('call_recordings')) {
|
||||
$domain_settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid]);
|
||||
|
||||
//get the recording location for this domain
|
||||
$call_recording_location = $domain_settings->get('switch', 'recordings', '/var/lib/freeswitch/storage/recordings') . '/default';
|
||||
$call_recording_location = $domain_settings->get('switch', 'recordings', '/var/lib/freeswitch/recordings');
|
||||
|
||||
//get the retention days for this domain
|
||||
$retention_days = $domain_settings->get('call_recordings', 'filesystem_retention_days', '');
|
||||
@@ -492,8 +492,8 @@ if (!class_exists('call_recordings')) {
|
||||
$retention_days = intval($retention_days);
|
||||
|
||||
//get list of mp3 and wav files
|
||||
$mp3_files = glob("$call_recording_location/$domain_name/*/archive/*.mp3");
|
||||
$wav_files = glob("$call_recording_location/$domain_name/*/archive/*.wav");
|
||||
$mp3_files = glob("$call_recording_location/$domain_name/archive/*/*/*/*.mp3");
|
||||
$wav_files = glob("$call_recording_location/$domain_name/archive/*/*/*/*.wav");
|
||||
|
||||
//combine to single array
|
||||
$domain_call_recording_files = array_merge($mp3_files, $wav_files);
|
||||
@@ -506,7 +506,7 @@ if (!class_exists('call_recordings')) {
|
||||
//remove the file when it is older
|
||||
if (unlink($file)) {
|
||||
//log success
|
||||
maintenance_service::log_write(self::class, "Removed $file from call_recordings", $domain_uuid);
|
||||
maintenance_service::log_write(self::class, "Removed $file from call_recordings older than $retention_days days", $domain_uuid);
|
||||
} else {
|
||||
//log failure
|
||||
maintenance_service::log_write(self::class, "Unable to remove $file", $domain_uuid, maintenance_service::LOG_ERROR);
|
||||
|
||||
@@ -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'] = "استخدم هذا لعرض جميع الملحقات ومراقبة المكالمات النشطة والتفاعل معها.";
|
||||
|
||||
@@ -88,10 +88,8 @@
|
||||
}
|
||||
$num_rows = @sizeof($rows);
|
||||
|
||||
|
||||
//if the connnection is available then run it and return the results
|
||||
if (!$event_socket) {
|
||||
|
||||
$msg = "<div align='center'>".$text['confirm-socket']."<br /></div>";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='40%'>\n";
|
||||
@@ -103,172 +101,197 @@
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "</div>\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 "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['title']."</b><div class='count'>".number_format($num_rows)."</div></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
echo " <span id='refresh_state'>".button::create(['type'=>'button','title'=>$text['label-refresh_pause'],'icon'=>'sync-alt fa-spin','onclick'=>'refresh_stop()'])."</span>";
|
||||
if (permission_exists('call_active_eavesdrop') && !empty($_SESSION['user']['extensions'])) {
|
||||
if (sizeof($_SESSION['user']['extensions']) > 1) {
|
||||
echo " <input type='hidden' id='eavesdrop_dest' value=\"".(($_REQUEST['eavesdrop_dest'] == '') ? $_SESSION['user']['extension'][0]['destination'] : escape($_REQUEST['eavesdrop_dest']))."\">\n";
|
||||
echo " <i class='fas fa-headphones' style='margin-left: 15px; cursor: help;' title='".$text['description-eavesdrop_destination']."' align='absmiddle'></i>\n";
|
||||
echo " <select class='formfld' style='margin-right: 5px;' align='absmiddle' onchange=\"document.getElementById('eavesdrop_dest').value = this.options[this.selectedIndex].value; refresh_start();\" onfocus='refresh_stop();'>\n";
|
||||
if (is_array($_SESSION['user']['extensions'])) {
|
||||
foreach ($_SESSION['user']['extensions'] as $user_extension) {
|
||||
echo " <option value='".escape($user_extension)."' ".(($_REQUEST['eavesdrop_dest'] == $user_extension) ? "selected" : null).">".escape($user_extension)."</option>\n";
|
||||
}
|
||||
//add the style
|
||||
echo "<style>\n";
|
||||
echo " /* Small screens: Hide columns with class 'hide-small' */\n";
|
||||
echo " @media (max-width: 600px) {\n";
|
||||
echo " .hide-small {\n";
|
||||
echo " display: none;\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo "\n";
|
||||
echo " /* Medium screens: Hide columns with class 'hide-medium' */\n";
|
||||
echo "@media (max-width: 1023px) and (min-width: 601px) {\n";
|
||||
echo " .hide-medium {\n";
|
||||
echo " display: none;\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo "\n";
|
||||
echo "</style>\n";
|
||||
|
||||
//show the content
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['title']."</b><div class='count'>".number_format($num_rows)."</div></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
echo " <span id='refresh_state'>".button::create(['type'=>'button','title'=>$text['label-refresh_pause'],'icon'=>'sync-alt fa-spin','onclick'=>'refresh_stop()'])."</span>";
|
||||
if (permission_exists('call_active_eavesdrop') && !empty($_SESSION['user']['extensions'])) {
|
||||
if (sizeof($_SESSION['user']['extensions']) > 1) {
|
||||
echo " <input type='hidden' id='eavesdrop_dest' value=\"".(($_REQUEST['eavesdrop_dest'] == '') ? $_SESSION['user']['extension'][0]['destination'] : escape($_REQUEST['eavesdrop_dest']))."\">\n";
|
||||
echo " <i class='fas fa-headphones' style='margin-left: 15px; cursor: help;' title='".$text['description-eavesdrop_destination']."' align='absmiddle'></i>\n";
|
||||
echo " <select class='formfld' style='margin-right: 5px;' align='absmiddle' onchange=\"document.getElementById('eavesdrop_dest').value = this.options[this.selectedIndex].value; refresh_start();\" onfocus='refresh_stop();'>\n";
|
||||
if (is_array($_SESSION['user']['extensions'])) {
|
||||
foreach ($_SESSION['user']['extensions'] as $user_extension) {
|
||||
echo " <option value='".escape($user_extension)."' ".(($_REQUEST['eavesdrop_dest'] == $user_extension) ? "selected" : null).">".escape($user_extension)."</option>\n";
|
||||
}
|
||||
}
|
||||
echo " </select>\n";
|
||||
}
|
||||
else if (sizeof($_SESSION['user']['extensions']) == 1) {
|
||||
echo " <input type='hidden' id='eavesdrop_dest' value=\"".escape($_SESSION['user']['extension'][0]['destination'])."\">\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 " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\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 "<br /><br />\n";
|
||||
|
||||
//show the results
|
||||
echo "<div id='cmd_reponse'></div>\n";
|
||||
|
||||
echo "<form id='form_list' method='post' action='calls_exec.php'>\n";
|
||||
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||
|
||||
echo "<div class='card'>\n";
|
||||
echo " <table class='list'>\n";
|
||||
echo " <tr class='list-header'>\n";
|
||||
if (permission_exists('call_active_hangup')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='if (this.checked) { refresh_stop(); } else { refresh_start(); } list_all_toggle();' ".(empty($rows) ? "style='visibility: hidden;'" : null).">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
echo " <th class='hide-small'>".$text['label-profile']."</th>\n";
|
||||
//echo" <th>".$text['label-created']."</th>\n";
|
||||
echo " <th>".$text['label-duration']."</th>\n";
|
||||
if ($show == 'all') {
|
||||
echo " <th>".$text['label-domain']."</th>\n";
|
||||
}
|
||||
//echo " <th>".$text['label-number']."</th>\n";
|
||||
echo " <th class='hide-small'>".$text['label-cid-name']."</th>\n";
|
||||
echo " <th>".$text['label-cid-number']."</th>\n";
|
||||
echo " <th>".$text['label-destination']."</th>\n";
|
||||
echo " <th class='hide-small hide-medium'>".$text['label-app']."</th>\n";
|
||||
echo " <th class='hide-small hide-medium'>".$text['label-codec']."</th>\n";
|
||||
echo " <th class='hide-small hide-medium'>".$text['label-secure']."</th>\n";
|
||||
if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) {
|
||||
echo " <th> </th>\n";
|
||||
}
|
||||
echo " </tr>\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 " </select>\n";
|
||||
}
|
||||
else if (sizeof($_SESSION['user']['extensions']) == 1) {
|
||||
echo " <input type='hidden' id='eavesdrop_dest' value=\"".escape($_SESSION['user']['extension'][0]['destination'])."\">\n";
|
||||
|
||||
//calculate elapsed seconds
|
||||
$elapsed_seconds = time() - $created_epoch;
|
||||
|
||||
//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 " <tr class='list-row'>\n";
|
||||
if (permission_exists('call_active_hangup')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='calls[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (this.checked) { refresh_stop(); } else { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='calls[$x][uuid]' value='".escape($uuid)."' />\n";
|
||||
echo " </td>\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 " <td class='hide-small'>".escape($sip_profile)." </td>\n";
|
||||
//echo " <td>".escape($created)." </td>\n";
|
||||
echo " <td>".escape($elapsed_time)."</td>\n";
|
||||
if ($show == 'all') {
|
||||
echo " <td>".escape($domain_name)." </td>\n";
|
||||
}
|
||||
}
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\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 "<br /><br />\n";
|
||||
|
||||
//show the results
|
||||
echo "<div id='cmd_reponse'></div>\n";
|
||||
|
||||
echo "<form id='form_list' method='post' action='calls_exec.php'>\n";
|
||||
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||
|
||||
echo "<div class='card'>\n";
|
||||
echo "<table class='list'>\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
if (permission_exists('call_active_hangup')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='if (this.checked) { refresh_stop(); } else { refresh_start(); } list_all_toggle();' ".(empty($rows) ? "style='visibility: hidden;'" : null).">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
echo " <th>".$text['label-profile']."</th>\n";
|
||||
echo " <th>".$text['label-created']."</th>\n";
|
||||
if ($show == 'all') {
|
||||
echo " <th>".$text['label-domain']."</th>\n";
|
||||
}
|
||||
echo " <th>".$text['label-number']."</th>\n";
|
||||
echo " <th>".$text['label-cid-name']."</th>\n";
|
||||
echo " <th>".$text['label-cid-number']."</th>\n";
|
||||
echo " <th>".$text['label-destination']."</th>\n";
|
||||
echo " <th>".$text['label-app']."</th>\n";
|
||||
echo " <th>".$text['label-codec']."</th>\n";
|
||||
echo " <th>".$text['label-secure']."</th>\n";
|
||||
if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) {
|
||||
echo " <th> </th>\n";
|
||||
}
|
||||
echo "</tr>\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 "<tr class='list-row'>\n";
|
||||
if (permission_exists('call_active_hangup')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='calls[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (this.checked) { refresh_stop(); } else { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='calls[$x][uuid]' value='".escape($uuid)."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo " <td>".escape($sip_profile)." </td>\n";
|
||||
echo " <td>".escape($created)." </td>\n";
|
||||
if ($show == 'all') {
|
||||
echo " <td>".escape($domain_name)." </td>\n";
|
||||
}
|
||||
echo " <td>".escape($tmp_number)." </td>\n";
|
||||
echo " <td>".escape($cid_name)." </td>\n";
|
||||
echo " <td>".escape($cid_num)." </td>\n";
|
||||
echo " <td>".escape($dest)." </td>\n";
|
||||
echo " <td>".(!empty($application) ? escape($application).":".escape($application_data) : null)." </td>\n";
|
||||
echo " <td>".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." </td>\n";
|
||||
echo " <td>".escape($secure)." </td>\n";
|
||||
if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) {
|
||||
echo " <td class='button right' style='padding-right: 0;'>\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 "</td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
|
||||
//unset the domain name
|
||||
unset($domain_name);
|
||||
|
||||
//increment counter
|
||||
$x++;
|
||||
//echo " <td>".escape($tmp_number)." </td>\n";
|
||||
echo " <td class='hide-small'>".escape($cid_name)." </td>\n";
|
||||
echo " <td>".escape($cid_num)." </td>\n";
|
||||
echo " <td>".escape($dest)." </td>\n";
|
||||
echo " <td class='hide-small hide-medium' style='max-width: 200px; word-wrap: break-word;'>".(!empty($application) ? escape($application).":".escape($application_data) : null)." </td>\n";
|
||||
echo " <td class='hide-small hide-medium'>".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." </td>\n";
|
||||
echo " <td class='hide-small hide-medium'>".escape($secure)." </td>\n";
|
||||
if (permission_exists('call_active_eavesdrop') || permission_exists('call_active_hangup')) {
|
||||
echo " <td class='button right' style='padding-right: 0;'>\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 " </td>\n";
|
||||
}
|
||||
unset($rows);
|
||||
}
|
||||
echo " </tr>\n";
|
||||
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
|
||||
echo "</form>\n";
|
||||
//unset the domain name
|
||||
unset($domain_name);
|
||||
|
||||
//increment counter
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
|
||||
echo " </table>\n";
|
||||
echo "</div>\n";
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
?>
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
$array['dialplans'][0]["app_uuid"] = "b81412e8-7253-91f4-e48e-42fc2c9a38d9";
|
||||
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("dialplan_add", "temp");
|
||||
$p->add("dialplan_edit", "temp");
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
$array['conference_room_users'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
|
||||
//un-assigne the users from the conference room
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_room_user_delete', 'temp');
|
||||
|
||||
$database->app_name = 'conference_centers';
|
||||
@@ -358,7 +358,7 @@
|
||||
$array['conference_room_users'][0]['conference_room_uuid'] = $conference_room_uuid;
|
||||
$array['conference_room_users'][0]['user_uuid'] = $_SESSION["user_uuid"];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_room_user_add', 'temp');
|
||||
|
||||
$database->app_name = 'conference_centers';
|
||||
@@ -440,7 +440,7 @@
|
||||
$array['conference_room_users'][0]['conference_room_uuid'] = $conference_room_uuid;
|
||||
$array['conference_room_users'][0]['user_uuid'] = $user_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_room_user_add', 'temp');
|
||||
|
||||
$database->app_name = 'conference_centers';
|
||||
|
||||
@@ -349,7 +349,7 @@ if (!class_exists('conference_centers')) {
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
$p->add('dialplan_delete', 'temp');
|
||||
|
||||
@@ -425,7 +425,7 @@ if (!class_exists('conference_centers')) {
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_room_user_delete', 'temp');
|
||||
$p->add('conference_room_delete', 'temp');
|
||||
|
||||
@@ -489,7 +489,7 @@ if (!class_exists('conference_centers')) {
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_session_detail_delete', 'temp');
|
||||
$p->add('conference_user_delete', 'temp');
|
||||
|
||||
@@ -578,7 +578,7 @@ if (!class_exists('conference_centers')) {
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("dialplan_edit", "temp");
|
||||
|
||||
//save the array
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
$array['conference_controls'][0]['control_name'] = $control_name;
|
||||
$array['conference_controls'][0]['control_enabled'] = 'true';
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_control_add', 'temp');
|
||||
|
||||
$database->app_name = 'conference_controls';
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
$array['conference_control_details'][0]['control_enabled'] = $control_enabled;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_control_detail_add', 'temp');
|
||||
|
||||
$database->app_name = 'conference_controls';
|
||||
|
||||
@@ -103,7 +103,7 @@ if (!class_exists('conference_controls')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_control_detail_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
$array['conference_profiles'][0]['profile_name'] = $profile_name;
|
||||
$array['conference_profiles'][0]['profile_enabled'] = 'true';
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_profile_add', 'temp');
|
||||
|
||||
$database->app_name = 'conference_profiles';
|
||||
@@ -91,7 +91,7 @@
|
||||
$array['conference_profile_params'][0]['profile_param_value'] = $profile_param_value;
|
||||
$array['conference_profile_params'][0]['profile_param_enabled'] = $profile_param_enabled;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_profile_param_add', 'temp');
|
||||
|
||||
$database->app_name = 'conference_profiles';
|
||||
|
||||
@@ -103,7 +103,7 @@ if (!class_exists('conference_profiles')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_profile_param_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
@@ -410,7 +410,7 @@ if (!class_exists('conference_profiles')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_profile_param_add', 'temp');
|
||||
|
||||
//save the array
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
$user_uuid = $_REQUEST["user_uuid"];
|
||||
$conference_uuid = $_REQUEST["id"];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_user_delete', 'temp');
|
||||
|
||||
$array['conference_users'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
@@ -124,7 +124,7 @@
|
||||
$array['conference_users'][0]['conference_uuid'] = $conference_uuid;
|
||||
$array['conference_users'][0]['user_uuid'] = $user_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_user_add', 'temp');
|
||||
|
||||
$database = new database;
|
||||
@@ -239,7 +239,7 @@
|
||||
$array['dialplans'][0]['dialplan_enabled'] = $conference_enabled;
|
||||
$array['dialplans'][0]['dialplan_description'] = $conference_description;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_add', 'temp');
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ if (!class_exists('conferences')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_user_delete', 'temp');
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
$p->add('dialplan_delete', 'temp');
|
||||
@@ -203,7 +203,7 @@ if (!class_exists('conferences')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
|
||||
//save the array
|
||||
@@ -341,7 +341,7 @@ if (!class_exists('conferences')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('conference_user_add', 'temp');
|
||||
$p->add('dialplan_add', 'temp');
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -545,7 +545,7 @@
|
||||
//save the data
|
||||
if (!empty($array)) {
|
||||
//add the permission object
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_add', 'temp');
|
||||
$p->add('contact_phone_add', 'temp');
|
||||
$p->add('contact_address_add', 'temp');
|
||||
|
||||
@@ -112,7 +112,7 @@ if (!empty($_GET["contact_uuid"]) && is_uuid($_GET["contact_uuid"])) {
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -107,7 +107,7 @@ if ($_POST['a'] == 'import') {
|
||||
unset($duplicate_contact_uuid);
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_delete', 'temp');
|
||||
|
||||
//delete duplicate contact
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -108,7 +108,7 @@ if (!class_exists('contacts')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temp permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$database = new database;
|
||||
foreach ($this->tables as $table) {
|
||||
$p->add(database::singular($table).'_delete', 'temp');
|
||||
|
||||
@@ -83,7 +83,7 @@ if ($domains_processed == 1) {
|
||||
//save to the data
|
||||
if (!empty($array)) {
|
||||
//add temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('destination_edit', 'temp');
|
||||
|
||||
//create the database object and save the data
|
||||
@@ -109,7 +109,7 @@ if ($domains_processed == 1) {
|
||||
|
||||
if (!empty($array)) {
|
||||
//add temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('destination_edit', 'temp');
|
||||
|
||||
//create the database object and save the data
|
||||
|
||||
@@ -73,4 +73,3 @@
|
||||
$y++;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -41,10 +41,13 @@
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//initialize the database
|
||||
$database = new database;
|
||||
//initialize the database object
|
||||
$database = database::new();
|
||||
|
||||
//initialize the destinations object
|
||||
//initialize the settings object
|
||||
$settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid]);
|
||||
|
||||
//initialize the destination object
|
||||
$destination = new destinations;
|
||||
|
||||
//initialize the ringbacks object
|
||||
@@ -68,17 +71,20 @@
|
||||
default: $destination_type = 'inbound';
|
||||
}
|
||||
|
||||
//get the call recording extension
|
||||
$record_extension = $settings->get('call_recordings', 'record_extension', 'mp3');
|
||||
|
||||
//get total destination count from the database, check limit, if defined
|
||||
if (!permission_exists('destination_domain')) {
|
||||
if ($action == 'add') {
|
||||
if (!empty($_SESSION['limit']['destinations']['numeric'])) {
|
||||
if (!empty($settings->get('limit', 'destinations', ''))) {
|
||||
$sql = "select count(*) from v_destinations where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$total_destinations = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
if ($total_destinations >= $_SESSION['limit']['destinations']['numeric']) {
|
||||
message::add($text['message-maximum_destinations'].' '.$_SESSION['limit']['destinations']['numeric'], 'negative');
|
||||
if ($total_destinations >= $settings->get('limit', 'destinations', '')) {
|
||||
message::add($text['message-maximum_destinations'].' '.$settings->get('limit', 'destinations', ''), 'negative');
|
||||
header('Location: destinations.php');
|
||||
exit;
|
||||
}
|
||||
@@ -198,7 +204,7 @@
|
||||
if (empty($destination_enabled)) { $msg .= $text['message-required']." ".$text['label-destination_enabled']."<br>\n"; }
|
||||
|
||||
//check for duplicates
|
||||
if ($destination_type == 'inbound' && $destination_number != $db_destination_number && $_SESSION['destinations']['unique']['boolean'] == 'true') {
|
||||
if ($destination_type == 'inbound' && $destination_number != $db_destination_number && $settings->get('destinations', 'unique', '')) {
|
||||
$sql = "select count(*) from v_destinations ";
|
||||
$sql .= "where (destination_number = :destination_number or destination_prefix || destination_number = :destination_number) ";
|
||||
$sql .= "and destination_type = 'inbound' ";
|
||||
@@ -444,15 +450,15 @@
|
||||
if (!empty($destination_condition_field)) {
|
||||
$dialplan_detail_type = $destination_condition_field;
|
||||
}
|
||||
elseif (!empty($_SESSION['dialplan']['destination']['text'])) {
|
||||
$dialplan_detail_type = $_SESSION['dialplan']['destination']['text'];
|
||||
elseif (!empty($settings->get('dialplan', 'destination', ''))) {
|
||||
$dialplan_detail_type = $settings->get('dialplan', 'destination', '');
|
||||
}
|
||||
else {
|
||||
$dialplan_detail_type = "destination_number";
|
||||
}
|
||||
|
||||
//authorized specific dialplan_detail_type that are safe, sanitize all other values
|
||||
$dialplan_detail_type = $_SESSION['dialplan']['destination']['text'];
|
||||
$dialplan_detail_type = $settings->get('dialplan', 'destination', '');
|
||||
switch ($dialplan_detail_type) {
|
||||
case 'destination_number':
|
||||
break;
|
||||
@@ -530,10 +536,11 @@
|
||||
}
|
||||
if (!empty($destination_record) && $destination_record == 'true') {
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"set\" data=\"record_path=\${recordings_dir}/\${domain_name}/archive/\${strftime(%Y)}/\${strftime(%b)}/\${strftime(%d)}\" inline=\"true\"/>\n";
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"set\" data=\"record_name=\${uuid}.\${record_ext}\" inline=\"true\"/>\n";
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"set\" data=\"record_name=\${uuid}.".$record_extension."\" inline=\"true\"/>\n";
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"set\" data=\"record_append=true\" inline=\"true\"/>\n";
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"set\" data=\"record_in_progress=true\" inline=\"true\"/>\n";
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"set\" data=\"recording_follow_transfer=true\" inline=\"true\"/>\n";
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"set\" data=\"record_stereo_swap=true\" inline=\"true\"/>\n";
|
||||
$dialplan["dialplan_xml"] .= " <action application=\"record_session\" data=\"\${record_path}/\${record_name}\" inline=\"false\"/>\n";
|
||||
}
|
||||
if (!empty($destination_hold_music)) {
|
||||
@@ -592,7 +599,7 @@
|
||||
$dialplan["dialplan_xml"] .= "</extension>\n";
|
||||
|
||||
//dialplan details
|
||||
if ($_SESSION['destinations']['dialplan_details']['boolean'] == "true") {
|
||||
if ($settings->get('destinations', 'dialplan_details', '')) {
|
||||
|
||||
//set initial value of the row id
|
||||
$y=0;
|
||||
@@ -633,8 +640,8 @@
|
||||
if (!empty($destination_condition_field)) {
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = $destination_condition_field;
|
||||
}
|
||||
elseif (!empty($_SESSION['dialplan']['destination']['text'])) {
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = $_SESSION['dialplan']['destination']['text'];
|
||||
elseif (!empty($settings->get('dialplan', 'destination', ''))) {
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = $settings->get('dialplan', 'destination', '');
|
||||
}
|
||||
else {
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "regex";
|
||||
@@ -693,8 +700,8 @@
|
||||
if (!empty($destination_condition_field)) {
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = $destination_condition_field;
|
||||
}
|
||||
elseif (!empty($_SESSION['dialplan']['destination']['text'])) {
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = $_SESSION['dialplan']['destination']['text'];
|
||||
elseif (!empty($settings->get('dialplan', 'destination', ''))) {
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = $settings->get('dialplan', 'destination', '');
|
||||
}
|
||||
else {
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "destination_number";
|
||||
@@ -942,7 +949,7 @@
|
||||
$dialplan["dialplan_details"][$y]["dialplan_uuid"] = $dialplan_uuid;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "record_name=\${uuid}.\${record_ext}";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "record_name=\${uuid}.".$record_extension;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_inline"] = "true";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = $dialplan_detail_group;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order;
|
||||
@@ -979,6 +986,20 @@
|
||||
//increment the dialplan detail order
|
||||
$dialplan_detail_order = $dialplan_detail_order + 10;
|
||||
|
||||
//add a variable
|
||||
$dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_uuid"] = $dialplan_uuid;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "record_stereo_swap=true";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_inline"] = "true";
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = $dialplan_detail_group;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order;
|
||||
$y++;
|
||||
|
||||
//increment the dialplan detail order
|
||||
$dialplan_detail_order = $dialplan_detail_order + 10;
|
||||
|
||||
//add a variable
|
||||
$dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid;
|
||||
$dialplan["dialplan_details"][$y]["dialplan_uuid"] = $dialplan_uuid;
|
||||
@@ -1139,7 +1160,7 @@
|
||||
}
|
||||
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("dialplan_add", 'temp');
|
||||
$p->add("dialplan_detail_add", 'temp');
|
||||
$p->add("dialplan_edit", 'temp');
|
||||
@@ -1159,10 +1180,10 @@
|
||||
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
if ($_SESSION['destinations']['dialplan_mode']['text'] == 'multiple') {
|
||||
if ($settings->get('destinations', 'dialplan_mode', '') == 'multiple') {
|
||||
$cache->delete("dialplan:".$destination_context);
|
||||
}
|
||||
if ($_SESSION['destinations']['dialplan_mode']['text'] == 'single') {
|
||||
if ($settings->get('destinations', 'dialplan_mode', '') == 'single') {
|
||||
if (isset($destination_prefix) && is_numeric($destination_prefix) && isset($destination_number) && is_numeric($destination_number)) {
|
||||
$cache->delete("dialplan:".$destination_context.":".$destination_prefix.$destination_number);
|
||||
$cache->delete("dialplan:".$destination_context.":+".$destination_prefix.$destination_number);
|
||||
@@ -2046,7 +2067,7 @@
|
||||
echo " ".$text['label-destination_enabled']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') {
|
||||
if (substr($settings->get('theme', 'input_toggle_style', ''), 0, 6) == 'switch') {
|
||||
echo " <label class='switch'>\n";
|
||||
echo " <input type='checkbox' id='destination_enabled' name='destination_enabled' value='true' ".($destination_enabled == 'true' ? "checked='checked'" : null).">\n";
|
||||
echo " <span class='slider'></span>\n";
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1081,7 +1081,7 @@ if (!class_exists('destinations')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_delete', 'temp');
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
|
||||
@@ -1134,6 +1134,9 @@ if (!class_exists('destinations')) {
|
||||
$time_zone = date_default_timezone_get();
|
||||
}
|
||||
|
||||
//set the time zone for php
|
||||
date_default_timezone_set($time_zone);
|
||||
|
||||
//build the date range
|
||||
if (!empty($this->start_stamp_begin) || !empty($this->start_stamp_end)) {
|
||||
unset($this->quick_select);
|
||||
@@ -1236,6 +1239,7 @@ if (!class_exists('destinations')) {
|
||||
}
|
||||
$sql .= " and direction = 'inbound' \n";
|
||||
$sql .= " and caller_destination is not null \n";
|
||||
$sql .= " and leg = 'a' \n";
|
||||
$sql .= $sql_date_range ?? '';
|
||||
$sql .= ") as c \n";
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ if ($domains_processed == 1) {
|
||||
$array['device_keys'][$index]['device_key_vendor'] = $row["device_vendor"];
|
||||
}
|
||||
if (is_array($array) && @sizeof($array)) {
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_key_edit', 'temp');
|
||||
|
||||
$database->app_name = 'devices';
|
||||
@@ -106,7 +106,7 @@ if ($domains_processed == 1) {
|
||||
|
||||
//save the array
|
||||
if (!empty($array)) {
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_profile_key_add', 'temp');
|
||||
|
||||
$database->app_name = 'devices';
|
||||
@@ -144,7 +144,7 @@ if ($domains_processed == 1) {
|
||||
|
||||
//save the array
|
||||
if (!empty($array)) {
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_profile_setting_add', 'temp');
|
||||
|
||||
$database->app_name = 'devices';
|
||||
@@ -225,7 +225,7 @@ if ($domains_processed == 1) {
|
||||
|
||||
//execute
|
||||
if (!empty($array)) {
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_vendor_add', 'temp');
|
||||
$p->add('device_vendor_function_add', 'temp');
|
||||
$p->add('device_vendor_function_group_add', 'temp');
|
||||
|
||||
@@ -7364,4 +7364,3 @@ $text['label-required']['ja-jp'] = "必要";
|
||||
$text['label-required']['ko-kr'] = "필수의";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
+81
-89
@@ -44,8 +44,9 @@
|
||||
$device_firmware_version = '';
|
||||
$device_template ='';
|
||||
|
||||
//get the domain uuid
|
||||
//get the domain values
|
||||
$domain_uuid = $_SESSION['domain_uuid'] ?? '';
|
||||
$domain_name = $_SESSION['domain_name'] ?? '';
|
||||
|
||||
//initialize the database object
|
||||
$database = database::new();
|
||||
@@ -64,12 +65,12 @@
|
||||
|
||||
//get the total device count from the database, check the limit, if defined
|
||||
if ($action == 'add') {
|
||||
if (!empty($_SESSION['limit']['devices']['numeric']) && $_SESSION['limit']['devices']['numeric']) {
|
||||
if (!empty($settings->get('limit', 'devices', ''))) {
|
||||
$sql = "select count(*) from v_devices where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$total_devices = $database->select($sql, $parameters, 'column');
|
||||
if ($total_devices >= $_SESSION['limit']['devices']['numeric']) {
|
||||
message::add($text['message-maximum_devices'].' '.$_SESSION['limit']['devices']['numeric'], 'negative');
|
||||
if ($total_devices >= $settings->get('limit', 'devices', '')) {
|
||||
message::add($text['message-maximum_devices'].' '.$settings->get('limit', 'devices', ''), 'negative');
|
||||
header('Location: devices.php');
|
||||
exit;
|
||||
}
|
||||
@@ -228,14 +229,14 @@
|
||||
$sql .= " and d1.device_uuid <> :device_uuid ";
|
||||
}
|
||||
$parameters['device_address'] = $device_address;
|
||||
$domain_name = $database->select($sql, $parameters, 'column');
|
||||
if ($domain_name != '') {
|
||||
$message = $text['message-duplicate'].(if_group("superadmin") && $_SESSION["domain_name"] != $domain_name ? ": ".$domain_name : null);
|
||||
$device_domain_name = $database->select($sql, $parameters, 'column');
|
||||
if ($device_domain_name != '') {
|
||||
$message = $text['message-duplicate'].($device_domain_name != $domain_name ? ": ".$device_domain_name : null);
|
||||
message::add($message,'negative');
|
||||
header('Location: devices.php');
|
||||
exit;
|
||||
}
|
||||
unset($sql, $parameters, $domain_name);
|
||||
unset($sql, $parameters, $device_domain_name);
|
||||
}
|
||||
|
||||
//add or update the database
|
||||
@@ -304,6 +305,7 @@
|
||||
$device_line_uuid = uuid();
|
||||
$new_line = true;
|
||||
}
|
||||
|
||||
$array['devices'][0]['device_lines'][$y]['domain_uuid'] = $domain_uuid;
|
||||
$array['devices'][0]['device_lines'][$y]['device_uuid'] = $device_uuid;
|
||||
$array['devices'][0]['device_lines'][$y]['device_line_uuid'] = $device_line_uuid;
|
||||
@@ -311,23 +313,23 @@
|
||||
$array['devices'][0]['device_lines'][$y]['server_address'] = $row["server_address"];
|
||||
if (permission_exists('device_line_outbound_proxy_primary')) {
|
||||
$array['devices'][0]['device_lines'][$y]['outbound_proxy_primary'] = $row["outbound_proxy_primary"];
|
||||
} else if ($new_line && isset($_SESSION['provision']['outbound_proxy_primary'])) {
|
||||
$array['devices'][0]['device_lines'][$y]['outbound_proxy_primary'] = $_SESSION['provision']['outbound_proxy_primary']['text'];
|
||||
} else if ($new_line && !empty($settings->get('provision', 'outbound_proxy_primary'))) {
|
||||
$array['devices'][0]['device_lines'][$y]['outbound_proxy_primary'] = $settings->get('provision', 'outbound_proxy_primary', '');
|
||||
}
|
||||
if (permission_exists('device_line_outbound_proxy_secondary')) {
|
||||
$array['devices'][0]['device_lines'][$y]['outbound_proxy_secondary'] = $row["outbound_proxy_secondary"];
|
||||
} else if ($new_line && isset($_SESSION['provision']['outbound_proxy_secondary'])) {
|
||||
$array['devices'][0]['device_lines'][$y]['outbound_proxy_secondary'] = $_SESSION['provision']['outbound_proxy_secondary']['text'];
|
||||
} else if ($new_line && !empty($settings->get('provision', 'outbound_proxy_secondary'))) {
|
||||
$array['devices'][0]['device_lines'][$y]['outbound_proxy_secondary'] = $settings->get('provision', 'outbound_proxy_secondary', '');
|
||||
}
|
||||
if (permission_exists('device_line_server_address_primary')) {
|
||||
$array['devices'][0]['device_lines'][$y]['server_address_primary'] = $row["server_address_primary"];
|
||||
} else if ($new_line && isset($_SESSION['provision']['server_address_primary'])) {
|
||||
$array['devices'][0]['device_lines'][$y]['server_address_primary'] = $_SESSION['provision']['server_address_primary']['text'];
|
||||
} else if ($new_line && !empty($settings->get('provision', 'server_address_primary'))) {
|
||||
$array['devices'][0]['device_lines'][$y]['server_address_primary'] = $settings->get('provision', 'server_address_primary', '');
|
||||
}
|
||||
if (permission_exists('device_line_server_address_secondary')) {
|
||||
$array['devices'][0]['device_lines'][$y]['server_address_secondary'] = $row["server_address_secondary"];
|
||||
} else if ($new_line && isset($_SESSION['provision']['server_address_secondary'])) {
|
||||
$array['devices'][0]['device_lines'][$y]['server_address_secondary'] = $_SESSION['provision']['server_address_secondary']['text'];
|
||||
} else if ($new_line && !empty($settings->get('provision', 'server_address_secondary'))) {
|
||||
$array['devices'][0]['device_lines'][$y]['server_address_secondary'] = $settings->get('provision', 'server_address_secondary', '');
|
||||
}
|
||||
if (permission_exists('device_line_label')) {
|
||||
$array['devices'][0]['device_lines'][$y]['label'] = $row["label"];
|
||||
@@ -351,7 +353,7 @@
|
||||
}
|
||||
else {
|
||||
if ($action == "add") {
|
||||
$array['devices'][0]['device_lines'][$y]['sip_port'] = $_SESSION['provision']['line_sip_port']['numeric'];
|
||||
$array['devices'][0]['device_lines'][$y]['sip_port'] = $settings->get('provision', 'line_sip_port', '5060');
|
||||
}
|
||||
}
|
||||
if (permission_exists('device_line_transport')) {
|
||||
@@ -359,7 +361,7 @@
|
||||
}
|
||||
else {
|
||||
if ($action == "add") {
|
||||
$array['devices'][0]['device_lines'][$y]['sip_transport'] = $_SESSION['provision']['line_sip_transport']['text'];
|
||||
$array['devices'][0]['device_lines'][$y]['sip_transport'] = $settings->get('provision', 'line_sip_transport', 'tcp');
|
||||
}
|
||||
}
|
||||
if (permission_exists('device_line_register_expires')) {
|
||||
@@ -367,7 +369,7 @@
|
||||
}
|
||||
else {
|
||||
if ($action == "add") {
|
||||
$array['devices'][0]['device_lines'][$y]['register_expires'] = $_SESSION['provision']['line_register_expires']['numeric'];
|
||||
$array['devices'][0]['device_lines'][$y]['register_expires'] = $settings->get('provision', 'line_register_expires', '120');
|
||||
}
|
||||
}
|
||||
$y++;
|
||||
@@ -480,7 +482,7 @@
|
||||
}
|
||||
|
||||
//write the provision files
|
||||
if (!empty($_SESSION['provision']['path']['text'])) {
|
||||
if (!empty($settings->get('provision', 'path'))) {
|
||||
$prov = new provision(['settings' => $settings]);
|
||||
$prov->domain_uuid = $domain_uuid;
|
||||
$response = $prov->write();
|
||||
@@ -509,7 +511,6 @@
|
||||
$sql = "select * from v_devices ";
|
||||
$sql .= "where device_uuid = :device_uuid ";
|
||||
$parameters['device_uuid'] = $device_uuid;
|
||||
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row) && @sizeof($row) != 0) {
|
||||
$device_address = $row["device_address"];
|
||||
@@ -533,6 +534,13 @@
|
||||
unset($sql, $parameters, $row);
|
||||
}
|
||||
|
||||
//get device lines
|
||||
$sql = "select * ";
|
||||
$sql .= "from v_domains ";
|
||||
$sql .= "order by domain_name asc ";
|
||||
$domains = $database->select($sql, null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//set the defaults
|
||||
if (empty($device_enabled)) { $device_enabled = 'true'; }
|
||||
|
||||
@@ -563,20 +571,22 @@
|
||||
}
|
||||
|
||||
//get device lines
|
||||
$sql = "select * from v_device_lines ";
|
||||
$sql = "select l.*, d.domain_name ";
|
||||
$sql .= "from v_device_lines as l, v_domains as d ";
|
||||
$sql .= "where device_uuid = :device_uuid ";
|
||||
$sql .= "and l.domain_uuid = d.domain_uuid ";
|
||||
$sql .= "order by cast(line_number as int) asc ";
|
||||
$parameters['device_uuid'] = $device_uuid ?? null;
|
||||
|
||||
$device_lines = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//set the new line defaults
|
||||
$device_lines[$x]['line_number'] = '';
|
||||
$device_lines[$x]['server_address'] = '';
|
||||
$device_lines[$x]['outbound_proxy_primary'] = $_SESSION['provision']['outbound_proxy_primary']['text'] ?? null;
|
||||
$device_lines[$x]['outbound_proxy_secondary'] = $_SESSION['provision']['outbound_proxy_secondary']['text'] ?? null;
|
||||
$device_lines[$x]['server_address_primary'] = $_SESSION['provision']['server_address_primary']['text'] ?? null;
|
||||
$device_lines[$x]['server_address_secondary'] = $_SESSION['provision']['server_address_secondary']['text'] ?? null;
|
||||
$device_lines[$x]['outbound_proxy_primary'] = $settings->get('provision', 'outbound_proxy_primary', null);
|
||||
$device_lines[$x]['outbound_proxy_secondary'] = $settings->get('provision', 'outbound_proxy_secondary', null);
|
||||
$device_lines[$x]['server_address_primary'] = $settings->get('provision', 'server_address_primary', null);
|
||||
$device_lines[$x]['server_address_secondary'] = $settings->get('provision', 'server_address_secondary', null);
|
||||
$device_lines[$x]['label'] = '';
|
||||
$device_lines[$x]['display_name'] = '';
|
||||
$device_lines[$x]['user_id'] = '';
|
||||
@@ -584,9 +594,9 @@
|
||||
$device_lines[$x]['password'] = '';
|
||||
$device_lines[$x]['shared_line'] = '';
|
||||
$device_lines[$x]['enabled'] = '';
|
||||
$device_lines[$x]['sip_port'] = $_SESSION['provision']['line_sip_port']['numeric'];
|
||||
$device_lines[$x]['sip_transport'] = $_SESSION['provision']['line_sip_transport']['text'];
|
||||
$device_lines[$x]['register_expires'] = $_SESSION['provision']['line_register_expires']['numeric'];
|
||||
$device_lines[$x]['sip_port'] = $settings->get('provision', 'line_sip_port', '5060');
|
||||
$device_lines[$x]['sip_transport'] = $settings->get('provision', 'line_sip_transport', 'tcp');
|
||||
$device_lines[$x]['register_expires'] = $settings->get('provision', 'line_register_expires', '120');
|
||||
|
||||
//get device keys
|
||||
$sql = "select * from v_device_keys ";
|
||||
@@ -612,11 +622,11 @@
|
||||
|
||||
//add empty device key row(s)
|
||||
if (!is_uuid($device_uuid)) {
|
||||
$rows = $_SESSION['devices']['key_add_rows']['numeric'] ?? 1;
|
||||
$rows = $settings->get('devices', 'key_add_rows', '10');
|
||||
$id = 0;
|
||||
}
|
||||
else {
|
||||
$rows = $_SESSION['devices']['key_edit_rows']['numeric'] ?? 1;
|
||||
$rows = $settings->get('devices', 'key_edit_rows', '3');
|
||||
$id = count($device_keys) + 1;
|
||||
}
|
||||
for ($x = 0; $x < $rows; $x++) {
|
||||
@@ -638,7 +648,6 @@
|
||||
$sql .= "from v_device_vendors ";
|
||||
$sql .= "where enabled = 'true' ";
|
||||
$sql .= "order by name asc ";
|
||||
|
||||
$device_vendors = $database->select($sql, null, 'all');
|
||||
unset($sql);
|
||||
|
||||
@@ -662,11 +671,11 @@
|
||||
|
||||
//add empty device setting row(s)
|
||||
if (!is_uuid($device_uuid)) {
|
||||
$rows = $_SESSION['devices']['setting_add_rows']['numeric'] ?? 1;
|
||||
$rows = $settings->get('devices', 'key_add_rows', '10');
|
||||
$id = 0;
|
||||
}
|
||||
else {
|
||||
$rows = $_SESSION['devices']['setting_edit_rows']['numeric'] ?? 1;
|
||||
$rows = $settings->get('devices', 'key_edit_rows', '3');
|
||||
$id = count($device_settings) + 1;
|
||||
}
|
||||
for ($x = 0; $x < $rows; $x++) {
|
||||
@@ -694,12 +703,7 @@
|
||||
|
||||
//get the first device line info (found on the local server) for the provision button
|
||||
foreach ($device_lines as $row) {
|
||||
if (
|
||||
array_key_exists($row['domain_uuid'], $_SESSION['domains']) &&
|
||||
$row['server_address'] == $_SESSION['domains'][$row['domain_uuid']]['domain_name'] &&
|
||||
!empty($row['user_id']) &&
|
||||
!empty($row['server_address'])
|
||||
) {
|
||||
if ($row['server_address'] == $row['domain_name'] && !empty($row['user_id']) && !empty($row['server_address'])) {
|
||||
$user_id = $row['user_id'];
|
||||
$server_address = $row['server_address'];
|
||||
break;
|
||||
@@ -731,14 +735,13 @@
|
||||
echo " $('#target_file').fadeOut(fade_speed);\n";
|
||||
echo " document.getElementById('target_file').selectedIndex = 0;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " function download(d) {\n";
|
||||
echo " if (d == '".$text['label-download']."') return;\n";
|
||||
if ($_SESSION['provision']['http_domain_filter']['boolean'] == "false") {
|
||||
$domain_name = $_SERVER["HTTP_HOST"];
|
||||
if ($settings->get('provision', 'http_domain_filter', true)) {
|
||||
$provision_domain_name = $domain_name;
|
||||
}
|
||||
else {
|
||||
$domain_name = $_SESSION['domain_name'];
|
||||
$provision_domain_name = $_SERVER["HTTP_HOST"];
|
||||
}
|
||||
|
||||
if (!isset($_SERVER['HTTP_PROTOCOL'])) {
|
||||
@@ -747,7 +750,7 @@
|
||||
if ($_SERVER['HTTPS'] == 'on') { $_SERVER['HTTP_PROTOCOL'] = 'https'; }
|
||||
if ($_SERVER['SERVER_PORT'] == '443') { $_SERVER['HTTP_PROTOCOL'] = 'https'; }
|
||||
}
|
||||
echo " window.location = '".$_SERVER['HTTP_PROTOCOL']."://".$domain_name.PROJECT_PATH."/app/provision/index.php?address=".escape($device_address ?? '')."&file=' + d + '&content_type=application/octet-stream';\n";
|
||||
echo " window.location = '".$_SERVER['HTTP_PROTOCOL']."://".$provision_domain_name.PROJECT_PATH."/app/provision/index.php?address=".escape($device_address ?? '')."&file=' + d + '&content_type=application/octet-stream';\n";
|
||||
echo " }\n";
|
||||
|
||||
echo "\n";
|
||||
@@ -793,16 +796,11 @@
|
||||
//add the QR code
|
||||
if (permission_exists("device_line_password") && !empty($device_template) && $qr_code_enabled) {
|
||||
//set the mode
|
||||
if (isset($_SESSION['theme']['qr_image'])) {
|
||||
if (!empty($_SESSION['theme']['qr_image'])) {
|
||||
$mode = '4';
|
||||
}
|
||||
else {
|
||||
$mode = '0';
|
||||
}
|
||||
if (!empty($settings->get('theme', 'qr_image', ''))) {
|
||||
$mode = '4';
|
||||
}
|
||||
else {
|
||||
$mode = '4';
|
||||
$mode = '0';
|
||||
}
|
||||
|
||||
//get the device line settings
|
||||
@@ -922,15 +920,10 @@
|
||||
//build content for linphone
|
||||
if ($device_template == "linphone/default") {
|
||||
$auth_string = '';
|
||||
if (
|
||||
!empty($_SESSION['provision']['http_auth_enabled']['boolean']) &&
|
||||
$_SESSION['provision']['http_auth_enabled']['boolean'] == 'true' &&
|
||||
!empty($_SESSION['provision']['http_auth_username']['text']) &&
|
||||
!empty($_SESSION['provision']['http_auth_password'][0])
|
||||
) {
|
||||
$auth_string = $_SESSION['provision']['http_auth_username']['text'].':'.$_SESSION['provision']['http_auth_password'][0].'@';
|
||||
if ($settings->get('provision', 'http_auth_enabled', true) && !empty($settings->get('provision', 'http_auth_username', '')) && !empty($settings->get('provision', 'http_auth_password', ''))) {
|
||||
$auth_string = $settings->get('provision', 'http_auth_username', '').':'.$settings->get('provision', 'http_auth_password', '').'@';
|
||||
}
|
||||
$content = "https://".$auth_string.$_SESSION['domain_name'].'/app/provision/index.php?address='.$device_address;
|
||||
$content = "https://".$auth_string.$provision_domain_name.'/app/provision/index.php?address='.$device_address;
|
||||
}
|
||||
|
||||
//stream the file
|
||||
@@ -1001,16 +994,16 @@
|
||||
echo " <img id='qr_code' src='data:image/jpeg;base64,".base64_encode($image)."'>\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
/*
|
||||
if (isset($_SESSION['theme']['qr_image'])) {
|
||||
echo "<img id='img-buffer' src='".$_SESSION["theme"]["qr_image"]["text"]."' style='display: none;'>";
|
||||
if (!empty($settings->get('theme', 'qr_image', ''))) {
|
||||
echo "<img id='img-buffer' src='".$settings->get('theme', 'qr_image', '')."' style='display: none;'>";
|
||||
}
|
||||
else {
|
||||
echo "<img id='img-buffer' src='".PROJECT_PATH."/themes/".$_SESSION["domain"]["template"]["name"]."/images/qr_code.png' style='display: none;'>";
|
||||
echo "<img id='img-buffer' src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template', '')."/images/qr_code.png' style='display: none;'>";
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
//show the content
|
||||
@@ -1020,7 +1013,7 @@
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['header-device']."</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','link'=>'devices.php']);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$settings->get('theme', 'button_icon_back', ''),'id'=>'btn_back','link'=>'devices.php']);
|
||||
if ($action == 'update') {
|
||||
$button_margin = 'margin-left: 15px;';
|
||||
if (permission_exists("device_line_password") && $qr_code_enabled) {
|
||||
@@ -1038,7 +1031,7 @@
|
||||
$template_dir = $prov->template_dir;
|
||||
$files = glob($template_dir.'/'.$device_template.'/*');
|
||||
//add file buttons and the file list
|
||||
echo button::create(['type'=>'button','id'=>'button_files','label'=>$text['button-files'],'icon'=>$_SESSION['theme']['button_icon_download'],'style'=>($button_margin ?? ''),'onclick'=>'show_files()']);
|
||||
echo button::create(['type'=>'button','id'=>'button_files','label'=>$text['button-files'],'icon'=>$settings->get('theme', 'button_icon_download', ''),'style'=>($button_margin ?? ''),'onclick'=>'show_files()']);
|
||||
echo "<select class='formfld' style='display: none; width: auto;' name='target_file' id='target_file' onchange='download(this.value)'>\n";
|
||||
echo " <option value=''>".$text['label-download']."</option>\n";
|
||||
foreach ($files as $file) {
|
||||
@@ -1054,7 +1047,7 @@
|
||||
unset($button_margin);
|
||||
}
|
||||
if (permission_exists('device_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'style'=>($button_margin ?? ''),'name'=>'btn_copy','onclick'=>"modal_open('modal-copy','new_address');"]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$settings->get('theme', 'button_icon_copy', ''),'style'=>($button_margin ?? ''),'name'=>'btn_copy','onclick'=>"modal_open('modal-copy','new_address');"]);
|
||||
unset($button_margin);
|
||||
}
|
||||
if (
|
||||
@@ -1063,11 +1056,11 @@
|
||||
permission_exists('device_key_delete') ||
|
||||
permission_exists('device_setting_delete')
|
||||
) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'style'=>($button_margin ?? ''),'name'=>'btn_delete','onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$settings->get('theme', 'button_icon_delete', ''),'style'=>($button_margin ?? ''),'name'=>'btn_delete','onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
||||
unset($button_margin);
|
||||
}
|
||||
}
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','style'=>'margin-left: 15px;','onclick'=>'submit_form();']);
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$settings->get('theme', 'button_icon_save', ''),'id'=>'btn_save','style'=>'margin-left: 15px;','onclick'=>'submit_form();']);
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
@@ -1289,11 +1282,11 @@
|
||||
|
||||
//set the defaults
|
||||
if (!permission_exists('device_line_server_address')) {
|
||||
if (empty($row['server_address'])) { $row['server_address'] = $_SESSION['domain_name']; }
|
||||
if (empty($row['server_address'])) { $row['server_address'] = $domain_name; }
|
||||
}
|
||||
if (empty($row['sip_transport'])) { $row['sip_transport'] = $_SESSION['provision']['line_sip_transport']['text']; }
|
||||
if (!isset($row['sip_port'])) { $row['sip_port'] = $_SESSION['provision']['line_sip_port']['numeric']; } //used !isset to support a value of 0 as empty the empty function considers a value of 0 as empty.
|
||||
if (empty($row['register_expires'])) { $row['register_expires'] = $_SESSION['provision']['line_register_expires']['numeric']; }
|
||||
if (empty($row['sip_transport'])) { $row['sip_transport'] = $settings->get('provision', 'line_sip_transport', 'tcp'); }
|
||||
if (!isset($row['sip_port'])) { $row['sip_port'] = $settings->get('provision', 'line_sip_port', '5060'); } //used !isset to support a value of 0 as empty the empty function considers a value of 0 as empty.
|
||||
if (empty($row['register_expires'])) { $row['register_expires'] = $settings->get('provision', 'line_register_expires', '120'); }
|
||||
|
||||
//add the primary key uuid
|
||||
if (!empty($row['device_line_uuid']) && is_uuid($row['device_line_uuid'])) {
|
||||
@@ -1323,10 +1316,10 @@
|
||||
|
||||
if (permission_exists('device_line_server_address_primary')) {
|
||||
echo " <td valign='top' align='left' nowrap='nowrap'>\n";
|
||||
if (isset($_SESSION['provision']['server_address_primary']) && !isset($_SESSION['provision']['server_address_primary']['text'])) {
|
||||
if (!empty($settings->get('provision', 'server_address_primary', '')) && is_array($settings->get('provision', 'server_address_primary', ''))) {
|
||||
echo " <select class='formfld' style='width: 75px;' name='device_lines[".$x."][server_address_primary]'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach($_SESSION['provision']['server_address_primary'] as $field) {
|
||||
foreach($settings->get('provision', 'server_address_primary', '') as $field) {
|
||||
echo " <option value='".$field."' ".(($row['server_address_primary'] == $field) ? "selected" : null).">".$field."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
@@ -1339,10 +1332,10 @@
|
||||
|
||||
if (permission_exists('device_line_server_address_secondary')) {
|
||||
echo " <td valign='top' align='left' nowrap='nowrap'>\n";
|
||||
if (isset($_SESSION['provision']['server_address_secondary']) && !isset($_SESSION['provision']['server_address_secondary']['text'])) {
|
||||
if (!empty($settings->get('provision', 'server_address_secondary', '')) && is_array($settings->get('provision', 'server_address_secondary', ''))) {
|
||||
echo " <select class='formfld' style='width: 75px;' name='device_lines[".$x."][server_address_secondary]'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach($_SESSION['provision']['server_address_secondary'] as $field) {
|
||||
foreach($settings->get('provision', 'server_address_secondary', '') as $field) {
|
||||
echo " <option value='".$field."' ".(($row['server_address_secondary'] == $field) ? "selected" : null).">".$field."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
@@ -1355,10 +1348,10 @@
|
||||
|
||||
if (permission_exists('device_line_outbound_proxy_primary')) {
|
||||
echo " <td align='left'>\n";
|
||||
if (isset($_SESSION['provision']['outbound_proxy_primary']) && !isset($_SESSION['provision']['outbound_proxy_primary']['text'])) {
|
||||
if (!empty($settings->get('provision', 'outbound_proxy_primary', ''))) {
|
||||
echo " <select class='formfld' style='width: 75px;' name='device_lines[".$x."][outbound_proxy_primary]'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach($_SESSION['provision']['outbound_proxy_primary'] as $field) {
|
||||
foreach($settings->get('provision', 'outbound_proxy_primary', '') as $field) {
|
||||
echo " <option value='".$field."' ".(($row['outbound_proxy_primary'] == $field) ? "selected" : null).">".$field."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
@@ -1371,10 +1364,10 @@
|
||||
|
||||
if (permission_exists('device_line_outbound_proxy_secondary')) {
|
||||
echo " <td align='left'>\n";
|
||||
if (isset($_SESSION['provision']['outbound_proxy_secondary']) && !isset($_SESSION['provision']['outbound_proxy_secondary']['text'])) {
|
||||
if (!empty($settings->get('provision', 'outbound_proxy_secondary', ''))) {
|
||||
echo " <select class='formfld' style='width: 75px;' name='device_lines[".$x."][outbound_proxy_secondary]'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach($_SESSION['provision']['outbound_proxy_secondary'] as $field) {
|
||||
foreach($settings->get('provision', 'outbound_proxy_secondary', '') as $field) {
|
||||
echo " <option value='".$field."' ".(($row['outbound_proxy_secondary'] == $field) ? "selected" : null).">".$field."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
@@ -1495,7 +1488,7 @@
|
||||
foreach($device_profiles as $row) {
|
||||
echo " <option value='".escape($row['device_profile_uuid'])."' ".(!empty($device_profile_uuid) && $row['device_profile_uuid'] == $device_profile_uuid ? "selected='selected'" : null).">".escape($row['device_profile_name'])." ".(($row['domain_uuid'] == '') ? " (".$text['select-global'].")" : null)."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " </select>\n";
|
||||
}
|
||||
else {
|
||||
foreach($device_profiles as $row) {
|
||||
@@ -1963,7 +1956,7 @@
|
||||
else {
|
||||
echo " <option value=''>".$text['select-global']."</option>\n";
|
||||
}
|
||||
foreach ($_SESSION['domains'] as $row) {
|
||||
foreach ($domains as $row) {
|
||||
if ($row['domain_uuid'] == $domain_uuid) {
|
||||
echo " <option value='".escape($row['domain_uuid'])."' selected='selected'>".escape($row['domain_name'])."</option>\n";
|
||||
}
|
||||
@@ -1978,7 +1971,7 @@
|
||||
echo "</tr>\n";
|
||||
}
|
||||
else {
|
||||
echo " <input type='hidden' name='domain_uuid' id='domain_uuid' value=\"".$_SESSION['domain_uuid']."\"/>\n";
|
||||
echo " <input type='hidden' name='domain_uuid' id='domain_uuid' value=\"".$domain_uuid."\"/>\n";
|
||||
}
|
||||
|
||||
if (permission_exists('device_enable')) {
|
||||
@@ -1987,7 +1980,7 @@
|
||||
echo " ".$text['label-device_enabled']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') {
|
||||
if (substr($settings->get('theme', 'input_toggle_style', ''), 0, 6) == 'switch') {
|
||||
echo " <label class='switch'>\n";
|
||||
echo " <input type='checkbox' id='device_enabled' name='device_enabled' value='true' ".($device_enabled == 'true' ? "checked='checked'" : null).">\n";
|
||||
echo " <span class='slider'></span>\n";
|
||||
@@ -2054,4 +2047,3 @@
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -226,4 +226,3 @@
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
//delete the device vendor function group
|
||||
$array['device_vendor_function_groups'][0]['device_vendor_function_group_uuid'] = $device_vendor_function_group_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_vendor_function_group_delete', 'temp');
|
||||
|
||||
$database = new database;
|
||||
@@ -183,7 +183,7 @@
|
||||
$array['device_vendor_function_groups'][0]['group_name'] = $group_name;
|
||||
$array['device_vendor_function_groups'][0]['group_uuid'] = $group_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_vendor_function_group_add', 'temp');
|
||||
|
||||
$database = new database;
|
||||
@@ -403,4 +403,3 @@
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
}
|
||||
|
||||
//assign temp permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_vendor_add', 'temp');
|
||||
$p->add('device_vendor_function_add', 'temp');
|
||||
$p->add('device_vendor_function_group_add', 'temp');
|
||||
@@ -157,4 +157,3 @@
|
||||
exit;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
+36
-61
@@ -48,18 +48,6 @@
|
||||
$database = database::new();
|
||||
$settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid, 'user_uuid' => $user_uuid]);
|
||||
|
||||
//set all permissions
|
||||
$has_device_import = permission_exists('device_import');
|
||||
$has_device_edit = permission_exists('device_edit');
|
||||
$has_device_all = permission_exists('device_all');
|
||||
$has_device_delete = permission_exists('device_delete');
|
||||
$has_device_domain_all = permission_exists('device_domain_all');
|
||||
$has_device_export = permission_exists('device_export');
|
||||
$has_device_vendor_view = permission_exists('device_vendor_view');
|
||||
$has_device_profile_view = permission_exists('device_profile_view');
|
||||
$has_device_add = permission_exists('device_add');
|
||||
$has_show_all = &$has_device_domain_all;
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
@@ -78,13 +66,13 @@
|
||||
if (!empty($action) && !empty($devices) && is_array($devices) && @sizeof($devices) != 0) {
|
||||
switch ($action) {
|
||||
case 'toggle':
|
||||
if ($has_device_edit) {
|
||||
if (permission_exists('device_edit')) {
|
||||
$obj = new device;
|
||||
$obj->toggle($devices);
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
if ($has_device_delete) {
|
||||
if (permission_exists('device_delete')) {
|
||||
$obj = new device;
|
||||
$obj->delete($devices);
|
||||
}
|
||||
@@ -105,7 +93,7 @@
|
||||
//get total devices count from the database
|
||||
$sql = "select count(*) from v_devices ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
if (!$has_device_all && !$has_device_domain_all) {
|
||||
if (!permission_exists('device_all') && !permission_exists('device_domain_all')) {
|
||||
$sql .= "and device_user_uuid = :user_uuid ";
|
||||
$parameters['user_uuid'] = $user_uuid;
|
||||
}
|
||||
@@ -113,23 +101,6 @@
|
||||
$total_devices = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//update the has_device_add permission if the total device count is greater then set limit
|
||||
$device_limit = $settings->get('limit', 'devices', null);
|
||||
if ($has_device_add && $device_limit !== null) {
|
||||
$has_device_add = $total_devices > $device_limit;
|
||||
}
|
||||
|
||||
//get the domains if user has permission for show all
|
||||
$domains = [];
|
||||
if ($has_device_domain_all) {
|
||||
$rows = $database->select("select domain_uuid, domain_name from v_domains where domain_enabled = 'true'");
|
||||
if (!empty($rows)) {
|
||||
foreach ($rows as $row) {
|
||||
$domains[$row['domain_uuid']] = $row['domain_name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//get the devices profiles
|
||||
$sql = "select * from v_device_profiles ";
|
||||
$sql .= "where true ";
|
||||
@@ -142,7 +113,7 @@
|
||||
|
||||
//prepare to page the results
|
||||
$sql = "select count(*) from v_devices as d ";
|
||||
if (isset($_GET['show']) && $_GET['show'] == "all" && $has_device_all) {
|
||||
if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) {
|
||||
if (!empty($search)) {
|
||||
$sql .= "where ";
|
||||
}
|
||||
@@ -150,7 +121,7 @@
|
||||
else {
|
||||
$sql .= "where (";
|
||||
$sql .= " d.domain_uuid = :domain_uuid ";
|
||||
if ($has_device_all) {
|
||||
if (permission_exists('device_all')) {
|
||||
$sql .= " or d.domain_uuid is null ";
|
||||
}
|
||||
$sql .= ") ";
|
||||
@@ -205,7 +176,7 @@
|
||||
$param = "&search=".$search;
|
||||
$param .= "&fields=".$fields;
|
||||
}
|
||||
if (!empty($_GET['show']) && $_GET['show'] == "all" && $has_device_all) {
|
||||
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) {
|
||||
$param .= "&show=all";
|
||||
}
|
||||
$page = $_GET['page'] ?? 0;
|
||||
@@ -214,11 +185,15 @@
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//get the list
|
||||
$sql = "select d.*, d2.device_label as alternate_label, ";
|
||||
$sql = "select ";
|
||||
if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) {
|
||||
$sql .= "d3.domain_name, ";
|
||||
}
|
||||
$sql .="d.*, d2.device_label as alternate_label, ";
|
||||
$sql .= "to_char(timezone(:time_zone, d.device_provisioned_date), 'DD Mon YYYY') as provisioned_date_formatted, \n";
|
||||
$sql .= "to_char(timezone(:time_zone, d.device_provisioned_date), 'HH12:MI:SS am') as provisioned_time_formatted \n";
|
||||
$sql .= "from v_devices as d, v_devices as d2 ";
|
||||
if (isset($_GET['show']) && $_GET['show'] == "all" && $has_device_all) {
|
||||
if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) {
|
||||
$sql .= ", v_domains as d3 ";
|
||||
}
|
||||
$sql .= "where ( ";
|
||||
@@ -228,19 +203,19 @@
|
||||
$sql .= " d.device_uuid = d2.device_uuid ";
|
||||
$sql .= " ) ";
|
||||
$sql .= ") ";
|
||||
if (isset($_GET['show']) && $_GET['show'] == "all" && $has_device_all) {
|
||||
if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) {
|
||||
$sql .= " and d.domain_uuid = d3.domain_uuid ";
|
||||
}
|
||||
else {
|
||||
$sql .= "and (";
|
||||
$sql .= " d.domain_uuid = :domain_uuid ";
|
||||
if ($has_device_all) {
|
||||
if (permission_exists('device_all')) {
|
||||
$sql .= " or d.domain_uuid is null ";
|
||||
}
|
||||
$sql .= ") ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
}
|
||||
if (!$has_device_all && !$has_device_domain_all) {
|
||||
if (!permission_exists('device_all') && !permission_exists('device_domain_all')) {
|
||||
$sql .= "and d.device_user_uuid = :user_uuid ";
|
||||
$parameters['user_uuid'] = $user_uuid;
|
||||
}
|
||||
@@ -314,33 +289,33 @@
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['header-devices']."</b><div class='count'>".number_format($num_rows)."</div></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
if ($has_device_import) {
|
||||
if (permission_exists('device_import')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-import'],'icon'=>$settings->get('theme', 'button_icon_import'),'link'=>'device_imports.php']);
|
||||
}
|
||||
if ($has_device_export) {
|
||||
if (permission_exists('device_export')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-export'],'icon'=>$settings->get('theme', 'button_icon_export'),'link'=>'device_download.php']);
|
||||
}
|
||||
if ($has_device_vendor_view) {
|
||||
if (permission_exists('device_vendor_view')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-vendors'],'icon'=>'fax','link'=>'device_vendors.php']);
|
||||
}
|
||||
if ($has_device_profile_view) {
|
||||
if (permission_exists('device_profile_view')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-profiles'],'icon'=>'clone','link'=>'device_profiles.php']);
|
||||
}
|
||||
$margin_left = $has_device_import || $has_device_export || $has_device_vendor_view || $has_device_profile_view ? "margin-left: 15px;" : null;
|
||||
if ($has_device_add) {
|
||||
$margin_left = permission_exists('device_import') || permission_exists('device_export') || permission_exists('device_vendor_view') || permission_exists('device_profile_view') ? "margin-left: 15px;" : null;
|
||||
if (permission_exists('device_add') && (empty($_SESSION['limit']['devices']['numeric']) || ($total_devices < $_SESSION['limit']['devices']['numeric']))) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$settings->get('theme', 'button_icon_add'),'id'=>'btn_add','style'=>$margin_left,'link'=>'device_edit.php']);
|
||||
unset($margin_left);
|
||||
}
|
||||
if ($has_device_edit && $devices) {
|
||||
if (permission_exists('device_edit') && $devices) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$settings->get('theme', 'button_icon_toggle'),'id'=>'btn_toggle','name'=>'btn_toggle','style'=>'display: none; '.($margin_left ?? null),'onclick'=>"modal_open('modal-toggle','btn_toggle');"]);
|
||||
unset($margin_left);
|
||||
}
|
||||
if ($has_device_delete && $devices) {
|
||||
if (permission_exists('device_delete') && $devices) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$settings->get('theme', 'button_icon_delete'),'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; '.($margin_left ?? null),'onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
||||
unset($margin_left);
|
||||
}
|
||||
echo "<form id='form_search' class='inline' method='get'>\n";
|
||||
if ($has_device_all) {
|
||||
if (permission_exists('device_all')) {
|
||||
if (!empty($_GET['show']) && $_GET['show'] == 'all') {
|
||||
echo " <input type='hidden' name='show' value='all'>";
|
||||
}
|
||||
@@ -369,10 +344,10 @@
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
if ($has_device_edit && $devices) {
|
||||
if (permission_exists('device_edit') && $devices) {
|
||||
echo modal::create(['id'=>'modal-toggle','type'=>'toggle','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_toggle','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('toggle'); list_form_submit('form_list');"])]);
|
||||
}
|
||||
if ($has_device_delete && $devices) {
|
||||
if (permission_exists('device_delete') && $devices) {
|
||||
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('delete'); list_form_submit('form_list');"])]);
|
||||
}
|
||||
|
||||
@@ -387,12 +362,12 @@
|
||||
echo "<div class='card'>\n";
|
||||
echo "<table class='list'>\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
if ($has_device_edit || $has_device_delete) {
|
||||
if (permission_exists('device_edit') || permission_exists('device_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".(empty($devices) ? "style='visibility: hidden;'" : null).">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
if (!empty($_GET['show']) && $_GET['show'] == "all" && $has_device_all) {
|
||||
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) {
|
||||
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, null, null, $param);
|
||||
}
|
||||
echo th_order_by('device_address', $text['label-device_address'], $order_by, $order, null, null, $param ?? null);
|
||||
@@ -406,7 +381,7 @@
|
||||
echo th_order_by('device_enabled', $text['label-device_enabled'], $order_by, $order, null, "class='center'", $param ?? null);
|
||||
echo th_order_by('device_provisioned_date', $text['label-device_status'], $order_by, $order, null, null, $param ?? null);
|
||||
echo th_order_by('device_description', $text['label-device_description'], $order_by, $order, null, "class='hide-sm-dn'", $param ?? null);
|
||||
if ($has_device_edit && $settings->get('theme', 'list_row_edit_button', 'false') === 'true') {
|
||||
if (permission_exists('device_edit') && $settings->get('theme', 'list_row_edit_button', false)) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -422,7 +397,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if ($has_device_edit) {
|
||||
if (permission_exists('device_edit')) {
|
||||
$list_row_url = "device_edit.php?id=".urlencode($row['device_uuid']);
|
||||
}
|
||||
|
||||
@@ -437,17 +412,17 @@
|
||||
}
|
||||
|
||||
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||
if ($has_device_edit || $has_device_delete) {
|
||||
if (permission_exists('device_edit') || permission_exists('device_delete')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='devices[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"checkbox_on_change(this); if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='devices[$x][uuid]' value='".escape($row['device_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
if (!empty($_GET['show']) && $_GET['show'] == "all" && $has_device_all) {
|
||||
echo " <td>".escape($domains[$row['domain_uuid']])."</td>\n";
|
||||
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) {
|
||||
echo " <td>".escape($row['domain_name'])."</td>\n";
|
||||
}
|
||||
echo " <td class='no-wrap'>";
|
||||
echo $has_device_edit ? "<a href='".$list_row_url."'>".escape(format_device_address($row['device_address']))."</a>" : escape(format_device_address($row['device_address']));
|
||||
echo permission_exists('device_edit') ? "<a href='".$list_row_url."'>".escape(format_device_address($row['device_address']))."</a>" : escape(format_device_address($row['device_address']));
|
||||
echo " </td>\n";
|
||||
echo " <td>".escape($row['device_label'])." </td>\n";
|
||||
if ($device_alternate) {
|
||||
@@ -463,7 +438,7 @@
|
||||
echo " <td>".escape($row['device_vendor'])." </td>\n";
|
||||
echo " <td>".escape($row['device_template'])." </td>\n";
|
||||
echo " <td>".escape($device_profile_name)." </td>\n";
|
||||
if ($has_device_edit) {
|
||||
if (permission_exists('device_edit')) {
|
||||
echo " <td class='no-link center'>";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['device_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
}
|
||||
@@ -474,7 +449,7 @@
|
||||
echo " </td>\n";
|
||||
echo " <td class='no-link'><a title='".escape($row['device_provisioned_agent'])."' href='javascript:void(0)'>".escape($row['provisioned_date_formatted'])." ".escape($row['provisioned_time_formatted'])."</a> ".escape($device_provisioned_method)." <a href='".escape($device_provisioned_method)."://".escape($row['device_provisioned_ip'])."' target='_blank'>".escape($row['device_provisioned_ip'])."</a> </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['device_description'])." </td>\n";
|
||||
if ($has_device_edit && $settings->get('theme', 'list_row_edit_button', 'false') === 'true') {
|
||||
if (permission_exists('device_edit') && $settings->get('theme', 'list_row_edit_button', false)) {
|
||||
echo " <td class='action-button'>";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$settings->get('theme','button_icon_edit'),'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -512,7 +512,7 @@
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_setting_delete', 'temp');
|
||||
$p->add('device_line_delete', 'temp');
|
||||
$p->add('device_key_delete', 'temp');
|
||||
@@ -722,7 +722,7 @@
|
||||
if (!empty($array) && is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_vendor_function_delete', 'temp');
|
||||
$p->add('device_vendor_function_group_delete', 'temp');
|
||||
|
||||
@@ -784,7 +784,7 @@
|
||||
if (!empty($array) && is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_vendor_function_group_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
@@ -845,7 +845,7 @@
|
||||
if (!empty($array) && is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_profile_key_delete', 'temp');
|
||||
$p->add('device_profile_setting_delete', 'temp');
|
||||
|
||||
@@ -1370,13 +1370,13 @@
|
||||
if (!empty($array) && is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_profile_key_add', 'temp');
|
||||
$p->add('device_profile_setting_add', 'temp');
|
||||
|
||||
//save the array
|
||||
$this->database->app_name = $this->app_name;
|
||||
$this->databasee->app_uuid = $this->app_uuid;
|
||||
$this->database->app_uuid = $this->app_uuid;
|
||||
$this->database->save($array);
|
||||
unset($array);
|
||||
|
||||
|
||||
@@ -77,4 +77,3 @@ $array['dashboard'][$x]['dashboard_groups'][$y]['group_name'] = 'admin';
|
||||
$y++;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@
|
||||
}
|
||||
if ($save) {
|
||||
//add the temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_keys_add', 'temp');
|
||||
$p->add('device_key_edit', 'temp');
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@
|
||||
//update the destination dialplan_uuid
|
||||
if (is_uuid($destination_uuid)) {
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('destination_edit', 'temp');
|
||||
|
||||
$array['destinations'][0]['destination_uuid'] = $destination_uuid;
|
||||
|
||||
@@ -1648,5 +1648,3 @@ $text['description-accountcode']['ja-jp'] = "アカウントコードを入力
|
||||
$text['description-accountcode']['ko-kr'] = "계정코드를 입력하세요.";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2024
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -70,30 +70,37 @@
|
||||
$toll_allow = $_POST["toll_allow"] ?? '';
|
||||
$pin_numbers_enable = $_POST["pin_numbers_enabled"] ?? null;
|
||||
if (empty($pin_numbers_enable)) { $pin_numbers_enable = "false"; }
|
||||
|
||||
//set the default type
|
||||
$gateway_type = 'gateway';
|
||||
$gateway_2_type = 'gateway';
|
||||
$gateway_3_type = 'gateway';
|
||||
|
||||
//set the gateway type to bridge
|
||||
if (strtolower(substr($gateway, 0, 6)) == "bridge") {
|
||||
$gateway_type = 'bridge';
|
||||
}
|
||||
|
||||
//set the type to enum
|
||||
if (strtolower(substr($gateway, 0, 4)) == "enum") {
|
||||
$gateway_type = 'enum';
|
||||
}
|
||||
|
||||
//set the type to freetdm
|
||||
if (strtolower(substr($gateway, 0, 7)) == "freetdm") {
|
||||
$gateway_type = 'freetdm';
|
||||
}
|
||||
|
||||
//set the type to transfer
|
||||
if (strtolower(substr($gateway, 0, 8)) == "transfer") {
|
||||
$gateway_type = 'transfer';
|
||||
}
|
||||
|
||||
//set the type to dingaling
|
||||
if (strtolower(substr($gateway, 0, 4)) == "xmpp") {
|
||||
$gateway_type = 'xmpp';
|
||||
}
|
||||
|
||||
//set the gateway_uuid and gateway_name
|
||||
if ($gateway_type == "gateway") {
|
||||
$gateway_array = explode(":",$gateway);
|
||||
@@ -107,26 +114,32 @@
|
||||
|
||||
//set the gateway_2 variable
|
||||
$gateway_2 = $_POST["gateway_2"];
|
||||
|
||||
//set the type to bridge
|
||||
if (strtolower(substr($gateway_2, 0, 6)) == "bridge") {
|
||||
$gateway_2_type = 'bridge';
|
||||
}
|
||||
|
||||
//set type to enum
|
||||
if (strtolower(substr($gateway_2, 0, 4)) == "enum") {
|
||||
$gateway_2_type = 'enum';
|
||||
}
|
||||
|
||||
//set the type to freetdm
|
||||
if (strtolower(substr($gateway_2, 0, 7)) == "freetdm") {
|
||||
$gateway_2_type = 'freetdm';
|
||||
}
|
||||
|
||||
//set the type to transfer
|
||||
if (strtolower(substr($gateway_2, 0, 8)) == "transfer") {
|
||||
$gateway_type = 'transfer';
|
||||
}
|
||||
|
||||
//set the type to dingaling
|
||||
if (strtolower(substr($gateway_2, 0, 4)) == "xmpp") {
|
||||
$gateway_2_type = 'xmpp';
|
||||
}
|
||||
|
||||
//set the gateway_2_id and gateway_2_name
|
||||
if ($gateway_2_type == "gateway" && !empty($_POST["gateway_2"])) {
|
||||
$gateway_2_array = explode(":",$gateway_2);
|
||||
@@ -140,26 +153,32 @@
|
||||
|
||||
//set the gateway_3 variable
|
||||
$gateway_3 = $_POST["gateway_3"];
|
||||
|
||||
//set the type to bridge
|
||||
if (strtolower(substr($gateway_3, 0, 6)) == "bridge") {
|
||||
$gateway_3_type = 'bridge';
|
||||
}
|
||||
|
||||
//set the type to enum
|
||||
if (strtolower(substr($gateway_3, 0, 4)) == "enum") {
|
||||
$gateway_3_type = 'enum';
|
||||
}
|
||||
|
||||
//set the type to freetdm
|
||||
if (strtolower(substr($gateway_3, 0, 7)) == "freetdm") {
|
||||
$gateway_3_type = 'freetdm';
|
||||
}
|
||||
|
||||
//set the type to dingaling
|
||||
if (strtolower(substr($gateway_3, 0, 4)) == "xmpp") {
|
||||
$gateway_3_type = 'xmpp';
|
||||
}
|
||||
|
||||
//set the type to transfer
|
||||
if (strtolower(substr($gateway_3, 0, 8)) == "transfer") {
|
||||
$gateway_type = 'transfer';
|
||||
}
|
||||
|
||||
//set the gateway_3_id and gateway_3_name
|
||||
if ($gateway_3_type == "gateway" && !empty($_POST["gateway_3"])) {
|
||||
$gateway_3_array = explode(":",$gateway_3);
|
||||
@@ -170,6 +189,7 @@
|
||||
$gateway_3_id = '';
|
||||
$gateway_3_name = '';
|
||||
}
|
||||
|
||||
//set additional variables
|
||||
$dialplan_enabled = $_POST["dialplan_enabled"] ?? 'false';
|
||||
$dialplan_description = $_POST["dialplan_description"];
|
||||
@@ -815,7 +835,7 @@
|
||||
}
|
||||
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("dialplan_add", "temp");
|
||||
$p->add("dialplan_detail_add", "temp");
|
||||
|
||||
@@ -881,6 +901,9 @@
|
||||
unset($sql, $parameters);
|
||||
}
|
||||
|
||||
//set defaults
|
||||
if (empty($dialplan_enabled)) { $dialplan_enabled = "true"; }
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create($_SERVER['PHP_SELF']);
|
||||
@@ -939,6 +962,7 @@ function type_onchange(dialplan_detail_type) {
|
||||
echo $text['description-outbound-routes']."\n";
|
||||
echo "<br /><br />\n";
|
||||
|
||||
echo "<div class='card'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td width='30%' class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
@@ -1346,15 +1370,16 @@ function type_onchange(dialplan_detail_type) {
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "<br><br>";
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
echo "<br><br>\n";
|
||||
|
||||
if (!empty($action) && $action == "update") {
|
||||
echo "<input type='hidden' name='dialplan_uuid' value='".escape($dialplan_uuid)."'>\n";
|
||||
}
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
|
||||
echo "</form>";
|
||||
echo "</form>\n";
|
||||
|
||||
//show the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
$array['dialplan_details'][1]['dialplan_detail_data'] = 'WARNING [inbound routes] 404 not found \${sip_network_ip}';
|
||||
$array['dialplan_details'][1]['dialplan_detail_order'] = '20';
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_add', 'temp');
|
||||
$p->add('dialplan_detail_add', 'temp');
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
$array['dialplans'][0]['dialplan_description'] = $this->dialplan_description;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_add', 'temp');
|
||||
|
||||
//execute insert
|
||||
@@ -144,7 +144,7 @@
|
||||
$array['dialplans'][0]['dialplan_description'] = $this->dialplan_description;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
|
||||
//execute update
|
||||
@@ -447,7 +447,7 @@
|
||||
} //end foreach $xml_list
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_add', 'temp');
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
$p->add('dialplan_detail_add', 'temp');
|
||||
@@ -1007,7 +1007,7 @@
|
||||
$array['dialplans'][$x]['dialplan_uuid'] = $key;
|
||||
$array['dialplans'][$x]['dialplan_xml'] = $value;
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
//execute update
|
||||
$database = new database;
|
||||
@@ -1160,7 +1160,7 @@
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_delete', 'temp');
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
|
||||
@@ -1264,7 +1264,7 @@
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
@@ -1371,7 +1371,7 @@
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
|
||||
//save the array
|
||||
@@ -1525,7 +1525,7 @@
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_add', 'temp');
|
||||
|
||||
//save the array
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
$array['dialplans'][0]['dialplan_description'] = $this->dialplan_description;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_add', 'temp');
|
||||
|
||||
//execute insert
|
||||
@@ -156,7 +156,7 @@
|
||||
$array['dialplans'][0]['dialplan_description'] = $this->dialplan_description;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
|
||||
//execute update
|
||||
@@ -452,7 +452,7 @@
|
||||
} //end foreach $xml_list
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_add', 'temp');
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
$p->add('dialplan_detail_add', 'temp');
|
||||
@@ -1065,7 +1065,7 @@
|
||||
$array['dialplans'][$x]['dialplan_xml'] = $value;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
|
||||
//execute update
|
||||
@@ -1188,7 +1188,7 @@
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_delete', 'temp');
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
|
||||
@@ -1290,7 +1290,7 @@
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
@@ -1395,7 +1395,7 @@
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_edit', 'temp');
|
||||
|
||||
//save the array
|
||||
@@ -1546,7 +1546,7 @@
|
||||
if (!empty($array)) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_add', 'temp');
|
||||
|
||||
//save the array
|
||||
|
||||
@@ -40,6 +40,18 @@
|
||||
<condition field="${from_user_record}" expression="^local$" break="never">
|
||||
<action application="set" data="record_session=true" inline="true"/>
|
||||
</condition>
|
||||
<condition field="${record_session}" expression="^true$"/>
|
||||
<condition field="${call_direction}" expression="^inbound" break="never">
|
||||
<action application="set" data="record_stereo_swap=true" inline="true"/>
|
||||
</condition>
|
||||
<condition field="${record_session}" expression="^true$"/>
|
||||
<condition field="${call_direction}" expression="^outbound$" break="never">
|
||||
<action application="set" data="record_stereo=true" inline="true"/>
|
||||
</condition>
|
||||
<condition field="${record_session}" expression="^true$"/>
|
||||
<condition field="${call_direction}" expression="^local$" break="never">
|
||||
<action application="set" data="record_stereo=true" inline="true"/>
|
||||
</condition>
|
||||
<condition field="${record_session}" expression="^true$">
|
||||
<action application="set" data="record_path=${recordings_dir}/${domain_name}/archive/${strftime(%Y)}/${strftime(%b)}/${strftime(%d)}" inline="true" enabled="true"/>
|
||||
<action application="set" data="record_name=${uuid}.${record_ext}" inline="true" enabled="true"/>
|
||||
@@ -50,9 +62,8 @@
|
||||
<action application="bind_digit_action" data="local,*6,api:uuid_record,${uuid} unmask ${recordings_dir}/${domain_name}/archive/${strftime(%Y)}/${strftime(%b)}/${strftime(%d)}/${uuid}.${record_ext},both,self" enabled="true"/>
|
||||
<action application="set" data="record_append=true" inline="true" enabled="true"/>
|
||||
<action application="set" data="record_in_progress=true" inline="true" enabled="true"/>
|
||||
<action application="set" data="api_on_answer=uuid_record ${uuid} start ${record_path}/${record_name}" inline="false" enabled="false"/>
|
||||
<action application="set" data="RECORD_ANSWER_REQ=true" enabled="true"/>
|
||||
<action application="record_session" data="${record_path}/${record_name}" enabled="true"/>
|
||||
<action application="set" data="api_on_answer=uuid_record ${uuid} start ${record_path}/${record_name}" inline="false" enabled="true"/>
|
||||
<action application="set" data="record_answer_req=true" enabled="true"/>
|
||||
<action application="record_session" data="${record_path}/${record_name}" enabled="false"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
<extension name="valet_park" number="park+*5901-*5999" context="${domain_name}" continue="false" app_uuid="3cc8363d-5ce3-48aa-8ac1-143cf297c4f7" enabled="true" order="470">
|
||||
<condition field="destination_number" expression="^(park)?\+?\*(59(0[1-9]|[1-9][0-9]))$" break="never"/>
|
||||
<condition field="${sip_h_Referred-By}" expression="sip:(.*)@.*" break="never">
|
||||
<condition field="${sip_refer_to}" expression="^.+$" break="never"/>
|
||||
<condition field="${sip_refer_to}" expression="sip:(.*)@(.*?)(?::\d+)?\>" break="never">
|
||||
<action application="set" data="referred_by_host=$2" inline="true"/>
|
||||
</condition>
|
||||
<condition field="${sip_h_Referred-By}" expression="sip:(.*)@(.*?)(?::\d+)?\>" break="never">
|
||||
<action application="set" data="referred_by_user=$1" inline="true"/>
|
||||
</condition>
|
||||
<condition field="destination_number" expression="^(park)?\+?\*(59(0[1-9]|[1-9][0-9]))$" break="never"/>
|
||||
<condition field="${referred_by_user}" expression="^.+$" break="never">
|
||||
<action application="set" data="valet_context=${referred_by_host}" inline="true"/>
|
||||
<anti-action application="set" data="valet_context=${domain_name}" inline="true"/>
|
||||
</condition>
|
||||
<condition field="destination_number" expression="^(park)?\+?\*(59(0[1-9]|[1-9][0-9]))$" break="never">
|
||||
<action application="set" data="park_in_use=false" inline="true"/>
|
||||
<action application="set" data="park_lot=$2" inline="true"/>
|
||||
@@ -10,16 +19,16 @@
|
||||
</condition>
|
||||
<condition field="destination_number" expression="^(park)?\+?\*(59(0[1-9]|[1-9][0-9]))$"/>
|
||||
<condition field="${referred_by_user}" expression="^.+$" break="never">
|
||||
<action application="set" data="valet_info_park=${valet_info park@${domain_name}}|\*${park_lot}" inline="true"/>
|
||||
<action application="set" data="park_in_use=${regex ${valet_info park@${domain_name}}|\*${park_lot}}" inline="true"/>
|
||||
<action application="set" data="valet_info_park=${valet_info park@${valet_context}}|\*${park_lot}" inline="true"/>
|
||||
<action application="set" data="park_in_use=${regex ${valet_info park@${valet_context}}|\*${park_lot}}" inline="true"/>
|
||||
</condition>
|
||||
<condition field="${park_in_use}" expression="true" break="never">
|
||||
<action application="transfer" data="${referred_by_user} XML ${context}"/>
|
||||
<action application="transfer" data="${referred_by_user} XML ${referred_by_host}"/>
|
||||
<anti-action application="set" data="effective_caller_id_name=${cond ${regex ${direction} | inbound} == true ? 'park#${caller_id_name}' : 'park#${callee_id_name}'}" inline="true"/>
|
||||
<anti-action application="set" data="valet_parking_timeout=900"/>
|
||||
<anti-action application="set" data="valet_hold_music=${hold_music}"/>
|
||||
<anti-action application="set" data="valet_parking_orbit_exten=${cond ${regex ${referred_by_user} | ^$} == true ? ${sip_from_user} : ${referred_by_user}}"/>
|
||||
<anti-action application="answer" data=""/>
|
||||
<anti-action application="valet_park" data="park@${domain_name} *${park_lot}"/>
|
||||
<anti-action application="valet_park" data="park@${valet_context} *${park_lot}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<extension name="operator" number="0" context="${domain_name}" continue="false" app_uuid="0e1cd2d7-9d84-4959-8b6c-0cb23de4de59" enabled="false" order="480">
|
||||
<condition field="destination_number" expression="^0$|^operator$">
|
||||
<action application="export" data="transfer_context={v_context}" enabled="true"/>
|
||||
<action application="bind_meta_app" data="4 ab s execute_extension::att_xfer XML ${context}" enabled="false"/>
|
||||
<action application="bind_meta_app" data="5 ab s execute_extension::xfer_vm XML ${context}" enabled="false"/>
|
||||
<action application="set" data="domain_name={v_context}" enabled="true"/>
|
||||
<action application="transfer" data="${operator} XML {v_context}" enabled="true"/>
|
||||
<action application="export" data="transfer_context=${domain_name}" enabled="true"/>
|
||||
<action application="bind_meta_app" data="4 ab s execute_extension::att_xfer XML ${domain_name}" enabled="false"/>
|
||||
<action application="bind_meta_app" data="5 ab s execute_extension::xfer_vm XML ${domain_name}" enabled="false"/>
|
||||
<action application="set" data="domain_name=${domain_name}" enabled="true"/>
|
||||
<action application="transfer" data="${operator} XML ${domain_name}" enabled="true"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<extension name="operator-forward" number="*000" context="${domain_name}" continue="false" app_uuid="a90d3639-3b82-4905-a65d-85f58b6c4a19" enabled="true" order="485">
|
||||
<condition field="destination_number" expression="^\*000$" >
|
||||
<action application="set" data="dial_string=loopback/operator/${context}/XML" />
|
||||
<action application="set" data="dial_string=loopback/operator/${domain_name}/XML" />
|
||||
<action application="set" data="direction=both" />
|
||||
<action application="set" data="extension=true" />
|
||||
<action application="lua" data="dial_string.lua" />
|
||||
|
||||
@@ -414,4 +414,3 @@
|
||||
require_once "resources/footer.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
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
|
||||
//get the email settings
|
||||
$retry_limit = $settings->get('email_queue', 'retry_limit');
|
||||
$transcribe_enabled = $settings->get('transcribe', 'enabled');
|
||||
$transcribe_enabled = $settings->get('transcribe', 'enabled', false);
|
||||
$save_response = $settings->get('email_queue', 'save_response');
|
||||
|
||||
//set defaults
|
||||
@@ -181,6 +181,9 @@
|
||||
//$voicemail_description = $row["voicemail_description"];
|
||||
//$voicemail_name_base64 = $row["voicemail_name_base64"];
|
||||
//$voicemail_tutorial = $row["voicemail_tutorial"];
|
||||
if (gettype($voicemail_transcription_enabled) === 'string') {
|
||||
$voicemail_transcription_enabled = ($voicemail_transcription_enabled === 'true') ? true : false;
|
||||
}
|
||||
}
|
||||
unset($parameters);
|
||||
|
||||
@@ -220,7 +223,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($transcribe_enabled) && $transcribe_enabled === 'true' && isset($voicemail_transcription_enabled) && $voicemail_transcription_enabled === 'true') {
|
||||
if ($transcribe_enabled && isset($voicemail_transcription_enabled) && $voicemail_transcription_enabled) {
|
||||
//debug message
|
||||
echo "transcribe enabled: true\n";
|
||||
|
||||
@@ -440,7 +443,7 @@
|
||||
$array['email_queue'][0]['email_status'] = 'sent';
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('email_queue_add', 'temp');
|
||||
$p->add('email_queue_update', 'temp');
|
||||
//execute insert
|
||||
@@ -471,7 +474,7 @@
|
||||
$array['email_queue'][0]['email_status'] = 'failed';
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('email_queue_add', 'temp');
|
||||
|
||||
//execute insert
|
||||
@@ -525,7 +528,7 @@
|
||||
$array['email_logs'][0]['status'] = 'failed';
|
||||
$array['email_logs'][0]['email'] = str_replace("'", "''", $msg);
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('email_log_add', 'temp');
|
||||
//execute insert
|
||||
$database->app_name = 'v_mailto';
|
||||
@@ -569,4 +572,3 @@
|
||||
//fwrite($esl, $content);
|
||||
//fclose($esl);
|
||||
|
||||
?>
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
$sql = "select * from v_email_queue ";
|
||||
$sql .= "where (email_status = 'waiting' or email_status = 'trying') ";
|
||||
$sql .= "and hostname = :hostname ";
|
||||
$sql .= "order by domain_uuid asc ";
|
||||
$sql .= "order by domain_uuid, email_date desc ";
|
||||
$sql .= "limit :limit ";
|
||||
$parameters['hostname'] = $hostname;
|
||||
$parameters['limit'] = $email_queue_limit;
|
||||
@@ -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
|
||||
|
||||
@@ -579,7 +579,7 @@
|
||||
//add the missing email templates
|
||||
if (!empty($array['email_templates'])) {
|
||||
//add the temporary permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("email_template_add", 'temp');
|
||||
$p->add("email_template_edit", 'temp');
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ $text['title-emergency_logs']['zh-cn'] = "紧急日志";
|
||||
$text['title-emergency_logs']['ja-jp'] = "緊急ログ";
|
||||
$text['title-emergency_logs']['ko-kr'] = "비상 기록";
|
||||
|
||||
$text['title_description-emergency_logs']['en-us'] = "Track emergency calls includinng details of the time, date, and originating extension.";
|
||||
$text['title_description-emergency_logs']['en-gb'] = "Track emergency calls includinng details of the time, date, and originating extension.";
|
||||
$text['title_description-emergency_logs']['en-us'] = "Track emergency calls including details of the time, date, and originating extension.";
|
||||
$text['title_description-emergency_logs']['en-gb'] = "Track emergency calls including details of the time, date, and originating extension.";
|
||||
$text['title_description-emergency_logs']['ar-eg'] = "تتبع مكالمات الطوارئ بما في ذلك تفاصيل الوقت والتاريخ والامتداد الأصلي.";
|
||||
$text['title_description-emergency_logs']['de-at'] = "Verfolgen Sie Notrufe mit Angaben zu Uhrzeit, Datum und Nebenstelle des Anrufers.";
|
||||
$text['title_description-emergency_logs']['de-ch'] = "Verfolgen Sie Notrufe mit Angaben zu Uhrzeit, Datum und Nebenstelle des Anrufers.";
|
||||
|
||||
@@ -229,11 +229,11 @@
|
||||
$x++;
|
||||
}
|
||||
if (is_array($array)) {
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('event_guard_log_edit', 'temp');
|
||||
$database->app_name = 'event guard';
|
||||
$database->app_uuid = 'c5b86612-1514-40cb-8e2c-3f01a8f6f637';
|
||||
$database->save($array);
|
||||
$database->save($array, false);
|
||||
//$message = $database->message;
|
||||
$p->delete('event_guard_log_edit', 'temp');
|
||||
unset($array);
|
||||
@@ -349,11 +349,11 @@
|
||||
$array['event_guard_logs'][0]['extension'] = $event['to-user'].'@'.$event['to-host'];
|
||||
$array['event_guard_logs'][0]['user_agent'] = $event['user-agent'];
|
||||
$array['event_guard_logs'][0]['log_status'] = 'blocked';
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('event_guard_log_add', 'temp');
|
||||
$database->app_name = 'event guard';
|
||||
$database->app_uuid = 'c5b86612-1514-40cb-8e2c-3f01a8f6f637';
|
||||
$database->save($array);
|
||||
$database->save($array, false);
|
||||
$p->delete('event_guard_log_add', 'temp');
|
||||
|
||||
//send debug information to the console
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
}
|
||||
}
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('extension_edit', 'temp');
|
||||
|
||||
$database->app_name = 'extensions';
|
||||
@@ -69,7 +69,7 @@
|
||||
$sql .= "where default_setting_category = 'security' ";
|
||||
$sql .= "and default_setting_subcategory like 'password_%' ";
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('default_setting_edit', 'temp');
|
||||
|
||||
$database->execute($sql);
|
||||
|
||||
@@ -36,4 +36,3 @@
|
||||
$y++;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
}
|
||||
|
||||
//initialize the database object
|
||||
$database = new database;
|
||||
$database = database::new();
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
@@ -261,7 +261,7 @@
|
||||
$array['extension_users'][0]['user_uuid'] = $user_uuid;
|
||||
|
||||
//add temporary permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('extension_user_delete', 'temp');
|
||||
|
||||
//save the array
|
||||
@@ -288,7 +288,7 @@
|
||||
$array['device_lines'][0]['device_line_uuid'] = $device_line_uuid;
|
||||
|
||||
//add temporary permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('device_line_delete', 'temp');
|
||||
|
||||
//save the array
|
||||
@@ -401,6 +401,19 @@
|
||||
//extension exists
|
||||
}
|
||||
else {
|
||||
//password permission not assigned get the password from the database
|
||||
if ($action == "update" && !permission_exists('extension_password')) {
|
||||
$sql = "select password from v_extensions ";
|
||||
$sql .= "where extension_uuid = :extension_uuid ";
|
||||
$sql .= "and domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$parameters['extension_uuid'] = $extension_uuid;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row) && @sizeof($row) != 0) {
|
||||
$password = $row["password"];
|
||||
}
|
||||
unset($sql, $parameters, $row);
|
||||
}
|
||||
|
||||
//get the password length and strength
|
||||
$password_length = $_SESSION["extension"]["password_length"]["numeric"];
|
||||
@@ -658,9 +671,9 @@
|
||||
$array["devices"][$j]["device_lines"][0]["auth_id"] = $extension;
|
||||
$array["devices"][$j]["device_lines"][0]["password"] = $password;
|
||||
$array["devices"][$j]["device_lines"][0]["line_number"] = is_numeric($line_numbers[$d]) ? $line_numbers[$d] : '1';
|
||||
$array["devices"][$j]["device_lines"][0]["sip_port"] = $_SESSION['provision']['line_sip_port']['numeric'];
|
||||
$array["devices"][$j]["device_lines"][0]["sip_port"] = $_SESSION['provision']['line_sip_port']['text'];
|
||||
$array["devices"][$j]["device_lines"][0]["sip_transport"] = $_SESSION['provision']['line_sip_transport']['text'];
|
||||
$array["devices"][$j]["device_lines"][0]["register_expires"] = $_SESSION['provision']['line_register_expires']['numeric'];
|
||||
$array["devices"][$j]["device_lines"][0]["register_expires"] = $_SESSION['provision']['line_register_expires']['text'];
|
||||
$array["devices"][$j]["device_lines"][0]["enabled"] = "true";
|
||||
}
|
||||
|
||||
@@ -1766,7 +1779,7 @@
|
||||
echo " ".$text['label-voicemail_mail_to']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='voicemail_mail_to' maxlength='255' value=\"".escape($voicemail_mail_to ?? '')."\">\n";
|
||||
echo " <input class='formfld' type='text' name='voicemail_mail_to' maxlength='1024' value=\"".escape($voicemail_mail_to ?? '')."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-voicemail_mail_to']."\n";
|
||||
echo "</td>\n";
|
||||
|
||||
@@ -153,7 +153,7 @@ if (!class_exists('extension')) {
|
||||
//build update array
|
||||
$array['voicemails'][0]['voicemail_uuid'] = $voicemail_uuid;
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('voicemail_edit', 'temp');
|
||||
}
|
||||
else {
|
||||
@@ -161,7 +161,7 @@ if (!class_exists('extension')) {
|
||||
$array['voicemails'][0]['voicemail_uuid'] = uuid();
|
||||
$array['voicemails'][0]['domain_uuid'] = $this->domain_uuid;
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('voicemail_add', 'temp');
|
||||
}
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
@@ -639,7 +639,7 @@ if (!class_exists('extension')) {
|
||||
}
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('extension_user_delete', 'temp');
|
||||
$p->add('follow_me_delete', 'temp');
|
||||
$p->add('follow_me_destination_delete', 'temp');
|
||||
@@ -743,7 +743,7 @@ if (!class_exists('extension')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('extension_edit', 'temp');
|
||||
|
||||
//save the array
|
||||
@@ -798,4 +798,3 @@ if (!class_exists('extension')) {
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
$array_temp = $array;
|
||||
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("extension_edit", "temp");
|
||||
|
||||
//save to the data
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
//add the missing email templates
|
||||
if (!empty($array['email_templates'])) {
|
||||
//add the temporary permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("email_template_add", 'temp');
|
||||
$p->add("email_template_edit", 'temp');
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
//execute
|
||||
if (isset($array) && is_array($array)) {
|
||||
//assign temp permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fax_add', 'temp');
|
||||
$p->add('fax_edit', 'temp');
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
$array['fax'][0]['fax_description'] = $fax_description;
|
||||
|
||||
//execute insert
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fax_add', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
$array['fax_users'][0]['fax_uuid'] = $fax_uuid;
|
||||
$array['fax_users'][0]['user_uuid'] = $user_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fax_user_delete', 'temp');
|
||||
|
||||
$database = new database;
|
||||
@@ -202,7 +202,7 @@
|
||||
$array['fax_users'][0]['fax_uuid'] = $fax_uuid;
|
||||
$array['fax_users'][0]['user_uuid'] = $user_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fax_user_add', 'temp');
|
||||
|
||||
$database = new database;
|
||||
@@ -299,7 +299,7 @@
|
||||
$array['fax'][0]['dialplan_uuid'] = $dialplan_uuid;
|
||||
|
||||
//assign temp permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fax_add', 'temp');
|
||||
|
||||
//set the dialplan action
|
||||
@@ -311,7 +311,7 @@
|
||||
$array['fax'][0]['fax_uuid'] = $fax_uuid;
|
||||
|
||||
//assign temp permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fax_edit', 'temp');
|
||||
}
|
||||
|
||||
|
||||
@@ -266,8 +266,7 @@ if (!empty($result) && @sizeof($result) != 0) {
|
||||
|
||||
//send fax
|
||||
$cwd = getcwd();
|
||||
$included = true;
|
||||
require("fax_send.php");
|
||||
require "fax_send.php";
|
||||
if($cwd){
|
||||
chdir($cwd);
|
||||
}
|
||||
|
||||
@@ -518,7 +518,7 @@
|
||||
}
|
||||
|
||||
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||
if (permission_exists('fax_file_delete') || permission_exists['fax_file_edit']) {
|
||||
if (permission_exists('fax_file_delete') || permission_exists('fax_file_edit')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='fax_files[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all').checked = false; } checkbox_on_change(this);\">\n";
|
||||
echo " <input type='hidden' name='fax_files[$x][uuid]' value='".escape($row['fax_file_uuid'])."' />\n";
|
||||
|
||||
+26
-22
@@ -28,14 +28,19 @@
|
||||
Corey Moullas <cmoullas@emak.tech>
|
||||
*/
|
||||
|
||||
//set included to boolean
|
||||
if (!isset($included)) { $included = false; }
|
||||
|
||||
//check if windows
|
||||
if (stristr(PHP_OS, 'WIN')) { $IS_WINDOWS = true; } else { $IS_WINDOWS = false; }
|
||||
|
||||
//send email through browser
|
||||
if (!$included) {
|
||||
//executed via command line
|
||||
if (defined('STDIN')) {
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get($setting->get('domain','language','en-us'), 'app/fax');
|
||||
|
||||
}
|
||||
//executed via browser
|
||||
else {
|
||||
|
||||
//includes files
|
||||
require_once dirname(__DIR__, 2) . "/resources/require.php";
|
||||
@@ -124,6 +129,7 @@ if (!$included) {
|
||||
$fax_cover_font = $setting->get('fax','cover_font') ?? null;
|
||||
}
|
||||
|
||||
//define function correct_path
|
||||
if (!function_exists('correct_path')) {
|
||||
function correct_path($p) {
|
||||
global $IS_WINDOWS;
|
||||
@@ -206,7 +212,7 @@ if (!function_exists('fax_split_dtmf')) {
|
||||
|
||||
//send the fax
|
||||
$continue = false;
|
||||
if (!$included) {
|
||||
if (!defined('STDIN')) {
|
||||
if (!empty($_POST['action']) && $_POST['action'] == "send" && $domain_enabled == true) {
|
||||
//get the values from the HTTP POST
|
||||
$fax_numbers = $_POST['fax_numbers'];
|
||||
@@ -300,10 +306,10 @@ if (!function_exists('fax_split_dtmf')) {
|
||||
|
||||
//process uploaded or emailed files (if any)
|
||||
$fax_page_count = 0;
|
||||
$_files = (!$included) ? $_FILES['fax_files'] : $emailed_files;
|
||||
$_files = (!defined('STDIN')) ? $_FILES['fax_files'] : $emailed_files;
|
||||
unset($tif_files);
|
||||
foreach ($_files['tmp_name'] as $index => $fax_tmp_name) {
|
||||
$uploaded_file = (!$included) ? is_uploaded_file($fax_tmp_name) : true;
|
||||
$uploaded_file = (!defined('STDIN')) ? is_uploaded_file($fax_tmp_name) : true;
|
||||
if ( $uploaded_file && $_files['error'][$index] == 0 && $_files['size'][$index] > 0 ) {
|
||||
//get the file extension
|
||||
$fax_file_extension = strtolower(pathinfo($_files['name'][$index], PATHINFO_EXTENSION));
|
||||
@@ -323,7 +329,7 @@ if (!function_exists('fax_split_dtmf')) {
|
||||
}
|
||||
unset($attachment_file_name);
|
||||
|
||||
if (!$included) {
|
||||
if (!defined('STDIN')) {
|
||||
//check if directory exists
|
||||
if (!is_dir($dir_fax_temp)) {
|
||||
mkdir($dir_fax_temp, 0770);
|
||||
@@ -490,10 +496,9 @@ if (!function_exists('fax_split_dtmf')) {
|
||||
//field values
|
||||
$pdf->SetFont($pdf_font, "", 12);
|
||||
$pdf->SetXY($x + 2.0, $y + 1.65);
|
||||
if ($_REQUEST['submit'] != '' && $_REQUEST['submit'] != 'preview') {
|
||||
$time_zone = isset($_SESSION['domain']['time_zone']['name']) ? $_SESSION['domain']['time_zone']['name'] : date_default_timezone_get();
|
||||
$date = new DateTime('now', new DateTimeZone($time_zone) );
|
||||
$pdf->Write(0.3, $date->format('d M Y'));
|
||||
if (defined('STDIN') || ($_REQUEST['submit'] != '' && $_REQUEST['submit'] != 'preview')) {
|
||||
$date = new DateTime('now', new DateTimeZone( $setting->get('domain','time_zone', date_default_timezone_get() ) ));
|
||||
$pdf->Write(0.3, $date->format('d M Y @ h:i:s A'));
|
||||
}
|
||||
$pdf->SetXY($x + 2.0, $y + 1.95);
|
||||
if ($fax_recipient != '') {
|
||||
@@ -624,7 +629,7 @@ if (!function_exists('fax_split_dtmf')) {
|
||||
@unlink($tif_file);
|
||||
}
|
||||
}
|
||||
elseif (!$included) {
|
||||
elseif (!defined('STDIN')) {
|
||||
//nothing to send, redirect the browser
|
||||
message::add($text['message-invalid-fax'], 'negative', 4000);
|
||||
header("Location: fax_send.php?id=".$fax_uuid);
|
||||
@@ -678,13 +683,10 @@ if (!function_exists('fax_split_dtmf')) {
|
||||
unset($sql, $parameters, $row);
|
||||
|
||||
//for email to fax send email notification back to the email sender
|
||||
if ($included) {
|
||||
if (defined('STDIN')) {
|
||||
//use email-to-fax from address
|
||||
$mail_to_address = $sender_email;
|
||||
}
|
||||
else {
|
||||
//send fax through the browser
|
||||
}
|
||||
|
||||
//move the generated tif (and pdf) files to the sent directory
|
||||
//if (file_exists($dir_fax_temp.'/'.$fax_instance_uuid.".tif")) {
|
||||
@@ -733,6 +735,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) {
|
||||
@@ -808,7 +812,7 @@ if (!function_exists('fax_split_dtmf')) {
|
||||
$array['fax_queue'][0]['fax_command'] = 'originate '.$dial_string;
|
||||
|
||||
//add temporary permisison
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fax_queue_add', 'temp');
|
||||
|
||||
//save the data
|
||||
@@ -826,7 +830,7 @@ if (!function_exists('fax_split_dtmf')) {
|
||||
}
|
||||
|
||||
//redirect the browser
|
||||
if (!$included && is_uuid($fax_uuid)) {
|
||||
if (!defined('STDIN') && is_uuid($fax_uuid)) {
|
||||
header("Location: fax_files.php?id=".$fax_uuid."&box=sent");
|
||||
//header("Location: fax_outbox.php?id=".$fax_uuid);
|
||||
exit;
|
||||
@@ -836,7 +840,7 @@ if (!function_exists('fax_split_dtmf')) {
|
||||
|
||||
|
||||
//show content in the browser
|
||||
if (!$included) {
|
||||
if (!defined('STDIN')) {
|
||||
|
||||
//retrieve current user's assigned groups (uuids)
|
||||
foreach ($_SESSION['groups'] as $group_data) {
|
||||
@@ -861,7 +865,7 @@ if (!$included) {
|
||||
$sql .= "and cp.phone_type_fax = 1 ";
|
||||
$sql .= "and cp.phone_number is not null ";
|
||||
$sql .= "and cp.phone_number <> '' ";
|
||||
if ($setting->get('contact','permissions') == "true") {
|
||||
if ($setting->get('contact','permissions', false)) {
|
||||
if (is_array($user_group_uuids) && @sizeof($user_group_uuids) != 0) {
|
||||
//only show contacts assigned to current user's group(s) and those not assigned to any group
|
||||
$sql .= "and (";
|
||||
|
||||
@@ -99,7 +99,7 @@ if (!class_exists('fax')) {
|
||||
$array['dialplan_details'][0]['domain_uuid'] = $this->domain_uuid;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
@@ -166,7 +166,7 @@ if (!class_exists('fax')) {
|
||||
$array['dialplans'][] = $dialplan;
|
||||
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("dialplan_add", 'temp');
|
||||
$p->add("dialplan_detail_add", 'temp');
|
||||
$p->add("dialplan_edit", 'temp');
|
||||
@@ -312,7 +312,7 @@ if (!class_exists('fax')) {
|
||||
if (!empty($array) && is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fax_delete', 'temp');
|
||||
$p->add('fax_user_delete', 'temp');
|
||||
$p->add('fax_file_delete', 'temp');
|
||||
@@ -625,7 +625,7 @@ if (!class_exists('fax')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fax_add', 'temp');
|
||||
$p->add('dialplan_add', 'temp');
|
||||
|
||||
|
||||
@@ -47,7 +47,11 @@ function parse_message_decode_text($connection, &$part, $message_number, $id, $o
|
||||
}
|
||||
}
|
||||
if($charset){
|
||||
$msg = mb_convert_encoding($msg, $to_charset, $charset);
|
||||
if ($charset === 'windows-1256') {
|
||||
$msg = iconv('windows-1256', 'utf-8', $msg);
|
||||
} else {
|
||||
$msg = mb_convert_encoding($msg, $to_charset, $charset);
|
||||
}
|
||||
}
|
||||
$msg = trim($msg);
|
||||
}
|
||||
|
||||
@@ -76,6 +76,14 @@
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "30";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Number of days to retain the fax queue logs in the database for the maintenance app.";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5506cf35-e19d-4f02-ab9d-43fd0f8460f7";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "fax_queue";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "prefer_local";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "false";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Determine whether fax calls should attempt to stay local or route to the provider.";
|
||||
//$y++;
|
||||
//$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "afd729d9-cf69-4793-a140-21093814d314";
|
||||
//$apps[$x]['default_settings'][$y]['default_setting_category'] = "fax_queue";
|
||||
|
||||
@@ -324,7 +324,7 @@
|
||||
echo th_order_by('fax_retry_date', $text['label-fax_retry_date'], $order_by, $order);
|
||||
echo th_order_by('fax_notify_date', $text['label-fax_notify_date'], $order_by, $order);
|
||||
echo th_order_by('fax_retry_count', $text['label-fax_retry_count'], $order_by, $order);
|
||||
if ($permission['fax_queue_edit'] && $settings->get('theme', 'list_row_edit_button', 'false') == 'true') {
|
||||
if ($permission['fax_queue_edit'] && $settings->get('theme', 'list_row_edit_button', false)) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -358,7 +358,7 @@
|
||||
echo " <td>".escape($row['fax_retry_date_formatted'])." ".escape($row['fax_retry_time_formatted'])."</td>\n";
|
||||
echo " <td>".escape($row['fax_notify_date_formatted'])." ".escape($row['fax_notify_time_formatted'])."</td>\n";
|
||||
echo " <td>".escape($row['fax_retry_count'])."</td>\n";
|
||||
if ($permission['fax_queue_edit'] && $settings->get('theme', 'list_row_edit_button', 'false') == 'true') {
|
||||
if ($permission['fax_queue_edit'] && $settings->get('theme', 'list_row_edit_button', false)) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon' => $settings->get('theme', 'button_icon_edit'),'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -61,6 +61,9 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//connect to the database
|
||||
$database = new database;
|
||||
|
||||
//shutdown call back function
|
||||
function shutdown() {
|
||||
//when the fax status is still sending
|
||||
@@ -156,7 +159,6 @@
|
||||
$sql .= "where fax_queue_uuid = :fax_queue_uuid ";
|
||||
$sql .= "and q.domain_uuid = d.domain_uuid and f.fax_uuid = q.fax_uuid";
|
||||
$parameters['fax_queue_uuid'] = $fax_queue_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row)) {
|
||||
$fax_queue_uuid = $row['fax_queue_uuid'];
|
||||
@@ -221,6 +223,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()) {
|
||||
@@ -230,28 +249,70 @@
|
||||
|
||||
//fax options, first attempt use the fax variables from settings
|
||||
if ($fax_retry_count == 0) {
|
||||
$fax_options = '';
|
||||
}
|
||||
if ($fax_retry_count == 1) {
|
||||
//use default settings or domain settings (defaults to t38)
|
||||
$fax_options = '';
|
||||
foreach($setting->get('fax','variable') as $variable) {
|
||||
$fax_options .= $variable.",";
|
||||
}
|
||||
}
|
||||
elseif ($fax_retry_count == 2) {
|
||||
$fax_options = "fax_use_ecm=false,fax_enable_t38=true,fax_enable_t38_request=true";
|
||||
}
|
||||
elseif ($fax_retry_count == 3) {
|
||||
$fax_options = "fax_use_ecm=true,fax_enable_t38=true,fax_enable_t38_request=true,fax_disable_v17=false";
|
||||
}
|
||||
elseif ($fax_retry_count == 4) {
|
||||
elseif ($fax_retry_count == 1) {
|
||||
//send without t38 faster
|
||||
$fax_options = "fax_use_ecm=true,fax_enable_t38=false,fax_enable_t38_request=false,fax_disable_v17=false";
|
||||
}
|
||||
elseif ($fax_retry_count == 2) {
|
||||
//use t38 passthru
|
||||
$fax_options = "fax_use_ecm=false,fax_enable_t38=true,t38_passthru=true";
|
||||
}
|
||||
elseif ($fax_retry_count == 3) {
|
||||
//send without t38 slower
|
||||
$fax_options = "fax_use_ecm=true,fax_enable_t38=false,fax_enable_t38_request=false,fax_disable_v17=true";
|
||||
}
|
||||
elseif ($fax_retry_count == 4) {
|
||||
//send with t38 no error correction
|
||||
$fax_options = "fax_use_ecm=false,fax_enable_t38=true,fax_enable_t38_request=true";
|
||||
}
|
||||
elseif ($fax_retry_count == 5) {
|
||||
$fax_options = "fax_use_ecm=true,fax_enable_t38=true,fax_enable_t38_request=true,fax_disable_v17=true";
|
||||
//send with t38 with error correction faster
|
||||
$fax_options = "fax_use_ecm=true,fax_enable_t38=true,fax_enable_t38_request=true,fax_disable_v17=false";
|
||||
}
|
||||
elseif ($fax_retry_count == 6) {
|
||||
$fax_options = "fax_use_ecm=false,fax_enable_t38=false,fax_enable_t38_request=false,fax_disable_v17=false";
|
||||
//send with t38 with error correction slower
|
||||
$fax_options = "fax_use_ecm=true,fax_enable_t38=true,fax_enable_t38_request=true,fax_disable_v17=true";
|
||||
}
|
||||
else {
|
||||
//try the user definable method again
|
||||
$fax_options = '';
|
||||
foreach($setting->get('fax','variable') as $variable) {
|
||||
$fax_options .= $variable.",";
|
||||
}
|
||||
}
|
||||
|
||||
//extract fax_dtmf from the fax number
|
||||
fax_split_dtmf($fax_number, $fax_dtmf);
|
||||
|
||||
//get the fax toll allow
|
||||
if (!empty($fax_toll_allow)) {
|
||||
$channel_variables["toll_allow"] = $fax_toll_allow;
|
||||
}
|
||||
|
||||
//check to see if the destination number is local
|
||||
$local_destination = false;
|
||||
if ($setting->get('fax_queue','prefer_local', false)) {
|
||||
$sql = "select count(destination_uuid) ";
|
||||
$sql .= "from v_destinations ";
|
||||
$sql .= "where (";
|
||||
$sql .= " destination_number = :destination_number ";
|
||||
$sql .= " or concat(destination_prefix, destination_number) = :destination_number ";
|
||||
$sql .= " or concat(destination_trunk_prefix, destination_number) = :destination_number ";
|
||||
$sql .= " or concat(destination_area_code, destination_number) = :destination_number ";
|
||||
$sql .= " or concat(destination_prefix, destination_area_code, destination_number) = :destination_number ";
|
||||
$sql .= ") ";
|
||||
$parameters['destination_number'] = $fax_number;
|
||||
$destination_count = $database->select($sql, $parameters, 'column');
|
||||
if ($destination_count > 0) {
|
||||
$local_destination = true;
|
||||
$route_array[] = 'loopback/'.$fax_number.'/public';
|
||||
}
|
||||
}
|
||||
|
||||
//define the fax file
|
||||
@@ -262,34 +323,61 @@
|
||||
$common_variables .= "domain_name=" . $domain_name . ",";
|
||||
$common_variables .= "origination_caller_id_name='" . escape_quote($fax_caller_id_name) . "',";
|
||||
$common_variables .= "origination_caller_id_number=" . $fax_caller_id_number . ",";
|
||||
$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 .= "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) {
|
||||
$common_variables .= "sip_to_user=".$fax_number.",";
|
||||
$common_variables .= "sip_req_user=".$fax_number.",";
|
||||
}
|
||||
|
||||
//extract fax_dtmf from the fax number
|
||||
fax_split_dtmf($fax_number, $fax_dtmf);
|
||||
|
||||
//prepare the fax command
|
||||
if (!empty($fax_toll_allow)) {
|
||||
$channel_variables["toll_allow"] = $fax_toll_allow;
|
||||
}
|
||||
$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 (count($route_array) == 0) {
|
||||
//check for valid extension
|
||||
$sql = "select count(extension_uuid) ";
|
||||
$sql .= "from v_extensions ";
|
||||
$sql .= "where extension = :fax_number ";
|
||||
$sql .= "and domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$parameters['fax_number'] = $fax_number;
|
||||
$database = new database;
|
||||
$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;
|
||||
|
||||
if (empty($route_array)) {
|
||||
//send the internal call to the registered extension
|
||||
if (count($route_array) == 0) {
|
||||
//check for valid extension
|
||||
$sql = "select count(extension_uuid) ";
|
||||
$sql .= "from v_extensions ";
|
||||
$sql .= "where extension = :fax_number ";
|
||||
$sql .= "and domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$parameters['fax_number'] = $fax_number;
|
||||
$extension_count = $database->select($sql, $parameters, 'column');
|
||||
if ($extension_count > 0) {
|
||||
//send the internal call to the registered extension
|
||||
$fax_uri = "user/".$fax_number."@".$domain_name;
|
||||
}
|
||||
else {
|
||||
$fax_uri = '';
|
||||
$fax_status = 'failed';
|
||||
}
|
||||
}
|
||||
else {
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,13 +387,13 @@
|
||||
//build a list of fax variables
|
||||
$dial_string = $common_variables;
|
||||
$dial_string .= $fax_options.",";
|
||||
$dial_string .= "origination_uuid=" . $origination_uuid. ",";
|
||||
$dial_string .= "fax_uuid=" . $fax_uuid. ",";
|
||||
$dial_string .= "fax_queue_uuid=" . $fax_queue_uuid. ",";
|
||||
$dial_string .= "mailto_address='" . $fax_email_address . "',";
|
||||
$dial_string .= "origination_uuid=" . $origination_uuid . ",";
|
||||
$dial_string .= "fax_uuid=" . $fax_uuid . ",";
|
||||
$dial_string .= "fax_queue_uuid=" . $fax_queue_uuid . ",";
|
||||
$dial_string .= "mailto_address='" . $fax_email_address . "',";
|
||||
$dial_string .= "mailfrom_address='" . $email_from_address . "',";
|
||||
$dial_string .= "fax_retry_attempts=" . $fax_retry_count . ",";
|
||||
$dial_string .= "fax_retry_limit=" . $retry_limit . ",";
|
||||
$dial_string .= "fax_retry_attempts=" . $fax_retry_count . ",";
|
||||
$dial_string .= "fax_retry_limit=" . $retry_limit . ",";
|
||||
//$dial_string .= "fax_retry_sleep=180,";
|
||||
$dial_string .= "fax_verbose=true,";
|
||||
//$dial_string .= "fax_use_ecm=off,";
|
||||
@@ -315,21 +403,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
|
||||
@@ -351,11 +436,10 @@
|
||||
$array['fax_queue'][0]['fax_response'] = $fax_response;
|
||||
|
||||
//add temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fax_queue_edit', 'temp');
|
||||
|
||||
//save the data
|
||||
$database = new database;
|
||||
$database->app_name = 'fax queue';
|
||||
$database->app_uuid = '3656287f-4b22-4cf1-91f6-00386bf488f4';
|
||||
$database->save($array, false);
|
||||
@@ -399,7 +483,6 @@
|
||||
$parameters['template_language'] = $language_code;
|
||||
$parameters['template_category'] = 'fax';
|
||||
$parameters['template_type'] = 'html';
|
||||
$database = new database;
|
||||
$fax_templates = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
}
|
||||
@@ -451,7 +534,6 @@
|
||||
$sql .= "from v_fax_logs ";
|
||||
$sql .= "where fax_log_uuid = :fax_log_uuid ";
|
||||
$parameters['fax_log_uuid'] = $fax_log_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row)) {
|
||||
$fax_success = $row['fax_success'];
|
||||
@@ -569,11 +651,10 @@
|
||||
$array['fax_queue'][0]['fax_notify_date'] = 'now()';
|
||||
|
||||
//add temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fax_queue_edit', 'temp');
|
||||
|
||||
//save the data
|
||||
$database = new database;
|
||||
$database->app_name = 'fax queue';
|
||||
$database->app_uuid = '3656287f-4b22-4cf1-91f6-00386bf488f4';
|
||||
$database->save($array, false);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -30,6 +30,23 @@
|
||||
$apps[$x]['description']['sv-se'] = "";
|
||||
$apps[$x]['description']['uk-ua'] = "";
|
||||
|
||||
//destination details
|
||||
$y=0;
|
||||
$apps[$x]['destinations'][$y]['type'] = "sql";
|
||||
$apps[$x]['destinations'][$y]['label'] = "fifo";
|
||||
$apps[$x]['destinations'][$y]['name'] = "fifo";
|
||||
$apps[$x]['destinations'][$y]['sql'] = "select fifo_uuid as uuid, fifo_name as name, fifo_extension as extension, fifo_enabled from v_fifo ";
|
||||
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and fifo_enabled = 'true' ";
|
||||
$apps[$x]['destinations'][$y]['order_by'] = "natural_sort(fifo_extension) asc";
|
||||
$apps[$x]['destinations'][$y]['field']['uuid'] = "uuid";
|
||||
$apps[$x]['destinations'][$y]['field']['name'] = "name";
|
||||
$apps[$x]['destinations'][$y]['field']['extension'] = "extension";
|
||||
//$apps[$x]['destinations'][$y]['field']['context'] = "context";
|
||||
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${extension} XML \${context}";
|
||||
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${extension} XML \${context}";
|
||||
$apps[$x]['destinations'][$y]['select_label'] = "\${extension} \${name}";
|
||||
$y++;
|
||||
|
||||
//permission details
|
||||
$y = 0;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'fifo_view';
|
||||
@@ -70,6 +87,10 @@
|
||||
$apps[$x]['permissions'][$y]['name'] = 'fifo_member_all';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'fifo_destinations';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
|
||||
//queues
|
||||
$y=0;
|
||||
|
||||
@@ -135,6 +135,33 @@ $text['description-fifo_name']['zh-cn'] = "队列将被分配的名称。";
|
||||
$text['description-fifo_name']['ja-jp'] = "キューに割り当てられる名前。";
|
||||
$text['description-fifo_name']['ko-kr'] = "대기열에 할당될 이름입니다.";
|
||||
|
||||
$text['label-fifo']['en-us'] = "Queues";
|
||||
$text['label-fifo']['en-gb'] = "Queues";
|
||||
$text['label-fifo']['ar-eg'] = "الاستفسارات";
|
||||
$text['label-fifo']['de-at'] = "Warteschlangen";
|
||||
$text['label-fifo']['de-ch'] = "Warteschlangen";
|
||||
$text['label-fifo']['de-de'] = "Warteschlangen";
|
||||
$text['label-fifo']['el-gr'] = "Ουρές";
|
||||
$text['label-fifo']['es-cl'] = "Colas";
|
||||
$text['label-fifo']['es-mx'] = "Colas";
|
||||
$text['label-fifo']['fr-ca'] = "Files d'attente";
|
||||
$text['label-fifo']['fr-fr'] = "Files d'attente";
|
||||
$text['label-fifo']['he-il'] = "תורים";
|
||||
$text['label-fifo']['it-it'] = "Code";
|
||||
$text['label-fifo']['ka-ge'] = "რიგები";
|
||||
$text['label-fifo']['nl-nl'] = "Wachtrijen";
|
||||
$text['label-fifo']['pl-pl'] = "Kolejki";
|
||||
$text['label-fifo']['pt-br'] = "Filas";
|
||||
$text['label-fifo']['pt-pt'] = "Filas";
|
||||
$text['label-fifo']['ro-ro'] = "Cozi";
|
||||
$text['label-fifo']['ru-ru'] = "Очереди";
|
||||
$text['label-fifo']['sv-se'] = "Kö:er";
|
||||
$text['label-fifo']['uk-ua'] = "Клей";
|
||||
$text['label-fifo']['tr-tr'] = "Kuyruklar";
|
||||
$text['label-fifo']['zh-cn'] = "尾巴";
|
||||
$text['label-fifo']['ja-jp'] = "テイルス";
|
||||
$text['label-fifo']['ko-kr'] = "꼬리";
|
||||
|
||||
$text['label-fifo_extension']['en-us'] = "Extension";
|
||||
$text['label-fifo_extension']['en-gb'] = "Extension";
|
||||
$text['label-fifo_extension']['ar-eg'] = "امتداد";
|
||||
@@ -810,4 +837,3 @@ $text['label-member_enabled']['ja-jp'] = "有効";
|
||||
$text['label-member_enabled']['ko-kr'] = "활성화됨";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -36,4 +36,3 @@
|
||||
$y++;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
+10
-13
@@ -242,7 +242,7 @@
|
||||
}
|
||||
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("dialplan_add", "temp");
|
||||
$p->add("dialplan_edit", "temp");
|
||||
|
||||
@@ -396,14 +396,11 @@
|
||||
echo " <div class='heading'><b>".$text['title-fifo']."</b></div>\n";
|
||||
echo " <div class='actions'>\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 " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
@@ -482,7 +479,7 @@
|
||||
echo " <th class='vtablereq'>".$text['label-member_enabled']."</th>\n";
|
||||
if (is_array($fifo_members) && @sizeof($fifo_members) > 1 && permission_exists('fifo_member_delete')) {
|
||||
echo " <td class='vtable edit_delete_checkbox_all' onmouseover=\"swap_display('delete_label_details', 'delete_toggle_details');\" onmouseout=\"swap_display('delete_label_details', 'delete_toggle_details');\">\n";
|
||||
echo " <span id='delete_label_details'>".$text['label-action']."</span>\n";
|
||||
echo " <span id='delete_label_details'>".$text['label-delete']."</span>\n";
|
||||
echo " <span id='delete_toggle_details'><input type='checkbox' id='checkbox_all_details' name='checkbox_all' onclick=\"edit_all_toggle('details'); checkbox_on_change(this);\"></span>\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
@@ -497,9 +494,9 @@
|
||||
if (empty($row["member_wrap_up_time"])) { $row["member_wrap_up_time"] = '10'; }
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <input type='hidden' name='fifo_members[$x][domain_uuid]' value=\"".escape($row["domain_uuid"])."\">\n";
|
||||
echo " <input type='hidden' name='fifo_members[$x][fifo_uuid]' value=\"".escape($row["fifo_uuid"])."\">\n";
|
||||
echo " <input type='hidden' name='fifo_members[$x][fifo_member_uuid]' value=\"".escape($row["fifo_member_uuid"])."\">\n";
|
||||
echo " <input type='hidden' name='fifo_members[$x][domain_uuid]' value=\"".escape($row["domain_uuid"])."\">\n";
|
||||
echo " <input type='hidden' name='fifo_members[$x][fifo_uuid]' value=\"".escape($row["fifo_uuid"])."\">\n";
|
||||
echo " <input type='hidden' name='fifo_members[$x][fifo_member_uuid]' value=\"".escape($row["fifo_member_uuid"])."\">\n";
|
||||
echo " <td class='formfld'>\n";
|
||||
echo " $member_contact\n";
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -111,7 +111,7 @@ if (!class_exists('fifo')) {
|
||||
//delete the checked rows
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fifo_member_delete', 'temp');
|
||||
$p->add('dialplan_delete', 'temp');
|
||||
|
||||
@@ -261,7 +261,7 @@ if (!class_exists('fifo')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('fifo_member_add', 'temp');
|
||||
|
||||
//save the array
|
||||
|
||||
@@ -36,4 +36,3 @@ $y=0;
|
||||
$y++;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -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++;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user