initial clone

This commit is contained in:
i am da real crt yes 2022-09-05 10:18:30 +02:00
commit 5da3596a48
5066 changed files with 1421814 additions and 0 deletions

49
.htaccess Normal file
View File

@ -0,0 +1,49 @@
RewriteEngine On
#REST api
RewriteRule ^(.*)/api/(.*)$ $1/api/index.php?rewrite_uri=$2 [QSA]
# $mac or $mac.cfg/xml
RewriteRule ^.*([A-Fa-f0-9]{12})(?:\.xml|\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
# $m:a:c or $m:a:c.cfg/xml
RewriteRule ^.*((?:[A-Fa-f0-9]{2}[:-]){5}[A-Fa-f0-9]{2})(?:\.xml|\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
# kt*-$mac.xml
RewriteRule ^kt.*?-([A-Fa-f0-9]{12})\.xml$ app/provision/index.php?mac=$1 [QSA]
# cfg-$mac.xml
RewriteRule ^.*cfg([A-Fa-f0-9]{12})\.xml$ app/provision/index.php?mac=$1 [QSA]
#Snom m3
RewriteRule ^m3/settings/([A-Fa-f0-9]{12})(?:\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
#Grandstream
RewriteRule ^.*/cfg([A-Fa-f0-9]{12})(?:\.xml|\.cfg)?$ app/provision/?mac=$1 [QSA]
#Yealink and Polycom
RewriteRule ^.*/([A-Fa-f0-9]{12})(?:\.xml|\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
#Polycom
RewriteRule ^provision/000000000000.cfg$ app/provision/?mac=$1&file={$mac}.cfg [QSA]
RewriteRule ^provision/features.cfg$ app/provision/?mac=$1&file=features.cfg [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-sip.cfg$ app/provision/?mac=$1&file=sip.cfg [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-phone.cfg$ app/provision/?mac=$1 [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-registration.cfg$ app/provision/?mac=$1&file={$mac}-registration.cfg [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-site.cfg$ app/provision/?mac=$1&file=site.cfg [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-web.cfg$ app/provision/?mac=$1&file=web.cfg [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-directory.xml$ app/provision/?mac=$1&file=directory.xml [QSA]
#Escene
RewriteRule ^.*/([0-9]{1,11})_Extern.xml$ app/provision/?ext=$1&file={$mac}_extern.xml [QSA]
RewriteRule ^.*/([0-9]{1,11})_Phonebook.xml$ app/provision/?ext=$1&file={$mac}_phonebook.xml [QSA]
#Aastra
RewriteRule ^provision/aastra.cfg$ app/provision/index.php?file=aastra.cfg [QSA]
Options -Indexes
#PHP settings
php_value upload_max_filesize 25M
php_value post_max_size 35M
php_value memory_limit 512M

11
.project Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fusionbpx</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

91
app/aastra/app_config.php Normal file
View File

@ -0,0 +1,91 @@
<?php
//application details
$apps[$x]['name'] = "Aastra";
$apps[$x]['uuid'] = "c3b13bbc-3015-4c09-87e8-416749b29f66";
$apps[$x]['category'] = "Vendor";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "";
$apps[$x]['description']['en-gb'] = "";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "";
$apps[$x]['description']['es-cl'] = "";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "";
$apps[$x]['description']['fr-fr'] = "";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "";
$apps[$x]['description']['pt-pt'] = "";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//default settings
$y=0;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c471163a-12fa-11e8-b642-0ed5f89f718b";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_gmt_offset";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$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'] = "Aastra timezone offset in minutes (e.g. 300 = GMT-5 = Eastern Standard Time)";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c47117a2-12fa-11e8-b642-0ed5f89f718b";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_time_format";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$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'] = "Aastra clock format";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c47119aa-12fa-11e8-b642-0ed5f89f718b";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_date_format";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$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'] = "Aastra date format";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b31b1423-a04c-4b4a-9c55-a0b3791642c3";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_ptime";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "20";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set Aastra ptime";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "8b676397-2cf7-45de-a7ec-f3ceb7d529e3";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_silence_suppression";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$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'] = "Enable Aastra codec silence suppression (on / off)";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "1455b1b0-68ec-400d-be84-1d1132aea72f";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_zone_minutes";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$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'] = "Offset in minutes from GMT, 300 = GMT-5 = Eastern Standard Time, -120 = GMT+2 = Eastern European Time";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c90e804a-d2bb-431a-ace8-5c69e140c539";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_sip_silence_suppression";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$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'] = "Aastra SIP silence suppression - silence suppression: deactivated (0), activated (1); enabled on G.711 with CN(RFC3389) or G.729AB";
$y++;
?>

View File

@ -0,0 +1,458 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2018 - 2022
the Initial Developer. All Rights Reserved.
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('access_control_add') || permission_exists('access_control_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
$action = "update";
$access_control_uuid = $_REQUEST["id"];
$id = $_REQUEST["id"];
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (is_array($_POST) && @sizeof($_POST) != 0) {
$access_control_name = $_POST["access_control_name"];
$access_control_default = $_POST["access_control_default"];
$access_control_nodes = $_POST["access_control_nodes"];
$access_control_description = $_POST["access_control_description"];
}
//process the user data and save it to the database
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//enforce valid data
if ($access_control_name == 'providers' || $access_control_name == 'domains') {
$access_control_default = 'deny';
}
if ($access_control_default != 'allow' && $access_control_default != 'deny') {
$access_control_default = 'deny';
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: access_controls.php');
exit;
}
//process the http post data by submitted action
if ($_POST['action'] != '' && strlen($_POST['action']) > 0) {
//prepare the array(s)
$x = 0;
foreach ($_POST['access_control_nodes'] as $row) {
if (is_uuid($row['access_control_uuid']) && $row['checked'] === 'true') {
$array['access_controls'][$x]['checked'] = $row['checked'];
$array['access_controls'][$x]['access_control_nodes'][]['access_control_node_uuid'] = $row['access_control_node_uuid'];
$x++;
}
}
//send the array to the database class
switch ($_POST['action']) {
case 'copy':
if (permission_exists('access_control_add')) {
$obj = new database;
$obj->copy($array);
}
break;
case 'delete':
if (permission_exists('access_control_delete')) {
$obj = new database;
$obj->delete($array);
}
break;
case 'toggle':
if (permission_exists('access_control_update')) {
$obj = new database;
$obj->toggle($array);
}
break;
}
//clear the cache, reloadacl and redirect the user
if (in_array($_POST['action'], array('copy', 'delete', 'toggle'))) {
//clear the cache
$cache = new cache;
$cache->delete("configuration:acl.conf");
//create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
event_socket_request($fp, "api reloadacl");
}
//redirect the user
header('Location: access_control_edit.php?id='.$id);
exit;
}
}
//check for all required data
$msg = '';
if (strlen($access_control_name) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_name']."<br>\n"; }
if (strlen($access_control_default) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_default']."<br>\n"; }
//if (strlen($access_control_nodes) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_nodes']."<br>\n"; }
//if (strlen($access_control_description) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_description']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "resources/footer.php";
return;
}
//add the access_control_uuid
if (!is_uuid($_POST["access_control_uuid"])) {
$access_control_uuid = uuid();
}
//prepare the array
$array['access_controls'][0]['access_control_uuid'] = $access_control_uuid;
$array['access_controls'][0]['access_control_name'] = $access_control_name;
$array['access_controls'][0]['access_control_default'] = $access_control_default;
$array['access_controls'][0]['access_control_description'] = $access_control_description;
$y = 0;
if (is_array($access_control_nodes)) {
foreach ($access_control_nodes as $row) {
//validate the data
if (!is_uuid($row["access_control_node_uuid"])) { continue; }
if ($row["node_type"] != 'allow' && $row["node_type"] != 'deny') { continue; }
if (isset($row["node_cidr"]) && $row["node_cidr"] != '') {
$cidr_array = explode("/", str_replace("\\", "/", $row["node_cidr"]));
if (filter_var($cidr_array[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
if (isset($cidr_array[1]) && is_numeric($cidr_array[1])) {
//valid IPv4 address and cidr notation
$node_cidr = $row["node_cidr"];
}
else {
//valid IPv4 address add the missing cidr notation
$node_cidr = $row["node_cidr"].'/32';
}
}
elseif(filter_var($cidr_array[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
//valid IPv6 address
$node_cidr = $row["node_cidr"];
}
//if the cidr is provided ignore the domain.
$row["node_domain"] = '';
}
//build the sub array
$array['access_controls'][0]['access_control_nodes'][$y]['access_control_node_uuid'] = $row["access_control_node_uuid"];
$array['access_controls'][0]['access_control_nodes'][$y]['node_type'] = $row["node_type"];
$array['access_controls'][0]['access_control_nodes'][$y]['node_cidr'] = $node_cidr;
$array['access_controls'][0]['access_control_nodes'][$y]['node_domain'] = $row["node_domain"];
$array['access_controls'][0]['access_control_nodes'][$y]['node_description'] = $row["node_description"];
$y++;
//unset values
unset($cidr_array, $node_cidr);
}
}
//save the data
if (is_array($array)) {
$database = new database;
$database->app_name = 'access controls';
$database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
$database->save($array);
}
//clear the cache
$cache = new cache;
$cache->delete("configuration:acl.conf");
//create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
event_socket_request($fp, "api reloadacl");
}
//redirect the user
if (isset($action)) {
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
}
if ($action == "update") {
$_SESSION["message"] = $text['message-update'];
}
//header('Location: access_controls.php');
header('Location: access_control_edit.php?id='.urlencode($access_control_uuid));
return;
}
}
//pre-populate the form
if (is_array($_GET) && $_POST["persistformvar"] != "true") {
$sql = "select * from v_access_controls ";
$sql .= "where access_control_uuid = :access_control_uuid ";
$parameters['access_control_uuid'] = $access_control_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) {
$access_control_name = $row["access_control_name"];
$access_control_default = $row["access_control_default"];
$access_control_description = $row["access_control_description"];
}
unset($sql, $parameters, $row);
}
//get the child data
if (is_uuid($access_control_uuid)) {
$sql = "select * from v_access_control_nodes ";
$sql .= "where access_control_uuid = :access_control_uuid ";
$sql .= "order by node_cidr asc";
$parameters['access_control_uuid'] = $access_control_uuid;
$database = new database;
$access_control_nodes = $database->select($sql, $parameters, 'all');
unset ($sql, $parameters);
}
//add the $access_control_node_uuid
if (!is_uuid($access_control_node_uuid)) {
$access_control_node_uuid = uuid();
}
//add an empty row
if (is_array($access_control_nodes) && @sizeof($access_control_nodes) != 0) {
$x = count($access_control_nodes);
}
else {
$access_control_nodes = array();
$x = 0;
}
$access_control_nodes[$x]['access_control_uuid'] = $access_control_uuid;
$access_control_nodes[$x]['access_control_node_uuid'] = uuid();
$access_control_nodes[$x]['node_type'] = '';
$access_control_nodes[$x]['node_cidr'] = '';
$access_control_nodes[$x]['node_domain'] = '';
$access_control_nodes[$x]['node_description'] = '';
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
$document['title'] = $text['title-access_control'];
require_once "resources/header.php";
//show the content
echo "<form name='frm' id='frm' method='post'>\n";
echo "<input class='formfld' type='hidden' name='access_control_uuid' value='".escape($access_control_uuid)."'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-access_control']."</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','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'access_controls.php']);
if ($action == 'update') {
if (permission_exists('access_control_node_add')) {
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
}
if (permission_exists('access_control_node_delete')) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; margin-right: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
}
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','collapse'=>'hide-xs']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
echo $text['title_description-access_controls']."\n";
echo "<br /><br />\n";
if ($action == 'update') {
if (permission_exists('access_control_add')) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'copy','onclick'=>"modal_close();"])]);
}
if (permission_exists('access_control_delete')) {
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
}
}
if ($action == 'update') {
if (permission_exists('access_control_add')) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'copy','onclick'=>"modal_close();"])]);
}
if (permission_exists('access_control_delete')) {
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
}
}
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-access_control_name']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <input class='formfld' type='text' name='access_control_name' maxlength='255' value='".escape($access_control_name)."'>\n";
echo "<br />\n";
echo $text['description-access_control_name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-access_control_default']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <select class='formfld' name='access_control_default'>\n";
echo " <option value=''></option>\n";
if ($access_control_default == "allow") {
echo " <option value='allow' selected='selected'>".$text['label-allow']."</option>\n";
}
else {
echo " <option value='allow'>".$text['label-allow']."</option>\n";
}
if ($access_control_default == "deny") {
echo " <option value='deny' selected='selected'>".$text['label-deny']."</option>\n";
}
else {
echo " <option value='deny'>".$text['label-deny']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-access_control_default']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-access_control_nodes']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <table>\n";
echo " <tr>\n";
echo " <th class='vtablereq'>".$text['label-node_type']."</th>\n";
echo " <td class='vtable'>".$text['label-node_cidr']."</td>\n";
echo " <td class='vtable'>".$text['label-node_domain']."</td>\n";
echo " <td class='vtable'>".$text['label-node_description']."</td>\n";
if (is_array($access_control_nodes) && @sizeof($access_control_nodes) > 1 && permission_exists('access_control_node_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_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";
}
echo " </tr>\n";
$x = 0;
foreach($access_control_nodes as $row) {
echo " <tr>\n";
echo " <input type='hidden' name='access_control_nodes[$x][access_control_uuid]' value=\"".escape($row["access_control_uuid"])."\">\n";
echo " <input type='hidden' name='access_control_nodes[$x][access_control_node_uuid]' value=\"".escape($row["access_control_node_uuid"])."\">\n";
echo " <td class='formfld'>\n";
echo " <select class='formfld' name='access_control_nodes[$x][node_type]'>\n";
echo " <option value=''></option>\n";
if ($row['node_type'] == "allow") {
echo " <option value='allow' selected='selected'>".$text['label-allow']."</option>\n";
}
else {
echo " <option value='allow'>".$text['label-allow']."</option>\n";
}
if ($row['node_type'] == "deny") {
echo " <option value='deny' selected='selected'>".$text['label-deny']."</option>\n";
}
else {
echo " <option value='deny'>".$text['label-deny']."</option>\n";
}
echo " </select>\n";
echo " </td>\n";
echo " <td class='formfld'>\n";
echo " <input class='formfld' type='text' name='access_control_nodes[$x][node_cidr]' maxlength='255' value=\"".escape($row["node_cidr"])."\">\n";
echo " </td>\n";
echo " <td class='formfld'>\n";
echo " <input class='formfld' type='text' name='access_control_nodes[$x][node_domain]' maxlength='255' value=\"".escape($row["node_domain"])."\">\n";
echo " </td>\n";
echo " <td class='formfld'>\n";
echo " <input class='formfld' type='text' name='access_control_nodes[$x][node_description]' maxlength='255' value=\"".escape($row["node_description"])."\">\n";
echo " </td>\n";
if (is_array($access_control_nodes) && @sizeof($access_control_nodes) > 1 && permission_exists('access_control_node_delete')) {
if (is_uuid($row['access_control_node_uuid'])) {
echo " <td class='vtable' style='text-align: center; padding-bottom: 3px;'>\n";
echo " <input type='checkbox' name='access_control_nodes[".$x."][checked]' value='true' class='chk_delete checkbox_details' onclick=\"checkbox_on_change(this);\">\n";
echo " </td>\n";
}
else {
echo " <td></td>\n";
}
}
echo " </tr>\n";
$x++;
}
echo " </table>\n";
echo "<br />\n";
echo $text['description-node_description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-access_control_description']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <input class='formfld' type='text' name='access_control_description' maxlength='255' value='".escape($access_control_description)."'>\n";
echo "<br />\n";
echo $text['description-access_control_description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "<br /><br />";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,249 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2018 - 2020
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('access_control_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get the http post data
if (is_array($_POST['access_controls'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$access_controls = $_POST['access_controls'];
}
//process the http post data by action
if ($action != '' && is_array($access_controls) && @sizeof($access_controls) != 0) {
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: access_controls.php');
exit;
}
//prepare the array
foreach($access_controls as $row) {
$array['access_controls'][$x]['checked'] = $row['checked'];
$array['access_controls'][$x]['access_control_uuid'] = $row['access_control_uuid'];
$x++;
}
//prepare the database object
$database = new database;
$database->app_name = 'access_controls';
$database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
//send the array to the database class
switch ($action) {
case 'copy':
if (permission_exists('access_control_add')) {
$database->copy($array);
}
break;
case 'toggle':
if (permission_exists('access_control_edit')) {
$database->toggle($array);
}
break;
case 'delete':
if (permission_exists('access_control_delete')) {
$database->delete($array);
}
break;
}
//redirect the user
header('Location: access_controls.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
}
//get order and order by
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//add the search
if (isset($_GET["search"])) {
$search = strtolower($_GET["search"]);
$parameters['search'] = '%'.$search.'%';
}
//get the count
$sql = "select count(access_control_uuid) ";
$sql .= "from v_access_controls ";
if (isset($_GET["search"])) {
$sql .= "where (";
$sql .= " lower(access_control_name) like :search ";
$sql .= " or lower(access_control_default) like :search ";
$sql .= " or lower(access_control_description) like :search ";
$sql .= ") ";
}
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
//get the list
$sql = "select ";
$sql .= "access_control_uuid, ";
$sql .= "access_control_name, ";
$sql .= "access_control_default, ";
$sql .= "access_control_description ";
$sql .= "from v_access_controls ";
if (isset($_GET["search"])) {
$sql .= "where (";
$sql .= " lower(access_control_name) like :search ";
$sql .= " or lower(access_control_default) like :search ";
$sql .= " or lower(access_control_description) like :search ";
$sql .= ") ";
}
$sql .= order_by($order_by, $order, 'access_control_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$access_controls = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//additional includes
$document['title'] = $text['title-access_controls'];
require_once "resources/header.php";
//show the content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-access_controls']." (".$num_rows.")</b></div>\n";
echo " <div class='actions'>\n";
if (permission_exists('access_control_add')) {
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','name'=>'btn_add','link'=>'access_control_edit.php']);
}
if (permission_exists('access_control_add') && $access_controls) {
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display:none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
}
if (permission_exists('access_control_delete') && $access_controls) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display:none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo "<form id='form_search' class='inline' method='get'>\n";
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'access_controls.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
}
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if (permission_exists('access_control_add') && $access_controls) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
}
if (permission_exists('access_control_delete') && $access_controls) {
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');"])]);
}
echo $text['title_description-access_controls']."\n";
echo "<br /><br />\n";
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('access_control_add') || permission_exists('access_control_edit') || permission_exists('access_control_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($access_controls ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
echo th_order_by('access_control_name', $text['label-access_control_name'], $order_by, $order);
echo th_order_by('access_control_default', $text['label-access_control_default'], $order_by, $order);
echo " <th class='hide-sm-dn'>".$text['label-access_control_description']."</th>\n";
if (permission_exists('access_control_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($access_controls) && @sizeof($access_controls) != 0) {
$x = 0;
foreach ($access_controls as $row) {
if (permission_exists('access_control_edit')) {
$list_row_url = "access_control_edit.php?id=".urlencode($row['access_control_uuid']);
}
echo "<tr class='list-row' href='".$list_row_url."'>\n";
if (permission_exists('access_control_add') || permission_exists('access_control_edit') || permission_exists('access_control_delete')) {
echo " <td class='checkbox'>\n";
echo " <input type='checkbox' name='access_controls[$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='access_controls[$x][access_control_uuid]' value='".escape($row['access_control_uuid'])."' />\n";
echo " </td>\n";
}
echo " <td>\n";
if (permission_exists('access_control_edit')) {
echo " <a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['access_control_name'])."</a>\n";
}
else {
echo " ".escape($row['access_control_name']);
}
echo " </td>\n";
echo " <td>".escape($row['access_control_default'])."</td>\n";
echo " <td class='description overflow hide-sm-dn'>".escape($row['access_control_description'])."</td>\n";
if (permission_exists('access_control_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>\n";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";
}
echo "</tr>\n";
$x++;
}
unset($access_controls);
}
echo "</table>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,122 @@
<?php
//application details
$apps[$x]['name'] = "Access Controls";
$apps[$x]['uuid'] = "1416a250-f6e1-4edc-91a6-5c9b883638fd";
$apps[$x]['category'] = "";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Manage access control lists";
$apps[$x]['description']['en-gb'] = "Manage access control lists";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Zugriffssteuerungslisten verwalten";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Zugriffssteuerungslisten verwalten";
$apps[$x]['description']['es-cl'] = "";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "Gérer les listes de contrôle d'accès";
$apps[$x]['description']['fr-fr'] = "Gérer les listes de contrôle d'accès";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "Beheer toegangs controle lijsten";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "";
$apps[$x]['description']['pt-pt'] = "";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "access_control_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_edit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_node_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_node_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_node_edit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_node_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
//cache details
$apps[$x]['cache']['key'] = "configuration.acl.conf";
//schema details
$y=0;
$apps[$x]['db'][$y]['table']['name'] = "v_access_controls";
$apps[$x]['db'][$y]['table']['parent'] = "";
$z=0;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "access_control_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "access_control_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "access_control_default";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the default type.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "access_control_description";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description";
$y++;
$apps[$x]['db'][$y]['table']['name'] = "v_access_control_nodes";
$apps[$x]['db'][$y]['table']['parent'] = "v_access_controls";
$z=0;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "access_control_node_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "access_control_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_access_controls";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "access_control_uuid";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "node_type";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the type.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "node_cidr";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the IP CIDR range.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "node_domain";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the domain.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "node_description";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description.";
?>

View File

@ -0,0 +1,144 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2016 - 2022
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//if the number of rows is 0 then read the acl xml into the database
if ($domains_processed == 1) {
//add the access control list to the database
$sql = "select count(*) from v_access_controls ";
$database = new database;
$num_rows = $database->select($sql, null, 'column');
if ($num_rows == 0) {
//set the directory
$xml_dir = $_SESSION["switch"]["conf"]["dir"].'/autoload_configs';
$xml_file = $xml_dir."/acl.conf.xml";
$xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/resources/templates/conf/autoload_configs/acl.conf';
//load the xml and save it into an array
if (file_exists($xml_file)) {
$xml_string = file_get_contents($xml_file);
}
elseif (file_exists($xml_file_alt)) {
$xml_string = file_get_contents(xml_file_alt);
}
else {
$xml_string = "<configuration name=\"acl.conf\" description=\"Network Lists\">\n";
$xml_string .= " <network-lists>\n";
$xml_string .= " <list name=\"rfc1918\" default=\"deny\">\n";
$xml_string .= " <node type=\"allow\" cidr=\"10.0.0.0/8\"/>\n";
$xml_string .= " <node type=\"allow\" cidr=\"172.16.0.0/12\"/>\n";
$xml_string .= " <node type=\"allow\" cidr=\"192.168.0.0/16\"/>\n";
$xml_string .= " </list>\n";
$xml_string .= " <list name=\"providers\" default=\"deny\">\n";
//$xml_string .= " <node type=\"allow\" domain=\"".$_SESSION['domain_name']."\"/>\n";
$xml_string .= " </list>\n";
$xml_string .= " </network-lists>\n";
$xml_string .= "</configuration>\n";
}
$xml_object = simplexml_load_string($xml_string);
$json = json_encode($xml_object);
$conf_array = json_decode($json, true);
//process the array
foreach($conf_array['network-lists']['list'] as $list) {
//get the attributes
$access_control_name = $list['@attributes']['name'];
$access_control_default = $list['@attributes']['default'];
//insert the name, description
$access_control_uuid = uuid();
$array['access_controls'][0]['access_control_uuid'] = $access_control_uuid;
$array['access_controls'][0]['access_control_name'] = $access_control_name;
$array['access_controls'][0]['access_control_default'] = $access_control_default;
$p = new permissions;
$p->add('access_control_add', 'temp');
$database = new database;
$database->app_name = 'access_controls';
$database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
$database->save($array, false);
unset($array);
$p->delete('access_control_add', 'temp');
//normalize the array - needed because the array is inconsistent when there is only one row vs multiple
if (strlen($list['node']['@attributes']['type']) > 0) {
$list['node'][]['@attributes'] = $list['node']['@attributes'];
unset($list['node']['@attributes']);
}
//add the nodes
foreach ($list['node'] as $row) {
//get the name and value pair
$node_type = $row['@attributes']['type'];
$node_cidr = $row['@attributes']['cidr'];
$node_domain = $row['@attributes']['domain'];
$node_description = $row['@attributes']['description'];
//replace $${domain}
if (strlen($node_domain) > 0) {
$node_domain = str_replace("\$\${domain}", $domain_name, $node_domain);
}
//add the profile settings into the database
$access_control_node_uuid = uuid();
$array['access_control_nodes'][0]['access_control_node_uuid'] = $access_control_node_uuid;
$array['access_control_nodes'][0]['access_control_uuid'] = $access_control_uuid;
$array['access_control_nodes'][0]['node_type'] = $node_type;
$array['access_control_nodes'][0]['node_cidr'] = $node_cidr;
$array['access_control_nodes'][0]['node_domain'] = $node_domain;
$array['access_control_nodes'][0]['node_description'] = $node_description;
$p = new permissions;
$p->add('access_control_node_add', 'temp');
$database = new database;
$database->app_name = 'access_controls';
$database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
$database->save($array, false);
unset($array);
$p->delete('access_control_node_add', 'temp');
}
}
//rename the file
if (file_exists($xml_dir.'/acl.conf.xml')) {
rename($xml_dir.'/acl.conf.xml', $xml_dir.'/acl.conf');
}
}
unset($sql, $num_rows);
//remove orphaned access control nodes
$sql = "delete from v_access_control_nodes ";
$sql .= "where access_control_uuid not in ( ";
$sql .= " select access_control_uuid from v_access_controls ";
$sql .= ")";
$database = new database;
$database->execute($sql, null);
unset($sql);
}
?>

View File

@ -0,0 +1,466 @@
<?php
#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
$text['title-access_controls']['en-us'] = "Access Controls";
$text['title-access_controls']['en-gb'] = "Access Controls";
$text['title-access_controls']['ar-eg'] = "عناصر التحكم في الوصول";
$text['title-access_controls']['de-at'] = " Zugriffskontrolle"; //copied from de-de
$text['title-access_controls']['de-ch'] = " Zugriffskontrolle"; //copied from de-de
$text['title-access_controls']['de-de'] = " Zugriffskontrolle";
$text['title-access_controls']['es-cl'] = "Controles de acceso";
$text['title-access_controls']['es-mx'] = "Controles de acceso"; //copied from es-cl
$text['title-access_controls']['fr-ca'] = "Contrôle d'accès"; //copied from fr-fr
$text['title-access_controls']['fr-fr'] = "Contrôle d'accès";
$text['title-access_controls']['he-il'] = "בקרת גישה";
$text['title-access_controls']['it-it'] = "Controllo Accessi";
$text['title-access_controls']['nl-nl'] = "Toegangs Controle";
$text['title-access_controls']['pl-pl'] = "Kontrola dostępu";
$text['title-access_controls']['pt-br'] = "Controles de Acesso"; //copied from pt-pt
$text['title-access_controls']['pt-pt'] = "Controles de Acesso";
$text['title-access_controls']['ro-ro'] = "Controale de acces";
$text['title-access_controls']['ru-ru'] = "Контроль доступа";
$text['title-access_controls']['sv-se'] = "Åtkomstkontroll";
$text['title-access_controls']['uk-ua'] = "контроль доступу";
$text['title-access_control_nodes']['en-us'] = "Nodes";
$text['title-access_control_nodes']['en-gb'] = "Nodes";
$text['title-access_control_nodes']['ar-eg'] = "العقد";
$text['title-access_control_nodes']['de-at'] = "Knoten"; //copied from de-de
$text['title-access_control_nodes']['de-ch'] = "Knoten"; //copied from de-de
$text['title-access_control_nodes']['de-de'] = "Knoten";
$text['title-access_control_nodes']['es-cl'] = "Nodos";
$text['title-access_control_nodes']['es-mx'] = "Nodos"; //copied from es-cl
$text['title-access_control_nodes']['fr-ca'] = " nœuds"; //copied from fr-fr
$text['title-access_control_nodes']['fr-fr'] = " nœuds";
$text['title-access_control_nodes']['he-il'] = "בלוטות";
$text['title-access_control_nodes']['it-it'] = "Nodi";
$text['title-access_control_nodes']['nl-nl'] = "Knooppunten";
$text['title-access_control_nodes']['pl-pl'] = "węzły";
$text['title-access_control_nodes']['pt-br'] = "Nodes";
$text['title-access_control_nodes']['pt-pt'] = " Nodes";
$text['title-access_control_nodes']['ro-ro'] = "Noduri";
$text['title-access_control_nodes']['ru-ru'] = "Узлы";
$text['title-access_control_nodes']['sv-se'] = "Noder";
$text['title-access_control_nodes']['uk-ua'] = "вузли";
$text['title-access_control_node']['en-us'] = "Node";
$text['title-access_control_node']['en-gb'] = "Node";
$text['title-access_control_node']['ar-eg'] = "العقدة";
$text['title-access_control_node']['de-at'] = "Netzknoten"; //copied from de-de
$text['title-access_control_node']['de-ch'] = "Netzknoten"; //copied from de-de
$text['title-access_control_node']['de-de'] = "Netzknoten";
$text['title-access_control_node']['es-cl'] = "Nodo";
$text['title-access_control_node']['es-mx'] = "Nodo"; //copied from es-cl
$text['title-access_control_node']['fr-ca'] = " noeud"; //copied from fr-fr
$text['title-access_control_node']['fr-fr'] = " noeud";
$text['title-access_control_node']['he-il'] = "צומת";
$text['title-access_control_node']['it-it'] = "Nodo";
$text['title-access_control_node']['nl-nl'] = "Knooppunt";
$text['title-access_control_node']['pl-pl'] = "węzeł";
$text['title-access_control_node']['pt-br'] = ""; //copied from pt-pt
$text['title-access_control_node']['pt-pt'] = "";
$text['title-access_control_node']['ro-ro'] = "Nod";
$text['title-access_control_node']['ru-ru'] = "Узел";
$text['title-access_control_node']['sv-se'] = "Nod";
$text['title-access_control_node']['uk-ua'] = "вузол";
$text['title-access_control']['en-us'] = "Access Control";
$text['title-access_control']['en-gb'] = "Access Control";
$text['title-access_control']['ar-eg'] = "التحكم في الوصول";
$text['title-access_control']['de-at'] = " Zugangskontrolle"; //copied from de-de
$text['title-access_control']['de-ch'] = " Zugangskontrolle"; //copied from de-de
$text['title-access_control']['de-de'] = " Zugangskontrolle";
$text['title-access_control']['es-cl'] = "Control de acceso";
$text['title-access_control']['es-mx'] = "Control de acceso"; //copied from es-cl
$text['title-access_control']['fr-ca'] = "Contrôle d'accès"; //copied from fr-fr
$text['title-access_control']['fr-fr'] = "Contrôle d'accès";
$text['title-access_control']['he-il'] = "בקרת גישה";
$text['title-access_control']['it-it'] = "Controllo Accesso";
$text['title-access_control']['nl-nl'] = "Toegangs Controle";
$text['title-access_control']['pl-pl'] = "Kontrola dostępu";
$text['title-access_control']['pt-br'] = "Controle de acesso"; //copied from pt-pt
$text['title-access_control']['pt-pt'] = "Controle de acesso";
$text['title-access_control']['ro-ro'] = "Controlul accesului";
$text['title-access_control']['ru-ru'] = "Управление доступом";
$text['title-access_control']['sv-se'] = "Åtkomstkontroll";
$text['title-access_control']['uk-ua'] = "Управління доступом";
$text['title_description-access_controls']['en-us'] = "Access control list can allow or deny ranges of IP addresses.";
$text['title_description-access_controls']['en-gb'] = "Access control list can allow or deny ranges of IP addresses.";
$text['title_description-access_controls']['ar-eg'] = "قائمة التحكم بالوصول يمكن السماح أو الرفض نطاقات العناوين.";
$text['title_description-access_controls']['de-at'] = " Die Zugriffskontrollliste kann Bereiche von IP Adressen zulassen oder ablehnen."; //copied from de-de
$text['title_description-access_controls']['de-ch'] = " Die Zugriffskontrollliste kann Bereiche von IP Adressen zulassen oder ablehnen."; //copied from de-de
$text['title_description-access_controls']['de-de'] = " Die Zugriffskontrollliste kann Bereiche von IP Adressen zulassen oder ablehnen.";
$text['title_description-access_controls']['es-cl'] = " Lista de control de acceso puede permitir o denegar los rangos de direcciones IP.";
$text['title_description-access_controls']['es-mx'] = " Lista de control de acceso puede permitir o denegar los rangos de direcciones IP."; //copied from es-cl
$text['title_description-access_controls']['fr-ca'] = " Liste de contrôle d'accès peut autoriser ou refuser des plages d'adresses IP."; //copied from fr-fr
$text['title_description-access_controls']['fr-fr'] = " Liste de contrôle d'accès peut autoriser ou refuser des plages d'adresses IP.";
$text['title_description-access_controls']['he-il'] = " רשימת בקרת גישה יכולה לאפשר או למנוע טווחים של כתובות IP.";
$text['title_description-access_controls']['it-it'] = "Le liste per il controllo di accesso permettono o negano l'accesso a range di IP.";
$text['title_description-access_controls']['nl-nl'] = "Toegang Controle lijst kan IP adres reeks toestaan of verbieden.";
$text['title_description-access_controls']['pl-pl'] = "Lista kontroli dostępu może umożliwić lub zablokować zakresy adresów IP.";
$text['title_description-access_controls']['pt-br'] = "Lista de controle de acesso pode permitir ou negar intervalos de endereços IP."; //copied from pt-pt
$text['title_description-access_controls']['pt-pt'] = "Lista de controle de acesso pode permitir ou negar intervalos de endereços IP.";
$text['title_description-access_controls']['ro-ro'] = "Lista de control al accesului poate permite sau refuza intervale de adrese IP.";
$text['title_description-access_controls']['ru-ru'] = "Контроль доступа может разрешить или запретить диапазоны IP адресов.";
$text['title_description-access_controls']['sv-se'] = "Åtkomstkontrollista kan tillåta eller neka intervall av IP-adresser.";
$text['title_description-access_controls']['uk-ua'] = "Список контролю доступу може дозволити або заборонити діапазони IP-адрес.";
$text['label-node_type']['en-us'] = "Type";
$text['label-node_type']['en-gb'] = "Type";
$text['label-node_type']['ar-eg'] = "اكتب";
$text['label-node_type']['de-at'] = "Art"; //copied from de-de
$text['label-node_type']['de-ch'] = "Art"; //copied from de-de
$text['label-node_type']['de-de'] = "Art";
$text['label-node_type']['es-cl'] = "Escribe";
$text['label-node_type']['es-mx'] = "Escribe"; //copied from es-cl
$text['label-node_type']['fr-ca'] = "Type"; //copied from fr-fr
$text['label-node_type']['fr-fr'] = "Type";
$text['label-node_type']['he-il'] = "סוג";
$text['label-node_type']['it-it'] = "Tipo";
$text['label-node_type']['nl-nl'] = "Type";
$text['label-node_type']['pl-pl'] = "typ";
$text['label-node_type']['pt-br'] = "Tipo"; //copied from pt-pt
$text['label-node_type']['pt-pt'] = "Tipo";
$text['label-node_type']['ro-ro'] = "Tip";
$text['label-node_type']['ru-ru'] = "Тип";
$text['label-node_type']['sv-se'] = "Typ";
$text['label-node_type']['uk-ua'] = "Тип";
$text['label-node_domain']['en-us'] = "Domain";
$text['label-node_domain']['en-gb'] = "Domain";
$text['label-node_domain']['ar-eg'] = "مجال";
$text['label-node_domain']['de-at'] = " Domäne"; //copied from de-de
$text['label-node_domain']['de-ch'] = " Domäne"; //copied from de-de
$text['label-node_domain']['de-de'] = " Domäne";
$text['label-node_domain']['es-cl'] = "Dominio";
$text['label-node_domain']['es-mx'] = "Dominio"; //copied from es-cl
$text['label-node_domain']['fr-ca'] = "Domaine"; //copied from fr-fr
$text['label-node_domain']['fr-fr'] = "Domaine";
$text['label-node_domain']['he-il'] = "תחום";
$text['label-node_domain']['it-it'] = "Dominio";
$text['label-node_domain']['nl-nl'] = "Domein";
$text['label-node_domain']['pl-pl'] = "domeny";
$text['label-node_domain']['pt-br'] = "Domínio"; //copied from pt-pt
$text['label-node_domain']['pt-pt'] = "Domínio";
$text['label-node_domain']['ro-ro'] = "Domeniu";
$text['label-node_domain']['ru-ru'] = "Домен";
$text['label-node_domain']['sv-se'] = "Domän";
$text['label-node_domain']['uk-ua'] = "домен";
$text['label-node_description']['en-us'] = "Description";
$text['label-node_description']['en-gb'] = "Description";
$text['label-node_description']['ar-eg'] = "وصف";
$text['label-node_description']['de-at'] = "Beschreibung"; //copied from de-de
$text['label-node_description']['de-ch'] = "Beschreibung"; //copied from de-de
$text['label-node_description']['de-de'] = "Beschreibung";
$text['label-node_description']['es-cl'] = "Descripción";
$text['label-node_description']['es-mx'] = "Descripción"; //copied from es-cl
$text['label-node_description']['fr-ca'] = "Description"; //copied from fr-fr
$text['label-node_description']['fr-fr'] = "Description";
$text['label-node_description']['he-il'] = "תיאור";
$text['label-node_description']['it-it'] = "Descrizione";
$text['label-node_description']['nl-nl'] = "Beschrijving";
$text['label-node_description']['pl-pl'] = "opis";
$text['label-node_description']['pt-br'] = "Descrição"; //copied from pt-pt
$text['label-node_description']['pt-pt'] = "Descrição";
$text['label-node_description']['ro-ro'] = "Descriere";
$text['label-node_description']['ru-ru'] = "Описание";
$text['label-node_description']['sv-se'] = "Beskrivning";
$text['label-node_description']['uk-ua'] = "опис";
$text['label-node_cidr']['en-us'] = "CIDR";
$text['label-node_cidr']['en-gb'] = "CIDR";
$text['label-node_cidr']['ar-eg'] = "CIDR";
$text['label-node_cidr']['de-at'] = "CIDR"; //copied from de-de
$text['label-node_cidr']['de-ch'] = "CIDR"; //copied from de-de
$text['label-node_cidr']['de-de'] = "CIDR";
$text['label-node_cidr']['es-cl'] = "CIDR";
$text['label-node_cidr']['es-mx'] = "CIDR"; //copied from es-cl
$text['label-node_cidr']['fr-ca'] = "CIDR"; //copied from fr-fr
$text['label-node_cidr']['fr-fr'] = "CIDR";
$text['label-node_cidr']['he-il'] = "CIDR";
$text['label-node_cidr']['it-it'] = "CIDR";
$text['label-node_cidr']['nl-nl'] = "CIDR";
$text['label-node_cidr']['pl-pl'] = "CIDR";
$text['label-node_cidr']['pt-br'] = "CIDR"; //copied from pt-pt
$text['label-node_cidr']['pt-pt'] = "CIDR";
$text['label-node_cidr']['ro-ro'] = "CIDR";
$text['label-node_cidr']['ru-ru'] = "CIDR";
$text['label-node_cidr']['sv-se'] = "CIDR";
$text['label-node_cidr']['uk-ua'] = "CIDR";
$text['label-deny']['en-us'] = "deny";
$text['label-deny']['en-gb'] = "deny";
$text['label-deny']['ar-eg'] = "تنكر";
$text['label-deny']['de-at'] = " verbieten"; //copied from de-de
$text['label-deny']['de-ch'] = " verbieten"; //copied from de-de
$text['label-deny']['de-de'] = " verbieten";
$text['label-deny']['es-cl'] = "Negar";
$text['label-deny']['es-mx'] = "Negar"; //copied from es-cl
$text['label-deny']['fr-ca'] = " nier"; //copied from fr-fr
$text['label-deny']['fr-fr'] = " nier";
$text['label-deny']['he-il'] = "להכחיש";
$text['label-deny']['it-it'] = "nega";
$text['label-deny']['nl-nl'] = "verbieden";
$text['label-deny']['pl-pl'] = "odrzuć";
$text['label-deny']['pt-br'] = "negar"; //copied from pt-pt
$text['label-deny']['pt-pt'] = "negar";
$text['label-deny']['ro-ro'] = "Nega";
$text['label-deny']['ru-ru'] = "запретить";
$text['label-deny']['sv-se'] = "förneka";
$text['label-deny']['uk-ua'] = "правда";
$text['label-allow']['en-us'] = "allow";
$text['label-allow']['en-gb'] = "allow";
$text['label-allow']['ar-eg'] = "السماح";
$text['label-allow']['de-at'] = "erlauben"; //copied from de-de
$text['label-allow']['de-ch'] = "erlauben"; //copied from de-de
$text['label-allow']['de-de'] = "erlauben";
$text['label-allow']['es-cl'] = "Permitir";
$text['label-allow']['es-mx'] = "Permitir"; //copied from es-cl
$text['label-allow']['fr-ca'] = " permettre"; //copied from fr-fr
$text['label-allow']['fr-fr'] = " permettre";
$text['label-allow']['he-il'] = "לאפשר";
$text['label-allow']['it-it'] = "permetti";
$text['label-allow']['nl-nl'] = "toestaan";
$text['label-allow']['pl-pl'] = "zezwól";
$text['label-allow']['pt-br'] = "permitir"; //copied from pt-pt
$text['label-allow']['pt-pt'] = "permitir";
$text['label-allow']['ro-ro'] = "Permite";
$text['label-allow']['ru-ru'] = "разрешить";
$text['label-allow']['sv-se'] = "tillåta";
$text['label-allow']['uk-ua'] = "дозволяти";
$text['label-access_control_name']['en-us'] = "Name";
$text['label-access_control_name']['en-gb'] = "Name";
$text['label-access_control_name']['ar-eg'] = "اسم";
$text['label-access_control_name']['de-at'] = "Name"; //copied from de-de
$text['label-access_control_name']['de-ch'] = "Name"; //copied from de-de
$text['label-access_control_name']['de-de'] = "Name";
$text['label-access_control_name']['es-cl'] = "Nombre";
$text['label-access_control_name']['es-mx'] = "Nombre"; //copied from es-cl
$text['label-access_control_name']['fr-ca'] = "Nom"; //copied from fr-fr
$text['label-access_control_name']['fr-fr'] = "Nom";
$text['label-access_control_name']['he-il'] = "שם";
$text['label-access_control_name']['it-it'] = "Nome";
$text['label-access_control_name']['nl-nl'] = "Naam";
$text['label-access_control_name']['pl-pl'] = " Imię";
$text['label-access_control_name']['pt-br'] = "Nome"; //copied from pt-pt
$text['label-access_control_name']['pt-pt'] = "Nome";
$text['label-access_control_name']['ro-ro'] = "Nume";
$text['label-access_control_name']['ru-ru'] = "Имя";
$text['label-access_control_name']['sv-se'] = "namn";
$text['label-access_control_name']['uk-ua'] = "ім'я";
$text['label-access_control_default']['en-us'] = "Default";
$text['label-access_control_default']['en-gb'] = "Default";
$text['label-access_control_default']['ar-eg'] = "افتراضي";
$text['label-access_control_default']['de-at'] = "Standard"; //copied from de-de
$text['label-access_control_default']['de-ch'] = "Standard"; //copied from de-de
$text['label-access_control_default']['de-de'] = "Standard";
$text['label-access_control_default']['es-cl'] = "Defecto";
$text['label-access_control_default']['es-mx'] = "Defecto"; //copied from es-cl
$text['label-access_control_default']['fr-ca'] = "Par défaut"; //copied from fr-fr
$text['label-access_control_default']['fr-fr'] = "Par défaut";
$text['label-access_control_default']['he-il'] = " ברירת מחדל";
$text['label-access_control_default']['it-it'] = "Predefinito";
$text['label-access_control_default']['nl-nl'] = "Standaard";
$text['label-access_control_default']['pl-pl'] = "Domyślnie";
$text['label-access_control_default']['pt-br'] = "Padrão"; //copied from pt-pt
$text['label-access_control_default']['pt-pt'] = "Padrão";
$text['label-access_control_default']['ro-ro'] = "Implicit";
$text['label-access_control_default']['ru-ru'] = "По умолчанию";
$text['label-access_control_default']['sv-se'] = "Standard";
$text['label-access_control_default']['uk-ua'] = "дефолт";
$text['label-access_control_nodes']['en-us'] = "Nodes";
$text['label-access_control_nodes']['en-gb'] = "Nodes";
$text['label-access_control_nodes']['ar-eg'] = "العقد";
$text['label-access_control_nodes']['de-at'] = "Knoten"; //copied from de-de
$text['label-access_control_nodes']['de-ch'] = "Knoten"; //copied from de-de
$text['label-access_control_nodes']['de-de'] = "Knoten";
$text['label-access_control_nodes']['es-cl'] = "Nodos";
$text['label-access_control_nodes']['es-mx'] = "Nodos"; //copied from es-cl
$text['label-access_control_nodes']['fr-ca'] = " nœuds"; //copied from fr-fr
$text['label-access_control_nodes']['fr-fr'] = " nœuds";
$text['label-access_control_nodes']['he-il'] = "בלוטות";
$text['label-access_control_nodes']['it-it'] = "Nodi";
$text['label-access_control_nodes']['nl-nl'] = "Knooppunten";
$text['label-access_control_nodes']['pl-pl'] = "węzły";
$text['label-access_control_nodes']['pt-br'] = "Nodes";
$text['label-access_control_nodes']['pt-pt'] = " Nodes";
$text['label-access_control_nodes']['ro-ro'] = "Noduri";
$text['label-access_control_nodes']['ru-ru'] = "Узлы";
$text['label-access_control_nodes']['sv-se'] = "Noder";
$text['label-access_control_nodes']['uk-ua'] = "вузли";
$text['label-access_control_description']['en-us'] = "Description";
$text['label-access_control_description']['en-gb'] = "Description";
$text['label-access_control_description']['ar-eg'] = "وصف";
$text['label-access_control_description']['de-at'] = "Beschreibung"; //copied from de-de
$text['label-access_control_description']['de-ch'] = "Beschreibung"; //copied from de-de
$text['label-access_control_description']['de-de'] = "Beschreibung";
$text['label-access_control_description']['es-cl'] = "Descripción";
$text['label-access_control_description']['es-mx'] = "Descripción"; //copied from es-cl
$text['label-access_control_description']['fr-ca'] = "Description"; //copied from fr-fr
$text['label-access_control_description']['fr-fr'] = "Description";
$text['label-access_control_description']['he-il'] = "תיאור";
$text['label-access_control_description']['it-it'] = "Descrizione";
$text['label-access_control_description']['nl-nl'] = "Omschrijving";
$text['label-access_control_description']['pl-pl'] = "opis";
$text['label-access_control_description']['pt-br'] = "Descrição"; //copied from pt-pt
$text['label-access_control_description']['pt-pt'] = "Descrição";
$text['label-access_control_description']['ro-ro'] = "Descriere";
$text['label-access_control_description']['ru-ru'] = "Описание";
$text['label-access_control_description']['sv-se'] = "Beskrivning";
$text['label-access_control_description']['uk-ua'] = "опис";
$text['description-node_type']['en-us'] = "Select the type.";
$text['description-node_type']['en-gb'] = "Select the type.";
$text['description-node_type']['ar-eg'] = "حدد نوع.";
$text['description-node_type']['de-at'] = " Wählen Sie den Typ."; //copied from de-de
$text['description-node_type']['de-ch'] = " Wählen Sie den Typ."; //copied from de-de
$text['description-node_type']['de-de'] = " Wählen Sie den Typ.";
$text['description-node_type']['es-cl'] = "Seleccione el tipo.";
$text['description-node_type']['es-mx'] = "Seleccione el tipo."; //copied from es-cl
$text['description-node_type']['fr-ca'] = " Sélectionnez le type"; //copied from fr-fr
$text['description-node_type']['fr-fr'] = " Sélectionnez le type";
$text['description-node_type']['he-il'] = " בחר את הסוג.";
$text['description-node_type']['it-it'] = "Seleziona il tipo.";
$text['description-node_type']['nl-nl'] = "Selecteer het type.";
$text['description-node_type']['pl-pl'] = "Wybierz rodzaj.";
$text['description-node_type']['pt-br'] = "Selecione o tipo."; //copied from pt-pt
$text['description-node_type']['pt-pt'] = "Selecione o tipo.";
$text['description-node_type']['ro-ro'] = "Selectați tipul.";
$text['description-node_type']['ru-ru'] = "Выберите тип.";
$text['description-node_type']['sv-se'] = "Välj typ.";
$text['description-node_type']['uk-ua'] = "Виберіть тип.";
$text['description-node_domain']['en-us'] = "Enter the domain name.";
$text['description-node_domain']['en-gb'] = "Enter the domain name.";
$text['description-node_domain']['ar-eg'] = "أدخل اسم المجال.";
$text['description-node_domain']['de-at'] = "Geben Sie den Domain-Namen."; //copied from de-de
$text['description-node_domain']['de-ch'] = "Geben Sie den Domain-Namen."; //copied from de-de
$text['description-node_domain']['de-de'] = "Geben Sie den Domain-Namen.";
$text['description-node_domain']['es-cl'] = "Introduzca el nombre de dominio.";
$text['description-node_domain']['es-mx'] = "Introduzca el nombre de dominio."; //copied from es-cl
$text['description-node_domain']['fr-ca'] = "Entrez le nom de domaine."; //copied from fr-fr
$text['description-node_domain']['fr-fr'] = "Entrez le nom de domaine.";
$text['description-node_domain']['he-il'] = " הזן את שם הדומיין.";
$text['description-node_domain']['it-it'] = "Inserisci il dominio.";
$text['description-node_domain']['nl-nl'] = "Voer de domeinnaam in.";
$text['description-node_domain']['pl-pl'] = " Wprowadź nazwę domeny.";
$text['description-node_domain']['pt-br'] = "Digite o nome de domínio."; //copied from pt-pt
$text['description-node_domain']['pt-pt'] = "Digite o nome de domínio.";
$text['description-node_domain']['ro-ro'] = "Introduceți numele de domeniu.";
$text['description-node_domain']['ru-ru'] = "Введите имя домена.";
$text['description-node_domain']['sv-se'] = "Ange domännamnet.";
$text['description-node_domain']['uk-ua'] = "Введіть ім'я домену.";
$text['description-node_description']['en-us'] = "Enter the description.";
$text['description-node_description']['en-gb'] = "Enter the description.";
$text['description-node_description']['ar-eg'] = "أدخل الوصف.";
$text['description-node_description']['de-at'] = "Geben Sie die Beschreibung ein."; //copied from de-de
$text['description-node_description']['de-ch'] = "Geben Sie die Beschreibung ein."; //copied from de-de
$text['description-node_description']['de-de'] = "Geben Sie die Beschreibung ein.";
$text['description-node_description']['es-cl'] = " Introduzca la descripción.";
$text['description-node_description']['es-mx'] = " Introduzca la descripción."; //copied from es-cl
$text['description-node_description']['fr-ca'] = "Entrez la description."; //copied from fr-fr
$text['description-node_description']['fr-fr'] = "Entrez la description.";
$text['description-node_description']['he-il'] = " הזן את התיאור.";
$text['description-node_description']['it-it'] = "Inserisci la descrizione.";
$text['description-node_description']['nl-nl'] = "Voer de beschrijving in.";
$text['description-node_description']['pl-pl'] = " Wprowadź opis.";
$text['description-node_description']['pt-br'] = "Digite a descrição.";
$text['description-node_description']['pt-pt'] = " Digite a descrição.";
$text['description-node_description']['ro-ro'] = "Introduceți descrierea.";
$text['description-node_description']['ru-ru'] = "Введите описание.";
$text['description-node_description']['sv-se'] = "Ange beskrivningen.";
$text['description-node_description']['uk-ua'] = "Введіть опис.";
$text['description-node_cidr']['en-us'] = "Enter the IP CIDR range.";
$text['description-node_cidr']['en-gb'] = "Enter the IP CIDR range.";
$text['description-node_cidr']['ar-eg'] = "أدخل نطاق IP CIDR.";
$text['description-node_cidr']['de-at'] = " Geben Sie die IP CIDR-Bereich an."; //copied from de-de
$text['description-node_cidr']['de-ch'] = " Geben Sie die IP CIDR-Bereich an."; //copied from de-de
$text['description-node_cidr']['de-de'] = " Geben Sie die IP CIDR-Bereich an.";
$text['description-node_cidr']['es-cl'] = " Introduzca el rango de direcciones IP CIDR.";
$text['description-node_cidr']['es-mx'] = " Introduzca el rango de direcciones IP CIDR."; //copied from es-cl
$text['description-node_cidr']['fr-ca'] = "Entrez la plage IP CIDR."; //copied from fr-fr
$text['description-node_cidr']['fr-fr'] = "Entrez la plage IP CIDR.";
$text['description-node_cidr']['he-il'] = " הזן את טווח ה- IP CIDR.";
$text['description-node_cidr']['it-it'] = "Inserisci il range IP CIDR.";
$text['description-node_cidr']['nl-nl'] = "Voer het IP CIDR reeks in.";
$text['description-node_cidr']['pl-pl'] = "Wprowadź zakres IP CIDR.";
$text['description-node_cidr']['pt-br'] = "Digite o intervalo IP CIDR."; //copied from pt-pt
$text['description-node_cidr']['pt-pt'] = "Digite o intervalo IP CIDR.";
$text['description-node_cidr']['ro-ro'] = "Introduceți intervalul de IP CIDR.";
$text['description-node_cidr']['ru-ru'] = "Введите диапазон IP CIDR.";
$text['description-node_cidr']['sv-se'] = "Ange IP CIDR sortimentet.";
$text['description-node_cidr']['uk-ua'] = "Введіть діапазон IP-CIDR.";
$text['description-access_control_name']['en-us'] = "Enter the name.";
$text['description-access_control_name']['en-gb'] = "Enter the name.";
$text['description-access_control_name']['ar-eg'] = "أدخل اسم.";
$text['description-access_control_name']['de-at'] = "Namen eingeben."; //copied from de-de
$text['description-access_control_name']['de-ch'] = "Namen eingeben."; //copied from de-de
$text['description-access_control_name']['de-de'] = "Namen eingeben.";
$text['description-access_control_name']['es-cl'] = " Introduzca el nombre.";
$text['description-access_control_name']['es-mx'] = " Introduzca el nombre."; //copied from es-cl
$text['description-access_control_name']['fr-ca'] = "Entrez le nom."; //copied from fr-fr
$text['description-access_control_name']['fr-fr'] = "Entrez le nom.";
$text['description-access_control_name']['he-il'] = " הזן את השם.";
$text['description-access_control_name']['it-it'] = "Inserisci il nome.";
$text['description-access_control_name']['nl-nl'] = "Voer de naam in.";
$text['description-access_control_name']['pl-pl'] = " Wpisz nazwę.";
$text['description-access_control_name']['pt-br'] = "Digite o nome."; //copied from pt-pt
$text['description-access_control_name']['pt-pt'] = "Digite o nome.";
$text['description-access_control_name']['ro-ro'] = "Introduceți numele.";
$text['description-access_control_name']['ru-ru'] = "Введите имя.";
$text['description-access_control_name']['sv-se'] = "Ange namnet.";
$text['description-access_control_name']['uk-ua'] = "Введіть ім'я.";
$text['description-access_control_description']['en-us'] = "Enter the description";
$text['description-access_control_description']['en-gb'] = "Enter the description";
$text['description-access_control_description']['ar-eg'] = "دخل وصف";
$text['description-access_control_description']['de-at'] = "Beschreibung eingeben."; //copied from de-de
$text['description-access_control_description']['de-ch'] = "Beschreibung eingeben."; //copied from de-de
$text['description-access_control_description']['de-de'] = "Beschreibung eingeben.";
$text['description-access_control_description']['es-cl'] = "Introduzca la descripción";
$text['description-access_control_description']['es-mx'] = "Introduzca la descripción"; //copied from es-cl
$text['description-access_control_description']['fr-ca'] = "Entrez la description."; //copied from fr-fr
$text['description-access_control_description']['fr-fr'] = "Entrez la description.";
$text['description-access_control_description']['he-il'] = " הזן את התיאור";
$text['description-access_control_description']['it-it'] = "Inserisci la descrizione";
$text['description-access_control_description']['nl-nl'] = "Voer de omschrijving in.";
$text['description-access_control_description']['pl-pl'] = "Wprowadź opis";
$text['description-access_control_description']['pt-br'] = "Digite a descrição.";
$text['description-access_control_description']['pt-pt'] = "Digite a descrição";
$text['description-access_control_description']['ro-ro'] = "Introduceți descrierea";
$text['description-access_control_description']['ru-ru'] = "Введите описание";
$text['description-access_control_description']['sv-se'] = "Ange en beskrivning";
$text['description-access_control_description']['uk-ua'] = "Введіть опис";
$text['description-access_control_default']['en-us'] = "Select the default type.";
$text['description-access_control_default']['en-gb'] = "Select the default type.";
$text['description-access_control_default']['ar-eg'] = "حدد نوع الافتراضي.";
$text['description-access_control_default']['de-at'] = " Wählen Sie den Standardtyp."; //copied from de-de
$text['description-access_control_default']['de-ch'] = " Wählen Sie den Standardtyp."; //copied from de-de
$text['description-access_control_default']['de-de'] = " Wählen Sie den Standardtyp.";
$text['description-access_control_default']['es-cl'] = "Seleccione el tipo de defecto.";
$text['description-access_control_default']['es-mx'] = "Seleccione el tipo de defecto."; //copied from es-cl
$text['description-access_control_default']['fr-ca'] = "Sélectionnez le type de défaut"; //copied from fr-fr
$text['description-access_control_default']['fr-fr'] = "Sélectionnez le type de défaut";
$text['description-access_control_default']['he-il'] = " בחר את סוג ברירת המחדל.";
$text['description-access_control_default']['it-it'] = "Scegli il tipo di default.";
$text['description-access_control_default']['nl-nl'] = "Selecteer het standaard type.";
$text['description-access_control_default']['pl-pl'] = "Wybierz typ domyślny.";
$text['description-access_control_default']['pt-br'] = "Selecione o tipo de padrão."; //copied from pt-pt
$text['description-access_control_default']['pt-pt'] = "Selecione o tipo de padrão.";
$text['description-access_control_default']['ro-ro'] = "Selectați tipul implicit.";
$text['description-access_control_default']['ru-ru'] = "Выберите тип по умолчанию.";
$text['description-access_control_default']['sv-se'] = "Välj standardtypen.";
$text['description-access_control_default']['uk-ua'] = "Вибір типу за замовчуванням.";
?>

View File

@ -0,0 +1,30 @@
<?php
$y=0;
$apps[$x]['menu'][$y]['title']['en-us'] = "Access Controls";
$apps[$x]['menu'][$y]['title']['en-gb'] = "Access Controls";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "عناصر التحكم في الوصول";
$apps[$x]['menu'][$y]['title']['de-at'] = " Zugriffskontrolle";
$apps[$x]['menu'][$y]['title']['de-ch'] = "";
$apps[$x]['menu'][$y]['title']['de-de'] = " Zugriffskontrolle";
$apps[$x]['menu'][$y]['title']['es-cl'] = "Controles de acceso";
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "Contrôles d'accès";
$apps[$x]['menu'][$y]['title']['he-il'] = "בקרת גישה";
$apps[$x]['menu'][$y]['title']['it-it'] = "Controlli Accesso";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "Toegangs Controle";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Kontrola dostępu";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Controles de Acesso";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "Controles de Acesso";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "Controale de acces";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Контроль доступа";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "контроль доступу";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Åtkomstkontroll";
$apps[$x]['menu'][$y]['uuid'] = "bd47c972-5498-4541-b44a-d4bbfac69496";
$apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['path'] = "/app/access_controls/access_controls.php";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
?>

View File

@ -0,0 +1,292 @@
<?php
/**
* access controls class
*
* @method null download
*/
if (!class_exists('access_controls')) {
class access_controls {
/**
* declare private variables
*/
private $app_name;
private $app_uuid;
private $permission_prefix;
private $list_page;
private $table;
private $uuid_prefix;
/**
* called when the object is created
*/
public function __construct() {
//assign private variables
$this->app_name = 'access_controls';
$this->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
$this->list_page = 'access_controls.php';
}
/**
* called when there are no references to a particular object
* unset the variables used in the class
*/
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
/**
* delete records
*/
public function delete($records) {
//assign private variables
$this->permission_prefix = 'access_control_';
$this->table = 'access_controls';
$this->uuid_prefix = 'access_control_';
if (permission_exists($this->permission_prefix.'delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//delete multiple records
if (is_array($records) && @sizeof($records) != 0) {
//build the delete array
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
$array['access_control_nodes'][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
}
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
//grant temporary permissions
$p = new permissions;
$p->add('access_control_node_delete', 'temp');
//execute delete
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->delete($array);
unset($array);
//revoke temporary permissions
$p->delete('access_control_node_delete', 'temp');
//clear the cache
$cache = new cache;
$cache->delete("configuration:acl.conf");
//create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
event_socket_request($fp, "api reloadacl");
}
//set message
message::add($text['message-delete']);
}
unset($records);
}
}
}
public function delete_nodes($records) {
//assign private variables
$this->permission_prefix = 'access_control_node_';
$this->table = 'access_control_nodes';
$this->uuid_prefix = 'access_control_node_';
if (permission_exists($this->permission_prefix.'delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate('/app/access_controls/access_control_nodes.php')) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//delete multiple records
if (is_array($records) && @sizeof($records) != 0) {
//build the delete array
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
}
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
//execute delete
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->delete($array);
unset($array);
//clear the cache
$cache = new cache;
$cache->delete("configuration:acl.conf");
//create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
event_socket_request($fp, "api reloadacl");
}
//set message
message::add($text['message-delete']);
}
unset($records);
}
}
}
/**
* copy records
*/
public function copy($records) {
//assign private variables
$this->permission_prefix = 'access_control_';
$this->table = 'access_controls';
$this->uuid_prefix = 'access_control_';
if (permission_exists($this->permission_prefix.'add')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//copy the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get checked records
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//create insert array from existing data
if (is_array($uuids) && @sizeof($uuids) != 0) {
//primary table
$sql = "select * from v_".$this->table." ";
$sql .= "where ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
$y = 0;
foreach ($rows as $x => $row) {
$primary_uuid = uuid();
//copy data
$array[$this->table][$x] = $row;
//overwrite
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $primary_uuid;
$array[$this->table][$x]['access_control_description'] = trim($row['access_control_description'].' ('.$text['label-copy'].')');
//nodes sub table
$sql_2 = "select * from v_access_control_nodes where access_control_uuid = :access_control_uuid";
$parameters_2['access_control_uuid'] = $row['access_control_uuid'];
$database = new database;
$rows_2 = $database->select($sql_2, $parameters_2, 'all');
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
foreach ($rows_2 as $row_2) {
//copy data
$array['access_control_nodes'][$y] = $row_2;
//overwrite
$array['access_control_nodes'][$y]['access_control_node_uuid'] = uuid();
$array['access_control_nodes'][$y]['access_control_uuid'] = $primary_uuid;
//increment
$y++;
}
}
unset($sql_2, $parameters_2, $rows_2, $row_2);
}
}
unset($sql, $parameters, $rows, $row);
}
//save the changes and set the message
if (is_array($array) && @sizeof($array) != 0) {
//grant temporary permissions
$p = new permissions;
$p->add('access_control_node_add', 'temp');
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('access_control_node_add', 'temp');
//clear the cache
$cache = new cache;
$cache->delete("configuration:acl.conf");
//create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
event_socket_request($fp, "api reloadacl");
}
//set message
message::add($text['message-copy']);
}
unset($records);
}
}
}
}
}
?>

View File

@ -0,0 +1,90 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,198 @@
<?php
class azure{
public static $formats = array (
'English-Zira' =>
array (
'lang' => 'en-US',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-US, ZiraRUS)'
),
'English-Jessa' =>
array (
'lang' => 'en-US',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-US, JessaRUS)'
),
'English-Benjamin' =>
array (
'lang' => 'en-US',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-US, BenjaminRUS)'
),
'British-Susan' =>
array (
'lang' => 'en-GB',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-GB, Susan, Apollo)'
),
'British-Hazel' =>
array (
'lang' => 'en-GB',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-GB, HazelRUS)'
),
'British-George' =>
array (
'lang' => 'en-GB',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-GB, George, Apollo)'
),
'Australian-Catherine' =>
array (
'lang' => 'en-AU',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-AU, Catherine)'
),
'Spanish-Helena' =>
array (
'lang' => 'es-ES',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (es-ES, HelenaRUS)'
),
'Spanish-Laura' =>
array (
'lang' => 'es-ES',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (es-ES, Laura, Apollo)'
),
'Spanish-Pablo' =>
array (
'lang' => 'es-ES',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (es-ES, Pablo, Apollo)'
),
'French-Julie' =>
array (
'lang' => 'fr-FR',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (fr-FR, Julie, Apollo)'
),
'French-Hortense' =>
array (
'lang' => 'fr-FR',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (fr-FR, HortenseRUS)'
),
'French-Paul' =>
array (
'lang' => 'fr-FR',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (fr-FR, Paul, Apollo)'
),
'German-Hedda' =>
array (
'lang' => 'de-DE',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (de-DE, Hedda)'
),
'Russian-Irina' =>
array (
'lang' => 'ru-RU',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (ru-RU, Irina, Apollo)'
),
'Russian-Pavel' =>
array (
'lang' => 'ru-RU',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (ru-RU, Pavel, Apollo)'
),
'Chinese-Huihui' =>
array (
'lang' => 'zh-CN',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (zh-CN, HuihuiRUS)'
),
'Chinese-Yaoyao' =>
array (
'lang' => 'zh-CN',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (zh-CN, Yaoyao, Apollo)'
),
'Chinese-Kangkang' =>
array (
'lang' => 'zh-CN',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (zh-CN, Kangkang, Apollo)'
)
);
private static function getTokenUrl(){
return "https://api.cognitive.microsoft.com/sts/v1.0/issueToken";
}
private static function getApiUrl(){
return "https://speech.platform.bing.com/synthesize";
}
private static function getSubscriptionKey(){
return $_SESSION['azure']['key']['text'];
}
private static function _getToken(){
$url = self::getTokenUrl();
$subscriptionKey = self::getSubscriptionKey();
$headers = array();
$headers[] = 'Ocp-Apim-Subscription-Key: '. $subscriptionKey;
$headers[] = 'Content-Length: 0';
$ch = curl_init();
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_URL, $url );
//curl_setopt($ch, CURLOPT_SSLVERSION, 1);
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 60 );
curl_setopt ( $ch, CURLOPT_TIMEOUT, 300 );
curl_setopt ( $ch, CURLOPT_VERBOSE, false);
curl_setopt($ch, CURLOPT_POST, true);
//curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
public static function synthesize($data,$formate_key){
$lang = self::$formats[$formate_key]['lang'];
$gender = self::$formats[$formate_key]['gender'];
$name = self::$formats[$formate_key]['name'];
$token = self::_getToken();
$url = self::getApiUrl();
$headers = array();
$headers[] = 'Authorization: Bearer '. $token;
$headers[] = 'Content-Type: application/ssml+xml';
$headers[] = 'X-Microsoft-OutputFormat: riff-16khz-16bit-mono-pcm';
$headers[] = 'User-Agent: TTS';
$xml_post_string = "<speak version='1.0' xml:lang='".$lang."'>
<voice xml:lang='".$lang."' xml:gender='".$gender."' name='".$name."'>";
$xml_post_string .= $data;
$xml_post_string .= "</voice>
</speak>";
$ch = curl_init();
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_URL, $url );
//curl_setopt($ch, CURLOPT_SSLVERSION, 1);
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 60 );
curl_setopt ( $ch, CURLOPT_TIMEOUT, 300 );
curl_setopt ( $ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);
$response = curl_exec($ch);
$filename = "tts_".time().".wav";
file_put_contents("/var/www/html/fusionpbx/app/voiplyrecording/tts_record/".$filename, $response);
curl_close($ch);
return $filename;
}
}

View File

@ -0,0 +1,103 @@
<?php
//application details
$apps[$x]['name'] = "Operator Panel";
$apps[$x]['uuid'] = "dd3d173a-5d51-4231-ab22-b18c5b712bb2";
$apps[$x]['category'] = "Switch";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Operator panel shows the status.";
$apps[$x]['description']['en-gb'] = "Operator panel shows the status.";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Das Bedienfeld zeigt den Status an.";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Das Bedienfeld zeigt den Status an.";
$apps[$x]['description']['es-cl'] = "";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "";
$apps[$x]['description']['fr-fr'] = "";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "Bedieningspaneel laat de status zien";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "";
$apps[$x]['description']['pt-pt'] = "Canais ativos no sistema.";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_manage";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_eavesdrop";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_hangup";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_record";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_call_details";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_on_demand";
//default settings
$y=0;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "569280f2-a433-4eaf-9c08-945efdc6cf8f";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "operator_panel";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "refresh";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "1500";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the refresh rate in seconds (<=120) or milliseconds (>=500).";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "0c273cad-1ee4-48d9-9336-08bc8260579a";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "operator_panel";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "group_extensions";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set if extensions are grouped by call_group when viewing all extensions.";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "a9ccd174-5ae1-4f90-8ee2-b79a183a04f8";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "operator_panel_main_background_color";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "#ffffff";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set main background color (and opacity) of extensions";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b9d34460-db41-40d5-becd-5da037fa8942";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "operator_panel_sub_background_color";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "#e5eaf5";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set sub background color (and opacity) of extensions";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "9cb6477d-0454-4b9c-b0fb-11c258d4f35f";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "operator_panel_border_color";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "#b9c5d8";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set border color (and opacity) of extensions";
$y++;
?>

View File

@ -0,0 +1,424 @@
<?php
#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
$text['title-operator_panel']['en-us'] = "Operator Panel";
$text['title-operator_panel']['en-gb'] = "Operator Panel";
$text['title-operator_panel']['ar-eg'] = "";
$text['title-operator_panel']['de-at'] = "Bedienfeld"; //copied from de-de
$text['title-operator_panel']['de-ch'] = "Bedienfeld"; //copied from de-de
$text['title-operator_panel']['de-de'] = "Bedienfeld";
$text['title-operator_panel']['es-cl'] = "Panel de Operador";
$text['title-operator_panel']['es-mx'] = "Panel de Operador"; //copied from es-cl
$text['title-operator_panel']['fr-ca'] = "Operator Panel"; //copied from fr-fr
$text['title-operator_panel']['fr-fr'] = "Operator Panel";
$text['title-operator_panel']['he-il'] = "לוח מפעיל";
$text['title-operator_panel']['it-it'] = "Pannello Operatore";
$text['title-operator_panel']['nl-nl'] = "Operator paneel";
$text['title-operator_panel']['pl-pl'] = "Panel operatora";
$text['title-operator_panel']['pt-br'] = "Painel do operador";
$text['title-operator_panel']['pt-pt'] = "Painel do Operador";
$text['title-operator_panel']['ro-ro'] = "";
$text['title-operator_panel']['ru-ru'] = "Панель Оператора";
$text['title-operator_panel']['sv-se'] = "Telefonist Panel";
$text['title-operator_panel']['uk-ua'] = "Панель оператора";
$text['label-status_on_demand']['en-us'] = "On Demand";
$text['label-status_on_demand']['en-gb'] = "On Demand";
$text['label-status_on_demand']['ar-eg'] = "";
$text['label-status_on_demand']['de-at'] = "Bei Bedarf"; //copied from de-de
$text['label-status_on_demand']['de-ch'] = "Bei Bedarf"; //copied from de-de
$text['label-status_on_demand']['de-de'] = "Bei Bedarf";
$text['label-status_on_demand']['es-cl'] = "A Pedido";
$text['label-status_on_demand']['es-mx'] = "A Pedido"; //copied from es-cl
$text['label-status_on_demand']['fr-ca'] = "Sur Demande"; //copied from fr-fr
$text['label-status_on_demand']['fr-fr'] = "Sur Demande";
$text['label-status_on_demand']['he-il'] = "על פי דרישה";
$text['label-status_on_demand']['it-it'] = "Su Richiesta";
$text['label-status_on_demand']['nl-nl'] = "Op Aanvraag";
$text['label-status_on_demand']['pl-pl'] = "Na żądanie";
$text['label-status_on_demand']['pt-br'] = "A pedido";
$text['label-status_on_demand']['pt-pt'] = "A Pedido";
$text['label-status_on_demand']['ro-ro'] = "";
$text['label-status_on_demand']['ru-ru'] = "По требованию";
$text['label-status_on_demand']['sv-se'] = "På Begäran";
$text['label-status_on_demand']['uk-ua'] = "На вимогу";
$text['label-status_on_break']['en-us'] = "On Break";
$text['label-status_on_break']['en-gb'] = "On Break";
$text['label-status_on_break']['ar-eg'] = "";
$text['label-status_on_break']['de-at'] = "In Pause"; //copied from de-de
$text['label-status_on_break']['de-ch'] = "In Pause"; //copied from de-de
$text['label-status_on_break']['de-de'] = "In Pause";
$text['label-status_on_break']['es-cl'] = "En Pausa";
$text['label-status_on_break']['es-mx'] = "En Pausa"; //copied from es-cl
$text['label-status_on_break']['fr-ca'] = "En Pause"; //copied from fr-fr
$text['label-status_on_break']['fr-fr'] = "En Pause";
$text['label-status_on_break']['he-il'] = "בהפסקה";
$text['label-status_on_break']['it-it'] = "In Pausa";
$text['label-status_on_break']['nl-nl'] = "In de wacht";
$text['label-status_on_break']['pl-pl'] = "Na przerwie";
$text['label-status_on_break']['pt-br'] = "Em pausa";
$text['label-status_on_break']['pt-pt'] = "Em Pausa";
$text['label-status_on_break']['ro-ro'] = "";
$text['label-status_on_break']['ru-ru'] = "Пауза";
$text['label-status_on_break']['sv-se'] = "På Rast";
$text['label-status_on_break']['uk-ua'] = "На перерві";
$text['label-status_logged_out_or_unknown']['en-us'] = "Logged Out / Unknown";
$text['label-status_logged_out_or_unknown']['en-gb'] = "Logged Out / Unknown";
$text['label-status_logged_out_or_unknown']['ar-eg'] = "";
$text['label-status_logged_out_or_unknown']['de-at'] = "Abgemeldet / Unbekannt"; //copied from de-de
$text['label-status_logged_out_or_unknown']['de-ch'] = "Abgemeldet / Unbekannt"; //copied from de-de
$text['label-status_logged_out_or_unknown']['de-de'] = "Abgemeldet / Unbekannt";
$text['label-status_logged_out_or_unknown']['es-cl'] = "Desconectado / Desconocido";
$text['label-status_logged_out_or_unknown']['es-mx'] = "Desconectado / Desconocido"; //copied from es-cl
$text['label-status_logged_out_or_unknown']['fr-ca'] = "Déconnexion / Unknown"; //copied from fr-fr
$text['label-status_logged_out_or_unknown']['fr-fr'] = "Déconnexion / Unknown";
$text['label-status_logged_out_or_unknown']['he-il'] = "";
$text['label-status_logged_out_or_unknown']['it-it'] = "Sloggato/Sconosciuto";
$text['label-status_logged_out_or_unknown']['nl-nl'] = "Afgelogged / Onbekend";
$text['label-status_logged_out_or_unknown']['pl-pl'] = "Wylogowany / Nieznany";
$text['label-status_logged_out_or_unknown']['pt-br'] = "Desligar / Desconhecido";
$text['label-status_logged_out_or_unknown']['pt-pt'] = "Desligado / Unknown";
$text['label-status_logged_out_or_unknown']['ro-ro'] = "";
$text['label-status_logged_out_or_unknown']['ru-ru'] = "Вышел из системы / Неизвестен";
$text['label-status_logged_out_or_unknown']['sv-se'] = "Utloggad / Okänd";
$text['label-status_logged_out_or_unknown']['uk-ua'] = "Вийшов/невідомо";
$text['label-status_logged_out']['en-us'] = "Logged Out";
$text['label-status_logged_out']['en-gb'] = "Logged Out";
$text['label-status_logged_out']['ar-eg'] = "";
$text['label-status_logged_out']['de-at'] = "Abgemeldet"; //copied from de-de
$text['label-status_logged_out']['de-ch'] = "Abgemeldet"; //copied from de-de
$text['label-status_logged_out']['de-de'] = "Abgemeldet";
$text['label-status_logged_out']['es-cl'] = "Desconectado";
$text['label-status_logged_out']['es-mx'] = "Desconectado"; //copied from es-cl
$text['label-status_logged_out']['fr-ca'] = "Déconnexion"; //copied from fr-fr
$text['label-status_logged_out']['fr-fr'] = "Déconnexion";
$text['label-status_logged_out']['he-il'] = "";
$text['label-status_logged_out']['it-it'] = "Sloggato";
$text['label-status_logged_out']['nl-nl'] = "Afgelogged";
$text['label-status_logged_out']['pl-pl'] = "Wylogowany";
$text['label-status_logged_out']['pt-br'] = "Desligado"; //copied from pt-pt
$text['label-status_logged_out']['pt-pt'] = "Desligado";
$text['label-status_logged_out']['ro-ro'] = "";
$text['label-status_logged_out']['ru-ru'] = "Вышел из системы";
$text['label-status_logged_out']['sv-se'] = "Utloggad";
$text['label-status_logged_out']['uk-ua'] = "Вийшов";
$text['label-status_do_not_disturb']['en-us'] = "Do Not Disturb";
$text['label-status_do_not_disturb']['en-gb'] = "Do Not Disturb";
$text['label-status_do_not_disturb']['ar-eg'] = "";
$text['label-status_do_not_disturb']['de-at'] = "Bitte nicht Stören"; //copied from de-de
$text['label-status_do_not_disturb']['de-ch'] = "Bitte nicht Stören"; //copied from de-de
$text['label-status_do_not_disturb']['de-de'] = "Bitte nicht Stören";
$text['label-status_do_not_disturb']['es-cl'] = "No Molestar";
$text['label-status_do_not_disturb']['es-mx'] = "No Molestar"; //copied from es-cl
$text['label-status_do_not_disturb']['fr-ca'] = "Ne pas Déranger"; //copied from fr-fr
$text['label-status_do_not_disturb']['fr-fr'] = "Ne pas Déranger";
$text['label-status_do_not_disturb']['he-il'] = "נא לא להפריע";
$text['label-status_do_not_disturb']['it-it'] = "Non Disturbare";
$text['label-status_do_not_disturb']['nl-nl'] = "Niet Storen";
$text['label-status_do_not_disturb']['pl-pl'] = "Nie przeszkadzać (DND)";
$text['label-status_do_not_disturb']['pt-br'] = "Não perturbe";
$text['label-status_do_not_disturb']['pt-pt'] = "Não perturbe (DND)";
$text['label-status_do_not_disturb']['ro-ro'] = "";
$text['label-status_do_not_disturb']['ru-ru'] = "Просьба не беспокоить";
$text['label-status_do_not_disturb']['sv-se'] = "Stör Ej";
$text['label-status_do_not_disturb']['uk-ua'] = "Не турбувати";
$text['label-status_available_on_demand']['en-us'] = "Available (On Demand)";
$text['label-status_available_on_demand']['en-gb'] = "Available (On Demand)";
$text['label-status_available_on_demand']['ar-eg'] = "";
$text['label-status_available_on_demand']['de-at'] = "Verfügbar (Bei Bedarf)"; //copied from de-de
$text['label-status_available_on_demand']['de-ch'] = "Verfügbar (Bei Bedarf)"; //copied from de-de
$text['label-status_available_on_demand']['de-de'] = "Verfügbar (Bei Bedarf)";
$text['label-status_available_on_demand']['es-cl'] = "Disponible (A Pedido)";
$text['label-status_available_on_demand']['es-mx'] = "Disponible (A Pedido)"; //copied from es-cl
$text['label-status_available_on_demand']['fr-ca'] = "Disponible (sur demande)"; //copied from fr-fr
$text['label-status_available_on_demand']['fr-fr'] = "Disponible (sur demande)";
$text['label-status_available_on_demand']['he-il'] = "";
$text['label-status_available_on_demand']['it-it'] = "Disponibile (Su Richiesta)";
$text['label-status_available_on_demand']['nl-nl'] = "Beschikbaar (Op Aaanvraag)";
$text['label-status_available_on_demand']['pl-pl'] = "Dostępny (na żądanie)";
$text['label-status_available_on_demand']['pt-br'] = "Disponivel (A pedido)";
$text['label-status_available_on_demand']['pt-pt'] = "Disponível (A Pedido)";
$text['label-status_available_on_demand']['ro-ro'] = "";
$text['label-status_available_on_demand']['ru-ru'] = "Доступен (по требованию)";
$text['label-status_available_on_demand']['sv-se'] = "Tillgänglig (På Begäran)";
$text['label-status_available_on_demand']['uk-ua'] = "Доступний (на вимогу)";
$text['label-status_available']['en-us'] = "Available";
$text['label-status_available']['en-gb'] = "Available";
$text['label-status_available']['ar-eg'] = "";
$text['label-status_available']['de-at'] = "Verfügbar"; //copied from de-de
$text['label-status_available']['de-ch'] = "Verfügbar"; //copied from de-de
$text['label-status_available']['de-de'] = "Verfügbar";
$text['label-status_available']['es-cl'] = "Disponible";
$text['label-status_available']['es-mx'] = "Disponible"; //copied from es-cl
$text['label-status_available']['fr-ca'] = "Disponible"; //copied from fr-fr
$text['label-status_available']['fr-fr'] = "Disponible";
$text['label-status_available']['he-il'] = "זמין";
$text['label-status_available']['it-it'] = "Disponibile";
$text['label-status_available']['nl-nl'] = "Beschikbaar";
$text['label-status_available']['pl-pl'] = "Dostępny";
$text['label-status_available']['pt-br'] = "Disponível";
$text['label-status_available']['pt-pt'] = "Disponível";
$text['label-status_available']['ro-ro'] = "";
$text['label-status_available']['ru-ru'] = "Доступен";
$text['label-status_available']['sv-se'] = "Tillgänglig";
$text['label-status_available']['uk-ua'] = "Доступний";
$text['label-refresh_pause']['en-us'] = "Pause Refresh";
$text['label-refresh_pause']['en-gb'] = "Pause Refresh";
$text['label-refresh_pause']['ar-eg'] = "";
$text['label-refresh_pause']['de-at'] = "Seite neu laden deaktivieren"; //copied from de-de
$text['label-refresh_pause']['de-ch'] = "Seite neu laden deaktivieren"; //copied from de-de
$text['label-refresh_pause']['de-de'] = "Seite neu laden deaktivieren";
$text['label-refresh_pause']['es-cl'] = "Actualizar Pausa";
$text['label-refresh_pause']['es-mx'] = "Actualizar Pausa"; //copied from es-cl
$text['label-refresh_pause']['fr-ca'] = "Pause Actualiser"; //copied from fr-fr
$text['label-refresh_pause']['fr-fr'] = "Pause Actualiser";
$text['label-refresh_pause']['he-il'] = "עצור רענון";
$text['label-refresh_pause']['it-it'] = "Interrompi";
$text['label-refresh_pause']['nl-nl'] = "Stop verversen";
$text['label-refresh_pause']['pl-pl'] = "Pauzuj odświeżanie";
$text['label-refresh_pause']['pt-br'] = "Pausar atualização";
$text['label-refresh_pause']['pt-pt'] = "Pausa Atualizar";
$text['label-refresh_pause']['ro-ro'] = "";
$text['label-refresh_pause']['ru-ru'] = "Приостановить обновление";
$text['label-refresh_pause']['sv-se'] = "Paus Uppdatera";
$text['label-refresh_pause']['uk-ua'] = "Припинити оновлення";
$text['label-refresh_enable']['en-us'] = "Enable Refresh";
$text['label-refresh_enable']['en-gb'] = "Enable Refresh";
$text['label-refresh_enable']['ar-eg'] = "";
$text['label-refresh_enable']['de-at'] = "Seite neu laden aktivieren"; //copied from de-de
$text['label-refresh_enable']['de-ch'] = "Seite neu laden aktivieren"; //copied from de-de
$text['label-refresh_enable']['de-de'] = "Seite neu laden aktivieren";
$text['label-refresh_enable']['es-cl'] = "Activar Actualizar";
$text['label-refresh_enable']['es-mx'] = "Activar Actualizar"; //copied from es-cl
$text['label-refresh_enable']['fr-ca'] = "Activer Actualiser"; //copied from fr-fr
$text['label-refresh_enable']['fr-fr'] = "Activer Actualiser";
$text['label-refresh_enable']['he-il'] = "אפשר רענון";
$text['label-refresh_enable']['it-it'] = "Abilita Aggiornamento";
$text['label-refresh_enable']['nl-nl'] = "Start verversen";
$text['label-refresh_enable']['pl-pl'] = "Włącz odświeżanie";
$text['label-refresh_enable']['pt-br'] = "Habilitar atualização";
$text['label-refresh_enable']['pt-pt'] = "Habilitar Atualização";
$text['label-refresh_enable']['ro-ro'] = "";
$text['label-refresh_enable']['ru-ru'] = "Включить обновление";
$text['label-refresh_enable']['sv-se'] = "Aktivera Uppdatering";
$text['label-refresh_enable']['uk-ua'] = "Включити оновлення";
$text['label-recording']['en-us'] = "Recording";
$text['label-recording']['en-gb'] = "Recording";
$text['label-recording']['ar-eg'] = "";
$text['label-recording']['de-at'] = "Aufnahme"; //copied from de-de
$text['label-recording']['de-ch'] = "Aufnahme"; //copied from de-de
$text['label-recording']['de-de'] = "Aufnahme";
$text['label-recording']['es-cl'] = "Grabación de Llamadas";
$text['label-recording']['es-mx'] = "Grabación de Llamadas"; //copied from es-cl
$text['label-recording']['fr-ca'] = "Enregistrement de L'appel"; //copied from fr-fr
$text['label-recording']['fr-fr'] = "Enregistrement de L'appel";
$text['label-recording']['he-il'] = "מקליט";
$text['label-recording']['it-it'] = "Registrazione";
$text['label-recording']['nl-nl'] = "Opnemend";
$text['label-recording']['pl-pl'] = "Nagrywanie";
$text['label-recording']['pt-br'] = "Gravação de chamadas";
$text['label-recording']['pt-pt'] = "Gravação de Chamadas";
$text['label-recording']['ro-ro'] = "";
$text['label-recording']['ru-ru'] = "Запись";
$text['label-recording']['sv-se'] = "Inspelning";
$text['label-recording']['uk-ua'] = "Запис";
$text['label-record']['en-us'] = "Record";
$text['label-record']['en-gb'] = "Record";
$text['label-record']['ar-eg'] = "";
$text['label-record']['de-at'] = "Aufnehmen"; //copied from de-de
$text['label-record']['de-ch'] = "Aufnehmen"; //copied from de-de
$text['label-record']['de-de'] = "Aufnehmen";
$text['label-record']['es-cl'] = "Registro";
$text['label-record']['es-mx'] = "Registro"; //copied from es-cl
$text['label-record']['fr-ca'] = "Enregistrer"; //copied from fr-fr
$text['label-record']['fr-fr'] = "Enregistrer";
$text['label-record']['he-il'] = "הקלטה";
$text['label-record']['it-it'] = "Registrazione";
$text['label-record']['nl-nl'] = "Opnemen";
$text['label-record']['pl-pl'] = "Nagrywanie";
$text['label-record']['pt-br'] = "Registro"; //copied from pt-pt
$text['label-record']['pt-pt'] = "Registro";
$text['label-record']['ro-ro'] = "";
$text['label-record']['ru-ru'] = "Воспроизведение";
$text['label-record']['sv-se'] = "Spela In";
$text['label-record']['uk-ua'] = "Запис";
$text['label-other_extensions']['en-us'] = "Other Extensions";
$text['label-other_extensions']['en-gb'] = "Other Extensions";
$text['label-other_extensions']['ar-eg'] = "";
$text['label-other_extensions']['de-at'] = "Andere Nebenstellen"; //copied from de-de
$text['label-other_extensions']['de-ch'] = "Andere Nebenstellen"; //copied from de-de
$text['label-other_extensions']['de-de'] = "Andere Nebenstellen";
$text['label-other_extensions']['es-cl'] = "Otras Extensiones";
$text['label-other_extensions']['es-mx'] = "Otras Extensiones"; //copied from es-cl
$text['label-other_extensions']['fr-ca'] = "Autres Extensions"; //copied from fr-fr
$text['label-other_extensions']['fr-fr'] = "Autres Extensions";
$text['label-other_extensions']['he-il'] = "שלוחות אחרות";
$text['label-other_extensions']['it-it'] = "Altri Interni";
$text['label-other_extensions']['nl-nl'] = "Andere toestellen";
$text['label-other_extensions']['pl-pl'] = "Inne numery wewnętrzne";
$text['label-other_extensions']['pt-br'] = "Outras extensões";
$text['label-other_extensions']['pt-pt'] = "Outros Extensions";
$text['label-other_extensions']['ro-ro'] = "";
$text['label-other_extensions']['ru-ru'] = "Другие внутренние номера";
$text['label-other_extensions']['sv-se'] = "Annan Anknytning";
$text['label-other_extensions']['uk-ua'] = "Інші розширення";
$text['label-no_extensions_found']['en-us'] = "No extensions found.";
$text['label-no_extensions_found']['en-gb'] = "No extensions found.";
$text['label-no_extensions_found']['ar-eg'] = "";
$text['label-no_extensions_found']['de-at'] = "Keine Nebenstellen gefunden."; //copied from de-de
$text['label-no_extensions_found']['de-ch'] = "Keine Nebenstellen gefunden."; //copied from de-de
$text['label-no_extensions_found']['de-de'] = "Keine Nebenstellen gefunden.";
$text['label-no_extensions_found']['es-cl'] = "No hay extensiones encontrados.";
$text['label-no_extensions_found']['es-mx'] = "No hay extensiones encontrados."; //copied from es-cl
$text['label-no_extensions_found']['fr-ca'] = "Aucun extensions trouvés."; //copied from fr-fr
$text['label-no_extensions_found']['fr-fr'] = "Aucun extensions trouvés.";
$text['label-no_extensions_found']['he-il'] = "לא נמצאו שלוחות";
$text['label-no_extensions_found']['it-it'] = "Nessun interno trovato.";
$text['label-no_extensions_found']['nl-nl'] = "Geen toestellen gevonden.";
$text['label-no_extensions_found']['pl-pl'] = "Nie znaleziono numerów wewnętrznych";
$text['label-no_extensions_found']['pt-br'] = "Não foi encontrada nenhuma extensão";
$text['label-no_extensions_found']['pt-pt'] = "Sem extensões encontrado.";
$text['label-no_extensions_found']['ro-ro'] = "";
$text['label-no_extensions_found']['ru-ru'] = "Внутренних номеров не найдено.";
$text['label-no_extensions_found']['sv-se'] = "Ingen anknytning funnen.";
$text['label-no_extensions_found']['uk-ua'] = "Не знайдено розширень";
$text['label-hangup']['en-us'] = "Hangup";
$text['label-hangup']['en-gb'] = "Hangup";
$text['label-hangup']['ar-eg'] = "";
$text['label-hangup']['de-at'] = "Abwürgen"; //copied from de-de
$text['label-hangup']['de-ch'] = "Abwürgen"; //copied from de-de
$text['label-hangup']['de-de'] = "Abwürgen";
$text['label-hangup']['es-cl'] = "Finalizar Llamada";
$text['label-hangup']['es-mx'] = "Finalizar Llamada"; //copied from es-cl
$text['label-hangup']['fr-ca'] = "Tuer Appel"; //copied from fr-fr
$text['label-hangup']['fr-fr'] = "Tuer Appel";
$text['label-hangup']['he-il'] = "הפסק";
$text['label-hangup']['it-it'] = "Abbatti";
$text['label-hangup']['nl-nl'] = "Ophangen";
$text['label-hangup']['pl-pl'] = "Rozłączenie się";
$text['label-hangup']['pt-br'] = "Chamada final";
$text['label-hangup']['pt-pt'] = "Chamada Final";
$text['label-hangup']['ro-ro'] = "";
$text['label-hangup']['ru-ru'] = "Убить";
$text['label-hangup']['sv-se'] = "Lägg På";
$text['label-hangup']['uk-ua'] = "вбити";
$text['label-eavesdrop']['en-us'] = "Eavesdrop";
$text['label-eavesdrop']['en-gb'] = "Eavesdrop";
$text['label-eavesdrop']['ar-eg'] = "";
$text['label-eavesdrop']['de-at'] = "Mithören"; //copied from de-de
$text['label-eavesdrop']['de-ch'] = "Mithören"; //copied from de-de
$text['label-eavesdrop']['de-de'] = "Mithören";
$text['label-eavesdrop']['es-cl'] = "Escuchar";
$text['label-eavesdrop']['es-mx'] = "Escuchar"; //copied from es-cl
$text['label-eavesdrop']['fr-ca'] = "Espionner"; //copied from fr-fr
$text['label-eavesdrop']['fr-fr'] = "Espionner";
$text['label-eavesdrop']['he-il'] = "";
$text['label-eavesdrop']['it-it'] = "Ascolta";
$text['label-eavesdrop']['nl-nl'] = "Afluisteren";
$text['label-eavesdrop']['pl-pl'] = "Podsłuchiwanie";
$text['label-eavesdrop']['pt-br'] = "Investigar";
$text['label-eavesdrop']['pt-pt'] = "Bisbilhotar";
$text['label-eavesdrop']['ro-ro'] = "";
$text['label-eavesdrop']['ru-ru'] = "Подслушивать";
$text['label-eavesdrop']['sv-se'] = "Medlyssning";
$text['label-eavesdrop']['uk-ua'] = "підслуховувати";
$text['label-call_group']['en-us'] = "Call Group";
$text['label-call_group']['en-gb'] = "Call Group";
$text['label-call_group']['ar-eg'] = "";
$text['label-call_group']['de-at'] = "Rufgruppe"; //copied from de-de
$text['label-call_group']['de-ch'] = "Rufgruppe"; //copied from de-de
$text['label-call_group']['de-de'] = "Rufgruppe";
$text['label-call_group']['es-cl'] = "Llamar a Grupo";
$text['label-call_group']['es-mx'] = "Llamar a Grupo"; //copied from es-cl
$text['label-call_group']['fr-ca'] = "Groupe d'appel"; //copied from fr-fr
$text['label-call_group']['fr-fr'] = "Groupe d'appel";
$text['label-call_group']['he-il'] = "קבוצת חיוג";
$text['label-call_group']['it-it'] = "Gruppo di Chiamata";
$text['label-call_group']['nl-nl'] = "Oproep Groep";
$text['label-call_group']['pl-pl'] = "Grupa odbiorców rozmowy";
$text['label-call_group']['pt-br'] = "Grupo"; //copied from pt-pt
$text['label-call_group']['pt-pt'] = "Grupo";
$text['label-call_group']['ro-ro'] = "";
$text['label-call_group']['ru-ru'] = "Группы вызова";
$text['label-call_group']['sv-se'] = "Ring Grupp";
$text['label-call_group']['uk-ua'] = "груповий виклик";
$text['label-call_direction']['en-us'] = "Call Direction";
$text['label-call_direction']['en-gb'] = "Call Direction";
$text['label-call_direction']['ar-eg'] = "";
$text['label-call_direction']['de-at'] = "Anruf Richtung"; //copied from de-de
$text['label-call_direction']['de-ch'] = "Anruf Richtung"; //copied from de-de
$text['label-call_direction']['de-de'] = "Anruf Richtung";
$text['label-call_direction']['es-cl'] = "Dirección de la llamada";
$text['label-call_direction']['es-mx'] = "Dirección de la llamada"; //copied from es-cl
$text['label-call_direction']['fr-ca'] = "Sens de l'appel"; //copied from fr-fr
$text['label-call_direction']['fr-fr'] = "Sens de l'appel";
$text['label-call_direction']['he-il'] = "כיוון שיחה";
$text['label-call_direction']['it-it'] = "Direzione Chiamata";
$text['label-call_direction']['nl-nl'] = "Oproep richting";
$text['label-call_direction']['pl-pl'] = "Kierunek rozmowy";
$text['label-call_direction']['pt-br'] = "Direção da chamada";
$text['label-call_direction']['pt-pt'] = "Direção da chamada";
$text['label-call_direction']['ro-ro'] = "";
$text['label-call_direction']['ru-ru'] = "Направление вызова";
$text['label-call_direction']['sv-se'] = "Samtals Riktning";
$text['label-call_direction']['uk-ua'] = "напрямок виклику";
$text['description-eavesdrop_destination']['en-us'] = "Select the Eavesdrop Destination";
$text['description-eavesdrop_destination']['en-gb'] = "Select the Eavesdrop Destination";
$text['description-eavesdrop_destination']['ar-eg'] = "";
$text['description-eavesdrop_destination']['de-at'] = "Wählen Sie ein Ziel zum Mithören"; //copied from de-de
$text['description-eavesdrop_destination']['de-ch'] = "Wählen Sie ein Ziel zum Mithören"; //copied from de-de
$text['description-eavesdrop_destination']['de-de'] = "Wählen Sie ein Ziel zum Mithören";
$text['description-eavesdrop_destination']['es-cl'] = "Seleccione el Eavesdrop Destino";
$text['description-eavesdrop_destination']['es-mx'] = "Seleccione el Eavesdrop Destino"; //copied from es-cl
$text['description-eavesdrop_destination']['fr-ca'] = "Sélectionnez la destination d'espionnage"; //copied from fr-fr
$text['description-eavesdrop_destination']['fr-fr'] = "Sélectionnez la destination d'espionnage";
$text['description-eavesdrop_destination']['he-il'] = "";
$text['description-eavesdrop_destination']['it-it'] = "Seleziona la Destinazione d'Ascolto";
$text['description-eavesdrop_destination']['nl-nl'] = "Kies afluister bestemming";
$text['description-eavesdrop_destination']['pl-pl'] = "Wybierz destynację podsłuchiwanych rozmów";
$text['description-eavesdrop_destination']['pt-br'] = "Selecione o eavesdrop de destino";
$text['description-eavesdrop_destination']['pt-pt'] = "Selecione o Eavesdrop Destino";
$text['description-eavesdrop_destination']['ro-ro'] = "";
$text['description-eavesdrop_destination']['ru-ru'] = "Выберите подслушивание пункта назначения";
$text['description-eavesdrop_destination']['sv-se'] = "Välj Medlyssning Destination";
$text['description-eavesdrop_destination']['uk-ua'] = "Виберіть пункт призначення підслуховувати";
$text['button-all']['en-us'] = "All";
$text['button-all']['en-gb'] = "All";
$text['button-all']['ar-eg'] = "";
$text['button-all']['de-at'] = "Alle"; //copied from de-de
$text['button-all']['de-ch'] = "Alle"; //copied from de-de
$text['button-all']['de-de'] = "Alle";
$text['button-all']['es-cl'] = "Todos";
$text['button-all']['es-mx'] = "Todos"; //copied from es-cl
$text['button-all']['fr-ca'] = "Tous"; //copied from fr-fr
$text['button-all']['fr-fr'] = "Tous";
$text['button-all']['he-il'] = "הכל";
$text['button-all']['it-it'] = "Tutti";
$text['button-all']['nl-nl'] = "Alle";
$text['button-all']['pl-pl'] = "Wszyscy";
$text['button-all']['pt-br'] = "Tudo"; //copied from pt-pt
$text['button-all']['pt-pt'] = "Tudo";
$text['button-all']['ro-ro'] = "";
$text['button-all']['ru-ru'] = "Все";
$text['button-all']['sv-se'] = "Alla";
$text['button-all']['uk-ua'] = "Всі";
?>

View File

@ -0,0 +1,30 @@
<?php
$y=0;
$apps[$x]['menu'][$y]['title']['en-us'] = "Operator Panel";
$apps[$x]['menu'][$y]['title']['en-gb'] = "Operator Panel";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
$apps[$x]['menu'][$y]['title']['de-at'] = "Bedienfeld";
$apps[$x]['menu'][$y]['title']['de-de'] = "Bedienfeld";
$apps[$x]['menu'][$y]['title']['es-cl'] = "";
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "Panneau Operateur";
$apps[$x]['menu'][$y]['title']['he-il'] = "לוח מפעיל";
$apps[$x]['menu'][$y]['title']['it-it'] = "Pannello Operatore";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "Bedienings paneel";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Panel operatora";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Painel do operador";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Панель оператора";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Telefonist Panel";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "Панель оператора";
$apps[$x]['menu'][$y]['uuid'] = "dd3d173a-5d51-4231-ab22-b18c5b712bb2";
$apps[$x]['menu'][$y]['parent_uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['path'] = "/app/basic_operator_panel/index.php";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
$apps[$x]['menu'][$y]['groups'][] = "admin";
?>

View File

@ -0,0 +1,195 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('contact_view')) {
//access granted
}
else {
exit;
}
//search term
$term = check_str($_GET['term']);
if (isset($_GET['debug'])) {
echo "Search Term: ".escape($term)."<br><br>";
}
//if term contains spaces, break into array
if (substr_count($term, ' ') > 0) {
$terms = explode(' ', $term);
}
else {
$terms[] = $term;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//retrieve current user's assigned groups (uuids)
foreach ($_SESSION['groups'] as $group_data) {
$user_group_uuids[] = $group_data['group_uuid'];
}
//add user's uuid to group uuid list to include private (non-shared) contacts
$user_group_uuids[] = $_SESSION["user_uuid"];
//create the database object
$database = new database;
//get extensions list
$sql = "select \n";
$sql .= "e.extension, \n";
$sql .= "e.effective_caller_id_name, \n";
$sql .= "concat(e.directory_first_name, ' ', e.directory_last_name) as directory_full_name \n";
$sql .= "from \n";
$sql .= "v_extensions e \n";
$sql .= "where \n";
foreach ($terms as $index => $term) {
$sql .= "( \n";
$sql .= " lower(e.effective_caller_id_name) like lower(:term) or \n";
$sql .= " lower(e.outbound_caller_id_name) like lower(:term) or \n";
$sql .= " lower(concat(e.directory_first_name, ' ', e.directory_last_name)) like lower(:term) or \n";
$sql .= " lower(e.description) like lower(:term) or \n";
$sql .= " lower(e.call_group) like lower(:term) or \n";
$sql .= " e.extension like :term \n";
$sql .= ") \n";
if ($index + 1 < sizeof($terms)) {
$sql .= " and \n";
}
}
$sql .= "and e.domain_uuid = :domain_uuid \n";
$sql .= "and e.enabled = 'true' \n";
$sql .= "order by \n";
$sql .= "directory_full_name asc, \n";
$sql .= "e.effective_caller_id_name asc \n";
if (isset($_GET['debug'])) { echo $sql."<br><br>"; }
$parameters['term'] = '%'.$term.'%';
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$result = $database->select($sql, $parameters, 'all');
unset ($parameters, $sql);
if (is_array($result)) {
if (isset($_GET['debug'])) { echo $result."<br><br>"; }
foreach($result as $row) {
if ($row['directory_full_name'] != '') { $values[] = $row['directory_full_name']; }
if ($row['effective_caller_id_name'] != '') { $values[] = $row['effective_caller_id_name']; }
$suggestions[] = "{ \"label\": \"".(implode(', ', $values)." @ ".$row['extension'])."\", \"value\": \"".$row['extension']."\" }";
unset($values);
}
unset($sql, $result, $row_count);
}
//get contacts list
$sql = "select \n";
$sql .= "c.contact_organization, \n";
$sql .= "c.contact_name_given, \n";
$sql .= "c.contact_name_middle, \n";
$sql .= "c.contact_name_family, \n";
$sql .= "c.contact_nickname, \n";
$sql .= "p.phone_number, \n";
$sql .= "p.phone_label \n";
$sql .= "from \n";
$sql .= "v_contacts as c, \n";
$sql .= "v_contact_phones as p \n";
$sql .= "where \n";
foreach ($terms as $index => $term) {
$sql .= "( \n";
$sql .= " lower(c.contact_organization) like lower(:term) or \n";
$sql .= " lower(c.contact_name_given) like lower(:term) or \n";
$sql .= " lower(c.contact_name_middle) like lower(:term) or \n";
$sql .= " lower(c.contact_name_family) like lower(:term) or \n";
$sql .= " lower(c.contact_nickname) like lower(:term) or \n";
$sql .= " p.phone_number like :term \n";
$sql .= ") \n";
if ($index + 1 < sizeof($terms)) {
$sql .= " and \n";
}
}
$sql .= "and c.contact_uuid = p.contact_uuid \n";
$sql .= "and c.domain_uuid = :domain_uuid \n";
if (sizeof($user_group_uuids) > 0) {
$sql .= "and ( \n"; //only contacts assigned to current user's group(s) and those not assigned to any group
$sql .= " c.contact_uuid in ( \n";
$sql .= " select contact_uuid from v_contact_groups \n";
$sql .= " where group_uuid in ('".implode("','", $user_group_uuids)."') \n";
$sql .= " and domain_uuid = :domain_uuid \n";
$sql .= " ) \n";
$sql .= " or \n";
$sql .= " c.contact_uuid not in ( \n";
$sql .= " select contact_uuid from v_contact_groups \n";
$sql .= " where domain_uuid = :domain_uuid \n";
$sql .= " ) \n";
$sql .= ") \n";
}
$sql .= "and p.phone_type_voice = 1 \n";
$sql .= "order by \n";
$sql .= "contact_organization desc, \n";
$sql .= "contact_name_given asc, \n";
$sql .= "contact_name_family asc \n";
if (isset($_GET['debug'])) { echo $sql."<br><br>"; }
$parameters['term'] = '%'.$term.'%';
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$result = $database->select($sql, $parameters, 'all');
unset ($parameters, $sql);
if (is_array($result)) {
foreach($result as $row) {
if ($row['contact_organization'] != '') { $values[] = $row['contact_organization']; }
if ($row['contact_name_given'] != '') { $names = $row['contact_name_given']; }
if ($row['contact_name_middle'] != '') { $names .= " ".$row['contact_name_middle']; }
if ($row['contact_name_family'] != '') { $names .= " ".$row['contact_name_family']; }
if ($names != '') { $values[] = $names; }
if ($row['contact_nickname'] != '') { $values[] = $row['contact_nickname']; }
$suggestions[] = "{ \"label\": \"".(implode(', ', $values)." - ".format_phone($row['phone_number']).(($row['phone_label'] != '') ? " (".$row['phone_label'].")" : null))."\", \"value\": \"".$row['phone_number']."\" }";
unset($values, $names);
}
unset($sql, $result, $row_count);
}
//output suggestions, if any
if (sizeof($suggestions) > 0) {
$resp .= "[\n";
$resp .= implode(",\n", $suggestions)."\n";
$resp .= "]";
if (isset($_GET['debug'])) { echo "<pre>"; }
echo $resp;
if (isset($_GET['debug'])) { echo "</pre>"; }
}
?>

View File

@ -0,0 +1,124 @@
<?php
/* $Id$ */
/*
v_exec.php
Copyright (C) 2008-2019 Mark J Crane
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('operator_panel_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//authorized referrer
// if(stristr($_SERVER["HTTP_REFERER"], '/index.php') === false) {
// if(stristr($_SERVER["HTTP_REFERER"], '/index_inc.php') === false) {
// echo " access denied";
// exit;
// }
// }
//process the requests
if (count($_GET) > 0) {
//set the variables
$switch_cmd = trim($_GET["cmd"]);
$action = trim($_GET["action"]);
$data = trim($_GET["data"]);
$direction = trim($_GET["direction"]);
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//allow specific commands
if (strlen($switch_cmd) > 0) {
$api_cmd = '';
$uuid_pattern = '/[^-A-Fa-f0-9]/';
$num_pattern = '/[^-A-Za-z0-9()*#]/';
if ($switch_cmd == 'originate') {
$source = preg_replace($num_pattern,'',$_GET['source']);
$destination = preg_replace($num_pattern,'',$_GET['destination']);
$api_cmd = 'bgapi originate {sip_auto_answer=true,origination_caller_id_number=' . $source . ',sip_h_Call-Info=_undef_}user/' . $source . '@' . $_SESSION['domain_name'] . ' ' . $destination . ' XML ' . trim($_SESSION['user_context']);
} elseif ($switch_cmd == 'uuid_record') {
$uuid = preg_replace($uuid_pattern,'',$_GET['uuid']);
$api_cmd = 'uuid_record ' . $uuid . ' start ' . $_SESSION['switch']['recordings']['dir'] . '/' . $_SESSION['domain_name'] . '/archive/' . date('Y/M/d') . '/' . $uuid . '.wav';
} elseif ($switch_cmd == 'uuid_transfer') {
$uuid = preg_replace($uuid_pattern,'',$_GET['uuid']);
$destination = preg_replace($num_pattern,'',$_GET['destination']);
$api_cmd = 'uuid_transfer ' . $uuid . ' ' . $destination . ' XML ' . trim($_SESSION['user_context']);
} elseif ($switch_cmd == 'uuid_eavesdrop') {
$chan_uuid = preg_replace($uuid_pattern,'',$_GET['chan_uuid']);
$ext = preg_replace($num_pattern,'',$_GET['ext']);
$destination = preg_replace($num_pattern,'',$_GET['destination']);
$language = new text;
$text = $language->get();
$api_cmd = 'bgapi originate {origination_caller_id_name=' . $text['label-eavesdrop'] . ',origination_caller_id_number=' . $ext . '}user/' . $destination . '@' . $_SESSION['domain_name'] . ' &eavesdrop(' . $chan_uuid . ')';
} elseif ($switch_cmd == 'uuid_kill') {
$call_id = preg_replace($uuid_pattern,'',$_GET['call_id']);
$api_cmd = 'uuid_kill ' . $call_id;
} else {
echo 'access denied';
return;
}
//run the command
$switch_result = event_socket_request($fp, 'api '.$api_cmd);
/*
//record stop
if ($action == "record") {
if (trim($_GET["action2"]) == "stop") {
$x=0;
while (true) {
if ($x > 0) {
$dest_file = $_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"]."_".$x.".wav";
}
else {
$dest_file = $_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"].".wav";
}
if (!file_exists($dest_file)) {
rename($_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"].".wav", $dest_file);
break;
}
$x++;
}
}
}
*/
}
}
?>

View File

@ -0,0 +1,599 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('operator_panel_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//set user status
if (isset($_REQUEST['status']) && $_REQUEST['status'] != '') {
//validate the user status
$user_status = $_REQUEST['status'];
switch ($user_status) {
case "Available" :
break;
case "Available (On Demand)" :
break;
case "On Break" :
break;
case "Do Not Disturb" :
break;
case "Logged Out" :
break;
default :
$user_status = '';
}
//update the status
if (permission_exists("user_setting_edit")) {
//add the user_edit permission
$p = new permissions;
$p->add("user_edit", "temp");
//update the database user_status
$array['users'][0]['user_uuid'] = $_SESSION['user']['user_uuid'];
$array['users'][0]['domain_uuid'] = $_SESSION['user']['domain_uuid'];
$array['users'][0]['user_status'] = $user_status;
$database = new database;
$database->app_name = 'operator_panel';
$database->app_uuid = 'dd3d173a-5d51-4231-ab22-b18c5b712bb2';
$database->save($array);
//remove the temporary permission
$p->delete("user_edit", "temp");
unset($array);
}
//if call center app is installed then update the user_status
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/call_centers')) {
//get the call center agent uuid
$sql = "select call_center_agent_uuid from v_call_center_agents ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and user_uuid = :user_uuid ";
$parameters['domain_uuid'] = $_SESSION['user']['domain_uuid'];
$parameters['user_uuid'] = $_SESSION['user']['user_uuid'];
$database = new database;
$call_center_agent_uuid = $database->select($sql, $parameters, 'column');
unset($sql, $parameters);
//update the user_status
if (is_uuid($call_center_agent_uuid)) {
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
$switch_cmd .= "callcenter_config agent set status ".$call_center_agent_uuid." '".$user_status."'";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
//update the user state
if (is_uuid($call_center_agent_uuid)) {
$cmd = "api callcenter_config agent set state ".$call_center_agent_uuid." Waiting";
$response = event_socket_request($fp, $cmd);
}
//update do not disturb
if ($user_status == "Do Not Disturb") {
$x = 0;
foreach($_SESSION['user']['extension'] as $row) {
//build the array
$array['extensions'][$x]['extension_uuid'] = $row['extension_uuid'];
$array['extensions'][$x]['dial_string'] = '!USER_BUSY';
$array['extensions'][$x]['do_not_disturb'] = 'true';
//delete extension from the cache
$cache = new cache;
$cache->delete("directory:".$row['extension']."@".$_SESSION['user']['domain_name']);
if(strlen($number_alias) > 0){
$cache->delete("directory:".$row['number_alias']."@".$_SESSION['user']['domain_name']);
}
//incrment
$x++;
}
}
else {
$x = 0;
foreach($_SESSION['user']['extension'] as $row) {
//build the array
$array['extensions'][$x]['extension_uuid'] = $row['extension_uuid'];
$array['extensions'][$x]['dial_string'] = null;
$array['extensions'][$x]['do_not_disturb'] = 'false';
//delete extension from the cache
$cache = new cache;
$cache->delete("directory:".$row['extension']."@".$_SESSION['user']['domain_name']);
if(strlen($number_alias) > 0){
$cache->delete("directory:".$row['number_alias']."@".$_SESSION['user']['domain_name']);
}
//incrment
$x++;
}
}
//grant temporary permissions
$p = new permissions;
$p->add('extension_edit', 'temp');
//execute update
$database = new database;
$database->app_name = 'calls';
$database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d';
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('extension_edit', 'temp');
//delete extension from the cache
$cache = new cache;
$cache->delete("directory:".$extension."@".$this->domain_name);
if(strlen($number_alias) > 0){
$cache->delete("directory:".$number_alias."@".$this->domain_name);
}
}
//stop execution
exit;
}
//set the title
$document['title'] = $text['title-operator_panel'];
//include the header
require_once "resources/header.php";
?>
<!-- virtual_drag function holding elements -->
<input type='hidden' class='formfld' id='vd_call_id' value=''>
<input type='hidden' class='formfld' id='vd_ext_from' value=''>
<input type='hidden' class='formfld' id='vd_ext_to' value=''>
<input type='hidden' class='formfld' id='sort1' value=''>
<!-- autocomplete for contact lookup -->
<link rel="stylesheet" type="text/css" href="<?php echo PROJECT_PATH; ?>/resources/jquery/jquery-ui.min.css">
<script language="JavaScript" type="text/javascript" src="<?php echo PROJECT_PATH; ?>/resources/jquery/jquery-ui.min.js"></script>
<script type="text/javascript">
<?php
//determine refresh rate
$refresh_default = 1500; //milliseconds
$refresh = is_numeric($_SESSION['operator_panel']['refresh']['numeric']) ? $_SESSION['operator_panel']['refresh']['numeric'] : $refresh_default;
if ($refresh >= 0.5 && $refresh <= 120) { //convert seconds to milliseconds
$refresh = $refresh * 1000;
}
else if ($refresh < 0.5 || ($refresh > 120 && $refresh < 500)) {
$refresh = $refresh_default; //use default
}
else {
//>= 500, must be milliseconds
}
unset($refresh_default);
?>
//ajax refresh
var refresh = <?php echo $refresh; ?>;
var source_url = 'resources/content.php?' <?php if (isset($_GET['debug'])) { echo " + '&debug'"; } ?>;
var interval_timer_id;
function loadXmlHttp(url, id) {
var f = this;
f.xmlHttp = null;
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
try {f.ie = window.ActiveXObject}catch(e){f.ie = false;}
@end @*/
if (window.XMLHttpRequest&&!f.ie||/^http/.test(window.location.href))
f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
else if (/(object)|(function)/.test(typeof createRequest))
f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
else {
f.xmlHttp = null;
// Internet Explorer 5 to 6, includes IE 7+ when local //
/*@cc_on @*/
/*@if(@_jscript_version >= 5)
try{f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){f.xmlHttp=null;}}
@end @*/
}
if(f.xmlHttp != null){
f.el = document.getElementById(id);
f.xmlHttp.open("GET",url,true);
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
f.xmlHttp.send(null);
}
}
loadXmlHttp.prototype.stateChanged=function () {
var url = new URL(this.xmlHttp.responseURL);
if (/login\.php$/.test(url.pathname)) {
// You are logged out. Stop refresh!
refresh_stop();
url.searchParams.set('path', '<?php echo $_SERVER['REQUEST_URI']; ?>');
window.location.href = url.href;
return;
}
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
//this.el.innerHTML = this.xmlHttp.responseText;
document.getElementById('ajax_reponse').innerHTML = this.xmlHttp.responseText;
if (document.getElementById('sort')) {
if (document.getElementById('sort').value != "")
document.getElementById('sort1').value=document.getElementById('sort').value;
}
}
var requestTime = function() {
var url = source_url;
url += '&vd_ext_from=' + document.getElementById('vd_ext_from').value;
url += '&vd_ext_to=' + document.getElementById('vd_ext_to').value;
url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').value : '');
url += '&extension_filter=' + ((document.getElementById('extension_filter')) ? document.getElementById('extension_filter').value : '');
url += '&name_filter=' + ((document.getElementById('name_filter')) ? document.getElementById('name_filter').value : '');
url += '&eavesdrop_dest=' + ((document.getElementById('eavesdrop_dest')) ? document.getElementById('eavesdrop_dest').value : '');
if (document.getElementById('sort1'))
if (document.getElementById('sort1').value == '1') url += '&sort';
<?php
if (isset($_GET['debug'])) {
echo "url += '&debug';";
}
?>
new loadXmlHttp(url, 'ajax_reponse');
refresh_start();
}
if (window.addEventListener) {
window.addEventListener('load', requestTime, false);
}
else if (window.attachEvent) {
window.attachEvent('onload', requestTime);
}
//drag/drop functionality
var ie_workaround = false;
function drag(ev, from_ext) {
refresh_stop();
try {
ev.dataTransfer.setData("Call", ev.target.id);
ev.dataTransfer.setData("From", from_ext);
virtual_drag_reset();
}
catch (err) {
// likely internet explorer being used, do workaround
virtual_drag(ev.target.id, from_ext);
ie_workaround = true;
}
}
function allowDrop(ev, target_id) {
ev.preventDefault();
}
function discardDrop(ev, target_id) {
ev.preventDefault();
}
function drop(ev, to_ext) {
ev.preventDefault();
if (ie_workaround) { // potentially set on drag() function above
var call_id = document.getElementById('vd_call_id').value;
var from_ext = document.getElementById('vd_ext_from').value;
virtual_drag_reset();
}
else {
var call_id = ev.dataTransfer.getData("Call");
var from_ext = ev.dataTransfer.getData("From");
}
var to_ext = to_ext;
var cmd;
if (call_id != '') {
cmd = get_transfer_cmd(call_id, to_ext); //transfer a call
}
else {
if (from_ext != to_ext) { // prevent user from dragging extention onto self
cmd = get_originate_cmd(from_ext, to_ext); //make a call
}
}
if (cmd != '') { send_cmd(cmd) }
refresh_start();
}
//refresh controls
function refresh_stop() {
clearInterval(interval_timer_id);
if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 1px; cursor: pointer;' onclick='refresh_start();' alt=\"<?php echo $text['label-refresh_enable']?>\" title=\"<?php echo $text['label-refresh_enable']?>\">"; }
}
function refresh_start() {
if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' alt=\"<?php echo $text['label-refresh_pause']?>\" title=\"<?php echo $text['label-refresh_pause']?>\">"; }
refresh_stop();
interval_timer_id = setInterval( function() {
url = source_url;
url += '&vd_ext_from=' + document.getElementById('vd_ext_from').value;
url += '&vd_ext_to=' + document.getElementById('vd_ext_to').value;
url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').value : '');
url += '&extension_filter=' + ((document.getElementById('extension_filter')) ? document.getElementById('extension_filter').value : '');
url += '&name_filter=' + ((document.getElementById('name_filter')) ? document.getElementById('name_filter').value : '');
url += '&eavesdrop_dest=' + ((document.getElementById('eavesdrop_dest')) ? document.getElementById('eavesdrop_dest').value : '');
if (document.getElementById('sort1'))
if (document.getElementById('sort1').value == '1') url += '&sort';
<?php
if (isset($_GET['debug'])) {
echo "url += '&debug';";
}
?>
new loadXmlHttp(url, 'ajax_reponse');
}, refresh);
}
//call or transfer to destination
function go_destination(from_ext, destination, which, call_id) {
call_id = typeof call_id !== 'undefined' ? call_id : '';
if (destination != '') {
if (!isNaN(parseFloat(destination)) && isFinite(destination)) {
if (call_id == '') {
cmd = get_originate_cmd(from_ext, destination); //make a call
}
else {
cmd = get_transfer_cmd(call_id, destination);
}
if (cmd != '') {
send_cmd(cmd);
$('#destination_'+from_ext+'_'+which).removeAttr('onblur');
toggle_destination(from_ext, which);
}
}
}
}
//hangup call
function hangup_call(call_id) {
if (call_id != '') {
send_cmd('exec.php?cmd=uuid_kill&call_id=' + call_id)
}
}
//eavesdrop call
function eavesdrop_call(ext, chan_uuid) {
if (ext != '' && chan_uuid != '') {
cmd = get_eavesdrop_cmd(ext, chan_uuid, document.getElementById('eavesdrop_dest').value);
if (cmd != '') {
send_cmd(cmd)
}
}
}
//record call
function record_call(chan_uuid) {
if (chan_uuid != '') {
cmd = get_record_cmd(chan_uuid);
if (cmd != '') {
send_cmd(cmd);
}
}
}
//used by call control and ajax refresh functions
function send_cmd(url) {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('cmd_reponse').innerHTML=xmlhttp.responseText;
}
//hide/show destination input field
function toggle_destination(ext, which) {
refresh_stop();
if (which == 'call') {
if ($('#destination_'+ext+'_call').is(':visible')) {
$('#destination_'+ext+'_call').val('');
$('#destination_'+ext+'_call').autocomplete('destroy');
$('#destination_'+ext+'_call').hide(0, function() {
$('.call_control').children().attr('onmouseout', "refresh_start();");
$('.destination_control').attr('onmouseout', "refresh_start();");
refresh_start();
});
}
else {
$('#destination_'+ext+'_call').show(0, function() {
$('#destination_'+ext+'_call').trigger('focus');
$('#destination_'+ext+'_call').autocomplete({
source: "autocomplete.php",
minLength: 3,
select: function(event, ui) {
$('#destination_'+ext+'_call').val(ui.item.value);
$('#frm_destination_'+ext+'_call').submit();
}
});
$('.call_control').children().removeAttr('onmouseout');
$('.destination_control').removeAttr('onmouseout');
});
}
}
else if (which == 'transfer') {
if ($('#destination_'+ext+'_transfer').is(':visible')) {
$('#destination_'+ext+'_transfer').val('');
$('#destination_'+ext+'_transfer').autocomplete('destroy');
$('#destination_'+ext+'_transfer').hide(0, function() {
$('#op_caller_details_'+ext).show();
$('.call_control').children().attr('onmouseout', "refresh_start();");
$('.destination_control').attr('onmouseout', "refresh_start();");
refresh_start();
});
}
else {
$('#op_caller_details_'+ext).hide(0, function() {
$('#destination_'+ext+'_transfer').show(0, function() {
$('#destination_'+ext+'_transfer').trigger('focus');
$('#destination_'+ext+'_transfer').autocomplete({
source: "autocomplete.php",
minLength: 3,
select: function(event, ui) {
$('#destination_'+ext+'_transfer').val(ui.item.value);
$('#frm_destination_'+ext+'_transfer').submit();
}
});
$('.call_control').children().removeAttr('onmouseout');
$('.destination_control').removeAttr('onmouseout');
});
});
}
}
}
function get_transfer_cmd(uuid, destination) {
url = "exec.php?cmd=uuid_transfer&uuid=" + uuid + "&destination=" + destination
return url;
}
function get_originate_cmd(source, destination) {
url = "exec.php?cmd=originate&source=" + source + "&destination=" + destination
return url;
}
function get_eavesdrop_cmd(ext, chan_uuid, destination) {
url = "exec.php?cmd=uuid_eavesdrop&ext=" + ext + "&chan_uuid=" + chan_uuid + "&destination=" + destination;
return url;
}
function get_record_cmd(uuid) {
url = "exec.php?cmd=uuid_record&uuid=" + uuid;
return url;
}
//virtual functions
function virtual_drag(call_id, ext) {
if (document.getElementById('vd_ext_from').value != '' && document.getElementById('vd_ext_to').value != '') {
virtual_drag_reset();
}
if (call_id != '') {
document.getElementById('vd_call_id').value = call_id;
}
if (ext != '') {
if (document.getElementById('vd_ext_from').value == '') {
document.getElementById('vd_ext_from').value = ext;
document.getElementById(ext).style.borderStyle = 'dotted';
if (document.getElementById('vd_ext_to').value != '') {
document.getElementById(document.getElementById('vd_ext_to').value).style.borderStyle = '';
document.getElementById('vd_ext_to').value = '';
}
}
else {
document.getElementById('vd_ext_to').value = ext;
if (document.getElementById('vd_ext_from').value != document.getElementById('vd_ext_to').value) {
if (document.getElementById('vd_call_id').value != '') {
cmd = get_transfer_cmd(document.getElementById('vd_call_id').value, document.getElementById('vd_ext_to').value); //transfer a call
}
else {
cmd = get_originate_cmd(document.getElementById('vd_ext_from').value, document.getElementById('vd_ext_to').value); //originate a call
}
if (cmd != '') {
//alert(cmd);
send_cmd(cmd);
}
}
virtual_drag_reset();
}
}
}
function virtual_drag_reset(vd_var) {
if (!(vd_var === undefined)) {
document.getElementById(vd_var).value = '';
}
else {
document.getElementById('vd_call_id').value = '';
if (document.getElementById('vd_ext_from').value != '') {
document.getElementById(document.getElementById('vd_ext_from').value).style.borderStyle = '';
document.getElementById('vd_ext_from').value = '';
}
if (document.getElementById('vd_ext_to').value != '') {
document.getElementById(document.getElementById('vd_ext_to').value).style.borderStyle = '';
document.getElementById('vd_ext_to').value = '';
}
}
}
</script>
<style type="text/css">
TABLE {
border-spacing: 0px;
border-collapse: collapse;
border: none;
}
</style>
<?php
//create simple array of users own extensions
unset($_SESSION['user']['extensions']);
if (is_array($_SESSION['user']['extension'])) {
foreach ($_SESSION['user']['extension'] as $assigned_extensions) {
$_SESSION['user']['extensions'][] = $assigned_extensions['user'];
}
}
?>
<div id='ajax_reponse'></div>
<div id='cmd_reponse' style='display: none;'></div>
<br><br>
<?php
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,257 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
/**
* Define the operator_panel class
*/
if (!class_exists('basic_operator_panel')) {
class basic_operator_panel {
/**
* Define the variables
*/
public $domain_uuid;
/**
* Called when the object is created
*/
public function __construct() {
if (!isset($this->domain_uuid)) {
$this->domain_uuid = $_SESSION['domain_uuid'];
}
}
/**
* Called when there are no references to a particular object
* unset the variables used in the class
*/
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
/**
* Get the call activity
*/
public function call_activity() {
//define the global variable
global $ext_user_status;
//get the extensions and their user status
$sql = "select ";
$sql .= "e.extension, ";
$sql .= "e.number_alias, ";
$sql .= "e.effective_caller_id_name, ";
$sql .= "lower(e.effective_caller_id_name) as filter_name, ";
$sql .= "e.effective_caller_id_number, ";
$sql .= "e.call_group, ";
$sql .= "e.description, ";
$sql .= "u.user_uuid, ";
$sql .= "u.user_status ";
$sql .= "from ";
$sql .= "v_extensions as e ";
$sql .= "left outer join v_extension_users as eu on ( eu.extension_uuid = e.extension_uuid and eu.domain_uuid = :domain_uuid ) ";
$sql .= "left outer join v_users as u on ( u.user_uuid = eu.user_uuid and u.domain_uuid = :domain_uuid ) ";
$sql .= "where ";
$sql .= "e.enabled = 'true' and ";
$sql .= "e.domain_uuid = :domain_uuid ";
$sql .= "order by ";
$sql .= "e.extension asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$extensions = $database->select($sql, $parameters);
//store extension status by user uuid
if (isset($extensions)) {
foreach($extensions as &$row) {
if ($row['user_uuid'] != '') {
$ext_user_status[$row['user_uuid']] = $row['user_status'];
unset($row['user_status']);
}
}
}
//send the command
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$switch_result = event_socket_request($fp, 'api show channels as json');
$json_array = json_decode($switch_result, true);
}
//build the response
$x = 0;
if (isset($extensions)) {
foreach($extensions as &$row) {
$user = $row['extension'];
if (strlen($row['number_alias']) >0 ) {
$user = $row['number_alias'];
}
//add the extension details
$array[$x] = $row;
//set the call detail defaults
$array[$x]["uuid"] = null;
$array[$x]["direction"] = null;
$array[$x]["created"] = null;
$array[$x]["created_epoch"] = null;
$array[$x]["name"] = null;
$array[$x]["state"] = null;
$array[$x]["cid_name"] = null;
$array[$x]["cid_num"] = null;
$array[$x]["ip_addr"] = null;
$array[$x]["dest"] = null;
$array[$x]["application"] = null;
$array[$x]["application_data"] = null;
$array[$x]["dialplan"] = null;
$array[$x]["context"] = null;
$array[$x]["read_codec"] = null;
$array[$x]["read_rate"] = null;
$array[$x]["read_bit_rate"] = null;
$array[$x]["write_codec"] = null;
$array[$x]["write_rate"] = null;
$array[$x]["write_bit_rate"] = null;
$array[$x]["secure"] = null;
$array[$x]["hostname"] = null;
$array[$x]["presence_id"] = null;
$array[$x]["presence_data"] = null;
$array[$x]["callstate"] = null;
$array[$x]["callee_name"] = null;
$array[$x]["callee_num"] = null;
$array[$x]["callee_direction"] = null;
$array[$x]["call_uuid"] = null;
$array[$x]["sent_callee_name"] = null;
$array[$x]["sent_callee_num"] = null;
$array[$x]["destination"] = null;
//add the active call details
$found = false;
if (isset($json_array['rows'])) {
foreach($json_array['rows'] as &$field) {
$presence_id = $field['presence_id'];
$presence = explode("@", $presence_id);
$presence_id = $presence[0];
$presence_domain = $presence[1];
if ($user == $presence_id) {
if ($presence_domain == $_SESSION['domain_name']) {
$found = true;
break;
}
}
}
}
//normalize the array
if ($found) {
$array[$x]["uuid"] = $field['uuid'];
$array[$x]["direction"] = $field['direction'];
$array[$x]["created"] = $field['created'];
$array[$x]["created_epoch"] = $field['created_epoch'];
$array[$x]["name"] = $field['name'];
$array[$x]["state"] = $field['state'];
$array[$x]["cid_name"] = $field['cid_name'];
$array[$x]["cid_num"] = $field['cid_num'];
$array[$x]["ip_addr"] = $field['ip_addr'];
$array[$x]["dest"] = $field['dest'];
$array[$x]["application"] = $field['application'];
$array[$x]["application_data"] = $field['application_data'];
$array[$x]["dialplan"] = $field['dialplan'];
$array[$x]["context"] = $field['context'];
$array[$x]["read_codec"] = $field['read_codec'];
$array[$x]["read_rate"] = $field['read_rate'];
$array[$x]["read_bit_rate"] = $field['read_bit_rate'];
$array[$x]["write_codec"] = $field['write_codec'];
$array[$x]["write_rate"] = $field['write_rate'];
$array[$x]["write_bit_rate"] = $field['write_bit_rate'];
$array[$x]["secure"] = $field['secure'];
$array[$x]["hostname"] = $field['hostname'];
$array[$x]["presence_id"] = $field['presence_id'];
$array[$x]["presence_data"] = $field['presence_data'];
$array[$x]["callstate"] = $field['callstate'];
$array[$x]["callee_name"] = $field['callee_name'];
$array[$x]["callee_num"] = $field['callee_num'];
$array[$x]["callee_direction"] = $field['callee_direction'];
$array[$x]["call_uuid"] = $field['call_uuid'];
$array[$x]["sent_callee_name"] = $field['sent_callee_name'];
$array[$x]["sent_callee_num"] = $field['sent_callee_num'];
$array[$x]["destination"] = $user;
//calculate and set the call length
$call_length_seconds = time() - $array[$x]["created_epoch"];
$call_length_hour = floor($call_length_seconds/3600);
$call_length_min = floor($call_length_seconds/60 - ($call_length_hour * 60));
$call_length_sec = $call_length_seconds - (($call_length_hour * 3600) + ($call_length_min * 60));
$call_length_min = sprintf("%02d", $call_length_min);
$call_length_sec = sprintf("%02d", $call_length_sec);
$call_length = $call_length_hour.':'.$call_length_min.':'.$call_length_sec;
$array[$x]['call_length'] = $call_length;
//send the command
if ($field['state'] != '') {
if ($fp) {
if (is_uuid($field['uuid'])) {
$switch_cmd = 'uuid_dump '.$field['uuid'].' json';
$dump_result = event_socket_request($fp, 'api '.$switch_cmd);
$dump_array = json_decode($dump_result, true);
if (is_array($dump_array)) {
foreach ($dump_array as $dump_var_name => $dump_var_value) {
$array[$x][$dump_var_name] = $dump_var_value;
}
}
}
}
}
}
//increment the row
$x++;
}
}
//reindex array using extension instead of auto-incremented value
$result = array();
if (is_array($array)) {
foreach ($array as $index => $subarray) {
$extension = $subarray['extension'];
if (is_array($subarray)) foreach ($subarray as $field => $value) {
$result[$extension][$field] = $array[$index][$field];
unset($array[$index][$field]);
}
unset($array[$subarray['extension']]['extension']);
unset($array[$index]);
}
}
//return array
return $result;
}
}
}
?>

View File

@ -0,0 +1,678 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2022
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('operator_panel_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get(null,'app/basic_operator_panel');
//get the call activity
$operator_panel = new basic_operator_panel;
$activity = $operator_panel->call_activity();
if (is_array($activity)) {
foreach ($activity as $extension => $fields) {
if (substr_count($fields['call_group'], ',')) {
$tmp = explode(',', $fields['call_group']);
if (is_array($tmp)) foreach ($tmp as $tmp_index => $tmp_value) {
if (trim($tmp_value) == '') { unset($tmp[$tmp_index]); }
else { $groups[] = $tmp_value; }
}
}
else if ($fields['call_group'] != '') {
$groups[] = $fields['call_group'];
}
}
}
if (is_array($groups)) {
$groups = array_unique($groups);
sort($groups);
}
//get the valet info
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$valet_info = event_socket_request($fp, 'api valet_info park@'.$_SESSION['domain_name']);
//get an array of the valet call uuid and park numbers
if (isset($valet_info)) {
preg_match_all('/<extension uuid=\"(.*?)\">(.*?)<\/extension>/s', $valet_info, $valet_matches, PREG_SET_ORDER);
//view_array($valet_matches, false);
}
//view_array($valet_matches, false);
//unset($_SESSION['valet']);
foreach($valet_matches as $row) {
if (!isset($_SESSION['valet']['uuid']['caller_id_name'])) {
$_SESSION['valet'][$row[1]]['caller_id_name'] = event_socket_request($fp, 'api uuid_getvar '.$row[1].' caller_id_name');
}
if (!isset($_SESSION['valet']['uuid']['caller_id_number'])) {
$_SESSION['valet'][$row[1]]['caller_id_number'] = event_socket_request($fp, 'api uuid_getvar '.$row[1].' caller_id_number');
}
}
//unset the array
//view_array($_SESSION['valet']);
//reformat the array and add the caller ID name and numbers
$x = 0;
foreach($valet_matches as $row) {
$valet_array[$x]['uuid'] = $row[1];
$valet_array[$x]['extension'] = $row[2];
if (isset($_SESSION['valet'][$row[1]]['caller_id_name'])) {
$valet_array[$x]['caller_id_name'] = $_SESSION['valet'][$row[1]]['caller_id_name'];
}
if (isset($_SESSION['valet'][$row[1]]['caller_id_number'])) {
$valet_array[$x]['caller_id_number'] = $_SESSION['valet'][$row[1]]['caller_id_number'];
}
$x++;
}
//view_array($valet, false);
}
//prevent warnings
if (!is_array($_SESSION['user']['extensions'])) {
$_SESSION['user']['extensions'] = array();
}
//get registrations -- All SIP profiles
$obj = new registrations;
$registrations = $obj->get("all");
//set the onhover paush refresh
$onhover_pause_refresh = " onmouseover='refresh_stop();' onmouseout='refresh_start();'";
echo "<table width='100%'>\n";
echo " <tr>\n";
echo " <td valign='top' align='left' width='50%' nowrap>\n";
echo " <b>".$text['title-operator_panel']."</b>\n";
echo " </td>\n";
echo " <td valign='top' align='center' nowrap>\n";
if (permission_exists("user_setting_edit") && sizeof($_SESSION['user']['extensions']) > 0) {
$status_options[1]['status'] = "Available";
$status_options[1]['label'] = $text['label-status_available'];
$status_options[1]['style'] = "op_btn_status_available";
if (permission_exists('operator_panel_on_demand')) {
$status_options[2]['status'] = "Available (On Demand)";
$status_options[2]['label'] = $text['label-status_on_demand'];
$status_options[2]['style'] = "op_btn_status_available_on_demand";
}
$status_options[3]['status'] = "On Break";
$status_options[3]['label'] = $text['label-status_on_break'];
$status_options[3]['style'] = "op_btn_status_on_break";
$status_options[4]['status'] = "Do Not Disturb";
$status_options[4]['label'] = $text['label-status_do_not_disturb'];
$status_options[4]['style'] = "op_btn_status_do_not_disturb";
$status_options[5]['status'] = "Logged Out";
$status_options[5]['label'] = $text['label-status_logged_out'];
$status_options[5]['style'] = "op_btn_status_logged_out";
if (is_array($status_options)) foreach ($status_options as $status_option) {
echo " <input type='button' id='".$status_option['style']."' class='btn' value=\"".$status_option['label']."\" onclick=\"send_cmd('index.php?status='+escape('".$status_option['status']."')); this.disabled='disabled'; refresh_start();\" ".$onhover_pause_refresh.">\n";
}
}
echo " </td>\n";
echo " <td valign='top' align='right' width='50%' nowrap>\n";
echo " <table cellpadding='0' cellspacing='0' border='0'>\n";
echo " <tr>\n";
echo " <td valign='middle' nowrap='nowrap' style='padding-right: 15px' id='refresh_state'>\n";
echo " <img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick='refresh_stop();' alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\">\n";
echo " </td>\n";
if (permission_exists('operator_panel_eavesdrop')) {
echo " <td valign='top' nowrap='nowrap'>\n";
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 " <img src='resources/images/eavesdrop.png' style='width: 12px; height: 12px; border: none; margin: 0px 5px; cursor: help;' title='".$text['description-eavesdrop_destination']."' align='absmiddle'>\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";
}
echo " </td>\n";
}
if (is_array($groups) && @sizeof($groups) > 0) {
echo " <td valign='top' nowrap='nowrap'>\n";
echo " <input type='hidden' id='group' value=\"".escape($_REQUEST['group'])."\">\n";
if (sizeof($groups) > 5) {
//show select box
echo " <select class='formfld' onchange=\"document.getElementById('group').value = this.options[this.selectedIndex].value; refresh_start();\" onfocus='refresh_stop();'>\n";
echo " <option value='' ".(($_REQUEST['group'] == '') ? "selected" : null).">".$text['label-call_group']."</option>\n";
echo " <option value=''>".$text['button-all']."</option>\n";
if (is_array($groups)) foreach ($groups as $group) {
echo " <option value='".escape($group)."' ".(($_REQUEST['group'] == $group) ? "selected" : null).">".escape($group)."</option>\n";
}
echo " </select>\n";
}
else {
//show buttons
echo " <input type='button' class='btn' title=\"".$text['label-call_group']."\" value=\"".$text['button-all']."\" onclick=\"document.getElementById('group').value = '';\" ".$onhover_pause_refresh.">\n";
if (is_array($groups)) foreach ($groups as $group) {
echo " <input type='button' class='btn' title=\"".$text['label-call_group']."\" value=\"".escape($group)."\" ".(($_REQUEST['group'] == $group) ? "disabled='disabled'" : null)." onclick=\"document.getElementById('group').value = this.value;\" ".$onhover_pause_refresh.">\n";
}
}
echo " </td>\n";
}
echo " <td valign='top' nowrap='nowrap'>\n";
echo " <input type='hidden' id='extension_filter' value=\"".escape($_REQUEST['extension_filter'])."\">\n";
echo " <input type='hidden' id='name_filter' value=\"".strtolower(escape($_REQUEST['name_filter']))."\">\n";
echo " <input type='text' class='formfld' placeholder='Filter Extension' value=\"".escape($_REQUEST['extension_filter'])."\" onkeyup=\"document.getElementById('extension_filter').value = this.value; refresh_start();\" onfocus='refresh_stop();'>\n";
echo " <input type='text' class='formfld' placeholder='Filter Name' value=\"".strtolower(escape($_REQUEST['name_filter']))."\" onkeyup=\"document.getElementById('name_filter').value = this.value; refresh_start();\" onfocus='refresh_stop();'>\n";
echo " <input type='button' class='btn' title=\"Clear\" value=\"Clear\" onclick=\"document.getElementById('extension_filter').value = ''; document.getElementById('name_filter').value = '';\" ".$onhover_pause_refresh.">\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<br>\n";
//define the arrays to ensure no errors are omitted below with the sizeof operators
$user_extensions = array();
$grouped_extensions = array();
$other_extensions = array();
//loop through the array
if (is_array($activity)) {
foreach ($activity as $extension => $ext) {
unset($block);
//filter by group, if defined
if ($_REQUEST['group'] != '' && substr_count($ext['call_group'], $_REQUEST['group']) == 0 && !in_array($extension, $_SESSION['user']['extensions'])) { continue; }
//filter by extension or name, if defined
if ($_REQUEST['extension_filter'] != '' && substr_count($ext['extension'], $_REQUEST['extension_filter']) == 0 && !in_array($extension, $_SESSION['user']['extensions'])) { continue; }
if ($_REQUEST['name_filter'] != '' && substr_count($ext['filter_name'], $_REQUEST['name_filter']) == 0 && !in_array($extension, $_SESSION['user']['extensions'])) { continue; }
//check if feature code being called
$format_number = (substr($ext['dest'], 0, 1) == '*') ? false : true;
//determine extension state, direction icon, and displayed name/number for caller/callee
if ($ext['state'] == 'CS_EXECUTE') {
if (($ext['callstate'] == 'RINGING' || $ext['callstate'] == 'EARLY' || $ext['callstate'] == 'RING_WAIT') && $ext['direction'] == 'inbound') {
$ext_state = 'ringing';
}
else if ($ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'outbound') {
$ext_state = 'active';
}
else if ($ext['callstate'] == 'HELD' && $ext['direction'] == 'outbound') {
$ext_state = 'held';
}
else if ($ext['callstate'] == 'RING_WAIT' && $ext['direction'] == 'outbound') {
$ext_state = 'ringing';
}
else if ($ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'inbound') {
$ext_state = 'active';
}
else if ($ext['callstate'] == 'HELD' && $ext['direction'] == 'inbound') {
$ext_state = 'held';
}
if (!$format_number) {
$call_name = 'System';
$call_number = $ext['dest'];
}
else {
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
$call_number = format_phone($ext['dest']);
}
$dir_icon = 'outbound';
}
else if ($ext['state'] == 'CS_HIBERNATE') {
if ($ext['callstate'] == 'ACTIVE') {
$ext_state = 'active';
if ($ext['direction'] == 'inbound') {
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
$call_number = format_phone($ext['dest']);
$dir_icon = 'outbound';
}
else if ($ext['direction'] == 'outbound') {
$call_name = $activity[$ext['cid_num']]['effective_caller_id_name'];
$call_number = format_phone($ext['cid_num']);
$dir_icon = 'inbound';
}
}
}
else if ($ext['state'] == 'CS_EXCHANGE_MEDIA' && $ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'inbound') {
//valet park
$ext_state = 'active';
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
$call_number = format_phone($ext['dest']);
}
else if ($ext['state'] == 'CS_SOFT_EXECUTE' && $ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'outbound') {
//valet park
$ext_state = 'active';
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
$call_number = format_phone($ext['dest']);
}
else if ($ext['state'] == 'CS_CONSUME_MEDIA' || $ext['state'] == 'CS_EXCHANGE_MEDIA') {
if ($ext['state'] == 'CS_CONSUME_MEDIA' && $ext['callstate'] == 'RINGING' && $ext['direction'] == 'outbound') {
$ext_state = 'ringing';
}
else if ($ext['state'] == 'CS_EXCHANGE_MEDIA' && $ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'outbound') {
$ext_state = 'active';
}
else if ($ext['state'] == 'CS_EXCHANGE_MEDIA' && $ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'outbound') {
$ext_state = 'active';
}
else if ($ext['state'] == 'CS_CONSUME_MEDIA' && $ext['callstate'] == 'HELD' && $ext['direction'] == 'outbound') {
$ext_state = 'held';
}
else if ($ext['state'] == 'CS_EXCHANGE_MEDIA' && $ext['callstate'] == 'HELD' && $ext['direction'] == 'outbound') {
$ext_state = 'held';
}
$dir_icon = 'inbound';
$call_name = $activity[$ext['cid_num']]['effective_caller_id_name'];
$call_number = format_phone($ext['cid_num']);
}
else {
unset($ext_state, $dir_icon, $call_name, $call_number);
}
//determin extension register status
$extension_number = $extension.'@'.$_SESSION['domain_name'];
$found_count = 0;
if (is_array($registrations)) {
foreach ($registrations as $array) {
if ($extension_number == $array['user']) {
$found_count++;
}
}
}
if ($found_count > 0) {
//determine block style by state (if any) and register status
$style = ($ext_state != '') ? "op_ext op_state_".$ext_state : "op_ext";
} else {
$style = "off_ext";
}
unset($extension_number, $found_count, $array);
//determine the call identifier passed on drop
if ($ext['uuid'] == $ext['call_uuid'] && $ext['variable_bridge_uuid'] == '') { // transfer an outbound internal call
$call_identifier = $activity[$call_number]['uuid'];
}
else if (($ext['variable_call_direction'] == 'outbound' || $ext['variable_call_direction'] == 'local') && $ext['variable_bridge_uuid'] != '') { // transfer an outbound external call
$call_identifier = $ext['variable_bridge_uuid'];
}
else {
if( $ext['call_uuid'] ) {
$call_identifier = $ext['call_uuid']; // transfer all other call types
}
else {
$call_identifier = $ext['uuid']; // e.g. voice menus
}
}
//determine extension draggable state
if (permission_exists('operator_panel_manage')) {
if (!in_array($extension, $_SESSION['user']['extensions'])) {
//other extension
if ($ext_state == "ringing") {
if ($_GET['vd_ext_from'] == '' && $dir_icon == 'inbound') {
$draggable = true; // selectable - is ringing and not outbound so can transfer away the call (can set as vd_ext_from)
}
else {
$draggable = false; // unselectable - is ringing so can't send a call to the ext (can't set as vd_ext_to)
}
}
else if ($ext_state == 'active') {
$draggable = false; // unselectable - on a call already so can't transfer or send a call to the ext (can't set as vd_ext_from or vd_ext_to)
}
else { // idle
if ($_GET['vd_ext_from'] == '') {
$draggable = false; // unselectable - is idle, but can't initiate a call from the ext as is not assigned to user (can't set as vd_ext_from)
}
else {
$draggable = true; // selectable - is idle, so can transfer a call in to ext (can set as vd_ext_to).
}
}
}
else {
//user extension
if ($ext['uuid'] != '' && $ext['uuid'] == $ext['call_uuid'] && $ext['variable_bridge_uuid'] == '') {
$draggable = false;
}
else if ($ext_state == 'ringing' && $ext['variable_call_direction'] == 'local') {
$draggable = false;
}
else if ($ext_state != '' && !$format_number) {
$draggable = false;
}
else {
$draggable = true;
}
}
}
else {
$draggable = false;
}
//determine extension (user) status
$ext_status = (in_array($extension, $_SESSION['user']['extensions'])) ? $ext_user_status[$_SESSION['user_uuid']] : $ext_user_status[$ext['user_uuid']];
switch ($ext_status) {
case "Available" :
$status_icon = "available";
$status_hover = $text['label-status_available'];
break;
case "Available (On Demand)" :
$status_icon = "available_on_demand";
$status_hover = $text['label-status_available_on_demand'];
break;
case "On Break" :
$status_icon = "on_break";
$status_hover = $text['label-status_on_break'];
break;
case "Do Not Disturb" :
$status_icon = "do_not_disturb";
$status_hover = $text['label-status_do_not_disturb'];
break;
default :
$status_icon = "logged_out";
$status_hover = $text['label-status_logged_out_or_unknown'];
}
//build the list of extensions
$block .= "<div id='".escape($extension)."' class='".$style."' ".(($_GET['vd_ext_from'] == $extension || $_GET['vd_ext_to'] == $extension) ? "style='border-style: dotted;'" : null)." ".(($ext_state != 'active' && $ext_state != 'ringing') ? "ondrop='drop(event, this.id);' ondragover='allowDrop(event, this.id);' ondragleave='discardDrop(event, this.id);'" : null).">"; // DRAG TO
$block .= "<table class='".$style."'>\n";
$block .= " <tr>\n";
$block .= " <td class='op_ext_icon'>\n";
$block .= " <span name='".escape($extension)."'>\n"; // DRAG FROM
$block .= "<img id='".escape($call_identifier)."' class='op_ext_icon' src='resources/images/status_".$status_icon.".png' title='".$status_hover."' ".(($draggable) ? "draggable='true' ondragstart=\"drag(event, this.parentNode.getAttribute('name'));\" onclick=\"virtual_drag('".escape($call_identifier)."', '".escape($extension)."');\"" : "onfocus='this.blur();' draggable='false' style='cursor: not-allowed;'").">\n";
$block .= "</span>\n";
$block .= " </td>\n";
$block .= " <td class='op_ext_info ".$style."'>\n";
if ($dir_icon != '') {
$block .= " <img src='resources/images/".$dir_icon.".png' align='right' style='margin-top: 3px; margin-right: 1px; width: 12px; height: 12px; cursor: help;' draggable='false' alt=\"".$text['label-call_direction']."\" title=\"".$text['label-call_direction']."\">\n";
}
$block .= " <span class='op_user_info'>\n";
if ($ext['effective_caller_id_name'] != '' && escape($ext['effective_caller_id_name']) != $extension) {
$block .= " <strong class='strong'>".escape($ext['effective_caller_id_name'])."</strong> (".escape($extension).")\n";
}
else {
$block .= " <strong class='strong'>".escape($extension)."</strong>\n";
}
$block .= " </span><br>\n";
if ($ext_state != '') {
$block .= " <span class='op_caller_info'>\n";
$block .= " <table align='right'><tr><td style='text-align: right;'>\n";
$block .= " <span class='op_call_info'>".escape($ext['call_length'])."</span><br>\n";
$block .= " <span class='call_control'>\n";
//record
if (permission_exists('operator_panel_record') && $ext_state == 'active') {
$call_identifier_record = $ext['call_uuid'];
$rec_file = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".date("Y")."/".date("M")."/".date("d")."/".escape($call_identifier_record).".wav";
if (file_exists($rec_file)) {
$block .= "<img src='resources/images/recording.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: help;' title=\"".$text['label-recording']."\" ".$onhover_pause_refresh.">\n";
}
else {
$block .= "<img src='resources/images/record.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' title=\"".$text['label-record']."\" onclick=\"record_call('".$call_identifier_record."');\" ".$onhover_pause_refresh.">\n";
}
}
//eavesdrop
if (permission_exists('operator_panel_eavesdrop') && $ext_state == 'active' && sizeof($_SESSION['user']['extensions']) > 0 && !in_array($extension, $_SESSION['user']['extensions'])) {
$block .= "<img src='resources/images/eavesdrop.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' title='".$text['label-eavesdrop']."' onclick=\"eavesdrop_call('".escape($ext['destination'])."','".escape($call_identifier)."');\" ".$onhover_pause_refresh.">\n";
}
//hangup
if (permission_exists('operator_panel_hangup') || in_array($extension, $_SESSION['user']['extensions'])) {
if ($ext['variable_bridge_uuid'] == '' && $ext_state == 'ringing') {
$call_identifier_hangup_uuid = $ext['uuid'];
}
else if ($dir_icon == 'outbound') {
$call_identifier_hangup_uuid = $ext['uuid'];
}
else {
$call_identifier_hangup_uuid = $call_identifier;
}
$block .= "<img src='resources/images/kill.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' title='".$text['label-hangup']."' onclick=\"hangup_call('".escape($call_identifier_hangup_uuid)."');\" ".$onhover_pause_refresh.">\n";
}
$block .= "</span>\n";
//transfer
if (in_array($extension, $_SESSION['user']['extensions']) && $ext_state == 'active') {
$block .= "<img id='destination_control_".escape($extension)."_transfer' class='destination_control' src='resources/images/keypad_transfer.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' onclick=\"toggle_destination('".escape($extension)."', 'transfer');\" ".$onhover_pause_refresh.">\n";
}
$block .= " </td></tr></table>\n";
if (permission_exists('operator_panel_call_details')) {
$block .= " <span id='op_caller_details_".escape($extension)."'><strong>".escape($call_name)."</strong><br>".escape($call_number)."</span>\n";
}
$block .= " </span>\n";
//transfer
if (in_array($extension, $_SESSION['user']['extensions']) && $ext_state == 'active') {
$call_identifier_transfer = $ext['variable_bridge_uuid'];
$block .= " <form id='frm_destination_".escape($extension)."_transfer' onsubmit=\"go_destination('".escape($extension)."', document.getElementById('destination_".escape($extension)."_transfer').value, 'transfer', '".escape($call_identifier_transfer)."'); return false;\">\n";
$block .= " <input type='text' class='formfld' id='destination_".escape($extension)."_transfer' style='width: 100px; min-width: 100px; max-width: 100px; margin-top: 3px; text-align: center; display: none;' onblur=\"toggle_destination('".escape($extension)."', 'transfer');\">\n";
$block .= " </form>\n";
}
}
else {
//call
if (in_array($extension, $_SESSION['user']['extensions'])) {
$block .= " <img id='destination_control_".escape($extension)."_call' class='destination_control' src='resources/images/keypad_call.png' style='width: 12px; height: 12px; border: none; margin-top: 26px; margin-right: 1px; cursor: pointer;' align='right' onclick=\"toggle_destination('".escape($extension)."', 'call');\" ".$onhover_pause_refresh.">\n";
$block .= " <form id='frm_destination_".escape($extension)."_call' onsubmit=\"go_destination('".escape($extension)."', document.getElementById('destination_".escape($extension)."_call').value, 'call'); return false;\">\n";
$block .= " <input type='text' class='formfld' id='destination_".escape($extension)."_call' style='width: 100px; min-width: 100px; max-width: 100px; margin-top: 10px; text-align: center; display: none;' onblur=\"toggle_destination('".escape($extension)."', 'call');\">\n";
$block .= " </form>\n";
}
}
$block .= " </td>\n";
$block .= " </tr>\n";
$block .= "</table>\n";
if (if_group("superadmin") && isset($_GET['debug'])) {
$block .= "<span style='font-size: 10px;'>\n";
$block .= "From ID<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: maroon'>".escape($extension)."</strong><br>\n";
$block .= "uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['uuid'] ? 'blue' : 'black').";'>".escape($ext['uuid'])."</strong><br>\n";
$block .= "call_uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['call_uuid'] ? 'blue' : 'black').";'>".escape($ext['call_uuid'])."</strong><br>\n";
$block .= "variable_bridge_uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['variable_bridge_uuid'] ? 'blue' : 'black').";'>".escape($ext['variable_bridge_uuid'])."</strong><br>\n";
$block .= "direction<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['direction'])."</strong><br>\n";
$block .= "variable_call_direction<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['variable_call_direction'])."</strong><br>\n";
$block .= "state<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['state'])."</strong><br>\n";
$block .= "cid_num<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['cid_num'])."</strong><br>\n";
$block .= "dest<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['dest'])."</strong><br>\n";
$block .= "context<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['context'])."</strong><br>\n";
$block .= "presence_id<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['presence_id'])."</strong><br>\n";
$block .= "callstate<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['callstate'])."</strong><br>\n";
$block .= "</span>\n";
}
$block .= "</div>\n";
if (in_array($extension, $_SESSION['user']['extensions'])) {
$user_extensions[] = $block;
} elseif (!empty($ext['call_group']) && filter_var($_SESSION['operator_panel']['group_extensions']['boolean'], FILTER_VALIDATE_BOOLEAN)) {
$grouped_extensions[$ext['call_group']][] = $block;
} else {
$other_extensions[] = $block;
}
}
}
if (sizeof($user_extensions) > 0) {
echo "<table width='100%'><tr><td>\n";
if (is_array($user_extensions)) {
foreach ($user_extensions as $ext_block) {
echo $ext_block;
}
}
foreach($valet_array as $row) {
$extension = $row['extension'];
$ext_state = 'active';
$style = "op_ext op_valet_park_active";
$draggable = false;
//build the list of park extensions
$valet_block .= "<div id='".escape($extension)."' class='".$style."' ".(($_GET['vd_ext_from'] == $extension || $_GET['vd_ext_to'] == $extension) ? "style='border-style: dotted;'" : null)." ondrop='drop(event, this.id);' ondragover='allowDrop(event, this.id);' ondragleave='discardDrop(event, this.id);'>\n"; // DRAG TO
$valet_block .= "<table class='".$style."'>\n";
$valet_block .= " <tr>\n";
$valet_block .= " <td class='op_ext_icon'>\n";
$valet_block .= " <span name='".escape($extension)."'>"; // DRAG FROM
$valet_block .= "<img id='".escape($call_identifier)."' class='op_ext_icon' src='resources/images/status_".$status_icon.".png' title='".$status_hover."' ".(($draggable) ? "draggable='true' ondragstart=\"drag(event, this.parentNode.getAttribute('name'));\" onclick=\"virtual_drag('".escape($call_identifier)."', '".escape($extension)."');\"" : "onfocus='this.blur();' draggable='false' style='cursor: not-allowed;'").">\n";
$valet_block .= "</span>\n";
$valet_block .= " </td>\n";
$valet_block .= " <td class='op_ext_info ".$style."'>\n";
if ($dir_icon != '') {
$valet_block .= " <img src='resources/images/".$dir_icon.".png' align='right' style='margin-top: 3px; margin-right: 1px; width: 12px; height: 12px; cursor: help;' draggable='false' alt=\"".$text['label-call_direction']."\" title=\"".$text['label-call_direction']."\">\n";
}
$valet_block .= " <span class='op_user_info'>\n";
//$valet_block .= " <strong class='strong'>".escape($extension)."</strong>";
$valet_block .= " <strong class='strong'>Park </strong> (".escape($extension).")\n";
$valet_block .= " </span><br>\n";
//if ($ext_state != '') {
$valet_block .= " <span class='op_caller_info'>\n";
$valet_block .= " <table align='right'><tr><td style='text-align: right;'>\n";
$valet_block .= " <span class='op_call_info'>".escape($ext['call_length'])."</span><br>\n";
$valet_block .= " <span class='call_control'>\n";
$call_identifier_record = $ext['call_uuid'];
$valet_block .= "</span>\n";
//transfer
//if (in_array($extension, $_SESSION['user']['extensions']) && $ext_state == 'active') {
// $valet_block .= "<img id='destination_control_".escape($extension)."_transfer' class='destination_control' src='resources/images/keypad_transfer.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' onclick=\"toggle_destination('".escape($extension)."', 'transfer');\" ".$onhover_pause_refresh.">";
//}
$valet_block .= " </td></tr></table>\n";
if (permission_exists('operator_panel_call_details')) {
$valet_block .= " <span id='op_caller_details_".escape($extension)."'><strong>".escape($row['caller_id_name'])."</strong><br>".escape($row['caller_id_number'])."</span>\n";
}
$valet_block .= " </span>\n";
//transfer
//if (in_array($extension, $_SESSION['user']['extensions']) && $ext_state == 'active') {
$call_identifier_transfer = $ext['variable_bridge_uuid'];
$valet_block .= " <form id='frm_destination_".escape($extension)."_transfer' onsubmit=\"go_destination('".escape($extension)."', document.getElementById('destination_".escape($extension)."_transfer').value, 'transfer', '".escape($call_identifier_transfer)."'); return false;\">\n";
$valet_block .= " <input type='text' class='formfld' id='destination_".escape($extension)."_transfer' style='width: 100px; min-width: 100px; max-width: 100px; margin-top: 3px; text-align: center; display: none;' onblur=\"toggle_destination('".escape($extension)."', 'transfer');\">\n";
$valet_block .= " </form>\n";
//}
//}
//else {
// //call
// if (in_array($extension, $_SESSION['user']['extensions'])) {
// $valet_block .= " <img id='destination_control_".escape($extension)."_call' class='destination_control' src='resources/images/keypad_call.png' style='width: 12px; height: 12px; border: none; margin-top: 26px; margin-right: 1px; cursor: pointer;' align='right' onclick=\"toggle_destination('".escape($extension)."', 'call');\" ".$onhover_pause_refresh.">";
// $valet_block .= " <form id='frm_destination_".escape($extension)."_call' onsubmit=\"go_destination('".escape($extension)."', document.getElementById('destination_".escape($extension)."_call').value, 'call'); return false;\">";
// $valet_block .= " <input type='text' class='formfld' id='destination_".escape($extension)."_call' style='width: 100px; min-width: 100px; max-width: 100px; margin-top: 10px; text-align: center; display: none;' onblur=\"toggle_destination('".escape($extension)."', 'call');\">";
// $valet_block .= " </form>\n";
// }
//}
$valet_block .= " </td>\n";
$valet_block .= " </tr>\n";
$valet_block .= "</table>\n";
if (if_group("superadmin") && isset($_GET['debug'])) {
$valet_block .= "<span style='font-size: 10px;'>\n";
$valet_block .= "From ID<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: maroon'>".escape($extension)."</strong><br>\n";
$valet_block .= "uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['uuid'] ? 'blue' : 'black').";'>".escape($ext['uuid'])."</strong><br>\n";
$valet_block .= "call_uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['call_uuid'] ? 'blue' : 'black').";'>".escape($ext['call_uuid'])."</strong><br>\n";
$valet_block .= "variable_bridge_uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['variable_bridge_uuid'] ? 'blue' : 'black').";'>".escape($ext['variable_bridge_uuid'])."</strong><br>\n";
$valet_block .= "direction<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['direction'])."</strong><br>\n";
$valet_block .= "variable_call_direction<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['variable_call_direction'])."</strong><br>\n";
$valet_block .= "state<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['state'])."</strong><br>\n";
$valet_block .= "cid_num<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['cid_num'])."</strong><br>\n";
$valet_block .= "dest<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['dest'])."</strong><br>\n";
$valet_block .= "context<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['context'])."</strong><br>\n";
$valet_block .= "presence_id<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['presence_id'])."</strong><br>\n";
$valet_block .= "callstate<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['callstate'])."</strong><br>\n";
$valet_block .= "</span>\n";
}
$valet_block .= "</div>\n";
echo $valet_block;
unset($valet_block);
}
echo "</td></tr></table><br>\n";
}
//loop throug each group
if (sizeof($grouped_extensions) > 0) {
//alphabetical order
ksort($grouped_extensions);
//loop through the groups
foreach ($grouped_extensions as $group => $extensions) {
echo "<div class=\"heading\"><strong>".ucwords(escape($group))."</strong></div>\n";
echo "<br><br>\n";
echo "<table width='100%'><tr><td>\n";
foreach ($extensions as $ext_block) {
echo $ext_block;
}
echo "</td></tr></table><br>\n";
}
}
//show the other extensions
if (sizeof($other_extensions) > 0) {
echo "<div class=\"heading\"><strong>".$text['label-other_extensions']."</strong></div>\n";
echo "<br><br>\n";
echo "<table width='100%'><tr><td>\n";
foreach ($other_extensions as $ext_block) {
echo $ext_block;
}
echo "</td></tr></table>\n";
}
//no extensions found
if (sizeof($other_extensions) + sizeof($grouped_extensions) < 1) {
echo $text['label-no_extensions_found'];
}
echo "<br><br>\n";
/*
if (if_group("superadmin") && isset($_GET['debug'])) {
echo '$activity<br>';
echo "<textarea style='width: 100%; height: 600px; overflow: scroll;' onfocus='refresh_stop();' onblur='refresh_start();'>";
print_r($activity);
echo "</textarea>";
echo "<br><br>";
echo '$_SESSION<br>';
echo "<textarea style='width: 100%; height: 600px; overflow: scroll;' onfocus='refresh_stop();' onblur='refresh_start();'>";
print_r($_SESSION);
echo "</textarea>";
}
*/
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,90 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,90 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,97 @@
<?php
//application details
$apps[$x]['name'] = 'Bridges';
$apps[$x]['uuid'] = 'a6a7c4c5-340a-43ce-bcbc-2ed9bab8659d';
$apps[$x]['category'] = '';
$apps[$x]['subcategory'] = '';
$apps[$x]['version'] = '';
$apps[$x]['license'] = 'Mozilla Public License 1.1';
$apps[$x]['url'] = 'http://www.fusionpbx.com';
$apps[$x]['description']['en-us'] = '';
$apps[$x]['description']['en-gb'] = '';
//permission details
$y = 0;
$apps[$x]['permissions'][$y]['name'] = 'bridge_view';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'bridge_add';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'bridge_edit';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'bridge_delete';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'bridge_all';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'bridge_destinations';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
//destination details
$y = 0;
$apps[$x]['destinations'][$y]['type'] = "sql";
$apps[$x]['destinations'][$y]['label'] = "bridges";
$apps[$x]['destinations'][$y]['name'] = "bridges";
//$apps[$x]['destinations'][$y]['sql'] = "select bridge_name, bridge_destination, bridge_description from v_bridges ";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and bridge_enabled = 'true'";
$apps[$x]['destinations'][$y]['order_by'] = "bridge_name asc";
$apps[$x]['destinations'][$y]['field']['bridge_uuid'] = "bridge_uuid";
$apps[$x]['destinations'][$y]['field']['name'] = "bridge_name";
$apps[$x]['destinations'][$y]['field']['description'] = "bridge_description";
$apps[$x]['destinations'][$y]['field']['destination'] = "bridge_destination";
$apps[$x]['destinations'][$y]['select_value']['user_contact'] = "\${destination}";
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "bridge:\${destination}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:bridge \${destination}";
$apps[$x]['destinations'][$y]['select_label'] = "\${name} \${description} ";
$y++;
//Bridges
$y = 0;
$apps[$x]['db'][$y]['table']['name'] = 'v_bridges';
$apps[$x]['db'][$y]['table']['parent'] = '';
$z = 0;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the name.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_destination';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the destination.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_enabled';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select to enable or disable.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_description';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the description.';
$z++;
?>

View File

@ -0,0 +1,257 @@
<?php
//Bridges
$text['title-bridges']['en-us'] = 'Bridges';
$text['title-bridges']['en-gb'] = 'Bridges';
$text['title-bridges']['ar-eg'] = '';
$text['title-bridges']['de-at'] = '';
$text['title-bridges']['de-ch'] = '';
$text['title-bridges']['de-de'] = '';
$text['title-bridges']['es-cl'] = '';
$text['title-bridges']['es-mx'] = '';
$text['title-bridges']['fr-ca'] = 'Ponts';
$text['title-bridges']['fr-fr'] = 'Ponts';
$text['title-bridges']['he-il'] = '';
$text['title-bridges']['it-it'] = '';
$text['title-bridges']['nl-nl'] = 'Bruggen';
$text['title-bridges']['pl-pl'] = 'Mostki';
$text['title-bridges']['pt-br'] = '';
$text['title-bridges']['pt-pt'] = '';
$text['title-bridges']['ro-ro'] = '';
$text['title-bridges']['ru-ru'] = '';
$text['title-bridges']['sv-se'] = '';
$text['title-bridges']['uk-ua'] = '';
$text['title-bridge']['en-us'] = 'Bridge';
$text['title-bridge']['en-gb'] = 'Bridge';
$text['title-bridge']['ar-eg'] = '';
$text['title-bridge']['de-at'] = '';
$text['title-bridge']['de-ch'] = '';
$text['title-bridge']['de-de'] = '';
$text['title-bridge']['es-cl'] = '';
$text['title-bridge']['es-mx'] = '';
$text['title-bridge']['fr-ca'] = 'Pont';
$text['title-bridge']['fr-fr'] = 'Pont';
$text['title-bridge']['he-il'] = '';
$text['title-bridge']['it-it'] = '';
$text['title-bridge']['nl-nl'] = 'Brug';
$text['title-bridge']['pl-pl'] = 'Mostek';
$text['title-bridge']['pt-br'] = '';
$text['title-bridge']['pt-pt'] = '';
$text['title-bridge']['ro-ro'] = '';
$text['title-bridge']['ru-ru'] = '';
$text['title-bridge']['sv-se'] = '';
$text['title-bridge']['uk-ua'] = '';
$text['title_description-bridge']['en-us'] = 'Add bridge statements to destination select list.';
$text['title_description-bridge']['en-gb'] = 'Add bridge statements to destination select list.';
$text['title_description-bridge']['ar-eg'] = '';
$text['title_description-bridge']['de-at'] = '';
$text['title_description-bridge']['de-ch'] = '';
$text['title_description-bridge']['de-de'] = '';
$text['title_description-bridge']['es-cl'] = '';
$text['title_description-bridge']['es-mx'] = '';
$text['title_description-bridge']['fr-ca'] = 'Ajouter des déclarations de pont à la liste de sélection';
$text['title_description-bridge']['fr-fr'] = 'Ajouter des déclarations de pont à la liste de sélection';
$text['title_description-bridge']['he-il'] = '';
$text['title_description-bridge']['it-it'] = '';
$text['title_description-bridge']['nl-nl'] = 'Voeg brug opdrachten toe aan bestemmings lijst.';
$text['title_description-bridge']['pl-pl'] = 'Dodaj wyrażenia mostkowania do listy wyboru destynacji.';
$text['title_description-bridge']['pt-br'] = '';
$text['title_description-bridge']['pt-pt'] = '';
$text['title_description-bridge']['ro-ro'] = '';
$text['title_description-bridge']['ru-ru'] = '';
$text['title_description-bridge']['sv-se'] = '';
$text['title_description-bridge']['uk-ua'] = '';
$text['label-bridge_name']['en-us'] = 'Name';
$text['label-bridge_name']['en-gb'] = 'Name';
$text['label-bridge_name']['ar-eg'] = '';
$text['label-bridge_name']['de-at'] = '';
$text['label-bridge_name']['de-ch'] = '';
$text['label-bridge_name']['de-de'] = '';
$text['label-bridge_name']['es-cl'] = '';
$text['label-bridge_name']['es-mx'] = '';
$text['label-bridge_name']['fr-ca'] = 'Nom';
$text['label-bridge_name']['fr-fr'] = 'Nom';
$text['label-bridge_name']['he-il'] = '';
$text['label-bridge_name']['it-it'] = '';
$text['label-bridge_name']['nl-nl'] = 'Naam';
$text['label-bridge_name']['pl-pl'] = 'Nazwa';
$text['label-bridge_name']['pt-br'] = '';
$text['label-bridge_name']['pt-pt'] = '';
$text['label-bridge_name']['ro-ro'] = '';
$text['label-bridge_name']['ru-ru'] = '';
$text['label-bridge_name']['sv-se'] = '';
$text['label-bridge_name']['uk-ua'] = '';
$text['description-bridge_name']['en-us'] = 'Enter the name.';
$text['description-bridge_name']['en-gb'] = 'Enter the name.';
$text['description-bridge_name']['ar-eg'] = '';
$text['description-bridge_name']['de-at'] = '';
$text['description-bridge_name']['de-ch'] = '';
$text['description-bridge_name']['de-de'] = '';
$text['description-bridge_name']['es-cl'] = '';
$text['description-bridge_name']['es-mx'] = '';
$text['description-bridge_name']['fr-ca'] = 'Entrez le nom';
$text['description-bridge_name']['fr-fr'] = 'Entrez le nom';
$text['description-bridge_name']['he-il'] = '';
$text['description-bridge_name']['it-it'] = '';
$text['description-bridge_name']['nl-nl'] = 'Voer naam in.';
$text['description-bridge_name']['pl-pl'] = 'Wprowadź nazwę.';
$text['description-bridge_name']['pt-br'] = '';
$text['description-bridge_name']['pt-pt'] = '';
$text['description-bridge_name']['ro-ro'] = '';
$text['description-bridge_name']['ru-ru'] = '';
$text['description-bridge_name']['sv-se'] = '';
$text['description-bridge_name']['uk-ua'] = '';
$text['label-bridge_destination']['en-us'] = 'Destination';
$text['label-bridge_destination']['en-gb'] = 'Destination';
$text['label-bridge_destination']['ar-eg'] = '';
$text['label-bridge_destination']['de-at'] = '';
$text['label-bridge_destination']['de-ch'] = '';
$text['label-bridge_destination']['de-de'] = '';
$text['label-bridge_destination']['es-cl'] = '';
$text['label-bridge_destination']['es-mx'] = '';
$text['label-bridge_destination']['fr-ca'] = 'Destination';
$text['label-bridge_destination']['fr-fr'] = 'Destination';
$text['label-bridge_destination']['he-il'] = '';
$text['label-bridge_destination']['it-it'] = '';
$text['label-bridge_destination']['nl-nl'] = 'Bestemming';
$text['label-bridge_destination']['pl-pl'] = 'Destynacja';
$text['label-bridge_destination']['pt-br'] = '';
$text['label-bridge_destination']['pt-pt'] = '';
$text['label-bridge_destination']['ro-ro'] = '';
$text['label-bridge_destination']['ru-ru'] = '';
$text['label-bridge_destination']['sv-se'] = '';
$text['label-bridge_destination']['uk-ua'] = '';
$text['description-bridge_destination']['en-us'] = 'Enter the destination.';
$text['description-bridge_destination']['en-gb'] = 'Enter the destination.';
$text['description-bridge_destination']['ar-eg'] = '';
$text['description-bridge_destination']['de-at'] = '';
$text['description-bridge_destination']['de-ch'] = '';
$text['description-bridge_destination']['de-de'] = '';
$text['description-bridge_destination']['es-cl'] = '';
$text['description-bridge_destination']['es-mx'] = '';
$text['description-bridge_destination']['fr-ca'] = 'Entrer la destination';
$text['description-bridge_destination']['fr-fr'] = 'Entrer la destination';
$text['description-bridge_destination']['he-il'] = '';
$text['description-bridge_destination']['it-it'] = '';
$text['description-bridge_destination']['nl-nl'] = 'Voer de bestemming in.';
$text['description-bridge_destination']['pl-pl'] = 'Wprowadź destynację.';
$text['description-bridge_destination']['pt-br'] = '';
$text['description-bridge_destination']['pt-pt'] = '';
$text['description-bridge_destination']['ro-ro'] = '';
$text['description-bridge_destination']['ru-ru'] = '';
$text['description-bridge_destination']['sv-se'] = '';
$text['description-bridge_destination']['uk-ua'] = '';
$text['label-bridge_enabled']['en-us'] = 'Enabled';
$text['label-bridge_enabled']['en-gb'] = 'Enabled';
$text['label-bridge_enabled']['ar-eg'] = '';
$text['label-bridge_enabled']['de-at'] = '';
$text['label-bridge_enabled']['de-ch'] = '';
$text['label-bridge_enabled']['de-de'] = '';
$text['label-bridge_enabled']['es-cl'] = '';
$text['label-bridge_enabled']['es-mx'] = '';
$text['label-bridge_enabled']['fr-ca'] = 'Activé';
$text['label-bridge_enabled']['fr-fr'] = 'Activé';
$text['label-bridge_enabled']['he-il'] = '';
$text['label-bridge_enabled']['it-it'] = '';
$text['label-bridge_enabled']['nl-nl'] = 'Geactiveerd';
$text['label-bridge_enabled']['pl-pl'] = 'Aktywny';
$text['label-bridge_enabled']['pt-br'] = '';
$text['label-bridge_enabled']['pt-pt'] = '';
$text['label-bridge_enabled']['ro-ro'] = '';
$text['label-bridge_enabled']['ru-ru'] = '';
$text['label-bridge_enabled']['sv-se'] = '';
$text['label-bridge_enabled']['uk-ua'] = '';
$text['description-bridge_enabled']['en-us'] = 'Select to enable or disable.';
$text['description-bridge_enabled']['en-gb'] = 'Select to enable or disable.';
$text['description-bridge_enabled']['ar-eg'] = '';
$text['description-bridge_enabled']['de-at'] = '';
$text['description-bridge_enabled']['de-ch'] = '';
$text['description-bridge_enabled']['de-de'] = '';
$text['description-bridge_enabled']['es-cl'] = '';
$text['description-bridge_enabled']['es-mx'] = '';
$text['description-bridge_enabled']['fr-ca'] = 'Sélectionnez pour activer ou désactiver';
$text['description-bridge_enabled']['fr-fr'] = 'Sélectionnez pour activer ou désactiver';
$text['description-bridge_enabled']['he-il'] = '';
$text['description-bridge_enabled']['it-it'] = '';
$text['description-bridge_enabled']['nl-nl'] = 'Kies aktiveer/deactiveer.';
$text['description-bridge_enabled']['pl-pl'] = 'Wybierz czy aktywować lub dezaktywować.';
$text['description-bridge_enabled']['pt-br'] = '';
$text['description-bridge_enabled']['pt-pt'] = '';
$text['description-bridge_enabled']['ro-ro'] = '';
$text['description-bridge_enabled']['ru-ru'] = '';
$text['description-bridge_enabled']['sv-se'] = '';
$text['description-bridge_enabled']['uk-ua'] = '';
$text['label-bridge_description']['en-us'] = 'Description';
$text['label-bridge_description']['en-gb'] = 'Description';
$text['label-bridge_description']['ar-eg'] = '';
$text['label-bridge_description']['de-at'] = '';
$text['label-bridge_description']['de-ch'] = '';
$text['label-bridge_description']['de-de'] = '';
$text['label-bridge_description']['es-cl'] = '';
$text['label-bridge_description']['es-mx'] = '';
$text['label-bridge_description']['fr-ca'] = 'La description';
$text['label-bridge_description']['fr-fr'] = 'La description';
$text['label-bridge_description']['he-il'] = '';
$text['label-bridge_description']['it-it'] = '';
$text['label-bridge_description']['nl-nl'] = 'Omschrijving';
$text['label-bridge_description']['pl-pl'] = 'Opis';
$text['label-bridge_description']['pt-br'] = '';
$text['label-bridge_description']['pt-pt'] = '';
$text['label-bridge_description']['ro-ro'] = '';
$text['label-bridge_description']['ru-ru'] = '';
$text['label-bridge_description']['sv-se'] = '';
$text['label-bridge_description']['uk-ua'] = '';
$text['description-bridge_description']['en-us'] = 'Enter the description. ';
$text['description-bridge_description']['en-gb'] = 'Enter the description. ';
$text['description-bridge_description']['ar-eg'] = '';
$text['description-bridge_description']['de-at'] = '';
$text['description-bridge_description']['de-ch'] = '';
$text['description-bridge_description']['de-de'] = '';
$text['description-bridge_description']['es-cl'] = '';
$text['description-bridge_description']['es-mx'] = '';
$text['description-bridge_description']['fr-ca'] = 'Entrez la description';
$text['description-bridge_description']['fr-fr'] = 'Entrez la description';
$text['description-bridge_description']['he-il'] = '';
$text['description-bridge_description']['it-it'] = '';
$text['description-bridge_description']['nl-nl'] = 'Voer omschrijving in.';
$text['description-bridge_description']['pl-pl'] = 'Wprowadź opis.';
$text['description-bridge_description']['pt-br'] = '';
$text['description-bridge_description']['pt-pt'] = '';
$text['description-bridge_description']['ro-ro'] = '';
$text['description-bridge_description']['ru-ru'] = '';
$text['description-bridge_description']['sv-se'] = '';
$text['description-bridge_description']['uk-ua'] = '';
$text['label-bridge_description']['en-us'] = "Description";
$text['label-bridge_description']['en-gb'] = "Description";
$text['label-bridge_description']['ar-eg'] = "";
$text['label-bridge_description']['de-at'] = "Beschreibung"; //copied from de-de
$text['label-bridge_description']['de-ch'] = "Beschreibung"; //copied from de-de
$text['label-bridge_description']['de-de'] = "Beschreibung";
$text['label-bridge_description']['es-cl'] = "Descripción";
$text['label-bridge_description']['es-mx'] = "Descripción"; //copied from es-cl
$text['label-bridge_description']['fr-ca'] = "Description"; //copied from fr-fr
$text['label-bridge_description']['fr-fr'] = "Description";
$text['label-bridge_description']['he-il'] = "";
$text['label-bridge_description']['it-it'] = "Descrizione";
$text['label-bridge_description']['nl-nl'] = "Omschrijving";
$text['label-bridge_description']['pl-pl'] = "Opis";
$text['label-bridge_description']['pt-br'] = "Descrição";
$text['label-bridge_description']['pt-pt'] = "Descripção";
$text['label-bridge_description']['ro-ro'] = "";
$text['label-bridge_description']['ru-ru'] = "Описание";
$text['label-bridge_description']['sv-se'] = "Beskrivning";
$text['label-bridge_description']['uk-ua'] = "Опис";
$text['label-bridge_description']['tr-tr'] = "ıklama";
?>

21
app/bridges/app_menu.php Normal file
View File

@ -0,0 +1,21 @@
<?php
$apps[$x]['menu'][0]['title']['en-us'] = 'Bridges';
$apps[$x]['menu'][0]['title']['en-gb'] = 'Bridges';
$apps[$x]['menu'][0]['title']['es-cl'] = '';
$apps[$x]['menu'][0]['title']['fr-fr'] = '';
$apps[$x]['menu'][0]['title']['fr-ca'] = '';
$apps[$x]['menu'][0]['title']['nl-nl'] = 'Bruggen';
$apps[$x]['menu'][0]['title']['pl'] = 'Mostkowania';
$apps[$x]['menu'][0]['title']['sv-se'] = '';
$apps[$x]['menu'][0]['title']['uk'] = '';
$apps[$x]['menu'][0]['title']['de-at'] = '';
$apps[$x]['menu'][0]['uuid'] = '345f0aad-8321-4a8b-9f08-c4730297660c';
$apps[$x]['menu'][0]['parent_uuid'] = 'fd29e39c-c936-f5fc-8e2b-611681b266b5';
$apps[$x]['menu'][0]['category'] = 'internal';
$apps[$x]['menu'][0]['path'] = '/app/bridges/bridges.php';
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
//$apps[$x]['menu'][0]['groups'][] = 'admin';
//$apps[$x]['menu'][0]['groups'][] = 'user';
?>

261
app/bridges/bridge_edit.php Normal file
View File

@ -0,0 +1,261 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2018 - 2019
the Initial Developer. All Rights Reserved.
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (!permission_exists('bridge_add') && !permission_exists('bridge_edit')) {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
$action = "update";
$bridge_uuid = $_REQUEST["id"];
$id = $_REQUEST["id"];
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (is_array($_POST)) {
$bridge_uuid = $_POST["bridge_uuid"];
$bridge_name = $_POST["bridge_name"];
$bridge_destination = $_POST["bridge_destination"];
$bridge_enabled = $_POST["bridge_enabled"];
$bridge_description = $_POST["bridge_description"];
}
//process the user data and save it to the database
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//delete the bridge
if (permission_exists('bridge_delete')) {
if ($_POST['action'] == 'delete' && is_uuid($bridge_uuid)) {
//prepare
$array[0]['checked'] = 'true';
$array[0]['uuid'] = $bridge_uuid;
//delete
$obj = new bridges;
$obj->delete($array);
//redirect
header('Location: bridges.php');
exit;
}
}
//get the uuid from the POST
if ($action == "update") {
$bridge_uuid = $_POST["bridge_uuid"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: bridges.php');
exit;
}
//check for all required data
$msg = '';
if (strlen($bridge_name) == 0) { $msg .= $text['message-required']." ".$text['label-bridge_name']."<br>\n"; }
if (strlen($bridge_destination) == 0) { $msg .= $text['message-required']." ".$text['label-bridge_destination']."<br>\n"; }
if (strlen($bridge_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-bridge_enabled']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "resources/footer.php";
return;
}
//add the bridge_uuid
if (strlen($bridge_uuid) == 0) {
$bridge_uuid = uuid();
}
//prepare the array
$array['bridges'][0]['bridge_uuid'] = $bridge_uuid;
$array['bridges'][0]['domain_uuid'] = $_SESSION["domain_uuid"];
$array['bridges'][0]['bridge_name'] = $bridge_name;
$array['bridges'][0]['bridge_destination'] = $bridge_destination;
$array['bridges'][0]['bridge_enabled'] = $bridge_enabled;
$array['bridges'][0]['bridge_description'] = $bridge_description;
//save to the data
$database = new database;
$database->app_name = 'bridges';
$database->app_uuid = 'a6a7c4c5-340a-43ce-bcbc-2ed9bab8659d';
$database->save($array);
$message = $database->message;
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
//redirect the user
if (isset($action)) {
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
}
if ($action == "update") {
$_SESSION["message"] = $text['message-update'];
}
header('Location: bridges.php');
return;
}
}
//pre-populate the form
if (is_array($_GET) && $_POST["persistformvar"] != "true") {
$bridge_uuid = $_GET["id"];
$sql = "select * from v_bridges ";
$sql .= "where bridge_uuid = :bridge_uuid ";
$parameters['bridge_uuid'] = $bridge_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && sizeof($row) != 0) {
$bridge_name = $row["bridge_name"];
$bridge_destination = $row["bridge_destination"];
$bridge_enabled = $row["bridge_enabled"];
$bridge_description = $row["bridge_description"];
}
unset($sql, $parameters, $row);
}
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
$document['title'] = $text['title-bridge'];
require_once "resources/header.php";
//show the content
echo "<form name='frm' id='frm' method='post'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-bridge']."</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','style'=>'margin-right: 15px;','link'=>'bridges.php']);
if ($action == 'update' && permission_exists('bridge_delete')) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'name'=>'btn_delete','style'=>'margin-right: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','name'=>'action','value'=>'save']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if ($action == 'update' && permission_exists('bridge_delete')) {
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
}
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='nowrap'>\n";
echo " ".$text['label-bridge_name']."\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' style='position: relative;' align='left'>\n";
echo " <input class='formfld' type='text' name='bridge_name' maxlength='255' value='".escape($bridge_name)."'>\n";
echo "<br />\n";
echo $text['description-bridge_name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-bridge_destination']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <input class='formfld' type='text' name='bridge_destination' maxlength='255' value='".escape($bridge_destination)."'>\n";
echo "<br />\n";
echo $text['description-bridge_destination']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-bridge_enabled']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <select class='formfld' name='bridge_enabled'>\n";
if ($bridge_enabled == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($bridge_enabled == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-bridge_enabled']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-bridge_description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='bridge_description' maxlength='255' value=\"".escape($bridge_description)."\">\n";
echo "<br />\n";
echo $text['description-bridge_description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "<br /><br />";
if ($action == "update") {
echo "<input type='hidden' name='bridge_uuid' value='".escape($bridge_uuid)."'>\n";
}
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>";
//include the footer
require_once "resources/footer.php";
?>

265
app/bridges/bridges.php Normal file
View File

@ -0,0 +1,265 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2018 - 2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/paging.php";
//check permissions
if (permission_exists('bridge_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get the http post data
if (is_array($_POST['bridges'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$bridges = $_POST['bridges'];
}
//process the http post data by action
if ($action != '' && is_array($bridges) && @sizeof($bridges) != 0) {
switch ($action) {
case 'copy':
if (permission_exists('bridge_add')) {
$obj = new bridges;
$obj->copy($bridges);
}
break;
case 'toggle':
if (permission_exists('bridge_edit')) {
$obj = new bridges;
$obj->toggle($bridges);
}
break;
case 'delete':
if (permission_exists('bridge_delete')) {
$obj = new bridges;
$obj->delete($bridges);
}
break;
}
header('Location: bridges.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
}
//get order and order by
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//add the search string
if (isset($_GET["search"])) {
$search = strtolower($_GET["search"]);
$sql_search = " (";
$sql_search .= " lower(bridge_name) like :search ";
$sql_search .= " or lower(bridge_destination) like :search ";
$sql_search .= " or lower(bridge_enabled) like :search ";
$sql_search .= " or lower(bridge_description) like :search ";
$sql_search .= ") ";
$parameters['search'] = '%'.$search.'%';
}
//get the count
$sql = "select count(bridge_uuid) from v_bridges ";
if ($_GET['show'] == "all" && permission_exists('bridge_all')) {
if (isset($sql_search)) {
$sql .= "where ".$sql_search;
}
}
else {
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
if (isset($sql_search)) {
$sql .= "and ".$sql_search;
}
$parameters['domain_uuid'] = $domain_uuid;
}
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
//prepare to page the results
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = $search ? "&search=".$search : null;
$param = ($_GET['show'] == 'all' && permission_exists('bridge_all')) ? "&show=all" : null;
$page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
$offset = $rows_per_page * $page;
//get the list
$sql = str_replace('count(bridge_uuid)', '*', $sql);
$sql .= order_by($order_by, $order, 'bridge_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$bridges = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//include the header
$document['title'] = $text['title-bridges'];
require_once "resources/header.php";
//show the content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-bridges']." (".$num_rows.")</b></div>\n";
echo " <div class='actions'>\n";
if (permission_exists('bridge_add')) {
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','link'=>'bridge_edit.php']);
}
if (permission_exists('bridge_add') && $bridges) {
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
}
if (permission_exists('bridge_edit') && $bridges) {
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'id'=>'btn_toggle','name'=>'btn_toggle','style'=>'display: none;','onclick'=>"modal_open('modal-toggle','btn_toggle');"]);
}
if (permission_exists('bridge_delete') && $bridges) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('bridge_all')) {
if ($_GET['show'] == 'all') {
echo " <input type='hidden' name='show' value='all'>\n";
}
else {
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']);
}
}
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'bridges.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
}
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if (permission_exists('bridge_add') && $bridges) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
}
if (permission_exists('bridge_edit') && $bridges) {
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 (permission_exists('bridge_delete') && $bridges) {
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');"])]);
}
echo $text['title_description-bridge']."\n";
echo "<br /><br />\n";
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('bridge_add') || permission_exists('bridge_edit') || permission_exists('bridge_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($bridges ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
if ($_GET['show'] == 'all' && permission_exists('bridge_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
}
echo th_order_by('bridge_name', $text['label-bridge_name'], $order_by, $order);
echo th_order_by('bridge_destination', $text['label-bridge_destination'], $order_by, $order);
echo th_order_by('bridge_enabled', $text['label-bridge_enabled'], $order_by, $order, null, "class='center'");
echo " <th class='hide-sm-dn'>".$text['label-bridge_description']."</th>\n";
if (permission_exists('bridge_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($bridges) && @sizeof($bridges) != 0) {
$x = 0;
foreach ($bridges as $row) {
if (permission_exists('bridge_edit')) {
$list_row_url = "bridge_edit.php?id=".urlencode($row['bridge_uuid']);
}
echo "<tr class='list-row' href='".$list_row_url."'>\n";
if (permission_exists('bridge_add') || permission_exists('bridge_edit') || permission_exists('bridge_delete')) {
echo " <td class='checkbox'>\n";
echo " <input type='checkbox' name='bridges[$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='bridges[$x][uuid]' value='".escape($row['bridge_uuid'])."' />\n";
echo " </td>\n";
}
if ($_GET['show'] == 'all' && permission_exists('bridge_all')) {
echo " <td>".escape($_SESSION['domains'][$row['domain_uuid']]['domain_name'])."</td>\n";
}
echo " <td>\n";
if (permission_exists('bridge_edit')) {
echo " <a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['bridge_name'])."</a>\n";
}
else {
echo " ".escape($row['bridge_name']);
}
echo " </td>\n";
echo " <td>".escape($row['bridge_destination'])."</td>\n";
if (permission_exists('bridge_edit')) {
echo " <td class='no-link center'>\n";
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['bridge_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
}
else {
echo " <td class='center'>\n";
echo $text['label-'.$row['bridge_enabled']];
}
echo " </td>\n";
echo " <td class='description overflow hide-sm-dn'>".escape($row['bridge_description'])."</td>\n";
if (permission_exists('bridge_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>\n";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";
}
echo "</tr>\n";
$x++;
}
unset($bridges);
}
echo "</table>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,270 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//define the bridges class
if (!class_exists('bridges')) {
class bridges {
/**
* declare private variables
*/
private $app_name;
private $app_uuid;
private $permission_prefix;
private $list_page;
private $table;
private $uuid_prefix;
private $toggle_field;
private $toggle_values;
/**
* called when the object is created
*/
public function __construct() {
//assign private variables
$this->app_name = 'bridges';
$this->app_uuid = 'a6a7c4c5-340a-43ce-bcbc-2ed9bab8659d';
$this->permission_prefix = 'bridge_';
$this->list_page = 'bridges.php';
$this->table = 'bridges';
$this->uuid_prefix = 'bridge_';
$this->toggle_field = 'bridge_enabled';
$this->toggle_values = ['true','false'];
}
/**
* called when there are no references to a particular object
* unset the variables used in the class
*/
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
/**
* delete records
*/
public function delete($records) {
if (permission_exists($this->permission_prefix.'delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//delete multiple records
if (is_array($records) && @sizeof($records) != 0) {
//build the delete array
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
$array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
}
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
//execute delete
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->delete($array);
unset($array);
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
//set message
message::add($text['message-delete']);
}
unset($records);
}
}
}
/**
* toggle records
*/
public function toggle($records) {
if (permission_exists($this->permission_prefix.'edit')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//toggle the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get current toggle state
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select ".$this->uuid_prefix."uuid as uuid, ".$this->toggle_field." as toggle from v_".$this->table." ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
$states[$row['uuid']] = $row['toggle'];
}
}
unset($sql, $parameters, $rows, $row);
}
//build update array
$x = 0;
foreach ($states as $uuid => $state) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
$array[$this->table][$x][$this->toggle_field] = $state == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
$x++;
}
//save the changes
if (is_array($array) && @sizeof($array) != 0) {
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
//set message
message::add($text['message-toggle']);
}
unset($records, $states);
}
}
}
/**
* copy records
*/
public function copy($records) {
if (permission_exists($this->permission_prefix.'add')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//copy the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get checked records
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//create insert array from existing data
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select * from v_".$this->table." ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $x => $row) {
//copy data
$array[$this->table][$x] = $row;
//overwrite
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = uuid();
$array[$this->table][$x]['bridge_description'] = trim($row['bridge_description'].' ('.$text['label-copy'].')');
}
}
unset($sql, $parameters, $rows, $row);
}
//save the changes and set the message
if (is_array($array) && @sizeof($array) != 0) {
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//set message
message::add($text['message-copy']);
}
unset($records);
}
}
}
}
}
?>

90
app/bridges/root.php Normal file
View File

@ -0,0 +1,90 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2018
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,170 @@
<?php
//application details
$apps[$x]['name'] = "Call Block";
$apps[$x]['uuid'] = "9ed63276-e085-4897-839c-4f2e36d92d6c";
$apps[$x]['category'] = "Switch";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "A tool to block incoming numbers.";
$apps[$x]['description']['en-gb'] = "A tool to block incoming numbers.";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Ein Werkzeug um eingehende Rufnummern zu sperren.";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Ein Werkzeug um eingehende Rufnummern zu sperren.";
$apps[$x]['description']['el-gr'] = "Εργαλείο για αποκλεισμό εισερχόμενων κλήσεων από συγκεκριμένους αριθμούς.";
$apps[$x]['description']['es-cl'] = "Una herramineta para bloquear números entrantes";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "Outil pour bloquer des numéros d'appelant.";
$apps[$x]['description']['fr-fr'] = "Outil pour bloquer des numéros d'appelant.";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "Gereedschap om inkommende nummers te blokkeren.";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "Uma ferramenta para bloquear números que entram.";
$apps[$x]['description']['pt-pt'] = "Uma ferramenta para bloquear números indesejados";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//default settings
$y=0;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "e8356e52-3d18-4da5-93b1-9b2e08878982";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "call_block";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "recent_call_limit";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "50";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Number of recent calls to show.";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "call_block_view";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "29295c90-b1b9-440b-9c7E-c8363c6e8975";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_edit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_all";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_extension";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_ivr";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_ring_group";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_voicemail";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "view_call_block";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
//schema details
$y=0;
$apps[$x]['db'][$y]['table']['name'] = "v_call_block";
$apps[$x]['db'][$y]['table']['parent'] = "";
$z=0;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_uuid";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_caller_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_direction";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the direction of the calls to block.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "extension_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_extensions";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "extension_uuid";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_name";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_caller_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_block_country_code";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the country code.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_number";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_caller_number";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the phone number.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_count";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_call_count";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Number of calls.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_action";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_call_action";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Action for call.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_block_app";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Application";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_block_data";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Data";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "date_added";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Date/Time number was added.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_enabled";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "block_call_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enable/disable blocking the call.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'call_block_description';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the description.';
?>

View File

@ -0,0 +1,51 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
if ($domains_processed == 1) {
//create a view for call block
$database = new database;
$database->execute("DROP VIEW view_call_block;", null);
$sql = "CREATE VIEW view_call_block AS ( \n";
$sql .= " select c.domain_uuid, call_block_uuid, c.call_block_direction, c.extension_uuid, c.call_block_name, c.call_block_country_code, \n";
$sql .= " c.call_block_number, e.extension, e.number_alias, c.call_block_count, c.call_block_app, c.call_block_data, c.date_added, c.call_block_enabled, c.call_block_description \n";
$sql .= " from v_call_block as c \n";
$sql .= " left join v_extensions as e \n";
$sql .= " on c.extension_uuid = e.extension_uuid \n";
$sql .= "); \n";
$database = new database;
$database->execute($sql, null);
unset($sql);
//set call blocks to inbound if no direction defined
$sql = "update v_call_block set call_block_direction = 'inbound' where call_block_direction is null ";
$database = new database;
$database->execute($sql, null);
unset($sql);
}
?>

View File

@ -0,0 +1,965 @@
<?php
#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
$text['title-call-block']['en-us'] = "Call Block";
$text['title-call-block']['en-gb'] = "Call Block";
$text['title-call-block']['ar-eg'] = "حظر المكالمات";
$text['title-call-block']['de-at'] = "Sperrlisten"; //copied from de-de
$text['title-call-block']['de-ch'] = "Sperrlisten"; //copied from de-de
$text['title-call-block']['de-de'] = "Sperrlisten";
$text['title-call-block']['el-gr'] = "Λίστα αποκλεισμών";
$text['title-call-block']['es-cl'] = "Bloqueo de llamadas";
$text['title-call-block']['es-mx'] = "Bloqueo de llamadas"; //copied from es-cl
$text['title-call-block']['fr-ca'] = "Filtrage d'appel"; //copied from fr-fr
$text['title-call-block']['fr-fr'] = "Filtrage d'appel";
$text['title-call-block']['he-il'] = "חסימת מספר";
$text['title-call-block']['it-it'] = "Blocco Chiamate";
$text['title-call-block']['nl-nl'] = "Oproep blokkade";
$text['title-call-block']['pl-pl'] = "Blokowanie rozmów";
$text['title-call-block']['pt-br'] = "Bloqueio de chamadas";
$text['title-call-block']['pt-pt'] = "Bloqueio de Chamadas";
$text['title-call-block']['ro-ro'] = "Blocare apel";
$text['title-call-block']['ru-ru'] = "Черный список";
$text['title-call-block']['sv-se'] = "Blockera Samtal";
$text['title-call-block']['uk-ua'] = "Блокування дзвінків";
$text['heading-recent_calls']['en-us'] = "Recent Calls";
$text['heading-recent_calls']['en-gb'] = "Recent Calls";
$text['heading-recent_calls']['ar-eg'] = "";
$text['heading-recent_calls']['de-at'] = "Kürzliche Anrufe"; //copied from de-de
$text['heading-recent_calls']['de-ch'] = "Kürzliche Anrufe"; //copied from de-de
$text['heading-recent_calls']['de-de'] = "Kürzliche Anrufe";
$text['heading-recent_calls']['el-gr'] = "Πρόσφατες Κλήσεις";
$text['heading-recent_calls']['es-cl'] = "Llamadas Recientes";
$text['heading-recent_calls']['es-mx'] = "Llamadas Recientes"; //copied from es-cl
$text['heading-recent_calls']['fr-ca'] = "Appels récents"; //copied from fr-fr
$text['heading-recent_calls']['fr-fr'] = "Appels récents";
$text['heading-recent_calls']['he-il'] = "שיחות אחרונות";
$text['heading-recent_calls']['it-it'] = "Chiamate Recenti";
$text['heading-recent_calls']['nl-nl'] = "Recente oproepen";
$text['heading-recent_calls']['pl-pl'] = "Ostatnie rozmowy";
$text['heading-recent_calls']['pt-br'] = "Chamadas recentes";
$text['heading-recent_calls']['pt-pt'] = "Chamadas Recentes";
$text['heading-recent_calls']['ro-ro'] = "Apeluri recente";
$text['heading-recent_calls']['ru-ru'] = "Недавние вызовы";
$text['heading-recent_calls']['sv-se'] = "Senaste Samtal";
$text['heading-recent_calls']['uk-ua'] = "Останні дзвінки";
$text['heading-block_recent_calls']['en-us'] = "Block Recent Calls";
$text['heading-block_recent_calls']['en-gb'] = "Block Recent Calls";
$text['heading-block_recent_calls']['ar-eg'] = "";
$text['heading-block_recent_calls']['de-at'] = "Kürzliche Anrufe Blockieren"; //copied from de-de
$text['heading-block_recent_calls']['de-ch'] = "Kürzliche Anrufe Blockieren"; //copied from de-de
$text['heading-block_recent_calls']['de-de'] = "Kürzliche Anrufe Blockieren";
$text['heading-block_recent_calls']['el-gr'] = "Αποκλεισμός Πρόσφατης Κλήσης";
$text['heading-block_recent_calls']['es-cl'] = "Bloqueo de llamadas recientes";
$text['heading-block_recent_calls']['es-mx'] = "Bloqueo de llamadas recientes"; //copied from es-cl
$text['heading-block_recent_calls']['fr-ca'] = "Bloquer appels récents"; //copied from fr-fr
$text['heading-block_recent_calls']['fr-fr'] = "Bloquer appels récents";
$text['heading-block_recent_calls']['he-il'] = "";
$text['heading-block_recent_calls']['it-it'] = "Blocca le chiamate recenti";
$text['heading-block_recent_calls']['nl-nl'] = "Blokkeer recente oproep";
$text['heading-block_recent_calls']['pl-pl'] = "Zablokuj ostatnią rozmowę";
$text['heading-block_recent_calls']['pt-br'] = "Bloquear chamadas recentes";
$text['heading-block_recent_calls']['pt-pt'] = "Bloquear Chamadas Recentes";
$text['heading-block_recent_calls']['ro-ro'] = "Blocare apel recent";
$text['heading-block_recent_calls']['ru-ru'] = "Блокировать недавний вызов";
$text['heading-block_recent_calls']['sv-se'] = "Blockera Senaste Samtal";
$text['heading-block_recent_calls']['uk-ua'] = "Блокувати недавній дзвінок";
$text['label-update-complete']['en-us'] = "Update Complete";
$text['label-update-complete']['en-gb'] = "Update Complete";
$text['label-update-complete']['ar-eg'] = "اكتمال التحديث";
$text['label-update-complete']['de-at'] = "Aktualisierung abgeschlossen"; //copied from de-de
$text['label-update-complete']['de-ch'] = "Aktualisierung abgeschlossen"; //copied from de-de
$text['label-update-complete']['de-de'] = "Aktualisierung abgeschlossen";
$text['label-update-complete']['el-gr'] = "Η ενημέρωση ολοκληρώθηκε";
$text['label-update-complete']['es-cl'] = "Actualización Completa";
$text['label-update-complete']['es-mx'] = "Actualización Completa"; //copied from es-cl
$text['label-update-complete']['fr-ca'] = "Mise à jour effectuée"; //copied from fr-fr
$text['label-update-complete']['fr-fr'] = "Mise à jour effectuée";
$text['label-update-complete']['he-il'] = "העדכון הושלם";
$text['label-update-complete']['it-it'] = "Aggiornamento Completato";
$text['label-update-complete']['nl-nl'] = "Bijgewerkt";
$text['label-update-complete']['pl-pl'] = "Zaktualizowano pomyślnie";
$text['label-update-complete']['pt-br'] = "Atualização Completa";
$text['label-update-complete']['pt-pt'] = "Actualização Efectuada";
$text['label-update-complete']['ro-ro'] = "Actualizare completă";
$text['label-update-complete']['ru-ru'] = "Обновление завершено";
$text['label-update-complete']['sv-se'] = "Uppdatering Klar";
$text['label-update-complete']['uk-ua'] = "Оновлено";
$text['label-reject']['en-us'] = "Reject";
$text['label-reject']['en-gb'] = "Reject";
$text['label-reject']['ar-eg'] = "رفض";
$text['label-reject']['de-at'] = "Zurückweisen"; //copied from de-de
$text['label-reject']['de-ch'] = "Zurückweisen"; //copied from de-de
$text['label-reject']['de-de'] = "Zurückweisen";
$text['label-reject']['el-gr'] = "Απόρριψη";
$text['label-reject']['es-cl'] = "Rechazar";
$text['label-reject']['es-mx'] = "Rechazar"; //copied from es-cl
$text['label-reject']['fr-ca'] = "Rejeter"; //copied from fr-fr
$text['label-reject']['fr-fr'] = "Rejeter";
$text['label-reject']['he-il'] = "לדחות";
$text['label-reject']['it-it'] = "Blocca";
$text['label-reject']['nl-nl'] = "Weigeren";
$text['label-reject']['pl-pl'] = "Odrzuć ";
$text['label-reject']['pt-br'] = "Rejeitar"; //copied from pt-pt
$text['label-reject']['pt-pt'] = "Rejeitar";
$text['label-reject']['ro-ro'] = "";
$text['label-reject']['ru-ru'] = "Отклонить";
$text['label-reject']['sv-se'] = "Neka";
$text['label-reject']['uk-ua'] = "Відхилити";
$text['label-provide-number']['en-us'] = "Please provide: Number";
$text['label-provide-number']['en-gb'] = "Please provide: Number";
$text['label-provide-number']['ar-eg'] = "من فضلك أدخل: الرقم";
$text['label-provide-number']['de-at'] = "Bitte geben Sie die Nummer an"; //copied from de-de
$text['label-provide-number']['de-ch'] = "Bitte geben Sie die Nummer an"; //copied from de-de
$text['label-provide-number']['de-de'] = "Bitte geben Sie die Nummer an";
$text['label-provide-number']['el-gr'] = "Εισάγετε: Αριθμό";
$text['label-provide-number']['es-cl'] = "Por favor agregue: Número";
$text['label-provide-number']['es-mx'] = "Por favor agregue: Número"; //copied from es-cl
$text['label-provide-number']['fr-ca'] = "S'il vous plaît indiquer: Numéro";
$text['label-provide-number']['fr-fr'] = "Merci d'indiquer: Numéro";
$text['label-provide-number']['he-il'] = "אנא הכנס מספר";
$text['label-provide-number']['it-it'] = "Prego fornire: Numero";
$text['label-provide-number']['nl-nl'] = "Geef aub: Nummer";
$text['label-provide-number']['pl-pl'] = " Wprowadź numer";
$text['label-provide-number']['pt-br'] = "Por favor indique: Número"; //copied from pt-pt
$text['label-provide-number']['pt-pt'] = "Por favor indique: Número";
$text['label-provide-number']['ro-ro'] = "";
$text['label-provide-number']['ru-ru'] = "Введите номер";
$text['label-provide-number']['sv-se'] = "Ange: Nummer";
$text['label-provide-number']['uk-ua'] = "Введіть номер";
$text['label-provide-name']['en-us'] = "Please provide: Name";
$text['label-provide-name']['en-gb'] = "Please provide: Name";
$text['label-provide-name']['ar-eg'] = "من فضلك أدخل: الأسم";
$text['label-provide-name']['de-at'] = "Bitte geben Sie den Namen an"; //copied from de-de
$text['label-provide-name']['de-ch'] = "Bitte geben Sie den Namen an"; //copied from de-de
$text['label-provide-name']['de-de'] = "Bitte geben Sie den Namen an";
$text['label-provide-name']['el-gr'] = "Εισάγετε: Όνομα";
$text['label-provide-name']['es-cl'] = "Por favor agregue: Nombre";
$text['label-provide-name']['es-mx'] = "Por favor agregue: Nombre"; //copied from es-cl
$text['label-provide-name']['fr-ca'] = "S'il vous plaît indiquer: Nom"; //copied from fr-fr
$text['label-provide-name']['fr-fr'] = "Merci d'indiquer: Nom";
$text['label-provide-name']['he-il'] = "אנא הכנס שם";
$text['label-provide-name']['it-it'] = "Prego fornire: Nome";
$text['label-provide-name']['nl-nl'] = "Geef aub: Naam";
$text['label-provide-name']['pl-pl'] = " Wprowadź nazwę ";
$text['label-provide-name']['pt-br'] = "Por favor indique: Nome"; //copied from pt-pt
$text['label-provide-name']['pt-pt'] = "Por favor indique: Nome";
$text['label-provide-name']['ro-ro'] = "";
$text['label-provide-name']['ru-ru'] = "Пожалуйста, введите: Имя";
$text['label-provide-name']['sv-se'] = "Ange: Namn";
$text['label-provide-name']['uk-ua'] = "Введіть назву";
$text['label-provide-enabled']['en-us'] = "Please provide: Enabled";
$text['label-provide-enabled']['en-gb'] = "Please provide: Enabled";
$text['label-provide-enabled']['ar-eg'] = "";
$text['label-provide-enabled']['de-at'] = "Bitte geben Sie folgendes an: Aktiv"; //copied from de-de
$text['label-provide-enabled']['de-ch'] = "Bitte geben Sie folgendes an: Aktiv"; //copied from de-de
$text['label-provide-enabled']['de-de'] = "Bitte geben Sie folgendes an: Aktiv";
$text['label-provide-enabled']['el-gr'] = "Εισάγετε: Ενεργοποιημένο";
$text['label-provide-enabled']['es-cl'] = "Por favor agregue: Activo";
$text['label-provide-enabled']['es-mx'] = "Por favor agregue: Activo"; //copied from es-cl
$text['label-provide-enabled']['fr-ca'] = "S'il vous plaît indiquer: Actif"; //copied from fr-fr
$text['label-provide-enabled']['fr-fr'] = "Merci d'indiquer: Actif";
$text['label-provide-enabled']['he-il'] = "";
$text['label-provide-enabled']['it-it'] = "Prego fornire: Abilitazione";
$text['label-provide-enabled']['nl-nl'] = "Geef aub: Aktief";
$text['label-provide-enabled']['pl-pl'] = " Wprowadź: Włączony";
$text['label-provide-enabled']['pt-br'] = "Por favor indique se está habilitado";
$text['label-provide-enabled']['pt-pt'] = "Por favor indique: Activado";
$text['label-provide-enabled']['ro-ro'] = "";
$text['label-provide-enabled']['ru-ru'] = "Пожалуйста, введите: Включить";
$text['label-provide-enabled']['sv-se'] = "Ange: Aktiverad";
$text['label-provide-enabled']['uk-ua'] = "Включити/відключити";
$text['label-country_code']['en-us'] = "Country Code";
$text['label-country_code']['en-gb'] = "Country Code";
$text['label-country_code']['ar-eg'] = "";
$text['label-country_code']['de-at'] = ""; //copied from de-de
$text['label-country_code']['de-ch'] = ""; //copied from de-de
$text['label-country_code']['de-de'] = "";
$text['label-country_code']['es-cl'] = "";
$text['label-country_code']['es-mx'] = ""; //copied from es-cl
$text['label-country_code']['fr-ca'] = "Préfixe"; //copied from fr-fr
$text['label-country_code']['fr-fr'] = "Préfixe";
$text['label-country_code']['he-il'] = "";
$text['label-country_code']['it-it'] = "";
$text['label-country_code']['nl-nl'] = "Voorloop";
$text['label-country_code']['pl-pl'] = "Kod Kraju";
$text['label-country_code']['pt-br'] = "Prefixo"; //copied from pt-pt
$text['label-country_code']['pt-pt'] = "";
$text['label-country_code']['ro-ro'] = "";
$text['label-country_code']['ru-ru'] = "";
$text['label-country_code']['sv-se'] = "";
$text['label-country_code']['uk-ua'] = "";
$text['label-number']['en-us'] = "Number";
$text['label-number']['en-gb'] = "Number";
$text['label-number']['ar-eg'] = "رقم";
$text['label-number']['de-at'] = "Nummer"; //copied from de-de
$text['label-number']['de-ch'] = "Nummer"; //copied from de-de
$text['label-number']['de-de'] = "Nummer";
$text['label-number']['el-gr'] = "Αριθμός";
$text['label-number']['es-cl'] = "Número";
$text['label-number']['es-mx'] = "Número"; //copied from es-cl
$text['label-number']['fr-ca'] = "Numéro"; //copied from fr-fr
$text['label-number']['fr-fr'] = "Numéro";
$text['label-number']['he-il'] = "מספר";
$text['label-number']['it-it'] = "Numero";
$text['label-number']['nl-nl'] = "Nummer";
$text['label-number']['pl-pl'] = "Numer";
$text['label-number']['pt-br'] = "Número"; //copied from pt-pt
$text['label-number']['pt-pt'] = "Número";
$text['label-number']['ro-ro'] = "Număr";
$text['label-number']['ru-ru'] = "Номер";
$text['label-number']['sv-se'] = "Nummer";
$text['label-number']['uk-ua'] = "Номер";
$text['label-message']['en-us'] = "Message";
$text['label-message']['en-gb'] = "Message";
$text['label-message']['ar-eg'] = "رسالة";
$text['label-message']['de-at'] = "Nachricht"; //copied from de-de
$text['label-message']['de-ch'] = "Nachricht"; //copied from de-de
$text['label-message']['de-de'] = "Nachricht";
$text['label-message']['el-gr'] = "Μήνυμα";
$text['label-message']['es-cl'] = "Mensaje";
$text['label-message']['es-mx'] = "Mensaje"; //copied from es-cl
$text['label-message']['fr-ca'] = "Message"; //copied from fr-fr
$text['label-message']['fr-fr'] = "Message";
$text['label-message']['he-il'] = "הודעה";
$text['label-message']['it-it'] = "Messaggio";
$text['label-message']['nl-nl'] = "Bericht";
$text['label-message']['pl-pl'] = "Wiadomość";
$text['label-message']['pt-br'] = "Mensagem"; //copied from pt-pt
$text['label-message']['pt-pt'] = "Mensagem";
$text['label-message']['ro-ro'] = "Mesaj";
$text['label-message']['ru-ru'] = "Сообщение";
$text['label-message']['sv-se'] = "Meddelande";
$text['label-message']['uk-ua'] = "Повідомлення";
$text['label-ivr_menus']['en-us'] = "IVR Menus";
$text['label-ivr_menus']['en-gb'] = "IVR Menus";
$text['label-ivr_menus']['ar-eg'] = "";
$text['label-ivr_menus']['de-at'] = "Automatische Vermittlungen"; //copied from de-de
$text['label-ivr_menus']['de-ch'] = "Automatische Vermittlungen"; //copied from de-de
$text['label-ivr_menus']['de-de'] = "Automatische Vermittlungen";
$text['label-ivr_menus']['es-cl'] = "Menus IVR";
$text['label-ivr_menus']['es-mx'] = "Menus IVR"; //copied from es-cl
$text['label-ivr_menus']['fr-ca'] = "Menus RVI"; //copied from fr-fr
$text['label-ivr_menus']['fr-fr'] = "Menus SVI";
$text['label-ivr_menus']['he-il'] = "";
$text['label-ivr_menus']['it-it'] = "Menu IVR";
$text['label-ivr_menus']['nl-nl'] = "IVR menus";
$text['label-ivr_menus']['pl-pl'] = "Menu zapowiedzi głosowych (IVR)";
$text['label-ivr_menus']['pt-br'] = "Menus de IVR"; //copied from pt-pt
$text['label-ivr_menus']['pt-pt'] = "Menus de IVR";
$text['label-ivr_menus']['ro-ro'] = "";
$text['label-ivr_menus']['ru-ru'] = "Голосовые Меню (IVR)";
$text['label-ivr_menus']['sv-se'] = "IVR Menyer";
$text['label-ivr_menus']['uk-ua'] = "";
$text['label-ivr']['en-us'] = "IVR";
$text['label-ivr']['en-gb'] = "IVR";
$text['label-ivr']['ar-eg'] = "";
$text['label-ivr']['de-at'] = "Automatische Vermittlungen"; //copied from de-de
$text['label-ivr']['de-ch'] = "Automatische Vermittlungen"; //copied from de-de
$text['label-ivr']['de-de'] = "Automatische Vermittlungen";
$text['label-ivr']['es-cl'] = "IVR";
$text['label-ivr']['es-mx'] = "IVR";
$text['label-ivr']['fr-ca'] = "RVI";
$text['label-ivr']['fr-fr'] = "SVI";
$text['label-ivr']['he-il'] = "";
$text['label-ivr']['it-it'] = "IVR";
$text['label-ivr']['nl-nl'] = "IVR";
$text['label-ivr']['pl-pl'] = "IVR";
$text['label-ivr']['pt-br'] = "IVR";
$text['label-ivr']['pt-pt'] = "IVR";
$text['label-ivr']['ro-ro'] = "";
$text['label-ivr']['ru-ru'] = "IVR";
$text['label-ivr']['sv-se'] = "IVR";
$text['label-ivr']['uk-ua'] = "";
$text['label-ring_groups']['en-us'] = "Ring Groups";
$text['label-ring_groups']['en-gb'] = "Ring Groups";
$text['label-ring_groups']['ar-eg'] = "مجموعات الرنين";
$text['label-ring_groups']['de-at'] = "Ringgruppen"; //copied from de-de
$text['label-ring_groups']['de-ch'] = "Ringgruppen"; //copied from de-de
$text['label-ring_groups']['de-de'] = "Ringgruppen";
$text['label-ring_groups']['es-cl'] = "Grupos de timbre";
$text['label-ring_groups']['es-mx'] = "Grupos de timbre"; //copied from es-cl
$text['label-ring_groups']['fr-ca'] = "Groupes de sonnerie"; //copied from fr-fr
$text['label-ring_groups']['fr-fr'] = "Groupes de sonnerie";
$text['label-ring_groups']['he-il'] = "קבוצות טבעת";
$text['label-ring_groups']['it-it'] = "Gruppi di suoneria";
$text['label-ring_groups']['nl-nl'] = "Belgroepen";
$text['label-ring_groups']['pl-pl'] = "Grupy dzwonków";
$text['label-ring_groups']['pt-br'] = "Grupos de toque"; //copied from pt-pt
$text['label-ring_groups']['pt-pt'] = "Grupos de toque";
$text['label-ring_groups']['ro-ro'] = "Grupuri de apeluri";
$text['label-ring_groups']['ru-ru'] = "Кольцевые группы";
$text['label-ring_groups']['sv-se'] = "Ringgrupper";
$text['label-ring_groups']['uk-ua'] = "Кільцеві групи";
$text['label-ring_group']['en-us'] = "Ring Group";
$text['label-ring_group']['en-gb'] = "Ring Group";
$text['label-ring_group']['ar-eg'] = "";
$text['label-ring_group']['de-at'] = "Rufgruppe"; //copied from de-de
$text['label-ring_group']['de-ch'] = "Rufgruppe"; //copied from de-de
$text['label-ring_group']['de-de'] = "Rufgruppe";
$text['label-ring_group']['es-cl'] = "Grupo de llamado";
$text['label-ring_group']['es-mx'] = "Grupo de llamado"; //copied from es-cl
$text['label-ring_group']['fr-ca'] = "Groupe de sonnerie"; //copied from fr-fr
$text['label-ring_group']['fr-fr'] = "Groupe de sonnerie";
$text['label-ring_group']['he-il'] = "קבוצת חיוג";
$text['label-ring_group']['it-it'] = "Gruppo di Squillo";
$text['label-ring_group']['nl-nl'] = "Belgroep";
$text['label-ring_group']['pl-pl'] = "Grupa odbiorców.";
$text['label-ring_group']['pt-br'] = "Grupo"; //copied from pt-pt
$text['label-ring_group']['pt-pt'] = "Grupo";
$text['label-ring_group']['ro-ro'] = "";
$text['label-ring_group']['ru-ru'] = "Группа вызовов";
$text['label-ring_group']['sv-se'] = "Ringgrupp";
$text['label-ring_group']['uk-ua'] = "";
$text['label-local']['en-us'] = "Local";
$text['label-local']['en-gb'] = "Local";
$text['label-local']['ar-eg'] = "محلي";
$text['label-local']['de-at'] = "Lokal"; //copied from de-de
$text['label-local']['de-ch'] = "Lokal"; //copied from de-de
$text['label-local']['de-de'] = "Lokal";
$text['label-local']['el-gr'] = "Τοπικό";
$text['label-local']['es-cl'] = "Local";
$text['label-local']['es-mx'] = "Local"; //copied from es-cl
$text['label-local']['fr-ca'] = "Local"; //copied from fr-fr
$text['label-local']['fr-fr'] = "Local";
$text['label-local']['he-il'] = "מקומי";
$text['label-local']['it-it'] = "Locale";
$text['label-local']['nl-nl'] = "Lokaal";
$text['label-local']['pl-pl'] = "Lokalny";
$text['label-local']['pt-br'] = "Local"; //copied from pt-pt
$text['label-local']['pt-pt'] = "Local";
$text['label-local']['ro-ro'] = "Local";
$text['label-local']['ru-ru'] = "Локальный";
$text['label-local']['sv-se'] = "Lokal";
$text['label-local']['uk-ua'] = "Місцевий";
$text['label-inbound']['en-us'] = "Inbound";
$text['label-inbound']['en-gb'] = "Inbound";
$text['label-inbound']['ar-eg'] = "";
$text['label-inbound']['de-at'] = "Eingehend"; //copied from de-de
$text['label-inbound']['de-ch'] = "Eingehend"; //copied from de-de
$text['label-inbound']['de-de'] = "Eingehend";
$text['label-inbound']['el-gr'] = "Εισερχόμενο";
$text['label-inbound']['es-cl'] = "Entrada";
$text['label-inbound']['es-mx'] = "Entrada"; //copied from es-cl
$text['label-inbound']['fr-ca'] = "Entrant"; //copied from fr-fr
$text['label-inbound']['fr-fr'] = "Entrant";
$text['label-inbound']['he-il'] = "";
$text['label-inbound']['it-it'] = "In ingresso";
$text['label-inbound']['nl-nl'] = "Inkomend";
$text['label-inbound']['pl-pl'] = "Przychodzący";
$text['label-inbound']['pt-br'] = "Entrada"; //copied from pt-pt
$text['label-inbound']['pt-pt'] = "Entrada";
$text['label-inbound']['ro-ro'] = "";
$text['label-inbound']['ru-ru'] = "Входящий";
$text['label-inbound']['sv-se'] = "Inkommande";
$text['label-inbound']['uk-ua'] = "Вихідний";
$text['label-outbound']['en-us'] = "Outbound";
$text['label-outbound']['en-gb'] = "Outbound";
$text['label-outbound']['ar-eg'] = "";
$text['label-outbound']['de-at'] = "Ausgehend"; //copied from de-de
$text['label-outbound']['de-ch'] = "Ausgehend"; //copied from de-de
$text['label-outbound']['de-de'] = "Ausgehend";
$text['label-outbound']['es-cl'] = "Salida";
$text['label-outbound']['es-mx'] = "Salida"; //copied from es-cl
$text['label-outbound']['fr-ca'] = "Sortant"; //copied from fr-fr
$text['label-outbound']['fr-fr'] = "Sortant";
$text['label-outbound']['he-il'] = "";
$text['label-outbound']['it-it'] = "In Uscita";
$text['label-outbound']['nl-nl'] = "";
$text['label-outbound']['pl-pl'] = "Wychodzące";
$text['label-outbound']['pt-br'] = "Saída"; //copied from pt-pt
$text['label-outbound']['pt-pt'] = "Saída";
$text['label-outbound']['ro-ro'] = "";
$text['label-outbound']['ru-ru'] = "Исходящие";
$text['label-outbound']['sv-se'] = "Utgående";
$text['label-outbound']['uk-ua'] = "";
$text['label-destination']['en-us'] = "Destination";
$text['label-destination']['en-gb'] = "Destination";
$text['label-destination']['ar-eg'] = "";
$text['label-destination']['de-at'] = "Ziel"; //copied from de-de
$text['label-destination']['de-ch'] = "Ziel"; //copied from de-de
$text['label-destination']['de-de'] = "Ziel";
$text['label-destination']['es-cl'] = "Destino";
$text['label-destination']['es-mx'] = "Destino"; //copied from es-cl
$text['label-destination']['fr-ca'] = "Destination"; //copied from fr-fr
$text['label-destination']['fr-fr'] = "Destination";
$text['label-destination']['he-il'] = "";
$text['label-destination']['it-it'] = "Destinazione";
$text['label-destination']['nl-nl'] = "";
$text['label-destination']['pl-pl'] = "Numer docelowy";
$text['label-destination']['pt-br'] = "Número de destino";
$text['label-destination']['pt-pt'] = "Destino";
$text['label-destination']['ro-ro'] = "";
$text['label-destination']['ru-ru'] = "Назначение";
$text['label-destination']['sv-se'] = "Destination";
$text['label-destination']['uk-ua'] = "Номер";
$text['label-edit-note']['en-us'] = "Block calls from a number. Edit the name and enable/disable below.";
$text['label-edit-note']['en-gb'] = "Block calls from a number. Edit the name and enable/disable below.";
$text['label-edit-note']['ar-eg'] = "";
$text['label-edit-note']['de-at'] = "Anrufe von einer Rufnummer sperren. Bearbeiten Sie den Namen und aktivieren/deaktivieren Sie diesen unten."; //copied from de-de
$text['label-edit-note']['de-ch'] = "Anrufe von einer Rufnummer sperren. Bearbeiten Sie den Namen und aktivieren/deaktivieren Sie diesen unten."; //copied from de-de
$text['label-edit-note']['de-de'] = "Anrufe von einer Rufnummer sperren. Bearbeiten Sie den Namen und aktivieren/deaktivieren Sie diesen unten.";
$text['label-edit-note']['el-gr'] = "Απόρριψη κλήσεων από ένα αριθμό. Τροποποιήστε το όνομα και (απ)ενεργοποιήστε το παρακάτω.";
$text['label-edit-note']['es-cl'] = "Bloquea llamadas desde un número. Edite el nombre y active/desactive abajo.";
$text['label-edit-note']['es-mx'] = "Bloquea llamadas desde un número. Edite el nombre y active/desactive abajo."; //copied from es-cl
$text['label-edit-note']['fr-ca'] = "Bloquer les appels à partir d'un numéro. Vérifiez le nom et activez/désactivez ci-dessous."; //copied from fr-fr
$text['label-edit-note']['fr-fr'] = "Bloquer les appels à partir d'un numéro. vérifiez le nom et activez/désactivez ci-dessous.";
$text['label-edit-note']['he-il'] = "";
$text['label-edit-note']['it-it'] = "Blocca le chiamate da un numero. Inserire il nome e abilitare/disabilitare qui sotto.";
$text['label-edit-note']['nl-nl'] = "Blokkeer oproepen van een nummer. Pas de naam aan en (de)aktiveer hieronder.";
$text['label-edit-note']['pl-pl'] = "Blokowanie połączeń z danego numeru. Edytuj nazwę i włącz/wyłącz poniżej.";
$text['label-edit-note']['pt-br'] = "Bloquear chamadas a partir de um número. Edite o nome e ative ou desative";
$text['label-edit-note']['pt-pt'] = "Bloquear chamadas a partir de um número. Edite o nome e active/desactive.";
$text['label-edit-note']['ro-ro'] = "Blocați apelurile de la un număr. Editați numele și activați/dezactivați mai jos.";
$text['label-edit-note']['ru-ru'] = "Блокировать вызовы от номера. Отредактируйте имя и включено/выключено ниже.";
$text['label-edit-note']['sv-se'] = "Blockera samtal från nummer. Editera namn och Aktiv/Inaktiv nedan.";
$text['label-edit-note']['uk-ua'] = "Блокувати дзвінки з номера. Змініть ім'я і включіть/відключіть нижче.";
$text['label-edit-edit']['en-us'] = "Call Block";
$text['label-edit-edit']['en-gb'] = "Call Block";
$text['label-edit-edit']['ar-eg'] = "";
$text['label-edit-edit']['de-at'] = "Sperrlisten"; //copied from de-de
$text['label-edit-edit']['de-ch'] = "Sperrlisten"; //copied from de-de
$text['label-edit-edit']['de-de'] = "Sperrlisten";
$text['label-edit-edit']['el-gr'] = "Απόρριψη Κλήσεων";
$text['label-edit-edit']['es-cl'] = "Bloqueo de llamada";
$text['label-edit-edit']['es-mx'] = "Bloqueo de llamada"; //copied from es-cl
$text['label-edit-edit']['fr-ca'] = "Filtrage d'appel"; //copied from fr-fr
$text['label-edit-edit']['fr-fr'] = "Filtrage d'appel";
$text['label-edit-edit']['he-il'] = "חסימת שיחה";
$text['label-edit-edit']['it-it'] = "Blocco Chiamate";
$text['label-edit-edit']['nl-nl'] = "Oproep blokkade";
$text['label-edit-edit']['pl-pl'] = "Blokowanie rozmów";
$text['label-edit-edit']['pt-br'] = "Bloqueio de chamadas";
$text['label-edit-edit']['pt-pt'] = "Bloqueio de Chamadas";
$text['label-edit-edit']['ro-ro'] = "Blocare apel";
$text['label-edit-edit']['ru-ru'] = "Черный список";
$text['label-edit-edit']['sv-se'] = "Blockera Samtal";
$text['label-edit-edit']['uk-ua'] = "Блокування дзвінків";
$text['label-edit-add']['en-us'] = "Call Block";
$text['label-edit-add']['en-gb'] = "Call Block";
$text['label-edit-add']['ar-eg'] = "حظر المكالمات";
$text['label-edit-add']['de-at'] = "Sperrlisten"; //copied from de-de
$text['label-edit-add']['de-ch'] = "Sperrlisten"; //copied from de-de
$text['label-edit-add']['de-de'] = "Sperrlisten";
$text['label-edit-add']['el-gr'] = "Λίστα Απόρριψης";
$text['label-edit-add']['es-cl'] = "Agregar bloqueo de llamada";
$text['label-edit-add']['es-mx'] = "Agregar bloqueo de llamada"; //copied from es-cl
$text['label-edit-add']['fr-ca'] = "Ajouter au filtrage d'appels"; //copied from fr-fr
$text['label-edit-add']['fr-fr'] = "Ajouter filtrage d'appel";
$text['label-edit-add']['he-il'] = "חסימת שיחה";
$text['label-edit-add']['it-it'] = "Blocco Chiamate";
$text['label-edit-add']['nl-nl'] = "Oproep blokkade";
$text['label-edit-add']['pl-pl'] = "Blokowaie rozmów";
$text['label-edit-add']['pt-br'] = "Adicionar bloqueio de chamadas";
$text['label-edit-add']['pt-pt'] = "Adicionar Bloqueio de Chamadas";
$text['label-edit-add']['ro-ro'] = "Blocare apel";
$text['label-edit-add']['ru-ru'] = "Черный список";
$text['label-edit-add']['sv-se'] = "Blockera Samtal";
$text['label-edit-add']['uk-ua'] = "Блокування дзвінків";
$text['label-duration']['en-us'] = "Duration";
$text['label-duration']['en-gb'] = "Duration";
$text['label-duration']['ar-eg'] = "المدة";
$text['label-duration']['de-at'] = "Dauer"; //copied from de-de
$text['label-duration']['de-ch'] = "Dauer"; //copied from de-de
$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"; //copied from es-cl
$text['label-duration']['fr-ca'] = "Durée"; //copied from fr-fr
$text['label-duration']['fr-fr'] = "Durée";
$text['label-duration']['he-il'] = "משך השיחה";
$text['label-duration']['it-it'] = "Durata";
$text['label-duration']['nl-nl'] = "Duur";
$text['label-duration']['pl-pl'] = "Czas trwania";
$text['label-duration']['pt-br'] = "Duração"; //copied from pt-pt
$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-delete-complete']['en-us'] = "Delete Complete";
$text['label-delete-complete']['en-gb'] = "Delete Complete";
$text['label-delete-complete']['ar-eg'] = "اكتمال المسح";
$text['label-delete-complete']['de-at'] = "Erfolgreich gelöscht"; //copied from de-de
$text['label-delete-complete']['de-ch'] = "Erfolgreich gelöscht"; //copied from de-de
$text['label-delete-complete']['de-de'] = "Erfolgreich gelöscht";
$text['label-delete-complete']['el-gr'] = "Η διαγραφή ολοκληρώθηκε";
$text['label-delete-complete']['es-cl'] = "Eliminar Completo";
$text['label-delete-complete']['es-mx'] = "Eliminar Completo"; //copied from es-cl
$text['label-delete-complete']['fr-ca'] = "Supprimé"; //copied from fr-fr
$text['label-delete-complete']['fr-fr'] = "Supprimé";
$text['label-delete-complete']['he-il'] = "המחיקה הושלמה";
$text['label-delete-complete']['it-it'] = "Cancellazione Completata";
$text['label-delete-complete']['nl-nl'] = "Verwijderen gereed";
$text['label-delete-complete']['pl-pl'] = "Usunięto pomyślnie";
$text['label-delete-complete']['pt-br'] = "Remoção efetuada";
$text['label-delete-complete']['pt-pt'] = "Remoção Efectuada";
$text['label-delete-complete']['ro-ro'] = "Ștergere completă";
$text['label-delete-complete']['ru-ru'] = "Удаление завершено";
$text['label-delete-complete']['sv-se'] = "Borttagning Klar";
$text['label-delete-complete']['uk-ua'] = "Видалено";
$text['label-date-added']['en-us'] = "Date Added";
$text['label-date-added']['en-gb'] = "Date Added";
$text['label-date-added']['ar-eg'] = "تم اضافة التاريخ";
$text['label-date-added']['de-at'] = "Datum hinzugefügt"; //copied from de-de
$text['label-date-added']['de-ch'] = "Datum hinzugefügt"; //copied from de-de
$text['label-date-added']['de-de'] = "Datum hinzugefügt";
$text['label-date-added']['el-gr'] = "Η ημερομηνία προστέθηκε";
$text['label-date-added']['es-cl'] = "Fecha de ingreso";
$text['label-date-added']['es-mx'] = "Fecha de ingreso"; //copied from es-cl
$text['label-date-added']['fr-ca'] = "Date d'ajout"; //copied from fr-fr
$text['label-date-added']['fr-fr'] = "Date d'ajout";
$text['label-date-added']['he-il'] = "התאריך נוסף";
$text['label-date-added']['it-it'] = "Data Aggiunta";
$text['label-date-added']['nl-nl'] = "Datum toegevoegd";
$text['label-date-added']['pl-pl'] = "Dodano datę";
$text['label-date-added']['pt-br'] = "Data adicionada"; //copied from pt-pt
$text['label-date-added']['pt-pt'] = "Data adicionada";
$text['label-date-added']['ro-ro'] = "Data adăugării";
$text['label-date-added']['ru-ru'] = "Дата добавления";
$text['label-date-added']['sv-se'] = "Datum Tillagt";
$text['label-date-added']['uk-ua'] = "Додано";
$text['label-count']['en-us'] = "Count";
$text['label-count']['en-gb'] = "Count";
$text['label-count']['ar-eg'] = "";
$text['label-count']['de-at'] = "Zähler"; //copied from de-de
$text['label-count']['de-ch'] = "Zähler"; //copied from de-de
$text['label-count']['de-de'] = "Zähler";
$text['label-count']['el-gr'] = "Μετρητής";
$text['label-count']['es-cl'] = "Conteo";
$text['label-count']['es-mx'] = "Conteo"; //copied from es-cl
$text['label-count']['fr-ca'] = "Nombre d'appels"; //copied from fr-fr
$text['label-count']['fr-fr'] = "Nombre d'appels";
$text['label-count']['he-il'] = "";
$text['label-count']['it-it'] = "Conteggio";
$text['label-count']['nl-nl'] = "Aantal";
$text['label-count']['pl-pl'] = "Wyliczenie";
$text['label-count']['pt-br'] = "Contagem"; //copied from pt-pt
$text['label-count']['pt-pt'] = "Contagem";
$text['label-count']['ro-ro'] = "";
$text['label-count']['ru-ru'] = "Количество";
$text['label-count']['sv-se'] = "Räkna";
$text['label-count']['uk-ua'] = "Кількість";
$text['label-called']['en-us'] = "Called";
$text['label-called']['en-gb'] = "Called";
$text['label-called']['ar-eg'] = "تم الأتصال علي";
$text['label-called']['de-at'] = "Anruf"; //copied from de-de
$text['label-called']['de-ch'] = "Anruf"; //copied from de-de
$text['label-called']['de-de'] = "Anruf";
$text['label-called']['el-gr'] = "Η κλήση πραγματοποιήθηκε";
$text['label-called']['es-cl'] = "Llamó";
$text['label-called']['es-mx'] = "Llamó"; //copied from es-cl
$text['label-called']['fr-ca'] = "Appelé"; //copied from fr-fr
$text['label-called']['fr-fr'] = "Appelé";
$text['label-called']['he-il'] = "Opgeroepen";
$text['label-called']['it-it'] = "Chiamato";
$text['label-called']['nl-nl'] = "Aangeroepen";
$text['label-called']['pl-pl'] = "Zadzwoniono";
$text['label-called']['pt-br'] = "Chamada";
$text['label-called']['pt-pt'] = "Chamado";
$text['label-called']['ro-ro'] = "Sunat";
$text['label-called']['ru-ru'] = "Направление";
$text['label-called']['sv-se'] = "Ringdes";
$text['label-called']['uk-ua'] = "Дзвінок здійснено";
$text['label-busy']['en-us'] = "Busy";
$text['label-busy']['en-gb'] = "Busy";
$text['label-busy']['ar-eg'] = "مشغول";
$text['label-busy']['de-at'] = "Besetzt"; //copied from de-de
$text['label-busy']['de-ch'] = "Besetzt"; //copied from de-de
$text['label-busy']['de-de'] = "Besetzt";
$text['label-busy']['el-gr'] = "Κατειλημμένο";
$text['label-busy']['es-cl'] = "Ocupado";
$text['label-busy']['es-mx'] = "Ocupado"; //copied from es-cl
$text['label-busy']['fr-ca'] = "Occupé"; //copied from fr-fr
$text['label-busy']['fr-fr'] = "Occupé";
$text['label-busy']['he-il'] = "תפוס";
$text['label-busy']['it-it'] = "Occupato";
$text['label-busy']['nl-nl'] = "Bezet";
$text['label-busy']['pl-pl'] = "Zajęty";
$text['label-busy']['pt-br'] = "Ocupado"; //copied from pt-pt
$text['label-busy']['pt-pt'] = "Ocupado";
$text['label-busy']['ro-ro'] = "Ocupat";
$text['label-busy']['ru-ru'] = "Занято";
$text['label-busy']['sv-se'] = "Upptagen";
$text['label-busy']['uk-ua'] = "Зайнято";
$text['label-hold']['en-us'] = "Hold";
$text['label-hold']['en-gb'] = "Hold";
$text['label-hold']['ar-eg'] = "";
$text['label-hold']['de-at'] = "Halten"; //copied from de-de
$text['label-hold']['de-ch'] = "Halten"; //copied from de-de
$text['label-hold']['de-de'] = "Halten";
$text['label-hold']['el-gr'] = "Αναμονή";
$text['label-hold']['es-cl'] = "";
$text['label-hold']['es-mx'] = "";
$text['label-hold']['fr-ca'] = "Attente";
$text['label-hold']['fr-fr'] = "Attente";
$text['label-hold']['he-il'] = "";
$text['label-hold']['it-it'] = "In attesa";
$text['label-hold']['nl-nl'] = "Aanhouden";
$text['label-hold']['pl-pl'] = "";
$text['label-hold']['pt-br'] = "Espera"; //copied from pt-pt
$text['label-hold']['pt-pt'] = "Espera";
$text['label-hold']['ro-ro'] = "";
$text['label-hold']['ru-ru'] = "Удержание";
$text['label-hold']['sv-se'] = "Vänt";
$text['label-hold']['uk-ua'] = "";
$text['label-voicemail']['en-us'] = "Voicemail";
$text['label-voicemail']['en-gb'] = "Voicemail";
$text['label-voicemail']['ar-eg'] = "";
$text['label-voicemail']['de-at'] = "Mailbox"; //copied from de-de
$text['label-voicemail']['de-ch'] = "Mailbox"; //copied from de-de
$text['label-voicemail']['de-de'] = "Mailbox";
$text['label-voicemail']['el-gr'] = "Φωνοκιβώτιο";
$text['label-voicemail']['es-cl'] = "Correo de Voz";
$text['label-voicemail']['es-mx'] = "Correo de Voz"; //copied from es-cl
$text['label-voicemail']['fr-ca'] = "Messagerie vocale"; //copied from fr-fr
$text['label-voicemail']['fr-fr'] = "Messagerie vocale";
$text['label-voicemail']['he-il'] = "תא קולי";
$text['label-voicemail']['it-it'] = "Voicemail";
$text['label-voicemail']['nl-nl'] = "Opname";
$text['label-voicemail']['pl-pl'] = "Poczta głosowa";
$text['label-voicemail']['pt-br'] = "Correio de voz";
$text['label-voicemail']['pt-pt'] = "Correio de Voz";
$text['label-voicemail']['ro-ro'] = "";
$text['label-voicemail']['ru-ru'] = "Голосовая почта";
$text['label-voicemail']['sv-se'] = "Röstbrevlåda";
$text['label-voicemail']['uk-ua'] = "Голосова пошта";
$text['label-add-note']['en-us'] = "Block calls from a number. Either select a number from the list above or enter the number, name and enable below.";
$text['label-add-note']['en-gb'] = "Block calls from a number. Either select a number from the list above or enter the number, name and enable below.";
$text['label-add-note']['ar-eg'] = "";
$text['label-add-note']['de-at'] = "Anrufe einer Rufnummer sperren. Wählen Sie eine Nummer von der Liste oder geben Sie eine Nummer und einen Name ein. Aktivieren Sie die Sperrliste unten."; //copied from de-de
$text['label-add-note']['de-ch'] = "Anrufe einer Rufnummer sperren. Wählen Sie eine Nummer von der Liste oder geben Sie eine Nummer und einen Name ein. Aktivieren Sie die Sperrliste unten."; //copied from de-de
$text['label-add-note']['de-de'] = "Anrufe einer Rufnummer sperren. Wählen Sie eine Nummer von der Liste oder geben Sie eine Nummer und einen Name ein. Aktivieren Sie die Sperrliste unten.";
$text['label-add-note']['el-gr'] = "Απόρριψη κλήσεων από ένα αριθμό. Επιλέξτε από την παρακάτω λίστα ή εισάγετε ένα αριθμό, όνομα και την ενεργοποίηση παρακάτω";
$text['label-add-note']['es-cl'] = "Bloquea llamadas desde un número. Puede elegir un número de la lista de arriba o ingresar el n&uacute, nombre y activarlo abajo.";
$text['label-add-note']['es-mx'] = "Bloquea llamadas desde un número. Puede elegir un número de la lista de arriba o ingresar el n&uacute, nombre y activarlo abajo."; //copied from es-cl
$text['label-add-note']['fr-ca'] = "Bloquer les appels à partir d'un numéro. Choisissez un numéro dans liste ou entrez un numéro, nom et activez ci-dessous."; //copied from fr-fr
$text['label-add-note']['fr-fr'] = "Bloquer les appels à partir d'un numéro. Choisissez un numéro dans liste ou entrez un numéro, nom et activez ci-dessous.";
$text['label-add-note']['he-il'] = "";
$text['label-add-note']['it-it'] = "Blocca le chiamate da un numero. Seleziona un numero dalla lista sovrastante o inserisci il numero, il nome e l'abilitazione qui sotto.";
$text['label-add-note']['nl-nl'] = "Blokkeer oproepen van een nummer. Of select het nummer van de bovenstaande lijst, of voer het nummer, de naam en aktivering hieronder.";
$text['label-add-note']['pl-pl'] = "Blokowanie połączeń z danego numeru. Wybierz numer z powyższej listy j lub wpisz numer, nazwę i załącz poniżej.";
$text['label-add-note']['pt-br'] = "Bloquear chamadas a partir de um número. Selecione um número a partir da lista indicada ou insira um número e um nome em seguida ative";
$text['label-add-note']['pt-pt'] = "Bloquear chamadas a partir de um número. Seleccione um número a partir da lista indicada ou introduza um número, nome e active.";
$text['label-add-note']['ro-ro'] = "";
$text['label-add-note']['ru-ru'] = "Блокировка вызовов от номера. Выберите номер из списка выше либо введите его самостоятельно, имя и включите ниже.";
$text['label-add-note']['sv-se'] = "Blockera samtal från ett nummer. Välj antingen ett nummer från listan ovan eller fyll i nummer, namn och aktivera nedan.";
$text['label-add-note']['uk-ua'] = "Блокувати дзвінки з номера. Або вибрати номер зі списку вище або введіть номер, ім'я і включити нижче.";
$text['label-add-complete']['en-us'] = "Add Complete";
$text['label-add-complete']['en-gb'] = "Add Complete";
$text['label-add-complete']['ar-eg'] = "تمت الأضافة";
$text['label-add-complete']['de-at'] = "Erfolgreich hinzugefügt"; //copied from de-de
$text['label-add-complete']['de-ch'] = "Erfolgreich hinzugefügt"; //copied from de-de
$text['label-add-complete']['de-de'] = "Erfolgreich hinzugefügt";
$text['label-add-complete']['el-gr'] = "Η προσθήκη ολοκληρώθηκε";
$text['label-add-complete']['es-cl'] = "Agregar Completo";
$text['label-add-complete']['es-mx'] = "Agregar Completo"; //copied from es-cl
$text['label-add-complete']['fr-ca'] = "Ajouté"; //copied from fr-fr
$text['label-add-complete']['fr-fr'] = "Ajouté";
$text['label-add-complete']['he-il'] = "הוספה הושלמה";
$text['label-add-complete']['it-it'] = "Inserimento Completato";
$text['label-add-complete']['nl-nl'] = "Toevoegen gereed";
$text['label-add-complete']['pl-pl'] = "Dodano pomyślnie";
$text['label-add-complete']['pt-br'] = "Criação efetuada ";
$text['label-add-complete']['pt-pt'] = "Adição Efectuada";
$text['label-add-complete']['ro-ro'] = "Adăugare completă";
$text['label-add-complete']['ru-ru'] = "Добавление завершено";
$text['label-add-complete']['sv-se'] = "Tillagd";
$text['label-add-complete']['uk-ua'] = "Додано";
$text['label-action']['en-us'] = "Action";
$text['label-action']['en-gb'] = "Action";
$text['label-action']['ar-eg'] = "";
$text['label-action']['de-at'] = "Aktion"; //copied from de-de
$text['label-action']['de-ch'] = "Aktion"; //copied from de-de
$text['label-action']['de-de'] = "Aktion";
$text['label-action']['el-gr'] = "Ενέργεια";
$text['label-action']['es-cl'] = "Acción";
$text['label-action']['es-mx'] = "Acción"; //copied from es-cl
$text['label-action']['fr-ca'] = "Action"; //copied from fr-fr
$text['label-action']['fr-fr'] = "Action";
$text['label-action']['he-il'] = "פעולה";
$text['label-action']['it-it'] = "Azione";
$text['label-action']['nl-nl'] = "Actie";
$text['label-action']['pl-pl'] = "Operacja";
$text['label-action']['pt-br'] = "Ação";
$text['label-action']['pt-pt'] = "Acção";
$text['label-action']['ro-ro'] = "Acțiune";
$text['label-action']['ru-ru'] = "Действие";
$text['label-action']['sv-se'] = "Åtgärd";
$text['label-action']['uk-ua'] = "Дія";
$text['label-direction']['en-us'] = "Direction";
$text['label-direction']['en-gb'] = "Direction";
$text['label-direction']['ar-eg'] = "";
$text['label-direction']['de-at'] = "Richtung"; //copied from de-de
$text['label-direction']['de-ch'] = "Richtung"; //copied from de-de
$text['label-direction']['de-de'] = "Richtung";
$text['label-direction']['es-cl'] = "Dirección";
$text['label-direction']['es-mx'] = "Dirección"; //copied from es-cl
$text['label-direction']['fr-ca'] = "Direction"; //copied from fr-fr
$text['label-direction']['fr-fr'] = "Direction";
$text['label-direction']['he-il'] = "";
$text['label-direction']['it-it'] = "Direzione";
$text['label-direction']['nl-nl'] = "";
$text['label-direction']['pl-pl'] = "Kierunek";
$text['label-direction']['pt-br'] = "Direção";
$text['label-direction']['pt-pt'] = "Direcção";
$text['label-direction']['ro-ro'] = "";
$text['label-direction']['ru-ru'] = "Направление";
$text['label-direction']['sv-se'] = "Riktning";
$text['label-direction']['uk-ua'] = "Напрям";
$text['description-direction']['en-us'] = "Select the direction of the calls to block.";
$text['description-direction']['en-gb'] = "Select the direction of the calls to block.";
$text['description-direction']['ar-eg'] = "Select the direction of the calls to block.";
$text['description-direction']['de-at'] = "Select the direction of the calls to block.";
$text['description-direction']['de-ch'] = "Select the direction of the calls to block.";
$text['description-direction']['de-de'] = "Select the direction of the calls to block.";
$text['description-direction']['el-gr'] = "Select the direction of the calls to block.";
$text['description-direction']['es-cl'] = "Select the direction of the calls to block.";
$text['description-direction']['es-mx'] = "Select the direction of the calls to block.";
$text['description-direction']['fr-ca'] = "Sélectionnez la direction des appels à bloquer.";
$text['description-direction']['fr-fr'] = "Sélectionnez la direction des appels à bloquer.";
$text['description-direction']['he-il'] = "Select the direction of the calls to block.";
$text['description-direction']['it-it'] = "Select the direction of the calls to block.";
$text['description-direction']['nl-nl'] = "Select the direction of the calls to block.";
$text['description-direction']['pl-pl'] = "Wybierz kierunek połączeń, które mają być blokowane.";
$text['description-direction']['pt-br'] = "Select the direction of the calls to block.";
$text['description-direction']['pt-pt'] = "Select the direction of the calls to block.";
$text['description-direction']['ro-ro'] = "Select the direction of the calls to block.";
$text['description-direction']['ru-ru'] = "Select the direction of the calls to block.";
$text['description-direction']['sv-se'] = "Select the direction of the calls to block.";
$text['description-direction']['uk-ua'] = "Select the direction of the calls to block.";
$text['description-call_block_name']['en-us'] = "Enter the Caller ID Name to block.";
$text['description-call_block_name']['en-gb'] = "Enter the Caller ID Name to block.";
$text['description-call_block_name']['ar-eg'] = "";
$text['description-call_block_name']['de-at'] = "";
$text['description-call_block_name']['de-ch'] = "";
$text['description-call_block_name']['de-de'] = "";
$text['description-call_block_name']['el-gr'] = "Εισάγετε την ταυτότητα καλούντος προς απόρριψη.";
$text['description-call_block_name']['es-cl'] = "";
$text['description-call_block_name']['es-mx'] = "";
$text['description-call_block_name']['fr-ca'] = "Entrez le nom d'affichage à bloquer.";
$text['description-call_block_name']['fr-fr'] = "Entrez le nom d'affichage à bloquer.";
$text['description-call_block_name']['he-il'] = "";
$text['description-call_block_name']['it-it'] = "";
$text['description-call_block_name']['nl-nl'] = "Voer het te blokkeren CID Naam in.";
$text['description-call_block_name']['pl-pl'] = "Wprowadź prezentację Nazwy numeru dzwoniącego do zablokowania.";
$text['description-call_block_name']['pt-br'] = "";
$text['description-call_block_name']['pt-pt'] = "";
$text['description-call_block_name']['ro-ro'] = "";
$text['description-call_block_name']['ru-ru'] = "";
$text['description-call_block_name']['sv-se'] = "";
$text['description-call_block_name']['uk-ua'] = "";
$text['description-country_code']['en-us'] = "Enter the Country Code prefix.";
$text['description-country_code']['en-gb'] = "Enter the Country Code prefix.";
$text['description-country_code']['ar-eg'] = "";
$text['description-country_code']['de-at'] = ""; //copied from de-de
$text['description-country_code']['de-ch'] = ""; //copied from de-de
$text['description-country_code']['de-de'] = "";
$text['description-country_code']['es-cl'] = "";
$text['description-country_code']['es-mx'] = ""; //copied from es-cl
$text['description-country_code']['fr-ca'] = "Entrez le préfixe de destination."; //copied from fr-fr
$text['description-country_code']['fr-fr'] = "Entrez le préfixe de destination.";
$text['description-country_code']['he-il'] = "";
$text['description-country_code']['it-it'] = "";
$text['description-country_code']['nl-nl'] = "Voer de bestemming prefix in.";
$text['description-country_code']['pl-pl'] = "Wprowadź prefiks Kodu Kraju.";
$text['description-country_code']['pt-br'] = "Insira o prefixo do destino.";
$text['description-country_code']['pt-pt'] = "";
$text['description-country_code']['ro-ro'] = "";
$text['description-country_code']['ru-ru'] = "";
$text['description-country_code']['sv-se'] = "";
$text['description-country_code']['uk-ua'] = "";
$text['description-call_block_number']['en-us'] = "Enter the Country Code and Caller ID Number to block.";
$text['description-call_block_number']['en-gb'] = "Enter the Country Code and Caller ID Number to block.";
$text['description-call_block_number']['ar-eg'] = "";
$text['description-call_block_number']['de-at'] = "";
$text['description-call_block_number']['de-ch'] = "";
$text['description-call_block_number']['de-de'] = "";
$text['description-call_block_number']['el-gr'] = "Εισάγετε την ταυτότητα καλούντος προς απόρριψη.";
$text['description-call_block_number']['es-cl'] = "";
$text['description-call_block_number']['es-mx'] = "";
$text['description-call_block_number']['fr-ca'] = "Entrez le numéro d'affichage à bloquer.";
$text['description-call_block_number']['fr-fr'] = "Entrez le numéro d'affichage à bloquer.";
$text['description-call_block_number']['he-il'] = "";
$text['description-call_block_number']['it-it'] = "";
$text['description-call_block_number']['nl-nl'] = "Voer het te blokkeren CID Nummer in.";
$text['description-call_block_number']['pl-pl'] = "Wprowadź Kod Kraju i prezentację Numeru dzwoniącego do zablokowania.";
$text['description-call_block_number']['pt-br'] = "";
$text['description-call_block_number']['pt-pt'] = "";
$text['description-call_block_number']['ro-ro'] = "";
$text['description-call_block_number']['ru-ru'] = "";
$text['description-call_block_number']['sv-se'] = "";
$text['description-call_block_number']['uk-ua'] = "";
$text['description-extension']['en-us'] = "Select the extension to be affected.";
$text['description-extension']['en-gb'] = "Select the extension to be affected.";
$text['description-extension']['ar-eg'] = "";
$text['description-extension']['de-at'] = "";
$text['description-extension']['de-ch'] = "";
$text['description-extension']['de-de'] = "";
$text['description-extension']['el-gr'] = "Επιλέξτε το εσωτερικό προς απόρριψη.";
$text['description-extension']['es-cl'] = "";
$text['description-extension']['es-mx'] = "";
$text['description-extension']['fr-ca'] = "Choissizez le poste sur lequel cette règle sera appliquée.";
$text['description-extension']['fr-fr'] = "Choissizez le poste sur lequel cette règle sera appliquée.";
$text['description-extension']['he-il'] = "";
$text['description-extension']['it-it'] = "";
$text['description-extension']['nl-nl'] = "Selecteer het toestel dat geblokkeerd moet worden.";
$text['description-extension']['pl-pl'] = "Wybierz numer wewnętrzny, którego blokowanie ma dotyczyć.";
$text['description-extension']['pt-br'] = "";
$text['description-extension']['pt-pt'] = "";
$text['description-extension']['ro-ro'] = "";
$text['description-extension']['ru-ru'] = "";
$text['description-extension']['sv-se'] = "";
$text['description-extension']['uk-ua'] = "";
$text['description-enable']['en-us'] = "Set to true to enable call blocking for this number.";
$text['description-enable']['en-gb'] = "Set to true to enable call blocking for this number.";
$text['description-enable']['ar-eg'] = "";
$text['description-enable']['de-at'] = "Setzen Sie auf An, um die Sperrung für diese Nummer zu aktivieren."; //copied from de-de
$text['description-enable']['de-ch'] = "Setzen Sie auf An, um die Sperrung für diese Nummer zu aktivieren."; //copied from de-de
$text['description-enable']['de-de'] = "Setzen Sie auf An, um die Sperrung für diese Nummer zu aktivieren.";
$text['description-enable']['el-gr'] = "Επιλέξτε το για να ενεργοποιήστε την απόρριψη κλήσεων για τον αριθμό αυτό.";
$text['description-enable']['es-cl'] = "Seleccione verdadero para activar el bloqueo de llamadas desde este número.";
$text['description-enable']['es-mx'] = "Seleccione verdadero para activar el bloqueo de llamadas desde este número."; //copied from es-cl
$text['description-enable']['fr-ca'] = "Choisir oui pour activer le filtrage d'appel pour ce numéro."; //copied from fr-fr
$text['description-enable']['fr-fr'] = "Choisir oui pour activer le filtrage d'appel pour ce numéro.";
$text['description-enable']['he-il'] = "";
$text['description-enable']['it-it'] = "Selezionare 'true' per abilitare il blocco chiamate da questo numero.";
$text['description-enable']['nl-nl'] = "Aktiveer om de blokkade aan te zetten voor dit nummer.";
$text['description-enable']['pl-pl'] = "Ustaw wartość na TAK, aby umożliwić blokowanie tego numeru ";
$text['description-enable']['pt-br'] = "Escolha 'sim' para ativar o bloqueio de chamadas para este número.";
$text['description-enable']['pt-pt'] = "Escolha 'sim' para activar o bloqueio de chamadas para este número.";
$text['description-enable']['ro-ro'] = "";
$text['description-enable']['ru-ru'] = "Выберите 'Да', чтобы блокировать вызовы с данного номера.";
$text['description-enable']['sv-se'] = "Välj Sann för att blockera detta nummer.";
$text['description-enable']['uk-ua'] = "Виберіть 'Так', щоб блокувати дзвінки з даного номера.";
$text['description-call-block']['en-us'] = "A list of numbers from which to block calls.";
$text['description-call-block']['en-gb'] = "A list of numbers from which to block calls.";
$text['description-call-block']['ar-eg'] = "";
$text['description-call-block']['de-at'] = "Eine Liste von Nummern die gesperrt werden sollen."; //copied from de-de
$text['description-call-block']['de-ch'] = "Eine Liste von Nummern die gesperrt werden sollen."; //copied from de-de
$text['description-call-block']['de-de'] = "Eine Liste von Nummern die gesperrt werden sollen.";
$text['description-call-block']['el-gr'] = "Μια λίστα από αριθμούς προς απόρριψη εισερχομένων κλήσεων.";
$text['description-call-block']['es-cl'] = "Un listado de números desde los cuales se bloquean las llamadas";
$text['description-call-block']['es-mx'] = "Un listado de números desde los cuales se bloquean las llamadas"; //copied from es-cl
$text['description-call-block']['fr-ca'] = "Une liste de numéros à partir de laquelle vous pouvez bloquer les appels."; //copied from fr-fr
$text['description-call-block']['fr-fr'] = "Une liste de numéros depuis lesquels vous pouvez bloquer les appels";
$text['description-call-block']['he-il'] = "";
$text['description-call-block']['it-it'] = "Una lista di numeri per cui è possibile bloccare le chiamate.";
$text['description-call-block']['nl-nl'] = "Een lijst van nummers die geblokkeerd moeten worden.";
$text['description-call-block']['pl-pl'] = "Lista numerów, z których rozmowy są blokowane.";
$text['description-call-block']['pt-br'] = "Uma lista de números que deseja bloquear as chamadas";
$text['description-call-block']['pt-pt'] = "Uma lista de números que deseje bloquear as chamadas";
$text['description-call-block']['ro-ro'] = "";
$text['description-call-block']['ru-ru'] = "Список номеров, с которых блокируются вызовы.";
$text['description-call-block']['sv-se'] = "En lista med nummer för blockering av samtal.";
$text['description-call-block']['uk-ua'] = "Список номерів, з яких блокуються дзвінки.";
$text['description-action']['en-us'] = "Set an action for calls from this number.";
$text['description-action']['en-gb'] = "Set an action for calls from this number.";
$text['description-action']['ar-eg'] = "";
$text['description-action']['de-at'] = "Wählen Sie eine Aktion für Anrufe von dieser Nummer."; //copied from de-de
$text['description-action']['de-ch'] = "Wählen Sie eine Aktion für Anrufe von dieser Nummer."; //copied from de-de
$text['description-action']['de-de'] = "Wählen Sie eine Aktion für Anrufe von dieser Nummer.";
$text['description-action']['el-gr'] = "Ορίστε ενέργεια για τις κλήσεις από αυτόν τον αριθμό.";
$text['description-action']['es-cl'] = "Configurar una acción para llamadas desde este número.";
$text['description-action']['es-mx'] = "Configurar una acción para llamadas desde este número."; //copied from es-cl
$text['description-action']['fr-ca'] = "Choisir une action pour les appels de ce numéro."; //copied from fr-fr
$text['description-action']['fr-fr'] = "Choisir une action pour les appels de ce numéro.";
$text['description-action']['he-il'] = "";
$text['description-action']['it-it'] = "Seleziona un'azione per le chiamate da questo numero.";
$text['description-action']['nl-nl'] = "Stel actie voor oproepen vanaf dit nummer in.";
$text['description-action']['pl-pl'] = "Ustaw co zrobić w przypadku polaczeń z tego numeru.";
$text['description-action']['pt-br'] = "Escolha uma ação para chamadas reailzadas por este número.";
$text['description-action']['pt-pt'] = "Escolha uma acção para chamadas com origem neste número.";
$text['description-action']['ro-ro'] = "";
$text['description-action']['ru-ru'] = "Установите действие для вызовов с данного номера.";
$text['description-action']['sv-se'] = "Välj en aktion för samtal från detta nummer.";
$text['description-action']['uk-ua'] = "Встановіть дію для дзвінків з цього номера.";
$text['confirm-block']['en-us'] = "Do you really want to block this?";
$text['confirm-block']['en-gb'] = "Do you really want to block this?";
$text['confirm-block']['ar-eg'] = "Do you really want to block this?";
$text['confirm-block']['de-at'] = "Do you really want to block this?";
$text['confirm-block']['de-ch'] = "Do you really want to block this?";
$text['confirm-block']['de-de'] = "Do you really want to block this?";
$text['confirm-block']['el-gr'] = "Do you really want to block this?";
$text['confirm-block']['es-cl'] = "Do you really want to block this?";
$text['confirm-block']['es-mx'] = "Do you really want to block this?";
$text['confirm-block']['fr-ca'] = "Voulez-vous vraiment bloquer ceci?";
$text['confirm-block']['fr-fr'] = "Voulez-vous vraiment bloquer ceci?";
$text['confirm-block']['he-il'] = "Do you really want to block this?";
$text['confirm-block']['it-it'] = "Do you really want to block this?";
$text['confirm-block']['nl-nl'] = "Do you really want to block this?";
$text['confirm-block']['pl-pl'] = "Czy na pewno chcesz to zablokować?";
$text['confirm-block']['pt-br'] = "Do you really want to block this?";
$text['confirm-block']['pt-pt'] = "Do you really want to block this?";
$text['confirm-block']['ro-ro'] = "Do you really want to block this?";
$text['confirm-block']['ru-ru'] = "Do you really want to block this?";
$text['confirm-block']['sv-se'] = "Do you really want to block this?";
$text['confirm-block']['uk-ua'] = "Do you really want to block this?";
$text['confirm-block']['tr-tr'] = "Do you really want to block this?";
$text['button-block']['en-us'] = "Block";
$text['button-block']['en-gb'] = "Block";
$text['button-block']['ar-eg'] = "Block";
$text['button-block']['de-at'] = "Block";
$text['button-block']['de-ch'] = "Block";
$text['button-block']['de-de'] = "Block";
$text['button-block']['el-gr'] = "Block";
$text['button-block']['es-cl'] = "Block";
$text['button-block']['es-mx'] = "Block";
$text['button-block']['fr-ca'] = "Bloquer";
$text['button-block']['fr-fr'] = "Bloquer";
$text['button-block']['he-il'] = "Block";
$text['button-block']['it-it'] = "Block";
$text['button-block']['nl-nl'] = "Block";
$text['button-block']['pl-pl'] = "Blokuj";
$text['button-block']['pt-br'] = "Block";
$text['button-block']['pt-pt'] = "Block";
$text['button-block']['ro-ro'] = "Block";
$text['button-block']['ru-ru'] = "Block";
$text['button-block']['sv-se'] = "Block";
$text['button-block']['uk-ua'] = "Block";
$text['button-block']['tr-tr'] = "Block";
?>

View File

@ -0,0 +1,33 @@
<?php
$y=0;
$apps[$x]['menu'][$y]['title']['en-us'] = "Call Block";
$apps[$x]['menu'][$y]['title']['en-gb'] = "Call Block";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "حظر المكالمات";
$apps[$x]['menu'][$y]['title']['de-at'] = "Sperrlisten";
$apps[$x]['menu'][$y]['title']['de-ch'] = "";
$apps[$x]['menu'][$y]['title']['de-de'] = "Sperrlisten";
$apps[$x]['menu'][$y]['title']['el-gr'] = "Λίστα απορρίψεων";
$apps[$x]['menu'][$y]['title']['es-cl'] = "Bloqueo de llamadas";
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "Liste Noire";
$apps[$x]['menu'][$y]['title']['he-il'] = "חסימת מספר";
$apps[$x]['menu'][$y]['title']['it-it'] = "Blocco Chiamate";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "Oproep blokkade";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Blokowanie rozmów";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Bloqueio de chamadas";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "Bloqueio de Chamadas";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "Blocare apel";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Черный список";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Blockera Samtal";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "Блокування дзвінків";
$apps[$x]['menu'][$y]['uuid'] = "29295c90-b1b9-440b-9c7E-c8363c6e8975";
$apps[$x]['menu'][$y]['parent_uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['path'] = "/app/call_block/call_block.php";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
$apps[$x]['menu'][$y]['groups'][] = "admin";
$apps[$x]['menu'][$y]['groups'][] = "user";
?>

View File

@ -0,0 +1,335 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
The original Call Block was written by Gerrit Visser <gerrit308@gmail.com>
All of it has been rewritten over years.
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/paging.php";
//check permissions
if (!permission_exists('call_block_view')) {
echo "access denied"; exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get posted data
if (is_array($_POST['call_blocks'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$call_blocks = $_POST['call_blocks'];
}
//process the http post data by action
if ($action != '' && is_array($call_blocks) && @sizeof($call_blocks) != 0) {
switch ($action) {
case 'copy':
if (permission_exists('call_block_add')) {
$obj = new call_block;
$obj->copy($call_blocks);
}
break;
case 'toggle':
if (permission_exists('call_block_edit')) {
$obj = new call_block;
$obj->toggle($call_blocks);
}
break;
case 'delete':
if (permission_exists('call_block_delete')) {
$obj = new call_block;
$obj->delete($call_blocks);
}
break;
}
header('Location: call_block.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
}
//get variables used to control the order
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//add the search term
$search = strtolower($_GET["search"]);
if (strlen($search) > 0) {
$sql_search = " (";
$sql_search .= "lower(call_block_name) like :search ";
$sql_search .= "or call_block_country_code like :search ";
$sql_search .= "or lower(call_block_number) like :search ";
$sql_search .= "or lower(call_block_description) like :search ";
$sql_search .= ") ";
$parameters['search'] = '%'.$search.'%';
}
//prepare to page the results
$sql = "select count(*) from view_call_block ";
$sql .= "where true ";
if ($_GET['show'] == "all" && permission_exists('call_forward_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
else {
$sql .= "and (domain_uuid = :domain_uuid) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
if (!permission_exists('call_block_all') && is_array($_SESSION['user']['extension']) && count($_SESSION['user']['extension']) > 0) {
$sql .= "and extension_uuid in (";
$x = 0;
foreach ($_SESSION['user']['extension'] as $field) {
if (is_uuid($field['extension_uuid'])) {
$sql .= ($x == 0) ? "'".$field['extension_uuid']."'" : ",'".$field['extension_uuid']."'";
}
$x++;
}
$sql .= ") ";
}
if (isset($sql_search)) {
$sql .= "and ".$sql_search;
}
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
unset($parameters);
//prepare to page the results
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = "&search=".$search;
if ($_GET['show'] == "all" && permission_exists('call_forward_all')) {
$param .= "&show=all";
}
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
$offset = $rows_per_page * $page;
//get the list
$sql = "select * from view_call_block ";
$sql .= "where true ";
if ($_GET['show'] == "all" && permission_exists('call_forward_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
else {
$sql .= "and (domain_uuid = :domain_uuid) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
if (!permission_exists('call_block_all') && is_array($_SESSION['user']['extension']) && count($_SESSION['user']['extension']) > 0) {
$sql .= "and extension_uuid in (";
$x = 0;
foreach ($_SESSION['user']['extension'] as $field) {
if (is_uuid($field['extension_uuid'])) {
$sql .= ($x == 0) ? "'".$field['extension_uuid']."'" : ",'".$field['extension_uuid']."'";
}
$x++;
}
$sql .= ") ";
}
if (isset($sql_search)) {
$sql .= "and ".$sql_search;
}
$sql .= order_by($order_by, $order, ['call_block_country_code','call_block_number']);
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$result = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//include the header
$document['title'] = $text['title-call-block'];
require_once "resources/header.php";
//show the content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-call-block']." (".$num_rows.")</b></div>\n";
echo " <div class='actions'>\n";
if (permission_exists('call_block_add')) {
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','link'=>'call_block_edit.php']);
}
if (permission_exists('call_block_add') && $result) {
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
}
if (permission_exists('call_block_edit') && $result) {
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'id'=>'btn_toggle','name'=>'btn_toggle','style'=>'display: none;','onclick'=>"modal_open('modal-toggle','btn_toggle');"]);
}
if (permission_exists('call_block_delete') && $result) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('call_forward_all')) {
if ($_GET['show'] == 'all') {
echo " <input type='hidden' name='show' value='all'>";
}
else {
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?type='.urlencode($destination_type).'&show=all'.($search != '' ? "&search=".urlencode($search) : null)]);
}
}
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'call_block.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
}
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if (permission_exists('call_block_add') && $result) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
}
if (permission_exists('call_block_edit') && $result) {
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 (permission_exists('call_block_delete') && $result) {
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');"])]);
}
echo $text['description-call-block']."\n";
echo "<br /><br />\n";
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('call_block_add') || permission_exists('call_block_edit') || permission_exists('call_block_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($result ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
if ($_GET['show'] == 'all' && permission_exists('domain_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
}
echo th_order_by('call_block_direction', $text['label-direction'], $order_by, $order, null, "style='width: 1%;' class='center'");
echo th_order_by('extension', $text['label-extension'], $order_by, $order, null, "class='center'");
echo th_order_by('call_block_name', $text['label-name'], $order_by, $order);
echo th_order_by('call_block_country_code', $text['label-country_code'], $order_by, $order);
echo th_order_by('call_block_number', $text['label-number'], $order_by, $order);
echo th_order_by('call_block_count', $text['label-count'], $order_by, $order, '', "class='center hide-sm-dn'");
echo th_order_by('call_block_action', $text['label-action'], $order_by, $order);
echo th_order_by('call_block_enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
echo th_order_by('date_added', $text['label-date-added'], $order_by, $order, null, "class='shrink no-wrap'");
echo "<th class='hide-md-dn pct-20'>".$text['label-description']."</th>\n";
if (permission_exists('call_block_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($result)) {
$x = 0;
foreach($result as $row) {
if (permission_exists('call_block_edit')) {
$list_row_url = "call_block_edit.php?id=".urlencode($row['call_block_uuid']);
}
echo "<tr class='list-row' href='".$list_row_url."'>\n";
if (permission_exists('call_block_add') || permission_exists('call_block_edit') || permission_exists('call_block_delete')) {
echo " <td class='checkbox'>\n";
echo " <input type='checkbox' name='call_blocks[".$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='call_blocks[".$x."][uuid]' value='".escape($row['call_block_uuid'])."' />\n";
echo " </td>\n";
}
if ($_GET['show'] == 'all' && permission_exists('domain_all')) {
echo " <td>".escape($_SESSION['domains'][$row['domain_uuid']]['domain_name'])."</td>\n";
}
echo " <td class='center'>";
switch ($row['call_block_direction']) {
case "inbound": echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_answered.png' style='border: none;' title='".$text['label-inbound']."'>\n"; break;
case "outbound": echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound_answered.png' style='border: none;' title='".$text['label-outbound']."'>\n"; break;
}
echo " </td>\n";
echo " <td class='center'>";
if (strlen($row['extension']) == 0) {
echo $text['label-all'];
}
else {
echo escape($row['extension']);
}
echo " </td>\n";
echo " <td>".escape($row['call_block_name'])."</td>\n";
echo " <td>";
if (permission_exists('call_block_edit')) {
echo "<a href='".$list_row_url."'>".escape($row['call_block_country_code'])."</a>";
}
else {
echo escape($row['call_block_country_code']);
}
echo " </td>\n";
echo " <td>";
if (permission_exists('call_block_edit')) {
echo "<a href='".$list_row_url."'>".escape(format_phone($row['call_block_number']))."</a>";
}
else {
echo escape(format_phone($row['call_block_number']));
}
echo " </td>\n";
echo " <td class='center hide-sm-dn'>".escape($row['call_block_count'])."</td>\n";
echo " <td>".$text['label-'.$row['call_block_app']]." ".escape($row['call_block_data'])."</td>\n";
if (permission_exists('call_block_edit')) {
echo " <td class='no-link center'>";
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['call_block_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
}
else {
echo " <td class='center'>";
echo $text['label-'.$row['call_block_enabled']];
}
echo " </td>\n";
echo " <td class='no-wrap'>".date('j M Y', $row['date_added'])." <span class='hide-sm-dn'>".date(($_SESSION['domain']['time_format']['text'] == '12h' ? 'h:i:s a' : 'H:i:s'), $row['date_added'])."</span></td>\n";
echo " <td class='description overflow hide-md-dn'>".escape($row['call_block_description'])."</td>\n";
if (permission_exists('call_block_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";
}
echo "</tr>\n";
$x++;
}
unset($result);
}
echo "</table>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,730 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
Original version of Call Block was written by Gerrit Visser <gerrit308@gmail.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (!permission_exists('call_block_edit') && !permission_exists('call_block_add')) {
echo "access denied"; exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
$action = "update";
$call_block_uuid = $_REQUEST["id"];
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (count($_POST) > 0) {
$call_block_direction = $_POST["call_block_direction"];
$extension_uuid = $_POST["extension_uuid"];
$call_block_name = $_POST["call_block_name"];
$call_block_country_code = $_POST["call_block_country_code"];
$call_block_number = $_POST["call_block_number"];
$call_block_enabled = $_POST["call_block_enabled"];
$call_block_description = $_POST["call_block_description"];
$action_array = explode(':', $_POST["call_block_action"]);
$call_block_app = $action_array[0];
$call_block_data = $action_array[1];
}
//handle the http post
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//handle action
if ($_POST['action'] != '') {
switch ($_POST['action']) {
case 'delete':
if (permission_exists('call_block_delete') && is_uuid($call_block_uuid)) {
//prepare
$array[0]['checked'] = 'true';
$array[0]['uuid'] = $call_block_uuid;
//delete
$obj = new call_block;
$obj->delete($array);
}
break;
case 'add':
$xml_cdrs = $_POST['xml_cdrs'];
if (permission_exists('call_block_add') && is_array($xml_cdrs) && @sizeof($xml_cdrs) != 0) {
$obj = new call_block;
$obj->call_block_direction = $call_block_direction;
$obj->extension_uuid = $extension_uuid;
$obj->call_block_app = $call_block_app;
$obj->call_block_data = $call_block_data;
$obj->add($xml_cdrs);
}
break;
}
header('Location: call_block.php');
exit;
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: call_block.php');
exit;
}
//check for all required data
$msg = '';
//if (strlen($call_block_name) == 0) { $msg .= $text['label-provide-name']."<br>\n"; }
//if (strlen($call_block_number) == 0) { $msg .= $text['label-provide-number']."<br>\n"; }
if (strlen($call_block_enabled) == 0) { $msg .= $text['label-provide-enabled']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "resources/footer.php";
return;
}
//add or update the database
if (is_array($_POST) && sizeof($_POST) != 0 && $_POST["persistformvar"] != "true") {
//ensure call block is enabled in the dialplan
if ($action == "add" || $action == "update") {
$sql = "select dialplan_uuid from v_dialplans where true ";
$sql .= "and domain_uuid = :domain_uuid ";
$sql .= "and app_uuid = 'b1b31930-d0ee-4395-a891-04df94599f1f' ";
$sql .= "and dialplan_enabled <> 'true' ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters);
if (is_array($rows) && sizeof($rows) != 0) {
foreach ($rows as $index => $row) {
$array['dialplans'][$index]['dialplan_uuid'] = $row['dialplan_uuid'];
$array['dialplans'][$index]['dialplan_enabled'] = 'true';
}
$p = new permissions;
$p->add('dialplan_edit', 'temp');
$database = new database;
$database->save($array);
unset($array);
$p->delete('dialplan_edit', 'temp');
}
}
//if user doesn't have call block all then use the assigned extension_uuid
if (!permission_exists('call_block_all')) {
$extension_uuid = $_SESSION['user']['extension'][0]['extension_uuid'];
}
//save the data to the database
if ($action == "add") {
$array['call_block'][0]['call_block_uuid'] = uuid();
$array['call_block'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['call_block'][0]['call_block_direction'] = $call_block_direction;
if (is_uuid($extension_uuid)) {
$array['call_block'][0]['extension_uuid'] = $extension_uuid;
}
$array['call_block'][0]['call_block_name'] = $call_block_name;
$array['call_block'][0]['call_block_country_code'] = $call_block_country_code;
$array['call_block'][0]['call_block_number'] = $call_block_number;
$array['call_block'][0]['call_block_count'] = 0;
$array['call_block'][0]['call_block_app'] = $call_block_app;
$array['call_block'][0]['call_block_data'] = $call_block_data;
$array['call_block'][0]['call_block_enabled'] = $call_block_enabled;
$array['call_block'][0]['date_added'] = time();
$array['call_block'][0]['call_block_description'] = $call_block_description;
$database = new database;
$database->app_name = 'call_block';
$database->app_uuid = '9ed63276-e085-4897-839c-4f2e36d92d6c';
$database->save($array);
$response = $database->message;
unset($array);
message::add($text['label-add-complete']);
header("Location: call_block.php");
return;
}
if ($action == "update") {
$sql = "select c.call_block_country_code, c.call_block_number, d.domain_name ";
$sql .= "from v_call_block as c ";
$sql .= "join v_domains as d on c.domain_uuid = d.domain_uuid ";
$sql .= "where c.domain_uuid = :domain_uuid ";
$sql .= "and c.call_block_uuid = :call_block_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['call_block_uuid'] = $call_block_uuid;
$database = new database;
$result = $database->select($sql, $parameters);
if (is_array($result) && sizeof($result) != 0) {
//set the domain_name
$domain_name = $result[0]["domain_name"];
//clear the cache
$cache = new cache;
$cache->delete("app:call_block:".$domain_name.":".$call_block_country_code.$call_block_number);
}
unset($sql, $parameters);
$array['call_block'][0]['call_block_uuid'] = $call_block_uuid;
$array['call_block'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['call_block'][0]['call_block_direction'] = $call_block_direction;
if (is_uuid($extension_uuid)) {
$array['call_block'][0]['extension_uuid'] = $extension_uuid;
}
$array['call_block'][0]['call_block_name'] = $call_block_name;
$array['call_block'][0]['call_block_country_code'] = $call_block_country_code;
$array['call_block'][0]['call_block_number'] = $call_block_number;
$array['call_block'][0]['call_block_app'] = $call_block_app;
$array['call_block'][0]['call_block_data'] = $call_block_data;
$array['call_block'][0]['call_block_enabled'] = $call_block_enabled;
$array['call_block'][0]['date_added'] = time();
$array['call_block'][0]['call_block_description'] = $call_block_description;
$database = new database;
$database->app_name = 'call_block';
$database->app_uuid = '9ed63276-e085-4897-839c-4f2e36d92d6c';
$database->save($array);
$response = $database->message;
unset($array);
message::add($text['label-update-complete']);
header("Location: call_block.php");
return;
}
}
}
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
$call_block_uuid = $_GET["id"];
$sql = "select * from v_call_block ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and call_block_uuid = :call_block_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['call_block_uuid'] = $call_block_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && sizeof($row) != 0) {
$call_block_direction = $row["call_block_direction"];
$extension_uuid = $row["extension_uuid"];
$call_block_name = $row["call_block_name"];
$call_block_country_code = $row["call_block_country_code"];
$call_block_number = $row["call_block_number"];
$call_block_app = $row["call_block_app"];
$call_block_data = $row["call_block_data"];
$call_block_enabled = $row["call_block_enabled"];
$call_block_description = $row["call_block_description"];
}
unset($sql, $parameters, $row);
}
//get the extensions
if (permission_exists('call_block_all') || permission_exists('call_block_extension')) {
$sql = "select extension_uuid, extension, number_alias, user_context, description from v_extensions ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and enabled = 'true' ";
$sql .= "order by extension asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$extensions = $database->select($sql, $parameters);
}
//get the ivr's
if (permission_exists('call_block_all') || permission_exists('call_block_ivr')) {
$sql = "select ivr_menu_uuid,ivr_menu_name, ivr_menu_extension, ivr_menu_description from v_ivr_menus ";
$sql .= "where domain_uuid = :domain_uuid ";
// $sql .= "and enabled = 'true' ";
$sql .= "order by ivr_menu_extension asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$ivrs = $database->select($sql, $parameters);
}
//get the ring groups
if (permission_exists('call_block_all') || permission_exists('call_block_ring_group')) {
$sql = "select ring_group_uuid,ring_group_name, ring_group_extension, ring_group_description from v_ring_groups ";
$sql .= "where domain_uuid = :domain_uuid ";
// $sql .= "and ring_group_enabled = 'true' ";
$sql .= "order by ring_group_extension asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$ring_groups = $database->select($sql, $parameters);
}
//get the voicemails
$sql = "select voicemail_uuid, voicemail_id, voicemail_description ";
$sql .= "from v_voicemails ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and voicemail_enabled = 'true' ";
$sql .= "order by voicemail_id asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$voicemails = $database->select($sql, $parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
$document['title'] = $text['title-call-block'];
require_once "resources/header.php";
//show the content
echo "<form method='post' name='frm' id='frm'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'>";
if ($action == "add") {
echo "<b>".$text['label-edit-add']."</b>\n";
}
if ($action == "update") {
echo "<b>".$text['label-edit-edit']."</b>\n";
}
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','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'call_block.php']);
if ($action == 'update' && permission_exists('call_block_delete')) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'name'=>'btn_delete','collapse'=>'hide-xs','style'=>'margin-right: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','collapse'=>'hide-xs']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if ($action == 'update' && permission_exists('call_block_delete')) {
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
}
if ($action == "add") {
echo $text['label-add-note']."\n";
}
if ($action == "update") {
echo $text['label-edit-note']."\n";
}
echo "<br /><br />\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-direction']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='call_block_direction'>\n";
echo " <option value='inbound'>".$text['label-inbound']."</option>\n";
echo " <option value='outbound' ".($call_block_direction == "outbound" ? "selected" : null).">".$text['label-outbound']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['description-direction']."\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
if (permission_exists('call_block_all')) {
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-extension']."\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <select class='formfld' name='extension_uuid'>\n";
echo " <option value=''>".$text['label-all']."</option>\n";
if (is_array($extensions) && sizeof($extensions) != 0) {
foreach ($extensions as $row) {
$selected = $extension_uuid == $row['extension_uuid'] ? "selected='selected'" : null;
echo " <option value='".urlencode($row["extension_uuid"])."' ".$selected.">".escape($row['extension'])." ".escape($row['description'])."</option>\n";
}
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-extension']."\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-name']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_block_name' maxlength='255' value=\"".escape($call_block_name)."\">\n";
echo "<br />\n";
echo $text['description-call_block_name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-number']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_block_country_code' maxlength='6' style='width: 60px;' value=\"".escape($call_block_country_code)."\">\n";
echo " <input class='formfld' type='text' name='call_block_number' maxlength='255' value=\"".escape($call_block_number)."\">\n";
echo "<br />\n";
echo $text['description-call_block_number']."\n";
echo "<br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-action']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
function call_block_action_select($label = false) {
global $select_margin, $text, $call_block_app, $call_block_data, $extensions, $ivrs, $voicemails, $ring_groups;
echo "<select class='formfld' style='".$select_margin."' name='call_block_action'>\n";
if ($label) {
echo " <option value='' disabled='disabled'>".$text['label-action']."</option>\n";
}
if ($call_block_app == "reject") {
echo " <option value='reject' selected='selected'>".$text['label-reject']."</option>\n";
}
else {
echo " <option value='reject' >".$text['label-reject']."</option>\n";
}
if ($call_block_app == "busy") {
echo " <option value='busy' selected='selected'>".$text['label-busy']."</option>\n";
}
else {
echo " <option value='busy'>".$text['label-busy']."</option>\n";
}
if ($call_block_app == "hold") {
echo " <option value='hold' selected='selected'>".$text['label-hold']."</option>\n";
}
else {
echo " <option value='hold'>".$text['label-hold']."</option>\n";
}
if (permission_exists('call_block_extension')) {
if (is_array($extensions) && sizeof($extensions) != 0) {
echo " <optgroup label='".$text['label-extension']."'>\n";
foreach ($extensions as &$row) {
$selected = ($call_block_app == 'extension' && $call_block_data == $row['extension']) ? "selected='selected'" : null;
echo " <option value='extension:".urlencode($row["extension"])."' ".$selected.">".escape($row['extension'])." ".escape($row['description'])."</option>\n";
}
echo " </optgroup>\n";
}
}
if (permission_exists('call_block_ivr')) {
if (is_array($ivrs) && sizeof($ivrs) != 0) {
echo " <optgroup label='".$text['label-ivr_menus']."'>\n";
foreach ($ivrs as &$row) {
$selected = ($call_block_app == 'ivr' && $call_block_data == $row['ivr_menu_extension']) ? "selected='selected'" : null;
echo " <option value='ivr:".urlencode($row["ivr_menu_extension"])."' ".$selected.">".escape($row['ivr_menu_name'])." ".escape($row['ivr_menu_extension'])."</option>\n";
}
echo " </optgroup>\n";
}
}
if (permission_exists('call_block_ring_group')) {
if (is_array($ring_groups) && sizeof($ring_groups) != 0) {
echo " <optgroup label='".$text['label-ring_groups']."'>\n";
foreach ($ring_groups as &$row) {
$selected = ($call_block_app == 'ring_group' && $call_block_data == $row['ring_group_extension']) ? "selected='selected'" : null;
echo " <option value='ring_group:".urlencode($row["ring_group_extension"])."' ".$selected.">".escape($row['ring_group_name'])." ".escape($row['ring_group_extension'])."</option>\n";
}
echo " </optgroup>\n";
}
}
if (permission_exists('call_block_voicemail')) {
if (is_array($voicemails) && sizeof($voicemails) != 0) {
echo " <optgroup label='".$text['label-voicemail']."'>\n";
foreach ($voicemails as &$row) {
$selected = ($call_block_app == 'voicemail' && $call_block_data == $row['voicemail_id']) ? "selected='selected'" : null;
echo " <option value='voicemail:".urlencode($row["voicemail_id"])."' ".$selected.">".escape($row['voicemail_id'])." ".escape($row['voicemail_description'])."</option>\n";
}
echo " </optgroup>\n";
}
}
echo " </select>";
}
call_block_action_select();
echo "<br />\n";
echo $text['description-action']."\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-enabled']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='call_block_enabled'>\n";
echo " <option value='true' ".(($call_block_enabled == "true") ? "selected" : null).">".$text['label-true']."</option>\n";
echo " <option value='false' ".(($call_block_enabled == "false") ? "selected" : null).">".$text['label-false']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['description-enable']."\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_block_description' maxlength='255' value=\"".escape($call_block_description)."\">\n";
echo "<br />\n";
echo $text['description-description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "<br><br>";
if ($action == "update") {
echo "<input type='hidden' name='call_block_uuid' value='".escape($call_block_uuid)."'>\n";
}
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>";
//get recent calls from the db (if not editing an existing call block record)
if (!is_uuid($_REQUEST["id"])) {
//without block all permission, limit to assigned extension(s)
if (!permission_exists('call_block_all') && is_array($_SESSION['user']['extension'])) {
foreach ($_SESSION['user']['extension'] as $assigned_extension) {
$assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user'];
}
if (is_array($assigned_extensions) && sizeof($assigned_extensions) != 0) {
$x = 0;
foreach ($assigned_extensions as $assigned_extension_uuid => $assigned_extension) {
$sql_where_array[] = "extension_uuid = :extension_uuid_".$x;
$parameters['extension_uuid_'.$x] = $assigned_extension_uuid;
$x++;
}
if (is_array($sql_where_array) && sizeof($sql_where_array) != 0) {
$sql_where .= "and (".implode(' or ', $sql_where_array).") ";
}
unset($sql_where_array);
}
}
//get recent calls
$sql = "select caller_id_name, caller_id_number, caller_destination, start_epoch, direction, hangup_cause, duration, billsec, xml_cdr_uuid ";
$sql .= "from v_xml_cdr where domain_uuid = :domain_uuid ";
$sql .= "and direction <> 'local' ";
$sql .= $sql_where;
$sql .= "order by start_stamp desc ";
$sql .= limit_offset($_SESSION['call_block']['recent_call_limit']['text']);
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$result = $database->select($sql, $parameters);
unset($sql, $parameters);
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value='add'>\n";
echo "<div class='action_bar' id='action_bar_sub'>\n";
echo " <div class='heading'>";
echo " <b id='heading_sub'>".$text['heading-recent_calls']."</b>";
echo " <select class='formfld' name='call_block_direction' style='margin-bottom: 6px; margin-left: 15px;' onchange=\"show_direction(this.options[this.selectedIndex].value);\">\n";
echo " <option value='' disabled='disabled'>".$text['label-direction']."</option>\n";
echo " <option value='inbound'>".$text['label-inbound']."</option>\n";
echo " <option value='outbound'>".$text['label-outbound']."</option>\n";
echo " </select>\n";
echo " </div>\n";
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','id'=>'action_bar_sub_button_back','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'collapse'=>'hide-xs','style'=>'display: none;','link'=>'call_block.php']);
if ($result) {
$select_margin = 'margin-left: 15px;';
if (permission_exists('call_block_all')) {
echo "<select class='formfld' style='".$select_margin."' name='extension_uuid'>\n";
echo " <option value='' disabled='disabled'>".$text['label-extension']."</option>\n";
echo " <option value='' selected='selected'>".$text['label-all']."</option>\n";
if (is_array($extensions) && sizeof($extensions) != 0) {
foreach ($extensions as $row) {
$selected = $extension_uuid == $row['extension_uuid'] ? "selected='selected'" : null;
echo " <option value='".urlencode($row["extension_uuid"])."' ".$selected.">".escape($row['extension'])." ".escape($row['description'])."</option>\n";
}
}
echo " </select>";
unset($select_margin);
}
call_block_action_select(true);
echo button::create(['type'=>'button','label'=>$text['button-block'],'icon'=>'ban','collapse'=>'hide-xs','onclick'=>"modal_open('modal-block','btn_block');"]);
}
echo "</div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if ($result) {
echo modal::create(['id'=>'modal-block','type'=>'general','message'=>$text['confirm-block'],'actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_block','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_form_submit('form_list');"])]);
}
foreach (['inbound','outbound'] as $direction) {
echo "<table class='list' id='list_".$direction."' ".($direction == 'outbound' ? "style='display: none;'" : null).">\n";
echo "<tr class='list-header'>\n";
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all_".$direction."' name='checkbox_all' onclick=\"list_all_toggle('".$direction."');\" ".($result ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
echo "<th style='width: 1%;'>&nbsp;</th>\n";
echo th_order_by('caller_id_name', $text['label-name'], $order_by, $order);
echo th_order_by('caller_id_number', $text['label-number'], $order_by, $order);
echo th_order_by('caller_id_number', $text['label-destination'], $order_by, $order);
echo th_order_by('start_stamp', $text['label-called'], $order_by, $order);
echo th_order_by('duration', $text['label-duration'], $order_by, $order, null, "class='right hide-sm-dn'");
echo "</tr>";
if (is_array($result) && @sizeof($result) != 0) {
foreach ($result as $x => $row) {
if ($row['direction'] == $direction) {
$list_row_onclick_uncheck = "if (!this.checked) { document.getElementById('checkbox_all_".$direction."').checked = false; }";
$list_row_onclick_toggle = "onclick=\"document.getElementById('checkbox_".$x."').checked = document.getElementById('checkbox_".$x."').checked ? false : true; ".$list_row_onclick_uncheck."\"";
if (strlen($row['caller_id_number']) >= 7) {
if ($_SESSION['domain']['time_format']['text'] == '24h') {
$tmp_start_epoch = date('j M Y', $row['start_epoch'])." <span class='hide-sm-dn'>".date('H:i:s', $row['start_epoch']).'</span>';
}
else {
$tmp_start_epoch = date('j M Y', $row['start_epoch'])." <span class='hide-sm-dn'>".date('h:i:s a', $row['start_epoch']).'</span>';
}
echo "<tr class='list-row row_".$row['direction']."' href='".$list_row_url."'>\n";
echo " <td class='checkbox'>\n";
echo " <input type='checkbox' class='checkbox_".$row['direction']."' name='xml_cdrs[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"".$list_row_onclick_uncheck."\">\n";
echo " <input type='hidden' name='xml_cdrs[$x][uuid]' value='".escape($row['xml_cdr_uuid'])."' />\n";
echo " </td>\n";
if (
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_voicemail.png") &&
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_answered.png") &&
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound_failed.png") &&
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound_answered.png")
) {
echo " <td class='center' ".$list_row_onclick_toggle.">";
switch ($row['direction']) {
case "inbound":
if ($row['billsec'] == 0) {
$title_mod = " ".$text['label-missed'];
$file_mod = "_voicemail";
}
else {
$file_mod = "_answered";
}
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound".$file_mod.".png' style='border: none;' title='".$text['label-inbound'].$title_mod."'>\n";
break;
case "outbound":
if ($row['billsec'] == 0) {
$title_mod = " ".$text['label-failed'];
$file_mod = "_failed";
}
else {
$file_mod = "_answered";
}
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound".$file_mod.".png' style='border: none;' title='".$text['label-outbound'].$title_mod."'>\n";
break;
}
echo " </td>\n";
}
else {
echo " <td ".$list_row_onclick_toggle.">&nbsp;</td>";
}
echo " <td ".$list_row_onclick_toggle.">".$row['caller_id_name']." </td>\n";
echo " <td ".$list_row_onclick_toggle.">".format_phone($row['caller_id_number'])."</td>\n";
echo " <td ".$list_row_onclick_toggle.">".format_phone($row['caller_destination'])."</td>\n";
echo " <td class='no-wrap' ".$list_row_onclick_toggle.">".$tmp_start_epoch."</td>\n";
$seconds = ($row['hangup_cause'] == "ORIGINATOR_CANCEL") ? $row['duration'] : $row['billsec']; //if they cancelled, show the ring time, not the bill time.
echo " <td class='right hide-sm-dn' ".$list_row_onclick_toggle.">".gmdate("G:i:s", $seconds)."</td>\n";
echo "</tr>\n";
}
}
}
}
echo "</table>\n";
}
unset($result);
echo "<br />\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//handle hiding and showing of direction recent calls
echo "<script>\n";
echo " function show_direction(direction) {\n";
echo " //determine other direction\n";
echo " direction_other = direction == 'inbound' ? 'outbound' : 'inbound';\n";
echo " //hide other direction list\n";
echo " document.getElementById('list_' + direction_other).style.display='none';\n";
echo " //uncheck all checkboxes\n";
echo " var checkboxes = document.querySelectorAll(\"input[type='checkbox']\")\n";
echo " if (checkboxes.length > 0) {\n";
echo " for (var i = 0; i < checkboxes.length; ++i) {\n";
echo " checkboxes[i].checked = false;\n";
echo " }\n";
echo " }\n";
echo " //show direction list\n";
echo " document.getElementById('list_' + direction).style.display='inline';\n";
echo " }\n";
echo "</script>\n";
}
//make sub action bar sticky
echo "<script>\n";
echo " window.addEventListener('scroll', function(){\n";
echo " action_bar_scroll('action_bar_sub', 480, heading_modify, heading_restore);\n";
echo " }, false);\n";
echo " function heading_modify() {\n";
echo " document.getElementById('heading_sub').innerHTML = \"".$text['heading-block_recent_calls']."\";\n";
echo " document.getElementById('action_bar_sub_button_back').style.display = 'inline-block';\n";
echo " }\n";
echo " function heading_restore() {\n";
echo " document.getElementById('heading_sub').innerHTML = \"".$text['heading-recent_calls']."\";\n";
echo " document.getElementById('action_bar_sub_button_back').style.display = 'none';\n";
echo " }\n";
echo "</script>\n";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,436 @@
<?php
/**
* call block class
*
* @method null download
*/
if (!class_exists('call_block')) {
class call_block {
/**
* declare private variables
*/
private $app_name;
private $app_uuid;
private $permission_prefix;
private $list_page;
private $table;
private $uuid_prefix;
private $toggle_field;
private $toggle_values;
/**
* declare public variables
*/
public $call_block_direction;
public $extension_uuid;
public $call_block_app;
public $call_block_data;
/**
* called when the object is created
*/
public function __construct() {
//assign private variables
$this->app_name = 'call_block';
$this->app_uuid = '9ed63276-e085-4897-839c-4f2e36d92d6c';
$this->permission_prefix = 'call_block_';
$this->list_page = 'call_block.php';
$this->table = 'call_block';
$this->uuid_prefix = 'call_block_';
$this->toggle_field = 'call_block_enabled';
$this->toggle_values = ['true','false'];
}
/**
* called when there are no references to a particular object
* unset the variables used in the class
*/
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
/**
* delete records
*/
public function delete($records) {
if (permission_exists($this->permission_prefix.'delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//delete multiple records
if (is_array($records) && @sizeof($records) != 0) {
//filter out unchecked, build where clause for below
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//get necessary call block details
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select ".$this->uuid_prefix."uuid as uuid, call_block_number from v_".$this->table." ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
$call_block_numbers[$row['uuid']] = $row['call_block_number'];
}
}
unset($sql, $parameters, $rows, $row);
}
//build the delete array
$x = 0;
foreach ($call_block_numbers as $call_block_uuid => $call_block_number) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $call_block_uuid;
$array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$x++;
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
//execute delete
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->delete($array);
unset($array);
//clear the cache
$cache = new cache;
foreach ($call_block_numbers as $call_block_number) {
$cache->delete("app:call_block:".$_SESSION['domain_name'].":".$call_block_number);
}
//set message
message::add($text['message-delete']);
}
unset($records);
}
}
}
/**
* toggle records
*/
public function toggle($records) {
if (permission_exists($this->permission_prefix.'edit')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//toggle the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get current toggle state
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select ".$this->uuid_prefix."uuid as uuid, ".$this->toggle_field." as toggle, call_block_number from v_".$this->table." ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
$states[$row['uuid']] = $row['toggle'];
$call_block_numbers[] = $row['call_block_number'];
}
}
unset($sql, $parameters, $rows, $row);
}
//build update array
$x = 0;
foreach ($states as $uuid => $state) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
$array[$this->table][$x][$this->toggle_field] = $state == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
$x++;
}
//save the changes
if (is_array($array) && @sizeof($array) != 0) {
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//clear the cache
$cache = new cache;
foreach ($call_block_numbers as $call_block_number) {
$cache->delete("app:call_block:".$_SESSION['domain_name'].":".$call_block_number);
}
//set message
message::add($text['message-toggle']);
}
unset($records, $states);
}
}
}
/**
* copy records
*/
public function copy($records) {
if (permission_exists($this->permission_prefix.'add')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//copy the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get checked records
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//create insert array from existing data
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select * from v_".$this->table." ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $x => $row) {
//copy data
$array[$this->table][$x] = $row;
//overwrite
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = uuid();
$array[$this->table][$x]['call_block_description'] = trim($row['call_block_description'].' ('.$text['label-copy'].')');
}
}
unset($sql, $parameters, $rows, $row);
}
//save the changes and set the message
if (is_array($array) && @sizeof($array) != 0) {
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//set message
message::add($text['message-copy']);
}
unset($records);
}
}
}
/**
* add records
*/
public function add($records) {
if (permission_exists($this->permission_prefix.'add')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//add the checked records
if (is_array($records) && @sizeof($records) != 0) {
//filter checked records
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//get the caller id info from cdrs
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select caller_id_name, caller_id_number, caller_destination from v_xml_cdr ";
$sql .= "where xml_cdr_uuid in (".implode(', ', $uuids).") ";
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
unset($sql);
}
//loop through records
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $x => $row) {
//build insert array
if (permission_exists('call_block_all')) {
$array['call_block'][$x]['call_block_uuid'] = uuid();
$array['call_block'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['call_block'][$x]['call_block_direction'] = $this->call_block_direction;
if (is_uuid($this->extension_uuid)) {
$array['call_block'][$x]['extension_uuid'] = $this->extension_uuid;
}
if ($this->call_block_direction == 'inbound') {
//remove e.164 and country code
if (trim($row["caller_id_number"])[0] == "+") {
//format e.164
$call_block_number = str_replace("+".trim($_SESSION['domain']['country_code']['numeric']), "", trim($row["caller_id_number"]));
} else {
//remove the country code if its the first in the string
$call_block_number = ltrim(trim($row["caller_id_number"]),$_SESSION['domain']['country_code']['numeric']);
}
//build the array
$array['call_block'][$x]['call_block_country_code'] = trim($_SESSION['domain']['country_code']['numeric']);
$array['call_block'][$x]['call_block_name'] = trim($row["caller_id_name"]);
$array['call_block'][$x]['call_block_number'] = $call_block_number;
$array['call_block'][$x]['call_block_description'] = trim($row["caller_id_name"]);
}
if ($this->call_block_direction == 'outbound') {
$array['call_block'][$x]['call_block_number'] = trim($row["caller_destination"]);
}
$array['call_block'][$x]['call_block_count'] = 0;
$array['call_block'][$x]['call_block_app'] = $this->call_block_app;
$array['call_block'][$x]['call_block_data'] = $this->call_block_data;
$array['call_block'][$x]['call_block_enabled'] = 'true';
$array['call_block'][$x]['date_added'] = time();
$x++;
}
else {
if (is_array($_SESSION['user']['extension'])) {
foreach ($_SESSION['user']['extension'] as $field) {
if (is_uuid($field['extension_uuid'])) {
$array['call_block'][$x]['call_block_uuid'] = uuid();
$array['call_block'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['call_block'][$x]['call_block_direction'] = $this->call_block_direction;
$array['call_block'][$x]['extension_uuid'] = $field['extension_uuid'];
if ($this->call_block_direction == 'inbound') {
//remove e.164 and country code
$call_block_number = str_replace("+".trim($_SESSION['domain']['country_code']['numeric']), "", trim($row["caller_id_number"]));
//build the array
$array['call_block'][$x]['call_block_name'] = trim($row["caller_id_name"]);
$array['call_block'][$x]['call_block_number'] = $call_block_number;
$array['call_block'][$x]['call_block_description'] = trim($row["caller_id_name"]);
}
if ($this->call_block_direction == 'outbound') {
$array['call_block'][$x]['call_block_number'] = trim($row["caller_destination"]);
}
$array['call_block'][$x]['call_block_count'] = 0;
$array['call_block'][$x]['call_block_app'] = $this->call_block_app;
$array['call_block'][$x]['call_block_data'] = $this->call_block_data;
$array['call_block'][$x]['call_block_enabled'] = 'true';
$array['call_block'][$x]['date_added'] = time();
$x++;
}
}
}
}
}
}
//add records
if (is_array($array) && @sizeof($array) != 0) {
//ensure call block is enabled in the dialplan (build update array)
$sql = "select dialplan_uuid from v_dialplans ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and app_uuid = '".$this->app_uuid."' ";
$sql .= "and dialplan_enabled <> 'true' ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters);
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $x => $row) {
$array['dialplans'][$x]['dialplan_uuid'] = $row['dialplan_uuid'];
$array['dialplans'][$x]['dialplan_enabled'] = 'true';
}
}
unset($rows, $parameters);
//grant temporary permissions
$p = new permissions;
$p->add('dialplan_edit', 'temp');
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
$response = $database->message;
unset($array);
//revoke temporary permissions
$p->delete('dialplan_edit', 'temp');
//set message
message::add($text['message-add']);
}
}
}
} //method
} //class
}
?>

90
app/call_block/root.php Normal file
View File

@ -0,0 +1,90 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,194 @@
<?php
//application details
$apps[$x]['name'] = "Call Broadcast";
$apps[$x]['uuid'] = "efc11f6b-ed73-9955-4d4d-3a1bed75a056";
$apps[$x]['category'] = "Switch";;
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Schedule to immediately make multiple calls to the extension, an IVR Menu, Conference Room, or any other number.";
$apps[$x]['description']['en-gb'] = "Schedule to immediately make multiple calls to the extension, an IVR Menu, Conference Room, or any other number.";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Methode um sofort mehrere parallele Anrufe an Nebenstellen, Automatische Zentralen, Conferenzräume oder andere Rufnummern zu leiten.";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Methode um sofort mehrere parallele Anrufe an Nebenstellen, Automatische Zentralen, Conferenzräume oder andere Rufnummern zu leiten.";
$apps[$x]['description']['es-cl'] = "Realiza llamadas inmediatamente a extensiones, IVR, conferencias o cualquier otro número";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "Il fait d' massive appels vers des extensions, IVR, salles de conferences ou quelqu'autre nom.";
$apps[$x]['description']['fr-fr'] = "Programmation de campagnes d'appels vers des extensions, IVR, salles de conferences ou tout autre numéro.";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "Methode om direct meerdere parallele oproepen naar toestellen, IVR menu, Conferentie, of een ander nummer te maken.";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "Programação para imediatamente realizar várias chamadas para uma extensão, um menu IVR, Sala de Conferência ou qualquer outro número.";
$apps[$x]['description']['pt-pt'] = "Programação para imediatamente fazer várias chamadas para uma extensão, um IVR, Sala de Conferência, ou qualquer outro número.";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_view";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "50153bbf-78c5-b49e-7bd9-4b3e4b1134e6";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_add";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_edit";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_start_time";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_timeout";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_concurrent_limit";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_caller_id";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_destination_number";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_phone_number_list";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_voicemail_detection";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "broadcast_toll_allow";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_delete";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_all";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_broadcast_send";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
//schema details
$y=0;
$apps[$x]['db'][$y]['table']['name'] = "v_call_broadcasts";
$apps[$x]['db'][$y]['table']['parent'] = "";
$z=0;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "id";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "call_broadcast_id";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_broadcast_uuid";
//$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'][0] = "call_call_broadcast_uuid";
//$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'][1] = "broadcast_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "broadcast_description";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "broadcast_desc";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_start_time";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_timeout";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_concurrent_limit";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "recording_uuid";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "recordingid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_recordings";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "recording_uuid";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_caller_id_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_caller_id_number";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_destination_type";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_phone_numbers";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_avmd";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_destination_data";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_accountcode";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_toll_allow";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
?>

View File

@ -0,0 +1,824 @@
<?php
#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
$text['title-call_broadcasts']['en-us'] = "Call Broadcasts";
$text['title-call_broadcasts']['en-gb'] = "Call Broadcasts";
$text['title-call_broadcasts']['ar-eg'] = "";
$text['title-call_broadcasts']['de-at'] = "Rundrufe"; //copied from de-de
$text['title-call_broadcasts']['de-ch'] = "Rundrufe"; //copied from de-de
$text['title-call_broadcasts']['de-de'] = "Rundrufe";
$text['title-call_broadcasts']['es-cl'] = "Llamada Masiva (Broadcast)";
$text['title-call_broadcasts']['es-mx'] = "Llamada Masiva (Broadcast)"; //copied from es-cl
$text['title-call_broadcasts']['fr-ca'] = "Campagne d'appels"; //copied from fr-fr
$text['title-call_broadcasts']['fr-fr'] = "Campagne d'appels";
$text['title-call_broadcasts']['he-il'] = "הגדרת חשבון";
$text['title-call_broadcasts']['it-it'] = "Chiamate Multiple";
$text['title-call_broadcasts']['nl-nl'] = "Omroep";
$text['title-call_broadcasts']['pl-pl'] = "Rozsyłanie rozmów";
$text['title-call_broadcasts']['pt-br'] = "Configurações da Conta";
$text['title-call_broadcasts']['pt-pt'] = "Chamadas de Broadcast";
$text['title-call_broadcasts']['ro-ro'] = "";
$text['title-call_broadcasts']['ru-ru'] = "Массовые вызовы";
$text['title-call_broadcasts']['sv-se'] = "Samtalsdistributioner";
$text['title-call_broadcasts']['uk-ua'] = "Трансляція дзвінків";
$text['title-call_broadcast']['en-us'] = "Call Broadcast";
$text['title-call_broadcast']['en-gb'] = "Call Broadcast";
$text['title-call_broadcast']['ar-eg'] = "";
$text['title-call_broadcast']['de-at'] = "Rundrufe"; //copied from de-de
$text['title-call_broadcast']['de-ch'] = "Rundrufe"; //copied from de-de
$text['title-call_broadcast']['de-de'] = "Rundrufe";
$text['title-call_broadcast']['es-cl'] = "Llamada Masiva (Broadcast)";
$text['title-call_broadcast']['es-mx'] = "Llamada Masiva (Broadcast)"; //copied from es-cl
$text['title-call_broadcast']['fr-ca'] = "Campagne d'appels"; //copied from fr-fr
$text['title-call_broadcast']['fr-fr'] = "Campagne d'appels";
$text['title-call_broadcast']['he-il'] = "הגדרת חשבון";
$text['title-call_broadcast']['it-it'] = "Chiamate Multiple";
$text['title-call_broadcast']['nl-nl'] = "Omroep";
$text['title-call_broadcast']['pl-pl'] = "Rozsyłanie rozmów";
$text['title-call_broadcast']['pt-br'] = "Configurações da Conta";
$text['title-call_broadcast']['pt-pt'] = "Chamadas de Broadcast";
$text['title-call_broadcast']['ro-ro'] = "";
$text['title-call_broadcast']['ru-ru'] = "Массовые вызовы";
$text['title-call_broadcast']['sv-se'] = "Samtalsdistributioner";
$text['title-call_broadcast']['uk-ua'] = "Трансляція дзвінків";
$text['title_description-call_broadcast']['en-us'] = "Manage the delivery of pre-recorded messages to mass recipients.";
$text['title_description-call_broadcast']['en-gb'] = "Manage the delivery of pre-recorded messages to mass recipients.";
$text['title_description-call_broadcast']['ar-eg'] = "";
$text['title_description-call_broadcast']['de-at'] = "";
$text['title_description-call_broadcast']['de-ch'] = "";
$text['title_description-call_broadcast']['de-de'] = "";
$text['title_description-call_broadcast']['es-cl'] = "";
$text['title_description-call_broadcast']['es-mx'] = "";
$text['title_description-call_broadcast']['fr-ca'] = "";
$text['title_description-call_broadcast']['fr-fr'] = "";
$text['title_description-call_broadcast']['he-il'] = "";
$text['title_description-call_broadcast']['it-it'] = "";
$text['title_description-call_broadcast']['nl-nl'] = "Beheer de aflevering van voor-opgenomen boodschappen naar meerdere ontvangers.";
$text['title_description-call_broadcast']['pl-pl'] = "Zarządzaj dostarczaniem nagranych wiadomości do odbiorców masowych.";
$text['title_description-call_broadcast']['pt-br'] = "";
$text['title_description-call_broadcast']['pt-pt'] = "";
$text['title_description-call_broadcast']['ro-ro'] = "";
$text['title_description-call_broadcast']['ru-ru'] = "";
$text['title_description-call_broadcast']['sv-se'] = "";
$text['title_description-call_broadcast']['uk-ua'] = "";
$text['option-true']['en-us'] = "True";
$text['option-true']['en-gb'] = "True";
$text['option-true']['ar-eg'] = "";
$text['option-true']['de-at'] = "Ein"; //copied from de-de
$text['option-true']['de-ch'] = "Ein"; //copied from de-de
$text['option-true']['de-de'] = "Ein";
$text['option-true']['es-cl'] = "Verdadero";
$text['option-true']['es-mx'] = "Verdadero"; //copied from es-cl
$text['option-true']['fr-ca'] = "Oui"; //copied from fr-fr
$text['option-true']['fr-fr'] = "Oui";
$text['option-true']['he-il'] = "חוקי";
$text['option-true']['it-it'] = "";
$text['option-true']['nl-nl'] = "Aan";
$text['option-true']['pl-pl'] = "Tak";
$text['option-true']['pt-br'] = "Sim"; //copied from pt-pt
$text['option-true']['pt-pt'] = "Sim";
$text['option-true']['ro-ro'] = "";
$text['option-true']['ru-ru'] = "Да";
$text['option-true']['sv-se'] = "Sann";
$text['option-true']['uk-ua'] = "Так";
$text['option-false']['en-us'] = "False";
$text['option-false']['en-gb'] = "False";
$text['option-false']['ar-eg'] = "";
$text['option-false']['de-at'] = "Aus"; //copied from de-de
$text['option-false']['de-ch'] = "Aus"; //copied from de-de
$text['option-false']['de-de'] = "Aus";
$text['option-false']['es-cl'] = "Falso";
$text['option-false']['es-mx'] = "Falso"; //copied from es-cl
$text['option-false']['fr-ca'] = "Non"; //copied from fr-fr
$text['option-false']['fr-fr'] = "Non";
$text['option-false']['he-il'] = "לא חוקי";
$text['option-false']['it-it'] = "";
$text['option-false']['nl-nl'] = "Uit";
$text['option-false']['pl-pl'] = "Nie";
$text['option-false']['pt-br'] = "Não"; //copied from pt-pt
$text['option-false']['pt-pt'] = "Não";
$text['option-false']['ro-ro'] = "";
$text['option-false']['ru-ru'] = "Нет";
$text['option-false']['sv-se'] = "Falsk";
$text['option-false']['uk-ua'] = "Ні";
$text['label-view-calls']['en-us'] = "View Calls";
$text['label-view-calls']['en-gb'] = "View Calls";
$text['label-view-calls']['ar-eg'] = "";
$text['label-view-calls']['de-at'] = "Anrufe ansehen"; //copied from de-de
$text['label-view-calls']['de-ch'] = "Anrufe ansehen"; //copied from de-de
$text['label-view-calls']['de-de'] = "Anrufe ansehen";
$text['label-view-calls']['es-cl'] = "Ver llamadas";
$text['label-view-calls']['es-mx'] = "Ver llamadas"; //copied from es-cl
$text['label-view-calls']['fr-ca'] = "Voir les appels"; //copied from fr-fr
$text['label-view-calls']['fr-fr'] = "Voir les appels";
$text['label-view-calls']['he-il'] = "";
$text['label-view-calls']['it-it'] = "Visualizza Chiamate";
$text['label-view-calls']['nl-nl'] = "Oproepen bekijken";
$text['label-view-calls']['pl-pl'] = "Podgląd rozmów";
$text['label-view-calls']['pt-br'] = "Ver chamadas";
$text['label-view-calls']['pt-pt'] = "Ver Chamadas";
$text['label-view-calls']['ro-ro'] = "";
$text['label-view-calls']['ru-ru'] = "Показать вызовы";
$text['label-view-calls']['sv-se'] = "Granska Samtal";
$text['label-view-calls']['uk-ua'] = "Перегляд дзвінків";
$text['label-start_time']['en-us'] = "Start Time";
$text['label-start_time']['en-gb'] = "Start Time";
$text['label-start_time']['ar-eg'] = "Start Time";
$text['label-start_time']['de-at'] = "Start Time"; //copied from de-de
$text['label-start_time']['de-ch'] = "Start Time"; //copied from de-de
$text['label-start_time']['de-de'] = "Start Time";
$text['label-start_time']['es-cl'] = "Start Time";
$text['label-start_time']['es-mx'] = "Start Time"; //copied from es-cl
$text['label-start_time']['fr-ca'] = "Start Time"; //copied from fr-fr
$text['label-start_time']['fr-fr'] = "Start Time";
$text['label-start_time']['he-il'] = "Start Time";
$text['label-start_time']['it-it'] = "Start Time";
$text['label-start_time']['nl-nl'] = "Start Time";
$text['label-start_time']['pl-pl'] = "Czas rozpoczęcia";
$text['label-start_time']['pt-br'] = "Start Time";
$text['label-start_time']['pt-pt'] = "Start Time";
$text['label-start_time']['ro-ro'] = "Start Time";
$text['label-start_time']['ru-ru'] = "Start Time";
$text['label-start_time']['sv-se'] = "Start Time";
$text['label-start_time']['uk-ua'] = "Start Time";
$text['label-timeout']['en-us'] = "Timeout";
$text['label-timeout']['en-gb'] = "Timeout";
$text['label-timeout']['ar-eg'] = "";
$text['label-timeout']['de-at'] = "Zeitüberschreitung"; //copied from de-de
$text['label-timeout']['de-ch'] = "Zeitüberschreitung"; //copied from de-de
$text['label-timeout']['de-de'] = "Zeitüberschreitung";
$text['label-timeout']['es-cl'] = "Tiempo Líimite";
$text['label-timeout']['es-mx'] = "Tiempo Líimite"; //copied from es-cl
$text['label-timeout']['fr-ca'] = "Timeout"; //copied from fr-fr
$text['label-timeout']['fr-fr'] = "Timeout";
$text['label-timeout']['he-il'] = "";
$text['label-timeout']['it-it'] = "";
$text['label-timeout']['nl-nl'] = "Tijdsoverschrijding";
$text['label-timeout']['pl-pl'] = "Przekroczenie czasu oczekiwania (timeout)";
$text['label-timeout']['pt-br'] = "Tempo limite";
$text['label-timeout']['pt-pt'] = "Timeout";
$text['label-timeout']['ro-ro'] = "";
$text['label-timeout']['ru-ru'] = "Тайм-аут";
$text['label-timeout']['sv-se'] = "Tidsgräns";
$text['label-timeout']['uk-ua'] = "Таймаут";
$text['label-phone']['en-us'] = "Phone Number List";
$text['label-phone']['en-gb'] = "Phone Number List";
$text['label-phone']['ar-eg'] = "";
$text['label-phone']['de-at'] = "Liste der Telefonnummern"; //copied from de-de
$text['label-phone']['de-ch'] = "Liste der Telefonnummern"; //copied from de-de
$text['label-phone']['de-de'] = "Liste der Telefonnummern";
$text['label-phone']['es-cl'] = "Lista de Números de Telefono";
$text['label-phone']['es-mx'] = "Lista de Números de Telefono"; //copied from es-cl
$text['label-phone']['fr-ca'] = "Liste de Numéros de téléphone"; //copied from fr-fr
$text['label-phone']['fr-fr'] = "Liste de Numéros de téléphone";
$text['label-phone']['he-il'] = "רשימת מספרי טלפון";
$text['label-phone']['it-it'] = "Lista Numeri di Telefono";
$text['label-phone']['nl-nl'] = "Telefoonnummer lijst";
$text['label-phone']['pl-pl'] = "Lista numerów telefonu";
$text['label-phone']['pt-br'] = "Lista de números de telefone";
$text['label-phone']['pt-pt'] = "Lista de Números de Telefone";
$text['label-phone']['ro-ro'] = "";
$text['label-phone']['ru-ru'] = "Список телефонних номеров";
$text['label-phone']['sv-se'] = "Lista Med Telefonnummer";
$text['label-phone']['uk-ua'] = "Список телефонних номерів";
$text['label-message']['en-us'] = "Message";
$text['label-message']['en-gb'] = "Message";
$text['label-message']['ar-eg'] = "";
$text['label-message']['de-at'] = "Nachricht"; //copied from de-de
$text['label-message']['de-ch'] = "Nachricht"; //copied from de-de
$text['label-message']['de-de'] = "Nachricht";
$text['label-message']['es-cl'] = "Mensaje";
$text['label-message']['es-mx'] = "Mensaje"; //copied from es-cl
$text['label-message']['fr-ca'] = "Message"; //copied from fr-fr
$text['label-message']['fr-fr'] = "Message";
$text['label-message']['he-il'] = "הודעה";
$text['label-message']['it-it'] = "Messaggio";
$text['label-message']['nl-nl'] = "Boodschappen";
$text['label-message']['pl-pl'] = "Wiadomość";
$text['label-message']['pt-br'] = "Mensagem"; //copied from pt-pt
$text['label-message']['pt-pt'] = "Mensagem";
$text['label-message']['ro-ro'] = "";
$text['label-message']['ru-ru'] = "Сообщение";
$text['label-message']['sv-se'] = "Meddelande";
$text['label-message']['uk-ua'] = "Повідомлення";
$text['label-has-been']['en-us'] = "has been started";
$text['label-has-been']['en-gb'] = "has been started";
$text['label-has-been']['ar-eg'] = "";
$text['label-has-been']['de-at'] = "wurde gestartet"; //copied from de-de
$text['label-has-been']['de-ch'] = "wurde gestartet"; //copied from de-de
$text['label-has-been']['de-de'] = "wurde gestartet";
$text['label-has-been']['es-cl'] = "iniciada";
$text['label-has-been']['es-mx'] = "iniciada"; //copied from es-cl
$text['label-has-been']['fr-ca'] = "a commencé"; //copied from fr-fr
$text['label-has-been']['fr-fr'] = "a commencé";
$text['label-has-been']['he-il'] = "";
$text['label-has-been']['it-it'] = "è iniziato.";
$text['label-has-been']['nl-nl'] = "is gestart";
$text['label-has-been']['pl-pl'] = "rozpoczęto";
$text['label-has-been']['pt-br'] = "foi inicializada"; //copied from pt-pt
$text['label-has-been']['pt-pt'] = "foi inicializada";
$text['label-has-been']['ro-ro'] = "";
$text['label-has-been']['ru-ru'] = "было запущено";
$text['label-has-been']['sv-se'] = "har startat";
$text['label-has-been']['uk-ua'] = "було запущено";
$text['label-destination']['en-us'] = "Destination Number";
$text['label-destination']['en-gb'] = "Destination Number";
$text['label-destination']['ar-eg'] = "";
$text['label-destination']['de-at'] = "Zielnummer"; //copied from de-de
$text['label-destination']['de-ch'] = "Zielnummer"; //copied from de-de
$text['label-destination']['de-de'] = "Zielnummer";
$text['label-destination']['es-cl'] = "Número de Destino";
$text['label-destination']['es-mx'] = "Número de Destino"; //copied from es-cl
$text['label-destination']['fr-ca'] = "Numéro de Destination"; //copied from fr-fr
$text['label-destination']['fr-fr'] = "Numéro de Destination";
$text['label-destination']['he-il'] = "יעד";
$text['label-destination']['it-it'] = "Numero di Destinazione";
$text['label-destination']['nl-nl'] = "Bestemmingnummer";
$text['label-destination']['pl-pl'] = "Destynacja";
$text['label-destination']['pt-br'] = "Número de destino";
$text['label-destination']['pt-pt'] = "Número de Destino";
$text['label-destination']['ro-ro'] = "";
$text['label-destination']['ru-ru'] = "Номер назначения";
$text['label-destination']['sv-se'] = "Destinationsnummer";
$text['label-destination']['uk-ua'] = "Номер";
$text['label-concurrent-limit']['en-us'] = "Concurrent Limit";
$text['label-concurrent-limit']['en-gb'] = "Concurrent Limit";
$text['label-concurrent-limit']['ar-eg'] = "";
$text['label-concurrent-limit']['de-at'] = "Gleichzeitige Anrufe"; //copied from de-de
$text['label-concurrent-limit']['de-ch'] = "Gleichzeitige Anrufe"; //copied from de-de
$text['label-concurrent-limit']['de-de'] = "Gleichzeitige Anrufe";
$text['label-concurrent-limit']['es-cl'] = "Límite de concurrencia";
$text['label-concurrent-limit']['es-mx'] = "Límite de concurrencia"; //copied from es-cl
$text['label-concurrent-limit']['fr-ca'] = "Appels Simultanés"; //copied from fr-fr
$text['label-concurrent-limit']['fr-fr'] = "Appels Simultanés";
$text['label-concurrent-limit']['he-il'] = "";
$text['label-concurrent-limit']['it-it'] = "Limite Chiamate Contemporanee";
$text['label-concurrent-limit']['nl-nl'] = "Maximaal aantal gelijktijdige oproepen";
$text['label-concurrent-limit']['pl-pl'] = "Limit jednoczesnych rozmów";
$text['label-concurrent-limit']['pt-br'] = "Limite de chamadas simultâneas";
$text['label-concurrent-limit']['pt-pt'] = "Limite de chamadas concorrentes";
$text['label-concurrent-limit']['ro-ro'] = "";
$text['label-concurrent-limit']['ru-ru'] = "Ограничение параллельных вызовов";
$text['label-concurrent-limit']['sv-se'] = "Samtidig Gräns";
$text['label-concurrent-limit']['uk-ua'] = "Обмеження одночасної кількості";
$text['label-callerid-number']['en-us'] = "Caller ID Number";
$text['label-callerid-number']['en-gb'] = "Caller ID Number";
$text['label-callerid-number']['ar-eg'] = "";
$text['label-callerid-number']['de-at'] = "Anruferkennung (Nummer)"; //copied from de-de
$text['label-callerid-number']['de-ch'] = "Anruferkennung (Nummer)"; //copied from de-de
$text['label-callerid-number']['de-de'] = "Anruferkennung (Nummer)";
$text['label-callerid-number']['es-cl'] = "Número de Origen";
$text['label-callerid-number']['es-mx'] = "Número de Origen"; //copied from es-cl
$text['label-callerid-number']['fr-ca'] = "Numéro d'appelant"; //copied from fr-fr
$text['label-callerid-number']['fr-fr'] = "Numéro d'appelant";
$text['label-callerid-number']['he-il'] = "";
$text['label-callerid-number']['it-it'] = "Numero Chiamante";
$text['label-callerid-number']['nl-nl'] = "CID Nummer";
$text['label-callerid-number']['pl-pl'] = "Prezentacja numeru dzwoniącego";
$text['label-callerid-number']['pt-br'] = "Número do discador";
$text['label-callerid-number']['pt-pt'] = "Número do Chamador";
$text['label-callerid-number']['ro-ro'] = "";
$text['label-callerid-number']['ru-ru'] = "Caller ID Номер";
$text['label-callerid-number']['sv-se'] = "Caller ID Nummer";
$text['label-callerid-number']['uk-ua'] = "Caller ID Номер";
$text['label-caller-id-name']['en-us'] = "Caller ID Name";
$text['label-caller-id-name']['en-gb'] = "Caller ID Name";
$text['label-caller-id-name']['ar-eg'] = "";
$text['label-caller-id-name']['de-at'] = "Anruferkennung (Name)"; //copied from de-de
$text['label-caller-id-name']['de-ch'] = "Anruferkennung (Name)"; //copied from de-de
$text['label-caller-id-name']['de-de'] = "Anruferkennung (Name)";
$text['label-caller-id-name']['es-cl'] = "Nombre de origen";
$text['label-caller-id-name']['es-mx'] = "Nombre de origen"; //copied from es-cl
$text['label-caller-id-name']['fr-ca'] = "Nom d'appelant"; //copied from fr-fr
$text['label-caller-id-name']['fr-fr'] = "Nom d'appelant";
$text['label-caller-id-name']['he-il'] = "";
$text['label-caller-id-name']['it-it'] = "Nome Chiamante";
$text['label-caller-id-name']['nl-nl'] = "CID Naam";
$text['label-caller-id-name']['pl-pl'] = "Prezentacja nazwy dzwoniącego";
$text['label-caller-id-name']['pt-br'] = "Nome do discador";
$text['label-caller-id-name']['pt-pt'] = "Nome do Chamador";
$text['label-caller-id-name']['ro-ro'] = "";
$text['label-caller-id-name']['ru-ru'] = "Caller ID Имя";
$text['label-caller-id-name']['sv-se'] = "Caller ID Namn";
$text['label-caller-id-name']['uk-ua'] = "Caller ID Ім’я";
$text['label-call-broadcasts']['en-us'] = "Call Broadcasts";
$text['label-call-broadcasts']['en-gb'] = "Call Broadcasts";
$text['label-call-broadcasts']['ar-eg'] = "";
$text['label-call-broadcasts']['de-at'] = "Rundrufe"; //copied from de-de
$text['label-call-broadcasts']['de-ch'] = "Rundrufe"; //copied from de-de
$text['label-call-broadcasts']['de-de'] = "Rundrufe";
$text['label-call-broadcasts']['es-cl'] = "Llamadas Masivas (Broadcast)";
$text['label-call-broadcasts']['es-mx'] = "Llamadas Masivas (Broadcast)"; //copied from es-cl
$text['label-call-broadcasts']['fr-ca'] = "Diffusions d'appels"; //copied from fr-fr
$text['label-call-broadcasts']['fr-fr'] = "Diffusions d'appels";
$text['label-call-broadcasts']['he-il'] = "";
$text['label-call-broadcasts']['it-it'] = "Chiamate Multiple";
$text['label-call-broadcasts']['nl-nl'] = "Omroepen";
$text['label-call-broadcasts']['pl-pl'] = "Rozsyłanie rozmów";
$text['label-call-broadcasts']['pt-br'] = "Chamadas broadcast";
$text['label-call-broadcasts']['pt-pt'] = "Chamadas de Broadcast";
$text['label-call-broadcasts']['ro-ro'] = "";
$text['label-call-broadcasts']['ru-ru'] = "Массовые вызовы";
$text['label-call-broadcasts']['sv-se'] = "Samtalsdistributioner";
$text['label-call-broadcasts']['uk-ua'] = "Трансляція дзвінків";
$text['label-call-broadcast']['en-us'] = "Call Broadcast";
$text['label-call-broadcast']['en-gb'] = "Call Broadcast";
$text['label-call-broadcast']['ar-eg'] = "";
$text['label-call-broadcast']['de-at'] = "Rundrufe"; //copied from de-de
$text['label-call-broadcast']['de-ch'] = "Rundrufe"; //copied from de-de
$text['label-call-broadcast']['de-de'] = "Rundrufe";
$text['label-call-broadcast']['es-cl'] = "Llamada Masiva (Broadcast)";
$text['label-call-broadcast']['es-mx'] = "Llamada Masiva (Broadcast)"; //copied from es-cl
$text['label-call-broadcast']['fr-ca'] = "Diffusion d'appels"; //copied from fr-fr
$text['label-call-broadcast']['fr-fr'] = "Diffusion d'appels";
$text['label-call-broadcast']['he-il'] = "";
$text['label-call-broadcast']['it-it'] = "Chiamata Multipla";
$text['label-call-broadcast']['nl-nl'] = "Omroep";
$text['label-call-broadcast']['pl-pl'] = "Rozsyłanie rozmów";
$text['label-call-broadcast']['pt-br'] = "Chamada de broadcast";
$text['label-call-broadcast']['pt-pt'] = "Chamada de Broadcast";
$text['label-call-broadcast']['ro-ro'] = "";
$text['label-call-broadcast']['ru-ru'] = "Массовый вызов";
$text['label-call-broadcast']['sv-se'] = "Samtalsdistribution";
$text['label-call-broadcast']['uk-ua'] = "Трансляція дзвінка";
$text['label-avmd']['en-us'] = "Voicemail Detection";
$text['label-avmd']['en-gb'] = "Voicemail Detection";
$text['label-avmd']['ar-eg'] = "";
$text['label-avmd']['de-at'] = "Erkennung von Sprachnachrichten"; //copied from de-de
$text['label-avmd']['de-ch'] = "Erkennung von Sprachnachrichten"; //copied from de-de
$text['label-avmd']['de-de'] = "Erkennung von Sprachnachrichten";
$text['label-avmd']['es-cl'] = "Detección de correo de voz";
$text['label-avmd']['es-mx'] = "Detección de correo de voz"; //copied from es-cl
$text['label-avmd']['fr-ca'] = "Détection de la messagerie vocale"; //copied from fr-fr
$text['label-avmd']['fr-fr'] = "Détection de la messagerie vocale";
$text['label-avmd']['he-il'] = "";
$text['label-avmd']['it-it'] = "Rilevamento Segreteria";
$text['label-avmd']['nl-nl'] = "Antwoordapparaat ontdekt";
$text['label-avmd']['pl-pl'] = "Wykrywanie poczty głosowej";
$text['label-avmd']['pt-br'] = "Detecção Voicemail";
$text['label-avmd']['pt-pt'] = "Voicemail Detecção";
$text['label-avmd']['ro-ro'] = "";
$text['label-avmd']['ru-ru'] = "Определение голосовой почты";
$text['label-avmd']['sv-se'] = "Känn Av Röstbrevlåda";
$text['label-avmd']['uk-ua'] = "Виявлення голосової пошти";
$text['label-broadcast_toll_allow']['en-us'] = "Toll Allow";
$text['label-broadcast_toll_allow']['en-gb'] = "Toll Allow";
$text['label-broadcast_toll_allow']['ar-eg'] = "";
$text['label-broadcast_toll_allow']['de-at'] = "Berechtigung"; //copied from de-de
$text['label-broadcast_toll_allow']['de-ch'] = "Berechtigung"; //copied from de-de
$text['label-broadcast_toll_allow']['de-de'] = "Berechtigung";
$text['label-broadcast_toll_allow']['es-cl'] = "Permitir Tarifas Especiales";
$text['label-broadcast_toll_allow']['es-mx'] = "Permitir Tarifas Especiales"; //copied from es-cl
$text['label-broadcast_toll_allow']['fr-ca'] = "droits"; //copied from fr-fr
$text['label-broadcast_toll_allow']['fr-fr'] = "droits";
$text['label-broadcast_toll_allow']['he-il'] = "";
$text['label-broadcast_toll_allow']['it-it'] = "Destinazioni Abilitate";
$text['label-broadcast_toll_allow']['nl-nl'] = "betaald gesprek toestaan";
$text['label-broadcast_toll_allow']['pl-pl'] = "Zezwalaj na drogie/szczególwe połaczenia";
$text['label-broadcast_toll_allow']['pt-br'] = "Categoria de Ligação"; //copied from pt-pt
$text['label-broadcast_toll_allow']['pt-pt'] = "Permissões";
$text['label-broadcast_toll_allow']['ro-ro'] = "";
$text['label-broadcast_toll_allow']['ru-ru'] = "Разрешить Платное Соединение";
$text['label-broadcast_toll_allow']['sv-se'] = "Toll Allow";
$text['label-broadcast_toll_allow']['uk-ua'] = "";
$text['label-accountcode']['en-us'] = "Accountcode";
$text['label-accountcode']['en-gb'] = "Accountcode";
$text['label-accountcode']['ar-eg'] = "";
$text['label-accountcode']['de-at'] = "Kontoschlüssel"; //copied from de-de
$text['label-accountcode']['de-ch'] = "Kontoschlüssel"; //copied from de-de
$text['label-accountcode']['de-de'] = "Kontoschlüssel";
$text['label-accountcode']['es-cl'] = "Código de cuenta";
$text['label-accountcode']['es-mx'] = "Código de cuenta"; //copied from es-cl
$text['label-accountcode']['fr-ca'] = "Code de compte"; //copied from fr-fr
$text['label-accountcode']['fr-fr'] = "Code de compte";
$text['label-accountcode']['he-il'] = "קוד חשבון";
$text['label-accountcode']['it-it'] = "";
$text['label-accountcode']['nl-nl'] = "Account code";
$text['label-accountcode']['pl-pl'] = "Numer konta billingowego";
$text['label-accountcode']['pt-br'] = "Código da conta";
$text['label-accountcode']['pt-pt'] = "Accountcode";
$text['label-accountcode']['ro-ro'] = "";
$text['label-accountcode']['ru-ru'] = "Код Авторизации";
$text['label-accountcode']['sv-se'] = "Accountcode";
$text['label-accountcode']['uk-ua'] = "Код облікового запису";
$text['label-sample_file']['en-us'] = "Sample CSV File";
$text['label-sample_file']['en-gb'] = "Sample CSV File";
$text['label-sample_file']['ar-eg'] = "Sample CSV File";
$text['label-sample_file']['de-at'] = "Sample CSV File";
$text['label-sample_file']['de-ch'] = "Sample CSV File";
$text['label-sample_file']['de-de'] = "Sample CSV File";
$text['label-sample_file']['es-cl'] = "Sample CSV File";
$text['label-sample_file']['es-mx'] = "Sample CSV File";
$text['label-sample_file']['fr-ca'] = "Sample CSV File";
$text['label-sample_file']['fr-fr'] = "Sample CSV File";
$text['label-sample_file']['he-il'] = "Sample CSV File";
$text['label-sample_file']['it-it'] = "Sample CSV File";
$text['label-sample_file']['nl-nl'] = "Voorbeeld CSV File";
$text['label-sample_file']['pl-pl'] = "Przykładowy plik CSV";
$text['label-sample_file']['pt-br'] = "Sample CSV File";
$text['label-sample_file']['pt-pt'] = "Sample CSV File";
$text['label-sample_file']['ro-ro'] = "Sample CSV File";
$text['label-sample_file']['ru-ru'] = "Sample CSV File";
$text['label-sample_file']['sv-se'] = "Sample CSV File";
$text['label-sample_file']['uk-ua'] = "Sample CSV File";
$text['label-list_example']['en-us'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['en-gb'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['ar-eg'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['de-at'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['de-ch'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['de-de'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['es-cl'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['es-mx'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['fr-ca'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['fr-fr'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['he-il'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['it-it'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['nl-nl'] = "Nummer|Eerste,Laatste\nNummer|Eerste,Laatste\n...";
$text['label-list_example']['pl-pl'] = "Numer|Pierwsze,Ostatnie\nNumer|Pierwsze,Ostatnie\n...";
$text['label-list_example']['pt-br'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['pt-pt'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['ro-ro'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['ru-ru'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['sv-se'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['uk-ua'] = "Number|First,Last\nNumber|First,Last\n...";
$text['description-start_time']['en-us'] = "Is the time in seconds to start sending calls.";
$text['description-start_time']['en-gb'] = "";
$text['description-start_time']['ar-eg'] = "";
$text['description-start_time']['de-at'] = ""; //copied from de-de
$text['description-start_time']['de-ch'] = ""; //copied from de-de
$text['description-start_time']['de-de'] = "";
$text['description-start_time']['es-cl'] = "";
$text['description-start_time']['es-mx'] = "";
$text['description-start_time']['fr-ca'] = "";
$text['description-start_time']['fr-fr'] = "";
$text['description-start_time']['he-il'] = "";
$text['description-start_time']['it-it'] = "";
$text['description-start_time']['nl-nl'] = "";
$text['description-start_time']['pl-pl'] = "Jest to czas w sekundach, po którym rozpocznie się wysyłanie połączeń";
$text['description-start_time']['pt-br'] = ""; //copied from pt-pt
$text['description-start_time']['pt-pt'] = "";
$text['description-start_time']['ro-ro'] = "";
$text['description-start_time']['ru-ru'] = "";
$text['description-start_time']['sv-se'] = "";
$text['description-start_time']['uk-ua'] = "";
$text['description-accountcode']['en-us'] = "Account code used most often used for billing systems.";
$text['description-accountcode']['en-gb'] = "";
$text['description-accountcode']['ar-eg'] = "";
$text['description-accountcode']['de-at'] = ""; //copied from de-de
$text['description-accountcode']['de-ch'] = ""; //copied from de-de
$text['description-accountcode']['de-de'] = "";
$text['description-accountcode']['es-cl'] = "";
$text['description-accountcode']['es-mx'] = "";
$text['description-accountcode']['fr-ca'] = "";
$text['description-accountcode']['fr-fr'] = "";
$text['description-accountcode']['he-il'] = "";
$text['description-accountcode']['it-it'] = "";
$text['description-accountcode']['nl-nl'] = "";
$text['description-accountcode']['pl-pl'] = "Kod konta używany najczęściej w systemach bilingowych.";
$text['description-accountcode']['pt-br'] = ""; //copied from pt-pt
$text['description-accountcode']['pt-pt'] = "";
$text['description-accountcode']['ro-ro'] = "";
$text['description-accountcode']['ru-ru'] = "";
$text['description-accountcode']['sv-se'] = "";
$text['description-accountcode']['uk-ua'] = "";
$text['description-timeout']['en-us'] = "Specify the absolute timeout in seconds.";
$text['description-timeout']['en-gb'] = "Specify the absolute timeout in seconds.";
$text['description-timeout']['ar-eg'] = "";
$text['description-timeout']['de-at'] = "Geben Sie die absolute Zeitüberschreitung in Sekunden an."; //copied from de-de
$text['description-timeout']['de-ch'] = "Geben Sie die absolute Zeitüberschreitung in Sekunden an."; //copied from de-de
$text['description-timeout']['de-de'] = "Geben Sie die absolute Zeitüberschreitung in Sekunden an.";
$text['description-timeout']['es-cl'] = "";
$text['description-timeout']['es-mx'] = "";
$text['description-timeout']['fr-ca'] = "Spécifiez le délai d'expiration absolu en secondes";
$text['description-timeout']['fr-fr'] = "Spécifiez le délai d'expiration absolu en secondes";
$text['description-timeout']['he-il'] = "";
$text['description-timeout']['it-it'] = "";
$text['description-timeout']['nl-nl'] = "Geef de absolute tijdsoverschrijding in seconden aan.";
$text['description-timeout']['pl-pl'] = "Ilość milisekund oczekiwania po odtworzeniu nagrania lub potwierdzenia makro.";
$text['description-timeout']['pt-br'] = "Limite de tempo (em milissegundos) de espera após reproduzir gravações ou confirmar a macro."; //copied from pt-pt
$text['description-timeout']['pt-pt'] = "Limite de tempo (em milissegundos) de espera após reproduzir gravações ou confirmar a macro.";
$text['description-timeout']['ro-ro'] = "";
$text['description-timeout']['ru-ru'] = "Время ожидания (в миллисекундах) после воспроизведения записи или подтверждения макроса.";
$text['description-timeout']['sv-se'] = "Specificera den absoluta timeout:en i sekunder.";
$text['description-timeout']['uk-ua'] = "";
$text['description-phone']['en-us'] = "Select a TXT/CSV file for upload, or enter Phone Numbers one per line in the format shown above.";
$text['description-phone']['en-gb'] = "Select a TXT/CSV file for upload, or enter Phone Numbers one per line in the format shown above.";
$text['description-phone']['ar-eg'] = "";
$text['description-phone']['de-at'] = "Optional: Ergänzen Sie eine Liste von Telefonnummern, eine Nummer pro Zeile im folgenden Format: 123-123-1234|Nachname,Vorname"; //copied from de-de
$text['description-phone']['de-ch'] = "Optional: Ergänzen Sie eine Liste von Telefonnummern, eine Nummer pro Zeile im folgenden Format: 123-123-1234|Nachname,Vorname"; //copied from de-de
$text['description-phone']['de-de'] = "Optional: Ergänzen Sie eine Liste von Telefonnummern, eine Nummer pro Zeile im folgenden Format: 123-123-1234|Nachname,Vorname";
$text['description-phone']['es-cl'] = "Opcional, definir una lista de números de telefono, uno por línea en el siguiente formato: 123-123-1234|Apellido,Nombre";
$text['description-phone']['es-mx'] = "Opcional, definir una lista de números de telefono, uno por línea en el siguiente formato: 123-123-1234|Apellido,Nombre"; //copied from es-cl
$text['description-phone']['fr-ca'] = "Optionnel, Insérer une liste de numéros de téléphone, un par ligne, dans le format suivant ; 0123456789|Nom,Prénom"; //copied from fr-fr
$text['description-phone']['fr-fr'] = "Optionnel, Insérer une liste de numéros de téléphone, un par ligne, dans le format suivant ; 0123456789|Nom,Prénom";
$text['description-phone']['he-il'] = "";
$text['description-phone']['it-it'] = "Opzionale, inserire una lista di numeri di telefono, uno per riga, nel formato 123-123-1234|Cognome,Nome";
$text['description-phone']['nl-nl'] = "Selecteer een TXT/CSV file om te 'uploaden' of voer Telefoonnummers in een per regel in het bovenstaande formaat.";
$text['description-phone']['pl-pl'] = "Opcjonalne - ułóż listę numerów (jeden pod drugim) w formacie: 123-123-1234|Nazwisko,Imię";
$text['description-phone']['pt-br'] = "Opcional, definir uma lista de números de telefone, um por linha, no seguinte formato: 210000000|Apelido,Primeiro Nome.";
$text['description-phone']['pt-pt'] = "Opcional, definir uma lista de números de telefone, um por linha, no seguinte formato: 210000000|Apelido,Primeiro Nome";
$text['description-phone']['ro-ro'] = "";
$text['description-phone']['ru-ru'] = "Дополнительно, задайте список телефонных номеров, по одному в ряд, в формате: 123-123-1234|Фамилия,Имя";
$text['description-phone']['sv-se'] = "Frivillig, fyll i en lista med nummer (ett per rad) i följande format: 123-123-1234|Efternamn,Förnamn";
$text['description-phone']['uk-ua'] = "Додатково, задайте список телефонних номерів по одному на рядок в наступному форматі: 123-123-1234|Прізвище,ім'я";
$text['description-name']['en-us'] = "Enter the name here.";
$text['description-name']['en-gb'] = "Enter the name here.";
$text['description-name']['ar-eg'] = "";
$text['description-name']['de-at'] = "Geben Sie den Namen an."; //copied from de-de
$text['description-name']['de-ch'] = "Geben Sie den Namen an."; //copied from de-de
$text['description-name']['de-de'] = "Geben Sie den Namen an.";
$text['description-name']['es-cl'] = "Ingrese el nombre aquí.";
$text['description-name']['es-mx'] = "Ingrese el nombre aquí."; //copied from es-cl
$text['description-name']['fr-ca'] = "Insérer le Nom."; //copied from fr-fr
$text['description-name']['fr-fr'] = "Insérer le Nom.";
$text['description-name']['he-il'] = "הכנס את השם";
$text['description-name']['it-it'] = "Inserire il nome qui.";
$text['description-name']['nl-nl'] = "Voer de naam hier in.";
$text['description-name']['pl-pl'] = "Wprowadź nazwę";
$text['description-name']['pt-br'] = "Insira o nome do broadcast.";
$text['description-name']['pt-pt'] = "Introduza o nome aqui.";
$text['description-name']['ro-ro'] = "";
$text['description-name']['ru-ru'] = "Введите имя";
$text['description-name']['sv-se'] = "Skriv in namnet här.";
$text['description-name']['uk-ua'] = "Введіть назву";
$text['description-info']['en-us'] = "Enter the description here.";
$text['description-info']['en-gb'] = "Enter the description here.";
$text['description-info']['ar-eg'] = "";
$text['description-info']['de-at'] = "Geben Sie eine Beschreibung an."; //copied from de-de
$text['description-info']['de-ch'] = "Geben Sie eine Beschreibung an."; //copied from de-de
$text['description-info']['de-de'] = "Geben Sie eine Beschreibung an.";
$text['description-info']['es-cl'] = "Ingrese descripción aquí.";
$text['description-info']['es-mx'] = "Ingrese descripción aquí."; //copied from es-cl
$text['description-info']['fr-ca'] = "Entrez la description ici";
$text['description-info']['fr-fr'] = "Entrez la description ici";
$text['description-info']['he-il'] = "הכנס תאור";
$text['description-info']['it-it'] = "Inserire la descrizione qui.";
$text['description-info']['nl-nl'] = "Voer de omschrijving hier in.";
$text['description-info']['pl-pl'] = "Wprowadź opis";
$text['description-info']['pt-br'] = "Inisra uma descrição";
$text['description-info']['pt-pt'] = "Insira a descrição aqui.";
$text['description-info']['ro-ro'] = "";
$text['description-info']['ru-ru'] = "Введите описание";
$text['description-info']['sv-se'] = "Ange beskrivning här.";
$text['description-info']['uk-ua'] = "Введіть опис";
$text['description-destination']['en-us'] = "Send the call to the extension an IVR Menu, Conference Room, or any other number.";
$text['description-destination']['en-gb'] = "Send the call to the extension an IVR Menu, Conference Room, or any other number.";
$text['description-destination']['ar-eg'] = "";
$text['description-destination']['de-at'] = "Der Anruf wird an eine Nebenstelle, eine Automatische Vermittlung, ein Konferenzraum oder jede andere Nummer weitergeleitet."; //copied from de-de
$text['description-destination']['de-ch'] = "Der Anruf wird an eine Nebenstelle, eine Automatische Vermittlung, ein Konferenzraum oder jede andere Nummer weitergeleitet."; //copied from de-de
$text['description-destination']['de-de'] = "Der Anruf wird an eine Nebenstelle, eine Automatische Vermittlung, ein Konferenzraum oder jede andere Nummer weitergeleitet.";
$text['description-destination']['es-cl'] = "Enviar la llamada a extension a IVR, conferencias o cualquier otro número.";
$text['description-destination']['es-mx'] = "Enviar la llamada a extension a IVR, conferencias o cualquier otro número."; //copied from es-cl
$text['description-destination']['fr-ca'] = "Emettre l'appel vers un SVI, salle de conférence, ou tout autre numéro."; //copied from fr-fr
$text['description-destination']['fr-fr'] = "Emettre l'appel vers un SVI, salle de conférence, ou tout autre numéro.";
$text['description-destination']['he-il'] = "";
$text['description-destination']['it-it'] = "Connetti la chiamata con un interno, un IVR, un'audioconferenza, o qualsiasi altro servizio.";
$text['description-destination']['nl-nl'] = "Send de oproep naar een toestel, IVR Menu, conferentie of een willekeurig ander nummer.";
$text['description-destination']['pl-pl'] = "Wybierz numer docelowy.";
$text['description-destination']['pt-br'] = "Enviar a chamada para a extensão de um menu de IVR, Sala de Conferência ou qualquer outro número. ";
$text['description-destination']['pt-pt'] = "Enviar a chamada para a extensão de um menu de IVR, Sala de Conferência ou qualquer outro número.";
$text['description-destination']['ro-ro'] = "";
$text['description-destination']['ru-ru'] = "Отправить вызов на внутренний номер, IVR, конференцию или любой другой номер.";
$text['description-destination']['sv-se'] = "Skicka samtalet till en anknytning, IVR Meny, Konferens Rum eller något annat nummer.";
$text['description-destination']['uk-ua'] = "Відправити дзвінок на розширення, меню IVR, конференцію, або будь-який інший номер.";
$text['description-concurrent-limit']['en-us'] = "Limit the approximate number of concurrent calls. Leave this empty for no limit.";
$text['description-concurrent-limit']['en-gb'] = "Limit the approximate number of concurrent calls. Leave this empty for no limit.";
$text['description-concurrent-limit']['ar-eg'] = "";
$text['description-concurrent-limit']['de-at'] = "Begrenzt die Anzahl gleichzeitiger Anrufe. Kein Limit wenn leer gelassen."; //copied from de-de
$text['description-concurrent-limit']['de-ch'] = "Begrenzt die Anzahl gleichzeitiger Anrufe. Kein Limit wenn leer gelassen."; //copied from de-de
$text['description-concurrent-limit']['de-de'] = "Begrenzt die Anzahl gleichzeitiger Anrufe. Kein Limit wenn leer gelassen.";
$text['description-concurrent-limit']['es-cl'] = "Limitar el número de llamadas simultaneas. Deje en blanco para no establecer un límite.";
$text['description-concurrent-limit']['es-mx'] = "Limitar el número de llamadas simultaneas. Deje en blanco para no establecer un límite."; //copied from es-cl
$text['description-concurrent-limit']['fr-ca'] = "Limite le nombre d'appels concurrents. Laisser vide pour illimité."; //copied from fr-fr
$text['description-concurrent-limit']['fr-fr'] = "Limite le nombre d'appels concurrents. Laisser vide pour illimité.";
$text['description-concurrent-limit']['he-il'] = "";
$text['description-concurrent-limit']['it-it'] = "Limita approssimativamente il numero di chiamate contemporanee. Lasciare vuoto per nessun limite.";
$text['description-concurrent-limit']['nl-nl'] = "Beperk de geschatter aantallen gelijktijdige oproepen. Laat leeg om geen limiet op te geven.";
$text['description-concurrent-limit']['pl-pl'] = "Ogranicz liczbę równoczesnych połączeń. Aby nie było limitu zostaw to pole puste.";
$text['description-concurrent-limit']['pt-br'] = "Limitar o número de chamadas simultâneas. Deixe este campo em branco para não ter limite.";
$text['description-concurrent-limit']['pt-pt'] = "Limitar o número de chamadas concurrentes. Deixe este campo em branco para não ter limite.";
$text['description-concurrent-limit']['ro-ro'] = "";
$text['description-concurrent-limit']['ru-ru'] = "Ограничение примерного количества параллельных вызовов. Оставьте пустым для его отсутствия.";
$text['description-concurrent-limit']['sv-se'] = "Begränsa ungefärliga antalet samtidiga samtal. Lämna det här tomt för ingen gräns.";
$text['description-concurrent-limit']['uk-ua'] = "Обмеження приблизної кількості одночасних дзвінків. Якщо пусто - без обмежень";
$text['description-caller-id-number']['en-us'] = "Applicable if the provider that allow the Caller ID number to be sent. default: 0000000000";
$text['description-caller-id-number']['en-gb'] = "Applicable if the provider that allow the Caller ID number to be sent. default: 0000000000";
$text['description-caller-id-number']['ar-eg'] = "";
$text['description-caller-id-number']['de-at'] = "Geben Sie die Anruferkennung (Nummer) hier ein."; //copied from de-de
$text['description-caller-id-number']['de-ch'] = "Geben Sie die Anruferkennung (Nummer) hier ein."; //copied from de-de
$text['description-caller-id-number']['de-de'] = "Geben Sie die Anruferkennung (Nummer) hier ein.";
$text['description-caller-id-number']['es-cl'] = "";
$text['description-caller-id-number']['es-mx'] = "";
$text['description-caller-id-number']['fr-ca'] = "Applicable uniquement si le fournisseur d'accès authorise l'acheminement du numéro d'appelant. Par défaut: 0000000000"; //copied from fr-fr
$text['description-caller-id-number']['fr-fr'] = "Applicable uniquement si le fournisseur d'accès authorise l'acheminement du numéro d'appelant. Par défaut: 0000000000";
$text['description-caller-id-number']['he-il'] = "";
$text['description-caller-id-number']['it-it'] = "Si usa se il provider permette la modifica del numero chiamante. Default: 0000000000";
$text['description-caller-id-number']['nl-nl'] = "Geef het afzender telefoonnummer hier in. standaard: 0000000000";
$text['description-caller-id-number']['pl-pl'] = "Zastosowane w przypadku jeżeli operator zezwala na prezentację numeru. Standardowo prezentacja jest w formacie: 0000000000";
$text['description-caller-id-number']['pt-br'] = "Aplicável se o provedor permitir o envio do número do originador das chamadas. Omissão: 0000000000.";
$text['description-caller-id-number']['pt-pt'] = "Aplicável se o provedor permitir o envio do número do originador das chamadas. Omissão: 0000000000";
$text['description-caller-id-number']['ro-ro'] = "";
$text['description-caller-id-number']['ru-ru'] = "Используется, если провайдер поддерживает передачу CallerID(number). По умолчанию: 0000000000";
$text['description-caller-id-number']['sv-se'] = "Gäller om leverantör tillåter att Caller ID nummer skickas. Standard: 0000000000";
$text['description-caller-id-number']['uk-ua'] = "Стосується, якщо постачальник, дозволяє надсилати номер абонента (Caller ID номер). За замовчуванням: 0000000000";
$text['description-caller-id-name']['en-us'] = "Applicable if the provider allow the Caller ID Name to be set. default: anonymous";
$text['description-caller-id-name']['en-gb'] = "Applicable if the provider allow the Caller ID Name to be set. default: anonymous";
$text['description-caller-id-name']['ar-eg'] = "";
$text['description-caller-id-name']['de-at'] = "Geben Sie die Anruferkennung (Name) hier ein, sofern der Provider dieses unterstützt. Default: anonym."; //copied from de-de
$text['description-caller-id-name']['de-ch'] = "Geben Sie die Anruferkennung (Name) hier ein, sofern der Provider dieses unterstützt. Default: anonym."; //copied from de-de
$text['description-caller-id-name']['de-de'] = "Geben Sie die Anruferkennung (Name) hier ein, sofern der Provider dieses unterstützt. Default: anonym.";
$text['description-caller-id-name']['es-cl'] = "Applicable si el proveedor permite enviar el número de origen. Por defecto: 0000000000";
$text['description-caller-id-name']['es-mx'] = "Applicable si el proveedor permite enviar el número de origen. Por defecto: 0000000000"; //copied from es-cl
$text['description-caller-id-name']['fr-ca'] = "Applicable uniquement si le fournisseur d'accès authorise l'acheminement du nom d'appelant. Par défaut: anonymous"; //copied from fr-fr
$text['description-caller-id-name']['fr-fr'] = "Applicable uniquement si le fournisseur d'accès authorise l'acheminement du nom d'appelant. Par défaut: anonymous";
$text['description-caller-id-name']['he-il'] = "";
$text['description-caller-id-name']['it-it'] = "Si usa se il provider permette la modifica del nome chiamante. Default: anonymous";
$text['description-caller-id-name']['nl-nl'] = "Geef de afzenderkenmerk (naam) hier, voorzover de provider die ondersteund. Standaard: anoniem ";
$text['description-caller-id-name']['pl-pl'] = "Zastosowane w przypadku jeżeli operator zezwala na prezentację nazwy. Standardowo prezentacja jest w formacie: 0000000000";
$text['description-caller-id-name']['pt-br'] = "Aplicável se o provedor de telefônia liberar o nome de quem está discando. Por padrão: anonymous (anônimo).";
$text['description-caller-id-name']['pt-pt'] = "Aplicável se o provedor permitir o envio do nome do originador das chamadas. Omissão: anonymous";
$text['description-caller-id-name']['ro-ro'] = "";
$text['description-caller-id-name']['ru-ru'] = "Используется, если провайдер поддерживает передачу CallerID(name). По умолчанию: anonymous";
$text['description-caller-id-name']['sv-se'] = "Gäller om leverantör tillåter att Caller ID namn skickas. Standard: anonymous";
$text['description-caller-id-name']['uk-ua'] = "Стосується, якщо постачальник, дозволяє надсилати ім’я абонента (Caller ID Ім’я). За замовчуванням: anonymous";
$text['description-avmd']['en-us'] = "Select whether to enable or disable the detection of voicemail messaging and answering machine systems.";
$text['description-avmd']['en-gb'] = "Select whether to enable or disable the detection of voicemail messaging and answering machine systems.";
$text['description-avmd']['ar-eg'] = "";
$text['description-avmd']['de-at'] = "Wählen Sie ob die Erkennung von Sprach-Mailboxen und automatischen Anrufbeantwortern Ein- oder Ausgeschaltet werden soll."; //copied from de-de
$text['description-avmd']['de-ch'] = "Wählen Sie ob die Erkennung von Sprach-Mailboxen und automatischen Anrufbeantwortern Ein- oder Ausgeschaltet werden soll."; //copied from de-de
$text['description-avmd']['de-de'] = "Wählen Sie ob die Erkennung von Sprach-Mailboxen und automatischen Anrufbeantwortern Ein- oder Ausgeschaltet werden soll.";
$text['description-avmd']['es-cl'] = "Seleccione si desea activar o desactivar la detección de sistemas de contestador automático de mensajes de correo de voz y.";
$text['description-avmd']['es-mx'] = "Seleccione si desea activar o desactivar la detección de sistemas de contestador automático de mensajes de correo de voz y."; //copied from es-cl
$text['description-avmd']['fr-ca'] = "Indiquez si vous souhaitez activer ou désactiver la détection de la messagerie vocale et les systèmes de machines de répondeur."; //copied from fr-fr
$text['description-avmd']['fr-fr'] = "Indiquez si vous souhaitez activer ou désactiver la détection de la messagerie vocale et les systèmes de machines de répondeur.";
$text['description-avmd']['he-il'] = "";
$text['description-avmd']['it-it'] = "Selezionare se si vuole abilitare o disabilitare il rilevamento delle segreterie telefoniche e dei messaggi registrati.";
$text['description-avmd']['nl-nl'] = "Selecteer of een antwoordapparaat detectie aan of uitgezet moet worden.";
$text['description-avmd']['pl-pl'] = "Wybierz, czy chcesz włączyć lub wyłączyć wykrywanie wiadomości poczty głosowej lub innych systemów automatycznego odbierania rozmów.";
$text['description-avmd']['pt-br'] = "Selecione se deseja ativar ou desativar a detecção de mensagens de correio de voz e sistemas de secretária eletrônica."; //copied from pt-pt
$text['description-avmd']['pt-pt'] = "Selecione se deseja ativar ou desativar a detecção de mensagens de correio de voz e sistemas de secretária eletrônica.";
$text['description-avmd']['ro-ro'] = "";
$text['description-avmd']['ru-ru'] = "Выберите, стоит ли использовать систему определения голосовой почты или автоответчика.";
$text['description-avmd']['sv-se'] = "Välj om deteketering av röstbrevlåda skall användas.";
$text['description-avmd']['uk-ua'] = "Виберіть, чи слід включити або відключити виявлення повідомлень голосової пошти і систему автовідповідача.";
$text['description-broadcast_toll_allow']['en-us'] = "Enter the toll allow value here. (Examples: domestic,international,local)";
$text['description-broadcast_toll_allow']['en-gb'] = "Enter the toll allow value here. (Examples: domestic,international,local)";
$text['description-broadcast_toll_allow']['ar-eg'] = "";
$text['description-broadcast_toll_allow']['de-at'] = "Geben Sie die Berechtigung an. (z.B.: domestic, international, local)"; //copied from de-de
$text['description-broadcast_toll_allow']['de-ch'] = "Geben Sie die Berechtigung an. (z.B.: domestic, international, local)"; //copied from de-de
$text['description-broadcast_toll_allow']['de-de'] = "Geben Sie die Berechtigung an. (z.B.: domestic, international, local)";
$text['description-broadcast_toll_allow']['es-cl'] = "Ingrese el tipo de tarifa especial a permitir (ej: doméstica, internacional, local).";
$text['description-broadcast_toll_allow']['es-mx'] = "Ingrese el tipo de tarifa especial a permitir (ej: doméstica, internacional, local)."; //copied from es-cl
$text['description-broadcast_toll_allow']['fr-ca'] = "Insérer les droits d'accès. (Exemples: domestic,international,local)"; //copied from fr-fr
$text['description-broadcast_toll_allow']['fr-fr'] = "Insérer les droits d'accès. (Exemples: domestic,international,local)";
$text['description-broadcast_toll_allow']['he-il'] = "";
$text['description-broadcast_toll_allow']['it-it'] = "Inserire qui le destinazioni permesse. (Es. fisso, mobile, internazionale, premium)";
$text['description-broadcast_toll_allow']['nl-nl'] = "Voer de betaalbaar waarde hier in (Voobeeld: domestic, international, local)";
$text['description-broadcast_toll_allow']['pl-pl'] = "Wpisz wartość drogich/szczegółowych połączeń.";
$text['description-broadcast_toll_allow']['pt-br'] = "Insira as categorias de ligação aqui. (Exemplos: Internacional, Local, DDD, DDI, Celular)";
$text['description-broadcast_toll_allow']['pt-pt'] = "Introduza as permissões aqui. (Exemplos: internacional, local)";
$text['description-broadcast_toll_allow']['ro-ro'] = "";
$text['description-broadcast_toll_allow']['ru-ru'] = "Введите здесь доступные значения. (Примеры: domestic,international,local)";
$text['description-broadcast_toll_allow']['sv-se'] = "Ange 'toll allow' värde här. (Exempel: domestic,international,local)";
$text['description-broadcast_toll_allow']['uk-ua'] = "";
$text['confirm-update']['en-us'] = "Update Complete";
$text['confirm-update']['en-gb'] = "Update Complete";
$text['confirm-update']['ar-eg'] = "";
$text['confirm-update']['de-at'] = "Aktualisierung durchgeführt"; //copied from de-de
$text['confirm-update']['de-ch'] = "Aktualisierung durchgeführt"; //copied from de-de
$text['confirm-update']['de-de'] = "Aktualisierung durchgeführt";
$text['confirm-update']['es-cl'] = "Actualización Completa";
$text['confirm-update']['es-mx'] = "Actualización Completa"; //copied from es-cl
$text['confirm-update']['fr-ca'] = "Mise à jour terminée"; //copied from fr-fr
$text['confirm-update']['fr-fr'] = "Mise à jour terminée";
$text['confirm-update']['he-il'] = "עידכון הושלם";
$text['confirm-update']['it-it'] = "Aggiornamento Completato.";
$text['confirm-update']['nl-nl'] = "Bijwerken gereed";
$text['confirm-update']['pl-pl'] = "Zaktualizowano pomyślnie";
$text['confirm-update']['pt-br'] = "Atualização Efetuada";
$text['confirm-update']['pt-pt'] = "Actualização Efectuada";
$text['confirm-update']['ro-ro'] = "";
$text['confirm-update']['ru-ru'] = "Обновление завершено";
$text['confirm-update']['sv-se'] = "Uppdatering Klar";
$text['confirm-update']['uk-ua'] = "Оновлення завершено";
$text['confirm-name']['en-us'] = "Please provide: Name";
$text['confirm-name']['en-gb'] = "Please provide: Name";
$text['confirm-name']['ar-eg'] = "";
$text['confirm-name']['de-at'] = "Bitte geben Sie den Namen an"; //copied from de-de
$text['confirm-name']['de-ch'] = "Bitte geben Sie den Namen an"; //copied from de-de
$text['confirm-name']['de-de'] = "Bitte geben Sie den Namen an";
$text['confirm-name']['es-cl'] = "Por favor agregue: Nombre";
$text['confirm-name']['es-mx'] = "Por favor agregue: Nombre"; //copied from es-cl
$text['confirm-name']['fr-ca'] = "Merci d'indiquer: Nom"; //copied from fr-fr
$text['confirm-name']['fr-fr'] = "Merci d'indiquer: Nom";
$text['confirm-name']['he-il'] = "";
$text['confirm-name']['it-it'] = "Prego fornire: Nome";
$text['confirm-name']['nl-nl'] = "Geef aub: Naam";
$text['confirm-name']['pl-pl'] = "Wprowadź: Nazwę";
$text['confirm-name']['pt-br'] = "Por favor insira: Nome";
$text['confirm-name']['pt-pt'] = "Por favor indique: Nome";
$text['confirm-name']['ro-ro'] = "";
$text['confirm-name']['ru-ru'] = "Пожалуйста, укажите: Имя";
$text['confirm-name']['sv-se'] = "Ange: Namn";
$text['confirm-name']['uk-ua'] = "Введіть назву";
$text['confirm-delete-info']['en-us'] = "Do you really want to delete this?";
$text['confirm-delete-info']['en-gb'] = "Do you really want to delete this?";
$text['confirm-delete-info']['ar-eg'] = "";
$text['confirm-delete-info']['de-at'] = "Wollen Sie das wirklich löschen?"; //copied from de-de
$text['confirm-delete-info']['de-ch'] = "Wollen Sie das wirklich löschen?"; //copied from de-de
$text['confirm-delete-info']['de-de'] = "Wollen Sie das wirklich löschen?";
$text['confirm-delete-info']['es-cl'] = "¿Desea realmente eliminar esto?";
$text['confirm-delete-info']['es-mx'] = "¿Desea realmente eliminar esto?"; //copied from es-cl
$text['confirm-delete-info']['fr-ca'] = "Voulez-vous vraiment supprimer cela?"; //copied from fr-fr
$text['confirm-delete-info']['fr-fr'] = "Voulez-vous vraiment supprimer cela?";
$text['confirm-delete-info']['he-il'] = "";
$text['confirm-delete-info']['it-it'] = "Vuoi veramente cancellarlo?";
$text['confirm-delete-info']['nl-nl'] = "Wilt u dit echt verwijderen?";
$text['confirm-delete-info']['pl-pl'] = "Czy na pewno chcesz to usunąć?";
$text['confirm-delete-info']['pt-br'] = "Deseja realmente remover isto?"; //copied from pt-pt
$text['confirm-delete-info']['pt-pt'] = "Deseja realmente remover isto?";
$text['confirm-delete-info']['ro-ro'] = "";
$text['confirm-delete-info']['ru-ru'] = "Вы действительно хотите это удалить?";
$text['confirm-delete-info']['sv-se'] = "Vill du verkligen ta bort detta?";
$text['confirm-delete-info']['uk-ua'] = "Ви дійсно бажаєте це видалити?";
$text['confirm-add']['en-us'] = "Add Complete";
$text['confirm-add']['en-gb'] = "Add Complete";
$text['confirm-add']['ar-eg'] = "";
$text['confirm-add']['de-at'] = "Erfolgreich hinzugefügt"; //copied from de-de
$text['confirm-add']['de-ch'] = "Erfolgreich hinzugefügt"; //copied from de-de
$text['confirm-add']['de-de'] = "Erfolgreich hinzugefügt";
$text['confirm-add']['es-cl'] = "Ingreso Completo";
$text['confirm-add']['es-mx'] = "Ingreso Completo"; //copied from es-cl
$text['confirm-add']['fr-ca'] = "Ajouté"; //copied from fr-fr
$text['confirm-add']['fr-fr'] = "Ajouté";
$text['confirm-add']['he-il'] = "הוספה הושלמה";
$text['confirm-add']['it-it'] = "Inserimento Completato";
$text['confirm-add']['nl-nl'] = "Toevoegen gereed";
$text['confirm-add']['pl-pl'] = "Dodano pomyślnie";
$text['confirm-add']['pt-br'] = "Criação efetuada";
$text['confirm-add']['pt-pt'] = "Adição Efectuada";
$text['confirm-add']['ro-ro'] = "";
$text['confirm-add']['ru-ru'] = "Добавление завершено";
$text['confirm-add']['sv-se'] = "Tillagd";
$text['confirm-add']['uk-ua'] = "Додано";
$text['file-error']['en-us'] = "Sorry, File type not allowed";
$text['file-error']['en-gb'] = "Sorry, File type not allowed";
$text['file-error']['ar-eg'] = "";
$text['file-error']['de-at'] = "Entschuldigung, Dateityp nicht erlaubt"; //copied from de-de
$text['file-error']['de-ch'] = "Entschuldigung, Dateityp nicht erlaubt"; //copied from de-de
$text['file-error']['de-de'] = "Entschuldigung, Dateityp nicht erlaubt";
$text['file-error']['es-cl'] = "Lo sentimos, no se permite el tipo de archivo";
$text['file-error']['es-mx'] = "Lo sentimos, no se permite el tipo de archivo"; //copied from es-cl
$text['file-error']['fr-ca'] = "Désolé, le type de fichier n'est pas autorisé"; //copied from fr-fr
$text['file-error']['fr-fr'] = "Désolé, le type de fichier n'est pas autorisé";
$text['file-error']['he-il'] = "מצטערים, סוג הקובץ אינו מותר";
$text['file-error']['it-it'] = "";
$text['file-error']['nl-nl'] = "Sorry, File type niet toegestaan";
$text['file-error']['pl-pl'] = "Niestety, Typ pliku jest niedozwolony";
$text['file-error']['pt-br'] = "Desculpe, tipo de arquivo não permitido";
$text['file-error']['pt-pt'] = "Desculpe, tipo de arquivo não permitido";
$text['file-error']['ro-ro'] = "";
$text['file-error']['ru-ru'] = "Обновление завершено";
$text['file-error']['sv-se'] = "Uppdatering Klar";
$text['file-error']['uk-ua'] = "Оновлення завершено";
?>

View File

@ -0,0 +1,31 @@
<?php
$y=0;
$apps[$x]['menu'][$y]['title']['en-us'] = "Call Broadcast";
$apps[$x]['menu'][$y]['title']['en-gb'] = "Call Broadcast";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
$apps[$x]['menu'][$y]['title']['de-at'] = "Rundrufe";
$apps[$x]['menu'][$y]['title']['de-ch'] = "";
$apps[$x]['menu'][$y]['title']['de-de'] = "Rundrufe";
$apps[$x]['menu'][$y]['title']['es-cl'] = "Llamada Broadcast";
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "Campagne d'Appels";
$apps[$x]['menu'][$y]['title']['he-il'] = "";
$apps[$x]['menu'][$y]['title']['it-it'] = "Chiamate Multiple";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "Omroep";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Rozsyłanie rozmów";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Chamada em broadcast";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "Chamada em Broadcast";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Массовые вызовы";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Samtalsdistribution";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "Трансляція дзвінка";
$apps[$x]['menu'][$y]['uuid'] = "50153bbf-78c5-b49e-7bd9-4b3e4b1134e6";
$apps[$x]['menu'][$y]['parent_uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['groups'][] = "admin";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
$apps[$x]['menu'][$y]['path'] = "/app/call_broadcast/call_broadcast.php";
?>

View File

@ -0,0 +1,251 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2020
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/paging.php";
//check permissions
if (permission_exists('call_broadcast_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get posted data
if (is_array($_POST['call_broadcasts'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$call_broadcasts = $_POST['call_broadcasts'];
}
//process the http post data by action
if ($action != '' && is_array($call_broadcasts) && @sizeof($call_broadcasts) != 0) {
switch ($action) {
case 'copy':
if (permission_exists('call_broadcast_add')) {
$obj = new call_broadcast;
$obj->copy($call_broadcasts);
}
break;
case 'delete':
if (permission_exists('call_broadcast_delete')) {
$obj = new call_broadcast;
$obj->delete($call_broadcasts);
}
break;
}
header('Location: call_broadcast.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
}
//get the http get variables and set them to php variables
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//add the search term
$search = strtolower($_GET["search"]);
if (strlen($search) > 0) {
$sql_search = " (";
$sql_search .= " lower(broadcast_name) like :search ";
$sql_search .= " or lower(broadcast_description) like :search ";
$sql_search .= " or lower(broadcast_caller_id_name) like :search ";
$sql_search .= " or lower(broadcast_caller_id_number) like :search ";
$sql_search .= " or lower(broadcast_phone_numbers) like :search ";
$sql_search .= ") ";
$parameters['search'] = '%'.$search.'%';
}
//get the count
$sql = "select count(*) from v_call_broadcasts ";
$sql .= "where true ";
if ($_GET['show'] != "all" || !permission_exists('call_broadcast_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
if (isset($sql_search)) {
$sql .= "and ".$sql_search;
}
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
//prepare the paging
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = "&search=".urlencode($search);
if ($_GET['show'] == "all" && permission_exists('call_broadcast_all')) {
$param .= "&show=all";
}
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
$offset = $rows_per_page * $page;
//get the call broadcasts
$sql = str_replace('count(*)','*', $sql);
$sql .= order_by($order_by, $order);
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$result = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//include the header
$document['title'] = $text['title-call_broadcast'];
require_once "resources/header.php";
//show the content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-call_broadcast']." (".$num_rows.")</b></div>\n";
echo " <div class='actions'>\n";
if (permission_exists('call_broadcast_add')) {
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','link'=>'call_broadcast_edit.php']);
}
if (permission_exists('call_broadcast_add') && $result) {
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
}
if (permission_exists('call_broadcast_delete') && $result) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('call_broadcast_all')) {
if ($_GET['show'] == 'all') {
echo " <input type='hidden' name='show' value='all'>";
}
else {
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?type='.urlencode($destination_type).'&show=all'.($search != '' ? "&search=".urlencode($search) : null)]);
}
}
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'call_broadcast.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
}
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if (permission_exists('call_broadcast_add') && $result) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
}
if (permission_exists('call_broadcast_delete') && $result) {
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');"])]);
}
echo $text['title_description-call_broadcast']."\n";
echo "<br /><br />\n";
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('call_broadcast_add') || permission_exists('call_broadcast_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($result ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
if ($_GET['show'] == "all" && permission_exists('call_broadcast_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
}
echo th_order_by('broadcast_name', $text['label-name'], $order_by, $order);
echo th_order_by('broadcast_concurrent_limit', $text['label-concurrent-limit'], $order_by, $order);
echo th_order_by('broadcast_description', $text['label-description'], $order_by, $order);
if (permission_exists('call_broadcast_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($result) && @sizeof($result) != 0) {
$x = 0;
foreach($result as $row) {
if (permission_exists('call_broadcast_edit')) {
$list_row_url = "call_broadcast_edit.php?id=".urlencode($row['call_broadcast_uuid']);
}
echo "<tr class='list-row' href='".$list_row_url."'>\n";
if (permission_exists('call_broadcast_add') || permission_exists('call_broadcast_delete')) {
echo " <td class='checkbox'>\n";
echo " <input type='checkbox' name='call_broadcasts[$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='call_broadcasts[$x][uuid]' value='".escape($row['call_broadcast_uuid'])."' />\n";
echo " </td>\n";
}
if ($_GET['show'] == "all" && permission_exists('call_broadcast_all')) {
if (strlen($_SESSION['domains'][$row['domain_uuid']]['domain_name']) > 0) {
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
}
else {
$domain = $text['label-global'];
}
echo " <td>".escape($domain)."</td>\n";
}
echo " <td>";
if (permission_exists('call_broadcast_edit')) {
echo "<a href='".$list_row_url."'>".escape($row['broadcast_name'])."</a>";
}
else {
echo escape($row['broadcast_name']);
}
echo " </td>\n";
echo " <td>".escape($row['broadcast_concurrent_limit'])."</td>\n";
echo " <td class='description overflow hide-xs'>".escape($row['broadcast_description'])."</td>\n";
if (permission_exists('call_broadcast_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";
}
echo "</tr>\n";
$x++;
}
}
unset($result);
echo "</table>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,700 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('call_broadcast_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//set the action with add or update
if (is_uuid($_REQUEST["id"])) {
$action = "update";
$call_broadcast_uuid = $_REQUEST["id"];
}
else {
$action = "add";
}
//function to Upload CSV/TXT file
function upload_file($sql, $broadcast_phone_numbers) {
$upload_csv = $sql = '';
if (isset($_FILES['broadcast_phone_numbers_file']) && !empty($_FILES['broadcast_phone_numbers_file']) && $_FILES['broadcast_phone_numbers_file']['size'] > 0) {
$filename=$_FILES["broadcast_phone_numbers_file"]["tmp_name"];
$file_extension = array('application/octet-stream','application/vnd.ms-excel','text/plain','text/csv','text/tsv');
if (in_array($_FILES['broadcast_phone_numbers_file']['type'],$file_extension)) {
$file = fopen($filename, "r");
$count = 0;
while (($getData = fgetcsv($file, 0, "\n")) !== FALSE)
{
$count++;
if ($count == 1) { continue; }
$getData = preg_split('/[ ,|]/', $getData[0], null, PREG_SPLIT_NO_EMPTY);
$separator = $getData[0];
$separator .= (isset($getData[1]) && $getData[1] != '')? '|'.$getData[1] : '';
$separator .= (isset($getData[2]) && $getData[2] != '')? ','.$getData[2] : '';
$separator .= '\n';
$upload_csv .= $separator;
}
fclose($file);
}
else {
return array('code'=>false,'sql'=>'');
}
}
if (!empty($broadcast_phone_numbers) && !empty($upload_csv)) {
$sql .= $broadcast_phone_numbers.'\n'.$upload_csv;
}
elseif (empty($broadcast_phone_numbers) && !empty($upload_csv)) {
$sql .= $upload_csv;
}
else {
$sql .= $broadcast_phone_numbers;
}
return array('code'=>true,'sql'=> $sql);
}
//get the http post variables and set them to php variables
if (count($_POST)>0) {
$broadcast_name = $_POST["broadcast_name"];
$broadcast_start_time = $_POST["broadcast_start_time"];
$broadcast_timeout = $_POST["broadcast_timeout"];
$broadcast_concurrent_limit = $_POST["broadcast_concurrent_limit"];
$broadcast_caller_id_name = $_POST["broadcast_caller_id_name"];
$broadcast_caller_id_number = $_POST["broadcast_caller_id_number"];
$broadcast_destination_type = $_POST["broadcast_destination_type"];
$broadcast_phone_numbers = $_POST["broadcast_phone_numbers"];
$broadcast_avmd = $_POST["broadcast_avmd"];
$broadcast_destination_data = $_POST["broadcast_destination_data"];
$broadcast_description = $_POST["broadcast_description"];
$broadcast_toll_allow = $_POST["broadcast_toll_allow"];
if (if_group("superadmin")) {
$broadcast_accountcode = $_POST["broadcast_accountcode"];
}
else if (if_group("admin") && file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
$sql = "select count(*) ";
$sql .= "from v_billings ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and type_value = :type_value ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['type_value'] = $_POST['accountcode'];
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
$broadcast_accountcode = $num_rows > 0 ? $_POST["broadcast_accountcode"] : $_SESSION['domain_name'];
unset($sql, $parameters, $num_rows);
}
else{
$broadcast_accountcode = $_SESSION['domain_name'];
}
}
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//delete the call broadcast
if (permission_exists('call_broadcast_delete')) {
if ($_POST['action'] == 'delete' && is_uuid($call_broadcast_uuid)) {
//prepare
$call_broadcasts[0]['checked'] = 'true';
$call_broadcasts[0]['uuid'] = $call_broadcast_uuid;
//delete
$obj = new call_broadcast;
$obj->delete($call_broadcasts);
//redirect
header('Location: call_broadcast.php');
exit;
}
}
$msg = '';
if ($action == "update") {
$call_broadcast_uuid = $_POST["call_broadcast_uuid"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: call_broadcast.php');
exit;
}
//check for all required data
if (strlen($broadcast_name) == 0) { $msg .= "".$text['confirm-name']."<br>\n"; }
//if (strlen($broadcast_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
//if (strlen($broadcast_timeout) == 0) { $msg .= "Please provide: Timeout<br>\n"; }
//if (strlen($broadcast_concurrent_limit) == 0) { $msg .= "Please provide: Concurrent Limit<br>\n"; }
//if (strlen($recording_uuid) == 0) { $msg .= "Please provide: Recording<br>\n"; }
//if (strlen($broadcast_caller_id_name) == 0) { $msg .= "Please provide: Caller ID Name<br>\n"; }
//if (strlen($broadcast_caller_id_number) == 0) { $msg .= "Please provide: Caller ID Number<br>\n"; }
//if (strlen($broadcast_destination_type) == 0) { $msg .= "Please provide: Type<br>\n"; }
//if (strlen($broadcast_phone_numbers) == 0) { $msg .= "Please provide: Phone Number List<br>\n"; }
//if (strlen($broadcast_avmd) == 0) { $msg .= "Please provide: Voicemail Detection<br>\n"; }
//if (strlen($broadcast_destination_data) == 0) { $msg .= "Please provide: Destination<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "resources/footer.php";
return;
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
//prep insert
if ($action == "add" && permission_exists('call_broadcast_add')) {
//begin insert array
$call_broadcast_uuid = uuid();
$array['call_broadcasts'][0]['call_broadcast_uuid'] = $call_broadcast_uuid;
//set message
message::add($text['confirm-add']);
//set return url on error
$error_return_url = "call_broadcast_edit.php";
}
//prep update
if ($action == "update" && permission_exists('call_broadcast_edit')) {
//begin update array
$array['call_broadcasts'][0]['call_broadcast_uuid'] = $call_broadcast_uuid;
//set message
message::add($text['confirm-update']);
//set return url on error
$error_return_url = "call_broadcast_edit.php?id=".urlencode($_GET['id']);
}
//execute
if (is_array($array) && @sizeof($array) != 0) {
//add file selection and download sample
$file_res = upload_file($sql, $broadcast_phone_numbers);
if ($file_res['code'] != true) {
$_SESSION["message_mood"] = "negative";
$_SESSION["message"] = $text['file-error'];
header("Location: ".$error_return_url);
exit;
}
$broadcast_phone_numbers = $file_res['sql'];
//common array items
$array['call_broadcasts'][0]['domain_uuid'] = $domain_uuid;
$array['call_broadcasts'][0]['broadcast_name'] = $broadcast_name;
$array['call_broadcasts'][0]['broadcast_start_time'] = $broadcast_start_time;
$array['call_broadcasts'][0]['broadcast_timeout'] = strlen($broadcast_timeout) != 0 ? $broadcast_timeout : null;
$array['call_broadcasts'][0]['broadcast_concurrent_limit'] = strlen($broadcast_concurrent_limit) != 0 ? $broadcast_concurrent_limit : null;
$array['call_broadcasts'][0]['broadcast_caller_id_name'] = $broadcast_caller_id_name;
$array['call_broadcasts'][0]['broadcast_caller_id_number'] = $broadcast_caller_id_number;
$array['call_broadcasts'][0]['broadcast_destination_type'] = $broadcast_destination_type;
$array['call_broadcasts'][0]['broadcast_phone_numbers'] = $broadcast_phone_numbers;
$array['call_broadcasts'][0]['broadcast_avmd'] = $broadcast_avmd;
$array['call_broadcasts'][0]['broadcast_destination_data'] = $broadcast_destination_data;
$array['call_broadcasts'][0]['broadcast_accountcode'] = $broadcast_accountcode;
$array['call_broadcasts'][0]['broadcast_description'] = $broadcast_description;
$array['call_broadcasts'][0]['broadcast_toll_allow'] = $broadcast_toll_allow;
//execute
$database = new database;
$database->app_name = 'call_broadcast';
$database->app_uuid = 'efc11f6b-ed73-9955-4d4d-3a1bed75a056';
$database->save($array);
unset($array);
//redirect
header("Location: call_broadcast.php");
exit;
}
}
}
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
$call_broadcast_uuid = $_GET["id"];
$sql = "select * from v_call_broadcasts ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and call_broadcast_uuid = :call_broadcast_uuid ";
$parameters['domain_uuid'] = $domain_uuid;
$parameters['call_broadcast_uuid'] = $call_broadcast_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) {
$broadcast_name = $row["broadcast_name"];
$broadcast_start_time = $row["broadcast_start_time"];
$broadcast_timeout = $row["broadcast_timeout"];
$broadcast_concurrent_limit = $row["broadcast_concurrent_limit"];
$broadcast_caller_id_name = $row["broadcast_caller_id_name"];
$broadcast_caller_id_number = $row["broadcast_caller_id_number"];
$broadcast_destination_type = $row["broadcast_destination_type"];
$broadcast_phone_numbers = $row["broadcast_phone_numbers"];
$broadcast_avmd = $row["broadcast_avmd"];
$broadcast_destination_data = $row["broadcast_destination_data"];
$broadcast_accountcode = $row["broadcast_accountcode"];
$broadcast_description = $row["broadcast_description"];
$broadcast_toll_allow = $row["broadcast_toll_allow"];
}
unset($sql, $parameters, $row);
}
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//begin header
$document['title'] = $text['title-call_broadcast'];
require_once "resources/header.php";
//begin content
echo "<form name='frm' id='frm' method='post' enctype='multipart/form-data'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-call_broadcast']."</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'=>'call_broadcast.php']);
if ($action == "update") {
echo button::create(['type'=>'button','label'=>$text['button-start'],'icon'=>$_SESSION['theme']['button_icon_start'],'style'=>'margin-left: 15px;','link'=>'call_broadcast_send.php?id='.urlencode($call_broadcast_uuid)]);
echo button::create(['type'=>'button','label'=>$text['button-stop'],'icon'=>$_SESSION['theme']['button_icon_stop'],'link'=>'call_broadcast_stop.php?id='.urlencode($call_broadcast_uuid)]);
if (permission_exists('call_broadcast_delete')) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'name'=>'btn_delete','style'=>'margin-left: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
}
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','style'=>'margin-left: 15px;']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if ($action == 'update' && permission_exists('call_broadcast_delete')) {
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
}
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";
echo " ".$text['label-name']."\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='broadcast_name' maxlength='255' value=\"".escape($broadcast_name)."\" required='required'>\n";
echo "<br />\n";
echo "".$text['description-name']."\n";
echo "</td>\n";
echo "</tr>\n";
if (permission_exists('call_broadcast_start_time')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-start_time']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='broadcast_start_time' value=\"".escape($broadcast_start_time)."\">\n";
echo "<br />\n";
echo "".$text['description-start_time']."\n";
echo "</td>\n";
echo "</tr>\n";
}
if (if_group("superadmin")){
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-accountcode']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
if ($action == "add") { $accountcode=$_SESSION['domain_name']; }
echo " <input class='formfld' type='text' name='broadcast_accountcode' maxlength='255' value=\"".escape($broadcast_accountcode)."\">\n";
echo "<br />\n";
echo $text['description-accountcode']."\n";
echo "</td>\n";
echo "</tr>\n";
}
if (permission_exists('call_broadcast_timeout')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-timeout']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='broadcast_timeout' maxlength='255' min='1' step='1' value=\"".escape($broadcast_timeout)."\">\n";
echo "<br />\n";
echo "".$text['description-timeout']."\n";
echo "</td>\n";
echo "</tr>\n";
}
if (permission_exists('call_broadcast_concurrent_limit')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-concurrent-limit']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='broadcast_concurrent_limit' maxlength='255' min='1' step='1' value=\"".escape($broadcast_concurrent_limit)."\">\n";
echo "<br />\n";
echo "".$text['description-concurrent-limit']."\n";
echo "</td>\n";
echo "</tr>\n";
}
//echo "<tr>\n";
//echo "<td class='vncell' valign='top' align='left' nowrap>\n";
//echo " Recording\n";
//echo "</td>\n";
//echo "<td class='vtable' align='left'>\n";
//echo " <select name='recording_uuid' class='formfld'>\n";
//echo " <option></option>\n";
//$sql = "";
//$sql .= "select * from v_recordings ";
//$sql .= "where domain_uuid = :domain_uuid ";
//$parameters['domain_uuid'] = $domain_uuid;
//$database = new database;
//$rows = $database->select($sql, $parameters, 'all');
//if (is_array($rows) && @sizeof($rows) != 0) {
// foreach ($rows as $row) {
// if ($recording_uuid == $row['recording_uuid']) {
// echo " <option value='".$row['recording_uuid']."' selected='yes'>".escape($row['recordingname'])."</option>\n";
// }
// else {
// echo " <option value='".$row['recording_uuid']."'>".escape($row['recordingname'])."</option>\n";
// }
// }
//}
//unset($sql, $parameters, $rows, $row);
//echo " </select>\n";
//echo "<br />\n";
//echo "Recording to play when the call is answered.<br />\n";
//echo "\n";
//echo "</td>\n";
//echo "</tr>\n";
if (permission_exists("call_broadcast_caller_id")) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-caller-id-name']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='broadcast_caller_id_name' maxlength='255' value=\"".escape($broadcast_caller_id_name)."\">\n";
echo "<br />\n";
echo "".$text['description-caller-id-name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-callerid-number']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='broadcast_caller_id_number' maxlength='255' min='0' step='1' value=\"".escape($broadcast_caller_id_number)."\">\n";
echo "<br />\n";
echo "".$text['description-caller-id-number']."\n";
echo "</td>\n";
echo "</tr>\n";
}
/*
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Type\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='broadcast_destination_type' maxlength='255' value=\"".escape($broadcast_destination_type)."\">\n";
echo "<br />\n";
echo "Optional, Destination Type: bridge, transfer, voicemail, conference, fifo, etc.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Destination\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='broadcast_destination_data' maxlength='255' value=\"".escape($broadcast_destination_data)."\">\n";
echo "<br />\n";
echo "Optional, send the call to an auto attendant, conference room, or any other destination. <br /><br />\n";
echo "conference (8khz): 01-\${domain}@default <br />\n";
echo "bridge (external number): sofia/gateway/gatewayname/12081231234 <br />\n";
echo "bridge (auto attendant): sofia/internal/5002@\${domain} <br />\n";
echo "transfer (external number): 12081231234 XML default <br />\n";
echo "</td>\n";
echo "</tr>\n";
*/
if (permission_exists('call_broadcast_destination_number')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-destination']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='broadcast_destination_data' maxlength='255' value=\"".escape($broadcast_destination_data)."\">\n";
echo "<br />\n";
echo "".$text['description-destination']." <br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
}
if (permission_exists('call_broadcast_phone_number_list')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-phone']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <textarea class='formfld' style='width: 300px; height: 200px;' type='text' name='broadcast_phone_numbers' placeholder=\"".$text['label-list_example']."\">".str_replace('\n', "\n", $broadcast_phone_numbers)."</textarea>";
echo "<br><br>";
echo " <input type='file' name='broadcast_phone_numbers_file' accept='.csv,.txt' style=\"display:inline-block;\"><a href='sample.csv' download><i class='fas fa-cloud-download-alt' style='margin-right: 5px;'></i>".$text['label-sample_file']."</a>";
echo "<br /><br />";
echo "".$text['description-phone']." <br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
}
if (permission_exists('call_broadcast_voicemail_detection')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-avmd']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='broadcast_avmd'>\n";
echo " <option value='false' ".(($broadcast_avmd == "false") ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='true' ".(($broadcast_avmd == "true") ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo "<br />\n";
echo $text['description-avmd']."\n";
echo "</td>\n";
echo "</tr>\n";
}
if (permission_exists('broadcast_toll_allow')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-broadcast_toll_allow']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='broadcast_toll_allow' maxlength='255' value=".escape($broadcast_toll_allow).">\n";
echo "<br />\n";
echo $text['description-broadcast_toll_allow']."\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='broadcast_description' maxlength='255' value=\"".escape($broadcast_description)."\">\n";
echo "<br />\n";
echo "".$text['description-info']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "<br><br>";
if ($action == "update") {
echo "<input type='hidden' name='call_broadcast_uuid' value='".escape($call_broadcast_uuid)."'>\n";
}
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>";
/*
if ($action == "update") {
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' nowrap><b>Call Broadcast</b></td>\n";
echo "<td width='50%' align='right'>&nbsp;</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<form method='get' name='frm' action='call_broadcast_send.php'>\n";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
echo " Category\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <select name='user_category' class='formfld'>\n";
echo " <option></option>\n";
$sql = "";
$sql .= "select distinct user_category as user_category from v_users ";
//$sql .= "where domain_uuid = :domain_uuid ";
//$parameters['domain_uuid'] = $domain_uuid;
$database = new database;
$rows = $database->select($sql, null, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
if ($user_category == $row['user_category']) {
echo " <option value='".escape($row['user_category'])."' selected='yes'>".escape($row['user_category'])."</option>\n";
}
else {
echo " <option value='".escape($row['user_category'])."'>".escape($row['user_category'])."</option>\n";
}
}
}
unset($sql, $parameters, $rows, $row);
echo " </select>\n";
echo "<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
echo " Group\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <select name='group_name' class='formfld'>\n";
echo " <option></option>\n";
$sql = "";
$sql .= "select * from v_groups ";
//$sql .= "where domain_uuid = :domain_uuid ";
//$parameters['domain_uuid'] = $domain_uuid;
$database = new database;
$rows = $database->select($sql, null, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
if ($recording_uuid == $row['group_name']) {
echo " <option value='".escape($row['group_name'])."' selected='yes'>".escape($row['group_name'])."</option>\n";
}
else {
echo " <option value='".escape($row['group_name'])."'>".escape($row['group_name'])."</option>\n";
}
}
}
unset($sql, $parameters, $rows, $row);
echo " </select>\n";
echo "<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
echo " Gateway\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <select name='gateway' class='formfld'>\n";
echo " <option></option>\n";
$sql = "";
$sql .= "select * from v_gateways ";
//$sql .= "where domain_uuid = :domain_uuid ";
//$parameters['domain_uuid'] = $domain_uuid;
$database = new database;
$rows = $database->select($sql, null, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
if ($gateway == $row['gateway']) {
echo " <option value='".escape($row['gateway'])."' selected='yes'>".escape($row['gateway'])."</option>\n";
}
else {
echo " <option value='".escape($row['gateway'])."'>".escape($row['gateway'])."</option>\n";
}
}
}
unset($sql, $parameters, $rows, $row);
echo " <option value='loopback'>loopback</option>\n";
echo " </select>\n";
echo "<br />\n";
//echo "zzz.<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Phone Type\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='phonetype1' class='formfld'>\n";
echo " <option></option>\n";
echo " <option value='phone1'>phone1</option>\n";
echo " <option value='phone2'>phone2</option>\n";
echo " <option value='cell'>cell</option>\n";
//echo " <option value='zzz'>cell</option>\n";
echo " </select>\n";
echo "<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Phone Type\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='phonetype2' class='formfld'>\n";
echo " <option></option>\n";
echo " <option value='phone1'>phone1</option>\n";
echo " <option value='phone2'>phone2</option>\n";
echo " <option value='cell'>cell</option>\n";
//echo " <option value='zzz'>cell</option>\n";
echo " </select>\n";
echo "<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
echo " <input type='hidden' name='call_broadcast_uuid' value='".escape($call_broadcast_uuid)."'>\n";
echo " <input type='submit' name='submit' class='btn' value='Send Broadcast'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "</form>";
}
*/
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,252 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2020
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//chec permissions
if (permission_exists('call_broadcast_send')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//set the max execution time to 1 hour
ini_set(max_execution_time,3600);
//define the asynchronous command function
function cmd_async($cmd) {
//windows
if (stristr(PHP_OS, 'WIN')) {
$descriptorspec = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout
2 => array("pipe", "w") // stderr
);
$process = proc_open("start ".$cmd, $descriptorspec, $pipes);
//sleep(1);
proc_close($process);
}
else { //posix
exec ($cmd ." /dev/null 2>&1 &");
}
}
//get the http get values and set as php variables
$group_name = $_GET["group_name"];
$call_broadcast_uuid = $_GET["id"];
$user_category = $_GET["user_category"];
$gateway = $_GET["gateway"];
$phonetype1 = $_GET["phonetype1"];
$phonetype2 = $_GET["phonetype2"];
//get the call broadcast details from the database
$sql = "select * from v_call_broadcasts ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and call_broadcast_uuid = :call_broadcast_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['call_broadcast_uuid'] = $call_broadcast_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && sizeof($row) != 0) {
$broadcast_name = $row["broadcast_name"];
$broadcast_start_time = $row["broadcast_start_time"];
$broadcast_timeout = $row["broadcast_timeout"];
$broadcast_concurrent_limit = $row["broadcast_concurrent_limit"];
$recordingid = $row["recordingid"];
$broadcast_caller_id_name = $row["broadcast_caller_id_name"];
$broadcast_caller_id_number = $row["broadcast_caller_id_number"];
$broadcast_destination_type = $row["broadcast_destination_type"];
$broadcast_phone_numbers = $row["broadcast_phone_numbers"];
$broadcast_destination_data = $row["broadcast_destination_data"];
$broadcast_avmd = $row["broadcast_avmd"];
$broadcast_accountcode = $row["broadcast_accountcode"];
$broadcast_description = $row["broadcast_description"];
//if (strlen($row["broadcast_destination_data"]) == 0) {
// $broadcast_destination_application = '';
// $broadcast_destination_data = '';
//}
//else {
// $broadcast_destination_array = explode(":", $row["broadcast_destination_data"]);
// $broadcast_destination_application = $broadcast_destination_array[0];
// $broadcast_destination_data = $broadcast_destination_array[1];
//}
}
unset($sql, $parameters, $row);
//set the defaults
if (strlen($broadcast_caller_id_name) == 0) {
$broadcast_caller_id_name = "anonymous";
}
if (strlen($broadcast_caller_id_number) == 0) {
$broadcast_caller_id_number = "0000000000";
}
if (strlen($broadcast_accountcode) == 0) {
$broadcast_accountcode = $_SESSION['domain_name'];;
}
if (isset($broadcast_start_time) && is_numeric($broadcast_start_time)) {
$sched_seconds = $broadcast_start_time;
}
else {
$sched_seconds = '3';
}
//get the recording name
//$recording_filename = get_recording_filename($recordingid);
//remove unsafe characters from the name
$broadcast_name = str_replace(" ", "", $broadcast_name);
$broadcast_name = str_replace("'", "", $broadcast_name);
//create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//get information over event socket
if (!$fp) {
require_once "resources/header.php";
$msg = "<div align='center'>Connection to Event Socket failed.<br /></div>";
echo "<div align='center'>\n";
echo "<table width='40%'>\n";
echo "<tr>\n";
echo "<th align='left'>".$text['label-message']."</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='row_style1'><strong>$msg</strong></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>\n";
require_once "resources/footer.php";
}
else {
//show the header
require_once "resources/header.php";
//send the call broadcast
if (strlen($broadcast_phone_numbers) > 0) {
$broadcast_phone_number_array = explode ("\n", $broadcast_phone_numbers);
$count = 1;
foreach ($broadcast_phone_number_array as $tmp_value) {
//set the variables
$tmp_value = str_replace(";", "|", $tmp_value);
$tmp_value_array = explode ("|", $tmp_value);
//remove the number formatting
$phone_1 = preg_replace('{\D}', '', $tmp_value_array[0]);
if (is_numeric($phone_1)) {
//get the dialplan variables and bridge statement
//$dialplan = new dialplan;
//$dialplan->domain_uuid = $_SESSION['domain_uuid'];
//$dialplan->outbound_routes($phone_1);
//$dialplan_variables = $dialplan->variables;
//$bridge_array[0] = $dialplan->bridges;
//prepare the string
$channel_variables = "ignore_early_media=true";
$channel_variables .= ",origination_number=".$phone_1;
$channel_variables .= ",origination_caller_id_name='$broadcast_caller_id_name'";
$channel_variables .= ",origination_caller_id_number=$broadcast_caller_id_number";
$channel_variables .= ",domain_uuid=".$_SESSION['domain_uuid'];
$channel_variables .= ",domain=".$_SESSION['domain_name'];
$channel_variables .= ",domain_name=".$_SESSION['domain_name'];
$channel_variables .= ",accountcode='$broadcast_accountcode'";
$channel_variables .= ",toll_allow='$broadcast_toll_allow'";
if ($broadcast_avmd == "true") {
$channel_variables .= ",execute_on_answer='avmd start'";
}
//$origination_url = "{".$channel_variables."}".$bridge_array[0];
$origination_url = "{".$channel_variables."}loopback/".$phone_1.'/'.$_SESSION['domain_name'];
//get the context
$context = $_SESSION['domain_name'];
//set the command
$cmd = "bgapi sched_api +".$sched_seconds." ".$call_broadcast_uuid." bgapi originate ".$origination_url." ".$broadcast_destination_data." XML $context";
//if the event socket connection is lost then re-connect
if (!$fp) {
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
}
//method 1
$response = trim(event_socket_request($fp, 'api '.$cmd));
//method 2
//cmd_async($_SESSION['switch']['bin']['dir']."/fs_cli -x \"".$cmd."\";");
//spread the calls out so that they are scheduled with different times
if (strlen($broadcast_concurrent_limit) > 0 && strlen($broadcast_timeout) > 0) {
if ($broadcast_concurrent_limit == $count) {
$sched_seconds = $sched_seconds + $broadcast_timeout;
$count=0;
}
}
$count++;
}
}
fclose($fp);
echo "<div align='center'>\n";
echo "<table width='50%'>\n";
echo "<tr>\n";
echo "<th align='left'>Message</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='row_style1' align='center'>\n";
echo " <strong>".$text['label-call-broadcast']." ".$broadcast_name." ".$text['label-has-been']."</strong>\n";
if (permission_exists('call_active_view')) {
echo " <br /><br />\n";
echo " <table width='100%'>\n";
echo " <tr>\n";
echo " <td align='center'>\n";
echo " <a href='".PROJECT_PATH."/app/calls_active/calls_active.php'>".$text['label-view-calls']."</a>\n";
echo " </td>\n";
echo " </table>\n";
}
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>\n";
}
//show the footer
require_once "resources/footer.php";
}
?>

View File

@ -0,0 +1,64 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('call_broadcast_send')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get the html values and set them as variables
$uuid = trim($_GET["id"]);
if (is_uuid($uuid)) {
//show the result
if (count($_GET) > 0) {
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$cmd = "sched_del ".$uuid;
$result = event_socket_request($fp, 'api '.$cmd);
message::add(htmlentities($result));
}
}
//redirect
header('Location: call_broadcast_edit.php?id='.$uuid);
exit;
}
//default redirect
header('Location: call_broadcasts.php');
exit;
?>

View File

@ -0,0 +1,167 @@
<?php
/**
* call broadcast class
*
* @method null download
*/
if (!class_exists('call_broadcast')) {
class call_broadcast {
/**
* declare private variables
*/
private $app_name;
private $app_uuid;
private $permission_prefix;
private $list_page;
private $table;
private $uuid_prefix;
/**
* called when the object is created
*/
public function __construct() {
//assign private variables
$this->app_name = 'call_broadcast';
$this->app_uuid = 'efc11f6b-ed73-9955-4d4d-3a1bed75a056';
$this->permission_prefix = 'call_broadcast_';
$this->list_page = 'call_broadcast.php';
$this->table = 'call_broadcasts';
$this->uuid_prefix = 'call_broadcast_';
}
/**
* called when there are no references to a particular object
* unset the variables used in the class
*/
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
/**
* delete records
*/
public function delete($records) {
if (permission_exists($this->permission_prefix.'delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//delete multiple records
if (is_array($records) && @sizeof($records) != 0) {
//build the delete array
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
$array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
}
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
//execute delete
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->delete($array);
unset($array);
//set message
message::add($text['message-delete']);
}
unset($records);
}
}
}
/**
* copy records
*/
public function copy($records) {
if (permission_exists($this->permission_prefix.'add')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//copy the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get checked records
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//create insert array from existing data
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select * from v_".$this->table." ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $x => $row) {
//copy data
$array[$this->table][$x] = $row;
//overwrite
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = uuid();
$array[$this->table][$x]['broadcast_description'] = trim($row['broadcast_description'].' ('.$text['label-copy'].')');
}
}
unset($sql, $parameters, $rows, $row);
}
//save the changes and set the message
if (is_array($array) && @sizeof($array) != 0) {
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//set message
message::add($text['message-copy']);
}
unset($records);
}
}
}
}
}
?>

View File

@ -0,0 +1,90 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,3 @@
Phone_Number,Last_Name,First_Name
9888888877,Doe,John
8777666666,Bullock,Sarah
1 Phone_Number Last_Name First_Name
2 9888888877 Doe John
3 8777666666 Bullock Sarah

View File

@ -0,0 +1,44 @@
<?php
//application details
$apps[$x]['name'] = "Call Center Active";
$apps[$x]['uuid'] = "3f159f62-ca2d-41b8-b3f0-c5519cebbc5a";
$apps[$x]['category'] = "Switch";;
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Shows active calls, and agents in the call center queue.";
$apps[$x]['description']['en-gb'] = "Shows active calls, and agents in the call center queue.";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Zeigt aktive Anrufe und Agenten in der Callcenter Warteschlange.";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Zeigt aktive Anrufe und Agenten in der Callcenter Warteschlange.";
$apps[$x]['description']['es-cl'] = "Muestra las llamadas activas y los agentes en la cola del centro de llamadas.";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "Il montre les appels actives et des agents en queue du centre d'appels.";
$apps[$x]['description']['fr-fr'] = "Affiche les appels actifs et les agents en queue sur le centre d'appel.";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "Laat actieve oproepen en agenten in het Call-Center wachtrij zien";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "Mostra as chamadas ativas, e os agentes na fila do Call Center.";
$apps[$x]['description']['pt-pt'] = "Mostra as chamadas ativas e agentes na fila do centro de chamadas.";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "call_center_active_view";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "7fb0dd87-e984-9980-c512-2c76b887aeb2";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_active_options";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "7fb0dd87-e984-9980-c512-2c76b887aeb2";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
?>

View File

@ -0,0 +1,865 @@
<?php
#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
$text['title-call_center_queue_activity']['en-us'] = "Call Center Queue Activity";
$text['title-call_center_queue_activity']['en-gb'] = "Call Center Queue Activity";
$text['title-call_center_queue_activity']['ar-eg'] = "";
$text['title-call_center_queue_activity']['de-at'] = "Callcenter Warteschlangen Aktivität"; //copied from de-de
$text['title-call_center_queue_activity']['de-ch'] = "Callcenter Warteschlangen Aktivität"; //copied from de-de
$text['title-call_center_queue_activity']['de-de'] = "Callcenter Warteschlangen Aktivität";
$text['title-call_center_queue_activity']['es-cl'] = "Actividad de Cola del Centro de Llamados";
$text['title-call_center_queue_activity']['es-mx'] = "Actividad de Cola del Centro de Llamados"; //copied from es-cl
$text['title-call_center_queue_activity']['fr-ca'] = "Activité des files d'attente du centre d'appel"; //copied from fr-fr
$text['title-call_center_queue_activity']['fr-fr'] = "Activité des files d'attente du centre d'appel";
$text['title-call_center_queue_activity']['he-il'] = "";
$text['title-call_center_queue_activity']['it-it'] = "Attività Coda Call Center";
$text['title-call_center_queue_activity']['nl-nl'] = "Call-Center wachtrij activiteit";
$text['title-call_center_queue_activity']['pl-pl'] = "Aktywność kolejek w Call Center ";
$text['title-call_center_queue_activity']['pt-br'] = "Atividade das filas do Call Center";
$text['title-call_center_queue_activity']['pt-pt'] = "Actividade das filas do Call Center";
$text['title-call_center_queue_activity']['ro-ro'] = "";
$text['title-call_center_queue_activity']['ru-ru'] = "Активность очередей Колл-центра";
$text['title-call_center_queue_activity']['sv-se'] = "Call Center Grupp Aktivitet";
$text['title-call_center_queue_activity']['uk-ua'] = "";
$text['title-active_call_center']['en-us'] = "Active Call Center";
$text['title-active_call_center']['en-gb'] = "Active Call Center";
$text['title-active_call_center']['ar-eg'] = "";
$text['title-active_call_center']['de-at'] = "Aktive Callcenter"; //copied from de-de
$text['title-active_call_center']['de-ch'] = "Aktive Callcenter"; //copied from de-de
$text['title-active_call_center']['de-de'] = "Aktive Callcenter";
$text['title-active_call_center']['es-cl'] = "Centro de Llamados Activo";
$text['title-active_call_center']['es-mx'] = "Centro de Llamados Activo"; //copied from es-cl
$text['title-active_call_center']['fr-ca'] = "Centre d'appel Actif"; //copied from fr-fr
$text['title-active_call_center']['fr-fr'] = "Centre d'appel Actif";
$text['title-active_call_center']['he-il'] = "";
$text['title-active_call_center']['it-it'] = "Call Center Attivo";
$text['title-active_call_center']['nl-nl'] = "Actieve Call-Center";
$text['title-active_call_center']['pl-pl'] = "Aktywność w Call Center ";
$text['title-active_call_center']['pt-br'] = "Atividade do Call Center"; //copied from pt-pt
$text['title-active_call_center']['pt-pt'] = "Atividade do Call Center";
$text['title-active_call_center']['ro-ro'] = "";
$text['title-active_call_center']['ru-ru'] = "Активные Колл-центры";
$text['title-active_call_center']['sv-se'] = "Aktivt Call Center";
$text['title-active_call_center']['uk-ua'] = "";
$text['message-confirm']['en-us'] = "Do you really want to do this?";
$text['message-confirm']['en-gb'] = "Do you really want to do this?";
$text['message-confirm']['ar-eg'] = "";
$text['message-confirm']['de-at'] = "Wollen Sie das wirklich tun?"; //copied from de-de
$text['message-confirm']['de-ch'] = "Wollen Sie das wirklich tun?"; //copied from de-de
$text['message-confirm']['de-de'] = "Wollen Sie das wirklich tun?";
$text['message-confirm']['es-cl'] = "¿Realmente desea ejecutar esta operación?";
$text['message-confirm']['es-mx'] = "¿Realmente desea ejecutar esta operación?"; //copied from es-cl
$text['message-confirm']['fr-ca'] = "Voulez-vous vraiment faire cela?"; //copied from fr-fr
$text['message-confirm']['fr-fr'] = "Voulez-vous vraiment faire cela?";
$text['message-confirm']['he-il'] = "";
$text['message-confirm']['it-it'] = "Sei sicuro di volerlo fare?";
$text['message-confirm']['nl-nl'] = "Wil je dit werkelijk doen?";
$text['message-confirm']['pl-pl'] = "Czy napewno chcesz to zrobić?";
$text['message-confirm']['pt-br'] = "Deseja realmente fazer isto?"; //copied from pt-pt
$text['message-confirm']['pt-pt'] = "Deseja realmente fazer isto?";
$text['message-confirm']['ro-ro'] = "";
$text['message-confirm']['ru-ru'] = "Вы действительно хотите это сдедать?";
$text['message-confirm']['sv-se'] = "Vill du verkligen göra det här?";
$text['message-confirm']['uk-ua'] = "";
$text['label-waiting']['en-us'] = "Waiting";
$text['label-waiting']['en-gb'] = "Waiting";
$text['label-waiting']['ar-eg'] = "انتظار";
$text['label-waiting']['de-at'] = "Warten"; //copied from de-de
$text['label-waiting']['de-ch'] = "Warten"; //copied from de-de
$text['label-waiting']['de-de'] = "Warten";
$text['label-waiting']['es-cl'] = "Esperando";
$text['label-waiting']['es-mx'] = "Esperando"; //copied from es-cl
$text['label-waiting']['fr-ca'] = "d'attente"; //copied from fr-fr
$text['label-waiting']['fr-fr'] = "d'attente";
$text['label-waiting']['he-il'] = "";
$text['label-waiting']['it-it'] = "Attesa";
$text['label-waiting']['nl-nl'] = "Wachten";
$text['label-waiting']['pl-pl'] = "Oczekiwanie";
$text['label-waiting']['pt-br'] = "Esperar";
$text['label-waiting']['pt-pt'] = "Esperando";
$text['label-waiting']['ro-ro'] = "";
$text['label-waiting']['ru-ru'] = "Ожидание";
$text['label-waiting']['sv-se'] = "Väntar";
$text['label-waiting']['uk-ua'] = "";
$text['label-trying']['en-us'] = "Trying";
$text['label-trying']['en-gb'] = "Trying";
$text['label-trying']['ar-eg'] = "";
$text['label-trying']['de-at'] = "Versuchen"; //copied from de-de
$text['label-trying']['de-ch'] = "Versuchen"; //copied from de-de
$text['label-trying']['de-de'] = "Versuchen";
$text['label-trying']['es-cl'] = "Intentando";
$text['label-trying']['es-mx'] = "Intentando"; //copied from es-cl
$text['label-trying']['fr-ca'] = "d'essais"; //copied from fr-fr
$text['label-trying']['fr-fr'] = "d'essais";
$text['label-trying']['he-il'] = "";
$text['label-trying']['it-it'] = "In Corso";
$text['label-trying']['nl-nl'] = "Proberen";
$text['label-trying']['pl-pl'] = "Próba";
$text['label-trying']['pt-br'] = "Tentando"; //copied from pt-pt
$text['label-trying']['pt-pt'] = "Tentando";
$text['label-trying']['ro-ro'] = "";
$text['label-trying']['ru-ru'] = "Попытка";
$text['label-trying']['sv-se'] = "Försöker";
$text['label-trying']['uk-ua'] = "";
$text['label-transfer']['en-us'] = "Transfer";
$text['label-transfer']['en-gb'] = "Transfer";
$text['label-transfer']['ar-eg'] = "تحويل";
$text['label-transfer']['de-at'] = "Weiterleiten"; //copied from de-de
$text['label-transfer']['de-ch'] = "Weiterleiten"; //copied from de-de
$text['label-transfer']['de-de'] = "Weiterleiten";
$text['label-transfer']['es-cl'] = "Transferir";
$text['label-transfer']['es-mx'] = "Transferir"; //copied from es-cl
$text['label-transfer']['fr-ca'] = "Transfert"; //copied from fr-fr
$text['label-transfer']['fr-fr'] = "Transfert";
$text['label-transfer']['he-il'] = "העבר";
$text['label-transfer']['it-it'] = "Traferimento";
$text['label-transfer']['nl-nl'] = "Overzetten";
$text['label-transfer']['pl-pl'] = "Transferowanie";
$text['label-transfer']['pt-br'] = "Transferir"; //copied from pt-pt
$text['label-transfer']['pt-pt'] = "Transferir";
$text['label-transfer']['ro-ro'] = "";
$text['label-transfer']['ru-ru'] = "Перевод";
$text['label-transfer']['sv-se'] = "Överför";
$text['label-transfer']['uk-ua'] = "";
$text['label-time_base_score']['en-us'] = "Time Base Score";
$text['label-time_base_score']['en-gb'] = "Time Base Score";
$text['label-time_base_score']['ar-eg'] = "";
$text['label-time_base_score']['de-at'] = "Zeitgeber für Klassifikation"; //copied from de-de
$text['label-time_base_score']['de-ch'] = "Zeitgeber für Klassifikation"; //copied from de-de
$text['label-time_base_score']['de-de'] = "Zeitgeber für Klassifikation";
$text['label-time_base_score']['es-cl'] = "Puntuación basada en tiempo";
$text['label-time_base_score']['es-mx'] = "Puntuación basada en tiempo"; //copied from es-cl
$text['label-time_base_score']['fr-ca'] = "Score basé sur le temps"; //copied from fr-fr
$text['label-time_base_score']['fr-fr'] = "Score basé sur le temps";
$text['label-time_base_score']['he-il'] = "";
$text['label-time_base_score']['it-it'] = "Punteggio su Base Tempo";
$text['label-time_base_score']['nl-nl'] = "Tijdbasis score";
$text['label-time_base_score']['pl-pl'] = "Wynik oparty na czasie";
$text['label-time_base_score']['pt-br'] = "Pontuação baseada no tempo"; //copied from pt-pt
$text['label-time_base_score']['pt-pt'] = "Pontuação baseada no tempo";
$text['label-time_base_score']['ro-ro'] = "";
$text['label-time_base_score']['ru-ru'] = "Оценка по времени";
$text['label-time_base_score']['sv-se'] = "Tidsbaserat Resultat";
$text['label-time_base_score']['uk-ua'] = "";
$text['label-time']['en-us'] = "Time";
$text['label-time']['en-gb'] = "Time";
$text['label-time']['ar-eg'] = "التوقيت";
$text['label-time']['de-at'] = "Zeit"; //copied from de-de
$text['label-time']['de-ch'] = "Zeit"; //copied from de-de
$text['label-time']['de-de'] = "Zeit";
$text['label-time']['es-cl'] = "Tiempo";
$text['label-time']['es-mx'] = "Tiempo"; //copied from es-cl
$text['label-time']['fr-ca'] = "Temps"; //copied from fr-fr
$text['label-time']['fr-fr'] = "Temps";
$text['label-time']['he-il'] = "אזור זמן";
$text['label-time']['it-it'] = "Tempo";
$text['label-time']['nl-nl'] = "Tijd";
$text['label-time']['pl-pl'] = "Czas";
$text['label-time']['pt-br'] = "Fuso Horário";
$text['label-time']['pt-pt'] = "Tempo";
$text['label-time']['ro-ro'] = "";
$text['label-time']['ru-ru'] = "Время";
$text['label-time']['sv-se'] = "Tid";
$text['label-time']['uk-ua'] = "";
$text['label-tier_state']['en-us'] = "Tier State";
$text['label-tier_state']['en-gb'] = "Tier State";
$text['label-tier_state']['ar-eg'] = "";
$text['label-tier_state']['de-at'] = "Ebenen-Status"; //copied from de-de
$text['label-tier_state']['de-ch'] = "Ebenen-Status"; //copied from de-de
$text['label-tier_state']['de-de'] = "Ebenen-Status";
$text['label-tier_state']['es-cl'] = "Estado de Nivel";
$text['label-tier_state']['es-mx'] = "Estado de Nivel"; //copied from es-cl
$text['label-tier_state']['fr-ca'] = "Etat du Niveau"; //copied from fr-fr
$text['label-tier_state']['fr-fr'] = "Etat du Niveau";
$text['label-tier_state']['he-il'] = "";
$text['label-tier_state']['it-it'] = "Stato Tier";
$text['label-tier_state']['nl-nl'] = "Vergelijkingen";
$text['label-tier_state']['pl-pl'] = "Status poziomu";
$text['label-tier_state']['pt-br'] = "Nivel de estado";
$text['label-tier_state']['pt-pt'] = "Estado do Nível";
$text['label-tier_state']['ro-ro'] = "";
$text['label-tier_state']['ru-ru'] = "Состояние компетенции";
$text['label-tier_state']['sv-se'] = "Kunskap Status";
$text['label-tier_state']['uk-ua'] = "";
$text['label-tier_rules_apply']['en-us'] = "Tier Rules Apply";
$text['label-tier_rules_apply']['en-gb'] = "Tier Rules Apply";
$text['label-tier_rules_apply']['ar-eg'] = "";
$text['label-tier_rules_apply']['de-at'] = "Ebenen-Regeln werden angewendet"; //copied from de-de
$text['label-tier_rules_apply']['de-ch'] = "Ebenen-Regeln werden angewendet"; //copied from de-de
$text['label-tier_rules_apply']['de-de'] = "Ebenen-Regeln werden angewendet";
$text['label-tier_rules_apply']['es-cl'] = "Aplicar Reglas de Nivel";
$text['label-tier_rules_apply']['es-mx'] = "Aplicar Reglas de Nivel"; //copied from es-cl
$text['label-tier_rules_apply']['fr-ca'] = "Appliquer les règles du Niveau"; //copied from fr-fr
$text['label-tier_rules_apply']['fr-fr'] = "Appliquer les règles du Niveau";
$text['label-tier_rules_apply']['he-il'] = "";
$text['label-tier_rules_apply']['it-it'] = "Applica Regole del Tier";
$text['label-tier_rules_apply']['nl-nl'] = "Vergelijkingsregels zijn van toepassing";
$text['label-tier_rules_apply']['pl-pl'] = "Zastosuj zasadę poziomów";
$text['label-tier_rules_apply']['pt-br'] = "Aplicar regas de nível";
$text['label-tier_rules_apply']['pt-pt'] = "Aplicar as Regras do Nível";
$text['label-tier_rules_apply']['ro-ro'] = "";
$text['label-tier_rules_apply']['ru-ru'] = "Применять правила компетенции";
$text['label-tier_rules_apply']['sv-se'] = "Kunskaps Regler Gäller";
$text['label-tier_rules_apply']['uk-ua'] = "";
$text['label-tier_rule_wait_second']['en-us'] = "Tier Rule Wait Second";
$text['label-tier_rule_wait_second']['en-gb'] = "Tier Rule Wait Second";
$text['label-tier_rule_wait_second']['ar-eg'] = "";
$text['label-tier_rule_wait_second']['de-at'] = "Wartezeit für Ebenen-Regel in Sekunden"; //copied from de-de
$text['label-tier_rule_wait_second']['de-ch'] = "Wartezeit für Ebenen-Regel in Sekunden"; //copied from de-de
$text['label-tier_rule_wait_second']['de-de'] = "Wartezeit für Ebenen-Regel in Sekunden";
$text['label-tier_rule_wait_second']['es-cl'] = "Regla de nível segundo de espera";
$text['label-tier_rule_wait_second']['es-mx'] = "Regla de nível segundo de espera"; //copied from es-cl
$text['label-tier_rule_wait_second']['fr-ca'] = "Attente en secondes de la règle du Niveau"; //copied from fr-fr
$text['label-tier_rule_wait_second']['fr-fr'] = "Attente en secondes de la règle du Niveau";
$text['label-tier_rule_wait_second']['he-il'] = "";
$text['label-tier_rule_wait_second']['it-it'] = "Regola Tier Secondi di Attesa";
$text['label-tier_rule_wait_second']['nl-nl'] = "Vergelijkingsregel wachttijd";
$text['label-tier_rule_wait_second']['pl-pl'] = "Poziomowa zasada czekania";
$text['label-tier_rule_wait_second']['pt-br'] = "Regra de segundo nível de espera";
$text['label-tier_rule_wait_second']['pt-pt'] = "Regra de nível segundo espera";
$text['label-tier_rule_wait_second']['ro-ro'] = "";
$text['label-tier_rule_wait_second']['ru-ru'] = "Правило компетенции: Ждать секунд";
$text['label-tier_rule_wait_second']['sv-se'] = "Kunskaps Regel Väntetid i Sekunder";
$text['label-tier_rule_wait_second']['uk-ua'] = "";
$text['label-tier_rule_wait_multiply_level']['en-us'] = "Tier Rule Wait Multiply Level";
$text['label-tier_rule_wait_multiply_level']['en-gb'] = "Tier Rule Wait Multiply Level";
$text['label-tier_rule_wait_multiply_level']['ar-eg'] = "";
$text['label-tier_rule_wait_multiply_level']['de-at'] = "Regel für Wartezeit-Multiplikator pro Ebene"; //copied from de-de
$text['label-tier_rule_wait_multiply_level']['de-ch'] = "Regel für Wartezeit-Multiplikator pro Ebene"; //copied from de-de
$text['label-tier_rule_wait_multiply_level']['de-de'] = "Regel für Wartezeit-Multiplikator pro Ebene";
$text['label-tier_rule_wait_multiply_level']['es-cl'] = "Regla de nivel multiplicar nivel de espera";
$text['label-tier_rule_wait_multiply_level']['es-mx'] = "Regla de nivel multiplicar nivel de espera"; //copied from es-cl
$text['label-tier_rule_wait_multiply_level']['fr-ca'] = "Règle d'attente multipliée par Niveau"; //copied from fr-fr
$text['label-tier_rule_wait_multiply_level']['fr-fr'] = "Règle d'attente multipliée par Niveau";
$text['label-tier_rule_wait_multiply_level']['he-il'] = "";
$text['label-tier_rule_wait_multiply_level']['it-it'] = "Regola Tier Moltiplica Attesa per Livello";
$text['label-tier_rule_wait_multiply_level']['nl-nl'] = "Vergelijkingsregels wachtvermenigvuldiger niveau";
$text['label-tier_rule_wait_multiply_level']['pl-pl'] = "Poziomowa zasada przemnożenia";
$text['label-tier_rule_wait_multiply_level']['pt-br'] = "Regra de espera multiplicado pelo nível";
$text['label-tier_rule_wait_multiply_level']['pt-pt'] = "Regra de nível de espera multiplicado pelo nível";
$text['label-tier_rule_wait_multiply_level']['ro-ro'] = "";
$text['label-tier_rule_wait_multiply_level']['ru-ru'] = "Правило компетенции: Множитель ожидания";
$text['label-tier_rule_wait_multiply_level']['sv-se'] = "Kunskaps Regel Väntetid Multipla Värden";
$text['label-tier_rule_wait_multiply_level']['uk-ua'] = "";
$text['label-tier_rule_no_agent_no_wait']['en-us'] = "Tier Rule No Agent No Wait";
$text['label-tier_rule_no_agent_no_wait']['en-gb'] = "Tier Rule No Agent No Wait";
$text['label-tier_rule_no_agent_no_wait']['ar-eg'] = "";
$text['label-tier_rule_no_agent_no_wait']['de-at'] = "Ebenen-Regel kein Agent nicht warten"; //copied from de-de
$text['label-tier_rule_no_agent_no_wait']['de-ch'] = "Ebenen-Regel kein Agent nicht warten"; //copied from de-de
$text['label-tier_rule_no_agent_no_wait']['de-de'] = "Ebenen-Regel kein Agent nicht warten";
$text['label-tier_rule_no_agent_no_wait']['es-cl'] = "Regla de Nivel sin Agente sin Espera";
$text['label-tier_rule_no_agent_no_wait']['es-mx'] = "Regla de Nivel sin Agente sin Espera"; //copied from es-cl
$text['label-tier_rule_no_agent_no_wait']['fr-ca'] = "Règle du Niveau Pas d'agent, pas d'attente"; //copied from fr-fr
$text['label-tier_rule_no_agent_no_wait']['fr-fr'] = "Règle du Niveau Pas d'agent, pas d'attente";
$text['label-tier_rule_no_agent_no_wait']['he-il'] = "";
$text['label-tier_rule_no_agent_no_wait']['it-it'] = "Regola Tier No Agenti No Attesa";
$text['label-tier_rule_no_agent_no_wait']['nl-nl'] = "Vergelijkingsregels Geen agent, niet wachten";
$text['label-tier_rule_no_agent_no_wait']['pl-pl'] = "Zasada poziomowa - nie ma agentów, nie ma czekania";
$text['label-tier_rule_no_agent_no_wait']['pt-br'] = "Regra de nível sem espera do agente";
$text['label-tier_rule_no_agent_no_wait']['pt-pt'] = "Regra de Nível Sem Agente Sem Espera";
$text['label-tier_rule_no_agent_no_wait']['ro-ro'] = "";
$text['label-tier_rule_no_agent_no_wait']['ru-ru'] = "Правило компетенции: Нет оператора, нет ожидания";
$text['label-tier_rule_no_agent_no_wait']['sv-se'] = "Kunskaps Regel Ingen Agent Ingen Väntan";
$text['label-tier_rule_no_agent_no_wait']['uk-ua'] = "";
$text['label-tier_position']['en-us'] = "Tier Position";
$text['label-tier_position']['en-gb'] = "Tier Position";
$text['label-tier_position']['ar-eg'] = "";
$text['label-tier_position']['de-at'] = "Ebenen-Position"; //copied from de-de
$text['label-tier_position']['de-ch'] = "Ebenen-Position"; //copied from de-de
$text['label-tier_position']['de-de'] = "Ebenen-Position";
$text['label-tier_position']['es-cl'] = "Posición de Nivel";
$text['label-tier_position']['es-mx'] = "Posición de Nivel"; //copied from es-cl
$text['label-tier_position']['fr-ca'] = "Position du Niveau"; //copied from fr-fr
$text['label-tier_position']['fr-fr'] = "Position du Niveau";
$text['label-tier_position']['he-il'] = "";
$text['label-tier_position']['it-it'] = "Posizione Tier";
$text['label-tier_position']['nl-nl'] = "Vergelijksregels positie";
$text['label-tier_position']['pl-pl'] = "Pozycja poziomu";
$text['label-tier_position']['pt-br'] = "Nivel da posição";
$text['label-tier_position']['pt-pt'] = "Posição do Tier";
$text['label-tier_position']['ro-ro'] = "";
$text['label-tier_position']['ru-ru'] = "Позиция компетенции";
$text['label-tier_position']['sv-se'] = "Kunskaps Position";
$text['label-tier_position']['uk-ua'] = "";
$text['label-tier_level']['en-us'] = "Tier Level";
$text['label-tier_level']['en-gb'] = "Tier Level";
$text['label-tier_level']['ar-eg'] = "";
$text['label-tier_level']['de-at'] = "Ebenen-Niveau"; //copied from de-de
$text['label-tier_level']['de-ch'] = "Ebenen-Niveau"; //copied from de-de
$text['label-tier_level']['de-de'] = "Ebenen-Niveau";
$text['label-tier_level']['es-cl'] = "Nivel";
$text['label-tier_level']['es-mx'] = "Nivel"; //copied from es-cl
$text['label-tier_level']['fr-ca'] = "Niveau"; //copied from fr-fr
$text['label-tier_level']['fr-fr'] = "Niveau";
$text['label-tier_level']['he-il'] = "";
$text['label-tier_level']['it-it'] = "Livello Tier";
$text['label-tier_level']['nl-nl'] = "Vergelijkingsregels niveau";
$text['label-tier_level']['pl-pl'] = "Tier Level";
$text['label-tier_level']['pt-br'] = "Nivel da camada";
$text['label-tier_level']['pt-pt'] = "Nível do Tier";
$text['label-tier_level']['ro-ro'] = "";
$text['label-tier_level']['ru-ru'] = "Уровень компетенции";
$text['label-tier_level']['sv-se'] = "Kunskaps Nivå";
$text['label-tier_level']['uk-ua'] = "";
$text['label-system']['en-us'] = "System";
$text['label-system']['en-gb'] = "System";
$text['label-system']['ar-eg'] = "النظام";
$text['label-system']['de-at'] = "System"; //copied from de-de
$text['label-system']['de-ch'] = "System"; //copied from de-de
$text['label-system']['de-de'] = "System";
$text['label-system']['es-cl'] = "Sistema";
$text['label-system']['es-mx'] = "Sistema"; //copied from es-cl
$text['label-system']['fr-ca'] = "Système"; //copied from fr-fr
$text['label-system']['fr-fr'] = "Système";
$text['label-system']['he-il'] = "מערכת";
$text['label-system']['it-it'] = "Sistema";
$text['label-system']['nl-nl'] = "Systeem";
$text['label-system']['pl-pl'] = "System";
$text['label-system']['pt-br'] = "Sistema"; //copied from pt-pt
$text['label-system']['pt-pt'] = "Sistema";
$text['label-system']['ro-ro'] = "";
$text['label-system']['ru-ru'] = "Система";
$text['label-system']['sv-se'] = "System";
$text['label-system']['uk-ua'] = "";
$text['label-strategy']['en-us'] = "Strategy";
$text['label-strategy']['en-gb'] = "Strategy";
$text['label-strategy']['ar-eg'] = "";
$text['label-strategy']['de-at'] = "Strategie"; //copied from de-de
$text['label-strategy']['de-ch'] = "Strategie"; //copied from de-de
$text['label-strategy']['de-de'] = "Strategie";
$text['label-strategy']['es-cl'] = "Estrategia";
$text['label-strategy']['es-mx'] = "Estrategia"; //copied from es-cl
$text['label-strategy']['fr-ca'] = "Stratégie"; //copied from fr-fr
$text['label-strategy']['fr-fr'] = "Stratégie";
$text['label-strategy']['he-il'] = "";
$text['label-strategy']['it-it'] = "Strategia";
$text['label-strategy']['nl-nl'] = "Strategie";
$text['label-strategy']['pl-pl'] = "Strategia";
$text['label-strategy']['pt-br'] = "Estratégia"; //copied from pt-pt
$text['label-strategy']['pt-pt'] = "Estratégia";
$text['label-strategy']['ro-ro'] = "";
$text['label-strategy']['ru-ru'] = "Стратегия";
$text['label-strategy']['sv-se'] = "Strategi";
$text['label-strategy']['uk-ua'] = "";
$text['label-status_change']['en-us'] = "Status Change";
$text['label-status_change']['en-gb'] = "Status Change";
$text['label-status_change']['ar-eg'] = "";
$text['label-status_change']['de-at'] = "Status Änderung"; //copied from de-de
$text['label-status_change']['de-ch'] = "Status Änderung"; //copied from de-de
$text['label-status_change']['de-de'] = "Status Änderung";
$text['label-status_change']['es-cl'] = "Cambio de Estado";
$text['label-status_change']['es-mx'] = "Cambio de Estado"; //copied from es-cl
$text['label-status_change']['fr-ca'] = "Change Status"; //copied from fr-fr
$text['label-status_change']['fr-fr'] = "Change Status";
$text['label-status_change']['he-il'] = "";
$text['label-status_change']['it-it'] = "Modifica Status";
$text['label-status_change']['nl-nl'] = "Status verandering";
$text['label-status_change']['pl-pl'] = "Zmiana statusu";
$text['label-status_change']['pt-br'] = "Mudança de estado";
$text['label-status_change']['pt-pt'] = "Mundança de Estado";
$text['label-status_change']['ro-ro'] = "";
$text['label-status_change']['ru-ru'] = "Изменения статуса";
$text['label-status_change']['sv-se'] = "Status Förändra";
$text['label-status_change']['uk-ua'] = "";
$text['label-status']['en-us'] = "Status";
$text['label-status']['en-gb'] = "Status";
$text['label-status']['ar-eg'] = "الحالة";
$text['label-status']['de-at'] = "Status"; //copied from de-de
$text['label-status']['de-ch'] = "Status"; //copied from de-de
$text['label-status']['de-de'] = "Status";
$text['label-status']['es-cl'] = "Estado";
$text['label-status']['es-mx'] = "Estado"; //copied from es-cl
$text['label-status']['fr-ca'] = "status"; //copied from fr-fr
$text['label-status']['fr-fr'] = "status";
$text['label-status']['he-il'] = "סטטוס";
$text['label-status']['it-it'] = "Status";
$text['label-status']['nl-nl'] = "Status";
$text['label-status']['pl-pl'] = "Status";
$text['label-status']['pt-br'] = "Estado"; //copied from pt-pt
$text['label-status']['pt-pt'] = "Estado";
$text['label-status']['ro-ro'] = "";
$text['label-status']['ru-ru'] = "Статус";
$text['label-status']['sv-se'] = "Status";
$text['label-status']['uk-ua'] = "";
$text['label-state']['en-us'] = "State";
$text['label-state']['en-gb'] = "State";
$text['label-state']['ar-eg'] = "";
$text['label-state']['de-at'] = "Status"; //copied from de-de
$text['label-state']['de-ch'] = "Status"; //copied from de-de
$text['label-state']['de-de'] = "Status";
$text['label-state']['es-cl'] = "Estado";
$text['label-state']['es-mx'] = "Estado"; //copied from es-cl
$text['label-state']['fr-ca'] = "Etat"; //copied from fr-fr
$text['label-state']['fr-fr'] = "Etat";
$text['label-state']['he-il'] = "מצב";
$text['label-state']['it-it'] = "Stato";
$text['label-state']['nl-nl'] = "Status";
$text['label-state']['pl-pl'] = "Stan";
$text['label-state']['pt-br'] = "Estado"; //copied from pt-pt
$text['label-state']['pt-pt'] = "Estado";
$text['label-state']['ro-ro'] = "";
$text['label-state']['ru-ru'] = "Состояние";
$text['label-state']['sv-se'] = "Status";
$text['label-state']['uk-ua'] = "";
$text['label-record_template']['en-us'] = "Record Template";
$text['label-record_template']['en-gb'] = "Record Template";
$text['label-record_template']['ar-eg'] = "";
$text['label-record_template']['de-at'] = "Aufnahme Vorlage"; //copied from de-de
$text['label-record_template']['de-ch'] = "Aufnahme Vorlage"; //copied from de-de
$text['label-record_template']['de-de'] = "Aufnahme Vorlage";
$text['label-record_template']['es-cl'] = "Plantilla de Grabación";
$text['label-record_template']['es-mx'] = "Plantilla de Grabación"; //copied from es-cl
$text['label-record_template']['fr-ca'] = "Modèle d'enregistrement"; //copied from fr-fr
$text['label-record_template']['fr-fr'] = "Modèle d'enregistrement";
$text['label-record_template']['he-il'] = "";
$text['label-record_template']['it-it'] = "Template Registrazione";
$text['label-record_template']['nl-nl'] = "Opname sjabloon";
$text['label-record_template']['pl-pl'] = "Nagraj";
$text['label-record_template']['pt-br'] = "Modelo de gravação";
$text['label-record_template']['pt-pt'] = "Gravar template";
$text['label-record_template']['ro-ro'] = "";
$text['label-record_template']['ru-ru'] = "Шаблон записи";
$text['label-record_template']['sv-se'] = "Spela In Mall";
$text['label-record_template']['uk-ua'] = "";
$text['label-queue_name']['en-us'] = "Queue Name";
$text['label-queue_name']['en-gb'] = "Queue Name";
$text['label-queue_name']['ar-eg'] = "اسم الطابور";
$text['label-queue_name']['de-at'] = "Warteschlange Name"; //copied from de-de
$text['label-queue_name']['de-ch'] = "Warteschlange Name"; //copied from de-de
$text['label-queue_name']['de-de'] = "Warteschlange Name";
$text['label-queue_name']['es-cl'] = "Nombre de Cola";
$text['label-queue_name']['es-mx'] = "Nombre de Cola"; //copied from es-cl
$text['label-queue_name']['fr-ca'] = " Nom de la file"; //copied from fr-fr
$text['label-queue_name']['fr-fr'] = " Nom de la file";
$text['label-queue_name']['he-il'] = "שם לתור";
$text['label-queue_name']['it-it'] = "Nome Coda";
$text['label-queue_name']['nl-nl'] = "Wachtrijnaam";
$text['label-queue_name']['pl-pl'] = "Nazwa kolejki";
$text['label-queue_name']['pt-br'] = "Nome da fila";
$text['label-queue_name']['pt-pt'] = "Nome da Fila";
$text['label-queue_name']['ro-ro'] = "";
$text['label-queue_name']['ru-ru'] = "Имя очереди";
$text['label-queue_name']['sv-se'] = "Grupp Namn";
$text['label-queue_name']['uk-ua'] = "";
$text['label-queue']['en-us'] = "Queue";
$text['label-queue']['en-gb'] = "Queue";
$text['label-queue']['ar-eg'] = "طابور";
$text['label-queue']['de-at'] = "Warteschlange"; //copied from de-de
$text['label-queue']['de-ch'] = "Warteschlange"; //copied from de-de
$text['label-queue']['de-de'] = "Warteschlange";
$text['label-queue']['es-cl'] = "Cola";
$text['label-queue']['es-mx'] = "Cola"; //copied from es-cl
$text['label-queue']['fr-ca'] = "File"; //copied from fr-fr
$text['label-queue']['fr-fr'] = "File";
$text['label-queue']['he-il'] = "תור";
$text['label-queue']['it-it'] = "Code";
$text['label-queue']['nl-nl'] = "Wachtrij";
$text['label-queue']['pl-pl'] = "Kolejka";
$text['label-queue']['pt-br'] = "Fila"; //copied from pt-pt
$text['label-queue']['pt-pt'] = "Fila";
$text['label-queue']['ro-ro'] = "";
$text['label-queue']['ru-ru'] = "Очередь";
$text['label-queue']['sv-se'] = "Grupp";
$text['label-queue']['uk-ua'] = "";
$text['label-options']['en-us'] = "Options";
$text['label-options']['en-gb'] = "Options";
$text['label-options']['ar-eg'] = "";
$text['label-options']['de-at'] = "Optionen"; //copied from de-de
$text['label-options']['de-ch'] = "Optionen"; //copied from de-de
$text['label-options']['de-de'] = "Optionen";
$text['label-options']['es-cl'] = "Opciones";
$text['label-options']['es-mx'] = "Opciones"; //copied from es-cl
$text['label-options']['fr-ca'] = "Options"; //copied from fr-fr
$text['label-options']['fr-fr'] = "Options";
$text['label-options']['he-il'] = "אופציות";
$text['label-options']['it-it'] = "Opzioni";
$text['label-options']['nl-nl'] = "Opties";
$text['label-options']['pl-pl'] = "Opcje";
$text['label-options']['pt-br'] = "Opções"; //copied from pt-pt
$text['label-options']['pt-pt'] = "Opções";
$text['label-options']['ro-ro'] = "";
$text['label-options']['ru-ru'] = "Параметры";
$text['label-options']['sv-se'] = "Val";
$text['label-options']['uk-ua'] = "";
$text['label-number']['en-us'] = "Number";
$text['label-number']['en-gb'] = "Number";
$text['label-number']['ar-eg'] = "رقم";
$text['label-number']['de-at'] = "Nummer"; //copied from de-de
$text['label-number']['de-ch'] = "Nummer"; //copied from de-de
$text['label-number']['de-de'] = "Nummer";
$text['label-number']['es-cl'] = "Número";
$text['label-number']['es-mx'] = "Número"; //copied from es-cl
$text['label-number']['fr-ca'] = "Numéro"; //copied from fr-fr
$text['label-number']['fr-fr'] = "Numéro";
$text['label-number']['he-il'] = "מספר";
$text['label-number']['it-it'] = "Numero";
$text['label-number']['nl-nl'] = "Nummer";
$text['label-number']['pl-pl'] = "Numer";
$text['label-number']['pt-br'] = "Número"; //copied from pt-pt
$text['label-number']['pt-pt'] = "Número";
$text['label-number']['ro-ro'] = "";
$text['label-number']['ru-ru'] = "Номер";
$text['label-number']['sv-se'] = "Nummer";
$text['label-number']['uk-ua'] = "";
$text['label-music_on_hold']['en-us'] = "Music on Hold";
$text['label-music_on_hold']['en-gb'] = "Music on Hold";
$text['label-music_on_hold']['ar-eg'] = "";
$text['label-music_on_hold']['de-at'] = "Wartemusik"; //copied from de-de
$text['label-music_on_hold']['de-ch'] = "Wartemusik"; //copied from de-de
$text['label-music_on_hold']['de-de'] = "Wartemusik";
$text['label-music_on_hold']['es-cl'] = "Musica en Espera";
$text['label-music_on_hold']['es-mx'] = "Musica en Espera"; //copied from es-cl
$text['label-music_on_hold']['fr-ca'] = "Musique en attente"; //copied from fr-fr
$text['label-music_on_hold']['fr-fr'] = "Musique en attente";
$text['label-music_on_hold']['he-il'] = "מוסיקה במתנה";
$text['label-music_on_hold']['it-it'] = "Musica d'Attesa";
$text['label-music_on_hold']['nl-nl'] = "Wachtmuziek";
$text['label-music_on_hold']['pl-pl'] = "Muzyka na czekanie";
$text['label-music_on_hold']['pt-br'] = "Música de espera";
$text['label-music_on_hold']['pt-pt'] = "Música em espera";
$text['label-music_on_hold']['ro-ro'] = "";
$text['label-music_on_hold']['ru-ru'] = "Музыка на удержании";
$text['label-music_on_hold']['sv-se'] = "Väntmusik";
$text['label-music_on_hold']['uk-ua'] = "";
$text['label-missed']['en-us'] = "Missed";
$text['label-missed']['en-gb'] = "Missed";
$text['label-missed']['ar-eg'] = "";
$text['label-missed']['de-at'] = "Verpasst"; //copied from de-de
$text['label-missed']['de-ch'] = "Verpasst"; //copied from de-de
$text['label-missed']['de-de'] = "Verpasst";
$text['label-missed']['es-cl'] = "Perdido";
$text['label-missed']['es-mx'] = "Perdido"; //copied from es-cl
$text['label-missed']['fr-ca'] = "Manqué"; //copied from fr-fr
$text['label-missed']['fr-fr'] = "Manqué";
$text['label-missed']['he-il'] = "שיחה שלא נענתה";
$text['label-missed']['it-it'] = "Perse";
$text['label-missed']['nl-nl'] = "Gemist";
$text['label-missed']['pl-pl'] = "Nie odebrany";
$text['label-missed']['pt-br'] = "Perdidas"; //copied from pt-pt
$text['label-missed']['pt-pt'] = "Perdidas";
$text['label-missed']['ro-ro'] = "";
$text['label-missed']['ru-ru'] = "Пропущенный";
$text['label-missed']['sv-se'] = "Missade";
$text['label-missed']['uk-ua'] = "";
$text['label-max_wait_time_with_no_agent']['en-us'] = "Max Wait Time with No Agent";
$text['label-max_wait_time_with_no_agent']['en-gb'] = "Max Wait Time with No Agent";
$text['label-max_wait_time_with_no_agent']['ar-eg'] = "";
$text['label-max_wait_time_with_no_agent']['de-at'] = "Maximale Wartezeit ohne Agent"; //copied from de-de
$text['label-max_wait_time_with_no_agent']['de-ch'] = "Maximale Wartezeit ohne Agent"; //copied from de-de
$text['label-max_wait_time_with_no_agent']['de-de'] = "Maximale Wartezeit ohne Agent";
$text['label-max_wait_time_with_no_agent']['es-cl'] = "Tiempo Máximo de Espera sin Agente";
$text['label-max_wait_time_with_no_agent']['es-mx'] = "Tiempo Máximo de Espera sin Agente"; //copied from es-cl
$text['label-max_wait_time_with_no_agent']['fr-ca'] = "Max d'attente sans Agent"; //copied from fr-fr
$text['label-max_wait_time_with_no_agent']['fr-fr'] = "Max d'attente sans Agent";
$text['label-max_wait_time_with_no_agent']['he-il'] = "";
$text['label-max_wait_time_with_no_agent']['it-it'] = "Tempo Max Attesa senza Agente";
$text['label-max_wait_time_with_no_agent']['nl-nl'] = "Maximale wachttijd bij geen agent";
$text['label-max_wait_time_with_no_agent']['pl-pl'] = "Maks czas oczekiwania bez agenta";
$text['label-max_wait_time_with_no_agent']['pt-br'] = "Tempo máximo de esoera sem agente";
$text['label-max_wait_time_with_no_agent']['pt-pt'] = "Tempo máximo de espera sem agente";
$text['label-max_wait_time_with_no_agent']['ro-ro'] = "";
$text['label-max_wait_time_with_no_agent']['ru-ru'] = "Максимальное время ожидания без оператора";
$text['label-max_wait_time_with_no_agent']['sv-se'] = "Max Vänt Tid (Ingen Agent)";
$text['label-max_wait_time_with_no_agent']['uk-ua'] = "";
$text['label-max_wait_time']['en-us'] = "Max Wait Time";
$text['label-max_wait_time']['en-gb'] = "Max Wait Time";
$text['label-max_wait_time']['ar-eg'] = "";
$text['label-max_wait_time']['de-at'] = "Maximale Wartezeit"; //copied from de-de
$text['label-max_wait_time']['de-ch'] = "Maximale Wartezeit"; //copied from de-de
$text['label-max_wait_time']['de-de'] = "Maximale Wartezeit";
$text['label-max_wait_time']['es-cl'] = "Tiempo Máximo de Espera";
$text['label-max_wait_time']['es-mx'] = "Tiempo Máximo de Espera"; //copied from es-cl
$text['label-max_wait_time']['fr-ca'] = "Temps d'attente maximal"; //copied from fr-fr
$text['label-max_wait_time']['fr-fr'] = "Temps d'attente maximal";
$text['label-max_wait_time']['he-il'] = "מקסימום זמן המתנה";
$text['label-max_wait_time']['it-it'] = "Tempo Attesa Max";
$text['label-max_wait_time']['nl-nl'] = "Maximale wachttijd";
$text['label-max_wait_time']['pl-pl'] = "Maks czas oczekiwania";
$text['label-max_wait_time']['pt-br'] = "Tempo máximo de espera"; //copied from pt-pt
$text['label-max_wait_time']['pt-pt'] = "Tempo máximo de espera";
$text['label-max_wait_time']['ro-ro'] = "";
$text['label-max_wait_time']['ru-ru'] = "Максимальное время ожидания";
$text['label-max_wait_time']['sv-se'] = "Max Vänt Tid";
$text['label-max_wait_time']['uk-ua'] = "";
$text['label-extension']['en-us'] = "Extension";
$text['label-extension']['en-gb'] = "Extension";
$text['label-extension']['ar-eg'] = "رقم داخلي";
$text['label-extension']['de-at'] = "Nebenstelle"; //copied from de-de
$text['label-extension']['de-ch'] = "Nebenstelle"; //copied from de-de
$text['label-extension']['de-de'] = "Nebenstelle";
$text['label-extension']['es-cl'] = "Extensión";
$text['label-extension']['es-mx'] = "Extensión"; //copied from es-cl
$text['label-extension']['fr-ca'] = "Extension"; //copied from fr-fr
$text['label-extension']['fr-fr'] = "Extension";
$text['label-extension']['he-il'] = "שלוחה";
$text['label-extension']['it-it'] = "Interno";
$text['label-extension']['nl-nl'] = "Toestel";
$text['label-extension']['pl-pl'] = "Numer wewnętrzny";
$text['label-extension']['pt-br'] = "Ramal";
$text['label-extension']['pt-pt'] = "Extensão";
$text['label-extension']['ro-ro'] = "";
$text['label-extension']['ru-ru'] = "Внутренний номер";
$text['label-extension']['sv-se'] = "Anknytning";
$text['label-extension']['uk-ua'] = "";
$text['label-eavesdrop']['en-us'] = "Eavesdrop";
$text['label-eavesdrop']['en-gb'] = "Eavesdrop";
$text['label-eavesdrop']['ar-eg'] = "";
$text['label-eavesdrop']['de-at'] = "Mithören"; //copied from de-de
$text['label-eavesdrop']['de-ch'] = "Mithören"; //copied from de-de
$text['label-eavesdrop']['de-de'] = "Mithören";
$text['label-eavesdrop']['es-cl'] = "Escuchar";
$text['label-eavesdrop']['es-mx'] = "Escuchar"; //copied from es-cl
$text['label-eavesdrop']['fr-ca'] = "Espionnage"; //copied from fr-fr
$text['label-eavesdrop']['fr-fr'] = "Espionnage";
$text['label-eavesdrop']['he-il'] = "";
$text['label-eavesdrop']['it-it'] = "Ascolta";
$text['label-eavesdrop']['nl-nl'] = "Meeluisteren";
$text['label-eavesdrop']['pl-pl'] = "Podsłuchiwanie";
$text['label-eavesdrop']['pt-br'] = "Investigar";
$text['label-eavesdrop']['pt-pt'] = "Escutar";
$text['label-eavesdrop']['ro-ro'] = "";
$text['label-eavesdrop']['ru-ru'] = "Подслушать";
$text['label-eavesdrop']['sv-se'] = "Medlyssning";
$text['label-eavesdrop']['uk-ua'] = "";
$text['label-discard_abandoned_after']['en-us'] = "Discard Abandoned After";
$text['label-discard_abandoned_after']['en-gb'] = "Discard Abandoned After";
$text['label-discard_abandoned_after']['ar-eg'] = "";
$text['label-discard_abandoned_after']['de-at'] = "Zurückweisen nach Abwurf"; //copied from de-de
$text['label-discard_abandoned_after']['de-ch'] = "Zurückweisen nach Abwurf"; //copied from de-de
$text['label-discard_abandoned_after']['de-de'] = "Zurückweisen nach Abwurf";
$text['label-discard_abandoned_after']['es-cl'] = "Descartar Abandono Despues de";
$text['label-discard_abandoned_after']['es-mx'] = "Descartar Abandono Despues de"; //copied from es-cl
$text['label-discard_abandoned_after']['fr-ca'] = "Ecarter les appels abandonnés après"; //copied from fr-fr
$text['label-discard_abandoned_after']['fr-fr'] = "Ecarter les appels abandonnés après";
$text['label-discard_abandoned_after']['he-il'] = "";
$text['label-discard_abandoned_after']['it-it'] = "Scarta Abbandonate Dopo";
$text['label-discard_abandoned_after']['nl-nl'] = "Vergeet na ophangen";
$text['label-discard_abandoned_after']['pl-pl'] = "Odrzuć opuszczoną rozmowę po";
$text['label-discard_abandoned_after']['pt-br'] = "Rejeição abandonada depois"; //copied from pt-pt
$text['label-discard_abandoned_after']['pt-pt'] = "Rejeição abandonada depois";
$text['label-discard_abandoned_after']['ro-ro'] = "";
$text['label-discard_abandoned_after']['ru-ru'] = "Сбросить вызов после покидания очереди";
$text['label-discard_abandoned_after']['sv-se'] = "Uteslut Övergivna Efter ";
$text['label-discard_abandoned_after']['uk-ua'] = "";
$text['label-call']['en-us'] = "Call";
$text['label-call']['en-gb'] = "Call";
$text['label-call']['ar-eg'] = "";
$text['label-call']['de-at'] = "Anruf"; //copied from de-de
$text['label-call']['de-ch'] = "Anruf"; //copied from de-de
$text['label-call']['de-de'] = "Anruf";
$text['label-call']['es-cl'] = "Llamar";
$text['label-call']['es-mx'] = "Llamar"; //copied from es-cl
$text['label-call']['fr-ca'] = "Appel"; //copied from fr-fr
$text['label-call']['fr-fr'] = "Appel";
$text['label-call']['he-il'] = "שיחה";
$text['label-call']['it-it'] = "Chiamata";
$text['label-call']['nl-nl'] = "Oproep";
$text['label-call']['pl-pl'] = "Rozmowa";
$text['label-call']['pt-br'] = "Chamada"; //copied from pt-pt
$text['label-call']['pt-pt'] = "Chamada";
$text['label-call']['ro-ro'] = "";
$text['label-call']['ru-ru'] = "Вызов";
$text['label-call']['sv-se'] = "Samtal";
$text['label-call']['uk-ua'] = "";
$text['label-answered']['en-us'] = "Answered";
$text['label-answered']['en-gb'] = "Answered";
$text['label-answered']['ar-eg'] = "";
$text['label-answered']['de-at'] = "Angenommen"; //copied from de-de
$text['label-answered']['de-ch'] = "Angenommen"; //copied from de-de
$text['label-answered']['de-de'] = "Angenommen";
$text['label-answered']['es-cl'] = "Respondido";
$text['label-answered']['es-mx'] = "Respondido"; //copied from es-cl
$text['label-answered']['fr-ca'] = "Répondu"; //copied from fr-fr
$text['label-answered']['fr-fr'] = "Répondu";
$text['label-answered']['he-il'] = "";
$text['label-answered']['it-it'] = "Risposta";
$text['label-answered']['nl-nl'] = "Beantwoord";
$text['label-answered']['pl-pl'] = "Odebrano";
$text['label-answered']['pt-br'] = "Atendidas"; //copied from pt-pt
$text['label-answered']['pt-pt'] = "Atendidas";
$text['label-answered']['ro-ro'] = "";
$text['label-answered']['ru-ru'] = "Отвеченый";
$text['label-answered']['sv-se'] = "Besvarad";
$text['label-answered']['uk-ua'] = "";
$text['label-agent']['en-us'] = "Agent";
$text['label-agent']['en-gb'] = "Agent";
$text['label-agent']['ar-eg'] = "";
$text['label-agent']['de-at'] = "Agent"; //copied from de-de
$text['label-agent']['de-ch'] = "Agent"; //copied from de-de
$text['label-agent']['de-de'] = "Agent";
$text['label-agent']['es-cl'] = "Agente";
$text['label-agent']['es-mx'] = "Agente"; //copied from es-cl
$text['label-agent']['fr-ca'] = "Agent"; //copied from fr-fr
$text['label-agent']['fr-fr'] = "Agent";
$text['label-agent']['he-il'] = "סוכן";
$text['label-agent']['it-it'] = "Agente";
$text['label-agent']['nl-nl'] = "Agent";
$text['label-agent']['pl-pl'] = "Agent";
$text['label-agent']['pt-br'] = "Agente"; //copied from pt-pt
$text['label-agent']['pt-pt'] = "Agente";
$text['label-agent']['ro-ro'] = "";
$text['label-agent']['ru-ru'] = "Оператор";
$text['label-agent']['sv-se'] = "Agent";
$text['label-agent']['uk-ua'] = "";
$text['label-abandoned_resume_allowed']['en-us'] = "Abandoned Resume Allowed";
$text['label-abandoned_resume_allowed']['en-gb'] = "Abandoned Resume Allowed";
$text['label-abandoned_resume_allowed']['ar-eg'] = "";
$text['label-abandoned_resume_allowed']['de-at'] = "Wiederaufnahme nach Zurückweisung erlaubt"; //copied from de-de
$text['label-abandoned_resume_allowed']['de-ch'] = "Wiederaufnahme nach Zurückweisung erlaubt"; //copied from de-de
$text['label-abandoned_resume_allowed']['de-de'] = "Wiederaufnahme nach Zurückweisung erlaubt";
$text['label-abandoned_resume_allowed']['es-cl'] = "Permitir Reanudación de Abandono";
$text['label-abandoned_resume_allowed']['es-mx'] = "Permitir Reanudación de Abandono"; //copied from es-cl
$text['label-abandoned_resume_allowed']['fr-ca'] = "Authoriser la reprise des abandonnés"; //copied from fr-fr
$text['label-abandoned_resume_allowed']['fr-fr'] = "Authoriser la reprise des abandonnés";
$text['label-abandoned_resume_allowed']['he-il'] = "";
$text['label-abandoned_resume_allowed']['it-it'] = "Permetti Ripristino Abbandonate";
$text['label-abandoned_resume_allowed']['nl-nl'] = "Gesprek vervolgen na ophangen toegestaan";
$text['label-abandoned_resume_allowed']['pl-pl'] = "Odbieranie odrzuconych rozmów jest dozwolone";
$text['label-abandoned_resume_allowed']['pt-br'] = "Resumo abandonado permidito";
$text['label-abandoned_resume_allowed']['pt-pt'] = "Resume Autorizado";
$text['label-abandoned_resume_allowed']['ro-ro'] = "";
$text['label-abandoned_resume_allowed']['ru-ru'] = "Разрешить восстанавливать покинутый вызов";
$text['label-abandoned_resume_allowed']['sv-se'] = "Återuppta Övergivna Tillåtet";
$text['label-abandoned_resume_allowed']['uk-ua'] = "";
$text['header-agents']['en-us'] = "Agents";
$text['header-agents']['en-gb'] = "Agents";
$text['header-agents']['ar-eg'] = "";
$text['header-agents']['de-at'] = "Agenten"; //copied from de-de
$text['header-agents']['de-ch'] = "Agenten"; //copied from de-de
$text['header-agents']['de-de'] = "Agenten";
$text['header-agents']['es-cl'] = "Agentes";
$text['header-agents']['es-mx'] = "Agentes"; //copied from es-cl
$text['header-agents']['fr-ca'] = "Agents"; //copied from fr-fr
$text['header-agents']['fr-fr'] = "Agents";
$text['header-agents']['he-il'] = "סוכנים";
$text['header-agents']['it-it'] = "Agenti";
$text['header-agents']['nl-nl'] = "Agenten";
$text['header-agents']['pl-pl'] = "Agenci";
$text['header-agents']['pt-br'] = "Agentes"; //copied from pt-pt
$text['header-agents']['pt-pt'] = "Agentes";
$text['header-agents']['ro-ro'] = "";
$text['header-agents']['ru-ru'] = "Операторы";
$text['header-agents']['sv-se'] = "Agenter";
$text['header-agents']['uk-ua'] = "";
$text['header-active_call_center']['en-us'] = "Active Call Center";
$text['header-active_call_center']['en-gb'] = "Active Call Center";
$text['header-active_call_center']['ar-eg'] = "";
$text['header-active_call_center']['de-at'] = "Aktives Callcenter"; //copied from de-de
$text['header-active_call_center']['de-ch'] = "Aktives Callcenter"; //copied from de-de
$text['header-active_call_center']['de-de'] = "Aktives Callcenter";
$text['header-active_call_center']['es-cl'] = "Centro de Llamados Activo";
$text['header-active_call_center']['es-mx'] = "Centro de Llamados Activo"; //copied from es-cl
$text['header-active_call_center']['fr-ca'] = "Centre d'appel Actif"; //copied from fr-fr
$text['header-active_call_center']['fr-fr'] = "Centre d'appel Actif";
$text['header-active_call_center']['he-il'] = "";
$text['header-active_call_center']['it-it'] = "Call Center Attivo";
$text['header-active_call_center']['nl-nl'] = "Aktieve Caal-Center";
$text['header-active_call_center']['pl-pl'] = "Aktywność w Call Center ";
$text['header-active_call_center']['pt-br'] = "Atividade do Call Center"; //copied from pt-pt
$text['header-active_call_center']['pt-pt'] = "Atividade do Call Center";
$text['header-active_call_center']['ro-ro'] = "";
$text['header-active_call_center']['ru-ru'] = "Активный Колл-центр";
$text['header-active_call_center']['sv-se'] = "Aktivt Call Center";
$text['header-active_call_center']['uk-ua'] = "";
$text['description-queue']['en-us'] = "A current list of callers in the queue is below.";
$text['description-queue']['en-gb'] = "A current list of callers in the queue is below.";
$text['description-queue']['ar-eg'] = "";
$text['description-queue']['de-at'] = "Eine aktuelle Liste der Anrufer in der Warteschlange sehen sie unten."; //copied from de-de
$text['description-queue']['de-ch'] = "Eine aktuelle Liste der Anrufer in der Warteschlange sehen sie unten."; //copied from de-de
$text['description-queue']['de-de'] = "Eine aktuelle Liste der Anrufer in der Warteschlange sehen sie unten.";
$text['description-queue']['es-cl'] = "Un listado de los llamantes en cola se muestra a continuación.";
$text['description-queue']['es-mx'] = "Un listado de los llamantes en cola se muestra a continuación."; //copied from es-cl
$text['description-queue']['fr-ca'] = "Liste des appelants dans la file."; //copied from fr-fr
$text['description-queue']['fr-fr'] = "Liste des appelants dans la file.";
$text['description-queue']['he-il'] = "";
$text['description-queue']['it-it'] = "Sotto, una lista aggiornata dei chiamanti.";
$text['description-queue']['nl-nl'] = "Een lijst van wachtenden in de wachtrij staat hieronder.";
$text['description-queue']['pl-pl'] = "Aktualna lista rozmówców w kolejce jest poniżej .";
$text['description-queue']['pt-br'] = "Lista atual das chamadas em fila abaixo.";
$text['description-queue']['pt-pt'] = "Lista de chamadas na fila.";
$text['description-queue']['ro-ro'] = "";
$text['description-queue']['ru-ru'] = "Текущий список звонящих в этой очереди ниже.";
$text['description-queue']['sv-se'] = "Aktuell lista på köande samtal enligt nedan ";
$text['description-queue']['uk-ua'] = "";
$text['description-agents']['en-us'] = "A current list of agents is below.";
$text['description-agents']['en-gb'] = "A current list of agents is below.";
$text['description-agents']['ar-eg'] = "";
$text['description-agents']['de-at'] = "Eine aktuelle Liste der Agenten sehen sie unten."; //copied from de-de
$text['description-agents']['de-ch'] = "Eine aktuelle Liste der Agenten sehen sie unten."; //copied from de-de
$text['description-agents']['de-de'] = "Eine aktuelle Liste der Agenten sehen sie unten.";
$text['description-agents']['es-cl'] = "Un listado de los agentes actuales de muestra a continuación.";
$text['description-agents']['es-mx'] = "Un listado de los agentes actuales de muestra a continuación."; //copied from es-cl
$text['description-agents']['fr-ca'] = "Liste des agents"; //copied from fr-fr
$text['description-agents']['fr-fr'] = "Liste des agents";
$text['description-agents']['he-il'] = "";
$text['description-agents']['it-it'] = "Sotto, una lista aggiornata degli agenti.";
$text['description-agents']['nl-nl'] = "Een lijst van agenten staat hieronder.";
$text['description-agents']['pl-pl'] = "Aktualna lista agentów jest poniżej ";
$text['description-agents']['pt-br'] = "Lista dos atuais agentes abaixo.";
$text['description-agents']['pt-pt'] = "Lista de agentes.";
$text['description-agents']['ro-ro'] = "";
$text['description-agents']['ru-ru'] = "Текущий список операторов ниже.";
$text['description-agents']['sv-se'] = "Aktuell lista på Agenter enligt nedan";
$text['description-agents']['uk-ua'] = "";
$text['description-active_call_center']['en-us'] = "Select a Call Center Queue from the list below to view its activity.";
$text['description-active_call_center']['en-gb'] = "Select a Call Center Queue from the list below to view its activity.";
$text['description-active_call_center']['ar-eg'] = "";
$text['description-active_call_center']['de-at'] = "Wählen Sie eine Callcenter-Warteschlange aus der Liste unten um die Aktivität zu beobachten."; //copied from de-de
$text['description-active_call_center']['de-ch'] = "Wählen Sie eine Callcenter-Warteschlange aus der Liste unten um die Aktivität zu beobachten."; //copied from de-de
$text['description-active_call_center']['de-de'] = "Wählen Sie eine Callcenter-Warteschlange aus der Liste unten um die Aktivität zu beobachten.";
$text['description-active_call_center']['es-cl'] = "Seleccione la Cola del Centro de Llamados desde el siguiente listado para ver su actividad.";
$text['description-active_call_center']['es-mx'] = "Seleccione la Cola del Centro de Llamados desde el siguiente listado para ver su actividad."; //copied from es-cl
$text['description-active_call_center']['fr-ca'] = "Choisir une file d'attente dans la liste pour voir son activité."; //copied from fr-fr
$text['description-active_call_center']['fr-fr'] = "Choisir une file d'attente dans la liste pour voir son activité.";
$text['description-active_call_center']['he-il'] = "";
$text['description-active_call_center']['it-it'] = "Selezionare una Coda di Contact Center per vederne lo stato attuale.";
$text['description-active_call_center']['nl-nl'] = "Selecteer een Call-Center wachtrij van de onderstaande lijst om de aktiviteiten te zien.";
$text['description-active_call_center']['pl-pl'] = "Aby zobaczyć aktywność kolejki w Call Center wybierz ja z poniższej listy.";
$text['description-active_call_center']['pt-br'] = "Selecione uma fila de Call Center a partir da lista abaixo para ver a sua atividade.";
$text['description-active_call_center']['pt-pt'] = "Seleccione uma fila de Call Center a partir da lista em baixo para ver a sua actividade.";
$text['description-active_call_center']['ro-ro'] = "";
$text['description-active_call_center']['ru-ru'] = "Выберите очередь Колл-центра из списка, чтобы посмотреть ее состояние";
$text['description-active_call_center']['sv-se'] = "Välj en Call Center Grupp från listan nedan för att se dess aktivitet";
$text['description-active_call_center']['uk-ua'] = "";
?>

View File

@ -0,0 +1,31 @@
<?php
$y=0;
$apps[$x]['menu'][$y]['title']['en-us'] = "Active Call Center";
$apps[$x]['menu'][$y]['title']['en-gb'] = "Active Call Center";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
$apps[$x]['menu'][$y]['title']['de-at'] = "Aktive Callcenter";
$apps[$x]['menu'][$y]['title']['de-ch'] = "";
$apps[$x]['menu'][$y]['title']['de-de'] = "Aktive Callcenter";
$apps[$x]['menu'][$y]['title']['es-cl'] = "Centro de Llamada Activo";
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "Centre d'Appels Active";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "Centre d'Appel Actif";
$apps[$x]['menu'][$y]['title']['he-il'] = "";
$apps[$x]['menu'][$y]['title']['it-it'] = "Call Center Attivi";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "Actieve Call-Center";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Aktywność w Call Center ";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Call Center ativos";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "Centro de Chamadas Activo";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Активные Колл-центры";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Aktivt Call Center";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "";
$apps[$x]['menu'][$y]['uuid'] = "7fb0dd87-e984-9980-c512-2c76b887aeb2";
$apps[$x]['menu'][$y]['parent_uuid'] = "0438b504-8613-7887-c420-c837ffb20cb1";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['path'] = "/app/call_center_active/call_center_queue.php";
$apps[$x]['menu'][$y]['groups'][] = "admin";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
?>

View File

@ -0,0 +1,152 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('call_center_active_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get the queue_name and set it as a variable
$queue_name = $_GET['queue_name'];
$name = $_GET['name'];
//get a new session array
unset($_SESSION['queues']);
unset($_SESSION['agents']);
//get the header
$document['title'] = $text['title-call_center_queue_activity'];
require_once "resources/header.php";
//add the ajax
?><script type="text/javascript">
function loadXmlHttp(url, id) {
var f = this;
f.xmlHttp = null;
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
try {f.ie = window.ActiveXObject}catch(e){f.ie = false;}
@end @*/
if (window.XMLHttpRequest&&!f.ie||/^http/.test(window.location.href))
f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
else if (/(object)|(function)/.test(typeof createRequest))
f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
else {
f.xmlHttp = null;
// Internet Explorer 5 to 6, includes IE 7+ when local //
/*@cc_on @*/
/*@if(@_jscript_version >= 5)
try{f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){f.xmlHttp=null;}}
@end @*/
}
if(f.xmlHttp != null) {
f.el = document.getElementById(id);
f.xmlHttp.open("GET",url,true);
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
f.xmlHttp.send(null);
}
}
loadXmlHttp.prototype.stateChanged=function () {
var url = new URL(this.xmlHttp.responseURL);
if (/login\.php$/.test(url.pathname)) {
// You are logged out. Stop refresh!
url.searchParams.set('path', '<?php echo $_SERVER['REQUEST_URI']; ?>');
window.location.href = url.href;
return;
}
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
//this.el.innerHTML = this.xmlHttp.responseText;
document.getElementById('ajax_response').innerHTML = this.xmlHttp.responseText;
//link table rows (except the last - the list_control_icons cell) on a table with a class of 'tr_hover', according to the href attribute of the <tr> tag
$('.tr_hover tr,.list tr').each(function(i,e) {
$(e).children('td:not(.list_control_icon,.list_control_icons,.tr_link_void,.list-row > .no-link,.list-row > .checkbox,.list-row > .button,.list-row > .action-button)').on('click', function() {
var href = $(this).closest('tr').attr('href');
var target = $(this).closest('tr').attr('target');
if (href) {
if (target) { window.open(href, target); }
else { window.location = href; }
}
});
});
}
var requestTime = function() {
var url = 'call_center_active_inc.php?queue_name=<?php echo escape($queue_name); ?>&name=<?php echo urlencode(escape($name)); ?>';
new loadXmlHttp(url, 'ajax_response');
<?php
if (strlen($_SESSION["ajax_refresh_rate"]) == 0) { $_SESSION["ajax_refresh_rate"] = "1777"; }
echo "setInterval(function(){new loadXmlHttp(url, 'ajax_reponse');}, ".$_SESSION["ajax_refresh_rate"].");";
?>
}
if (window.addEventListener) {
window.addEventListener('load', requestTime, false);
}
else if (window.attachEvent) {
window.attachEvent('onload', requestTime);
}
function send_command(url) {
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET", url, false);
xmlhttp.send(null);
//document.getElementById('cmd_response').innerHTML=xmlhttp.responseText;
}
</script>
<?php
//show the response
echo "<div id='ajax_response'></div>\n";
echo "<br><br>";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,389 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2021
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('call_center_active_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get the queue uuid and set it as a variable
$queue_uuid = $_GET['queue_name'];
//get the queues from the database
if (!is_array($_SESSION['queues'])) {
$sql = "select * from v_call_center_queues ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "order by queue_name asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$_SESSION['queues'] = $database->select($sql, $parameters, 'all');
}
//get the queue name
foreach ($_SESSION['queues'] as $row) {
if ($row['call_center_queue_uuid'] == $queue_uuid) {
$queue_name = $row['queue_name'];
$queue_extension = $row['queue_extension'];
}
}
//convert the string to a named array
function str_to_named_array($tmp_str, $tmp_delimiter) {
$tmp_array = explode ("\n", $tmp_str);
$result = array();
if (trim(strtoupper($tmp_array[0])) != "+OK") {
$tmp_field_name_array = explode ($tmp_delimiter, $tmp_array[0]);
$x = 0;
if (isset($tmp_array)) foreach ($tmp_array as $row) {
if ($x > 0) {
$tmp_field_value_array = explode ($tmp_delimiter, $tmp_array[$x]);
$y = 0;
if (isset($tmp_field_value_array)) foreach ($tmp_field_value_array as $tmp_value) {
$tmp_name = $tmp_field_name_array[$y];
if (trim(strtoupper($tmp_value)) != "+OK") {
$result[$x][$tmp_name] = $tmp_value;
}
$y++;
}
}
$x++;
}
unset($row);
}
return $result;
}
//create an event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//get the call center queue, agent and tiers list
if (!$fp) {
$msg = "<div align='center'>Connection to Event Socket failed.<br /></div>";
echo "<div align='center'>\n";
echo "<table width='40%'>\n";
echo "<tr>\n";
echo "<th align='left'>Message</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='row_style1'><strong>$msg</strong></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>\n";
}
else {
//get the agent list
//show the title
echo "<b>".$text['header-agents']."</b><br />\n";
echo $text['description-agents']."<br /><br />\n";
//send the event socket command and get the response
//callcenter_config queue list tiers [queue_name] |
$switch_command = 'callcenter_config queue list tiers '.$queue_extension."@".$_SESSION["domain_name"];
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_command));
$result = str_to_named_array($event_socket_str, '|');
//prepare the result for array_multisort
$x = 0;
if (is_array($result)) {
foreach ($result as $row) {
$tier_result[$x]['level'] = $row['level'];
$tier_result[$x]['position'] = $row['position'];
$tier_result[$x]['agent'] = $row['agent'];
$tier_result[$x]['state'] = trim($row['state']);
$tier_result[$x]['queue'] = $row['queue'];
$x++;
}
}
//sort the array //SORT_ASC, SORT_DESC, SORT_REGULAR, SORT_NUMERIC, SORT_STRING
if (isset($tier_result)) { array_multisort($tier_result, SORT_ASC); }
//send the event socket command and get the response
//callcenter_config queue list agents [queue_name] [status] |
$switch_command = 'callcenter_config queue list agents '.$queue_extension."@".$_SESSION["domain_name"];
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_command));
$agent_result = str_to_named_array($event_socket_str, '|');
//get the agents from the database
if (!is_array($_SESSION['agents'])) {
$sql = "select * from v_call_center_agents ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "order by agent_name asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$_SESSION['agents'] = $database->select($sql, $parameters, 'all');
}
//list the agents
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
echo "<th>".$text['label-name']."</th>\n";
echo "<th>".$text['label-extension']."</th>\n";
echo "<th>".$text['label-status']."</th>\n";
echo "<th>".$text['label-state']."</th>\n";
echo "<th>".$text['label-status_change']."</th>\n";
echo "<th class='center'>".$text['label-missed']."</th>\n";
echo "<th class='center'>".$text['label-answered']."</th>\n";
echo "<th>".$text['label-tier_state']."</th>\n";
echo "<th class='center'>".$text['label-tier_level']."</th>\n";
echo "<th class='center'>".$text['label-tier_position']."</th>\n";
if (permission_exists('call_center_active_options')) {
echo "<th class='center'>".$text['label-options']."</th>\n";
}
echo "</tr>\n";
if (isset($tier_result)) {
foreach ($tier_result as $tier_row) {
//$queue = $tier_row['queue'];
//$queue = str_replace('@'.$_SESSION['domain_name'], '', $queue);
$agent = $tier_row['agent'];
//$agent = str_replace('@'.$_SESSION['domain_name'], '', $agent);
$tier_state = $tier_row['state'];
$tier_level = $tier_row['level'];
$tier_position = $tier_row['position'];
if (isset($agent_result)) {
foreach ($agent_result as $agent_row) {
if ($tier_row['agent'] == $agent_row['name']) {
$agent_uuid = $agent_row['name'];
//get the agent name
$agent_name = '';
if (is_array($_SESSION['agents'])) {
foreach ($_SESSION['agents'] as $agent) {
if ($agent['call_center_agent_uuid'] == $agent_uuid) {
$agent_name = $agent['agent_name'];
}
}
}
//$system = $agent_row['system'];
if (is_uuid($agent_row['uuid'])) {
$agent_uuid = $agent_row['uuid'];
}
//$type = $agent_row['type'];
$contact = $agent_row['contact'];
$agent_extension = preg_replace("/user\//", "", $contact);
$agent_extension = preg_replace("/@.*/", "", $agent_extension);
$agent_extension = preg_replace("/{.*}/", "", $agent_extension);
$status = $agent_row['status'];
$state = $agent_row['state'];
$max_no_answer = $agent_row['max_no_answer'];
$wrap_up_time = $agent_row['wrap_up_time'];
$reject_delay_time = $agent_row['reject_delay_time'];
$busy_delay_time = $agent_row['busy_delay_time'];
$last_bridge_start = $agent_row['last_bridge_start'];
$last_bridge_end = $agent_row['last_bridge_end'];
//$last_offered_call = $agent_row['last_offered_call'];
$last_status_change = $agent_row['last_status_change'];
$no_answer_count = $agent_row['no_answer_count'];
$calls_answered = $agent_row['calls_answered'];
$talk_time = $agent_row['talk_time'];
$ready_time = $agent_row['ready_time'];
$last_status_change_seconds = time() - $last_status_change;
$last_status_change_length_hour = floor($last_status_change_seconds/3600);
$last_status_change_length_min = floor($last_status_change_seconds/60 - ($last_status_change_length_hour * 60));
$last_status_change_length_sec = $last_status_change_seconds - (($last_status_change_length_hour * 3600) + ($last_status_change_length_min * 60));
$last_status_change_length_min = sprintf("%02d", $last_status_change_length_min);
$last_status_change_length_sec = sprintf("%02d", $last_status_change_length_sec);
$last_status_change_length = $last_status_change_length_hour.':'.$last_status_change_length_min.':'.$last_status_change_length_sec;
if (permission_exists('call_center_agent_edit')) {
$list_row_url = "../call_centers/call_center_agent_edit.php?id=".$agent_uuid;
}
echo "<tr class='list-row' href='".$list_row_url."'>\n";
echo "<td>";
if (permission_exists('call_center_agent_edit')) {
echo "<a href='".$list_row_url."'>".escape($agent_name)."</a>";
}
else {
echo escape($agent_name);
}
echo "</td>\n";
echo "<td>".escape($agent_extension)."</td>\n";
echo "<td>".escape($status)."</td>\n";
echo "<td>".escape($state)."</td>\n";
echo "<td>".escape($last_status_change_length)."</td>\n";
echo "<td class='center'>".escape($no_answer_count)."</td>\n";
echo "<td class='center'>".escape($calls_answered)."</td>\n";
echo "<td>".escape($tier_state)."</td>\n";
echo "<td class='center'>".escape($tier_level)."</td>\n";
echo "<td class='center'>".escape($tier_position)."</td>\n";
if (permission_exists('call_center_active_options')) {
echo "<td class='no-link center'>\n";
//need to check state to so only waiting gets call, and trying/answer gets eavesdrop
if ($tier_state == "Offering" || $tier_state == "Active Inbound") {
//$orig_command="{origination_caller_id_name=eavesdrop,origination_caller_id_number=".escape($agent_extension)."}user/".$_SESSION['user']['extension'][0]['user']."@".$_SESSION['domain_name']." %26eavesdrop(".escape($agent_uuid).")";
echo button::create(['type'=>'button','class'=>'link','label'=>$text['label-eavesdrop'],'onclick'=>"if (confirm('".$text['message-confirm']."')) { send_command('call_center_exec.php?command=eavesdrop&uuid=".urlencode($agent_uuid)."&extension=".urlencode($agent_extension)."'); } else { this.blur(); return false; }"]);
//$xfer_command = escape($agent_uuid)." -bleg ".escape($_SESSION['user']['extension'][0]['user'])." XML ".escape($_SESSION['domain_name']);
echo button::create(['type'=>'button','class'=>'link','label'=>$text['label-transfer'],'style'=>'margin-left: 15px;','onclick'=>"if (confirm('".$text['message-confirm']."')) { send_command('call_center_exec.php?command=uuid_transfer&uuid=".urlencode($agent_uuid)."'); } else { this.blur(); return false; }"]);
}
else {
//$orig_call="{origination_caller_id_name=c2c-".urlencode(escape($name)).",origination_caller_id_number=".escape($agent_extension)."}user/".$_SESSION['user']['extension'][0]['user']."@".$_SESSION['domain_name']." %26bridge(user/".escape($agent_extension)."@".$_SESSION['domain_name'].")";
echo button::create(['type'=>'button','class'=>'link','label'=>$text['label-call'],'onclick'=>"if (confirm('".$text['message-confirm']."')) { send_command('call_center_exec.php?command=bridge&extension=".urlencode($agent_extension)."&caller_id_name=".urlencode($name)."'); } else { this.blur(); return false; }"]);
}
echo "</td>";
}
echo "</tr>\n";
} //if
} //foreach
} //if
} //foreach
} //if
echo "</table>\n\n";
//add vertical spacing
echo "<br /><br /><br />";
//get the queue list
//send the event socket command and get the response
//callcenter_config queue list members [queue_name]
if (is_uuid($queue_uuid)) {
$switch_command = 'callcenter_config queue list members '.$queue_extension."@".$_SESSION["domain_name"];
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_command));
$result = str_to_named_array($event_socket_str, '|');
if (!is_array($result)) { unset($result); }
}
//show the title
$q_waiting=0;
$q_trying=0;
$q_answered=0;
echo "<div class='action_bar sub'>\n";
echo " <div class='heading'><b>".$text['label-queue'].": ".ucfirst(escape($queue_name))."</b></div>\n";
echo " <div class='actions'>\n";
if (isset($result)) {
foreach ($result as $row) {
$state = $row['state'];
$q_trying += ($state == "Trying") ? 1 : 0;
$q_waiting += ($state == "Waiting") ? 1 : 0;
$q_answered += ($state == "Answered") ? 1 : 0;
}
}
echo " <strong>".$text['label-waiting'].":</strong> <b>".$q_waiting."</b>&nbsp;&nbsp;&nbsp;";
echo " <strong>".$text['label-trying'].":</strong> <b>".$q_trying."</b>&nbsp;&nbsp;&nbsp; ";
echo " <strong>".$text['label-answered'].":</strong> <b>".$q_answered."</b>";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
echo $text['description-queue']."\n";
echo "<br /><br />\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
echo "<th>".$text['label-time']."</th>\n";
//echo "<th>".$text['label-system']."</th>\n";
echo "<th>".$text['label-name']."</th>\n";
echo "<th>".$text['label-number']."</th>\n";
echo "<th>".$text['label-status']."</th>\n";
if ((if_group("admin") || if_group("superadmin"))) {
echo "<th>".$text['label-options']."</th>\n";
}
echo "<th>".$text['label-agent']."</th>\n";
echo "</tr>\n";
if (is_array($result)) {
foreach ($result as $row) {
$queue = $row['queue'];
$system = $row['system'];
$uuid = $row['uuid'];
$session_uuid = $row['session_uuid'];
$caller_number = $row['cid_number'];
$caller_name = $row['cid_name'];
$system_epoch = $row['system_epoch'];
$joined_epoch = $row['joined_epoch'];
$rejoined_epoch = $row['rejoined_epoch'];
$bridge_epoch = $row['bridge_epoch'];
$abandoned_epoch = $row['abandoned_epoch'];
$base_score = $row['base_score'];
$skill_score = $row['skill_score'];
$serving_agent = $row['serving_agent'];
$serving_system = $row['serving_system'];
$state = $row['state'];
$joined_seconds = time() - $joined_epoch;
$joined_length_hour = floor($joined_seconds/3600);
$joined_length_min = floor($joined_seconds/60 - ($joined_length_hour * 60));
$joined_length_sec = $joined_seconds - (($joined_length_hour * 3600) + ($joined_length_min * 60));
$joined_length_min = sprintf("%02d", $joined_length_min);
$joined_length_sec = sprintf("%02d", $joined_length_sec);
$joined_length = $joined_length_hour.':'.$joined_length_min.':'.$joined_length_sec;
//get the serving agent name
$serving_agent_name = '';
if (is_array($_SESSION['agents'])) {
foreach ($_SESSION['agents'] as $agent) {
if ($agent['call_center_agent_uuid'] == $serving_agent) {
$serving_agent_name = $agent['agent_name'];
}
}
}
echo "<tr class='list-row'>\n";
echo "<td>".escape($joined_length)."</td>\n";
//echo "<td>".escape($system_length)."</td>\n";
echo "<td>".escape($caller_name)."&nbsp;</td>\n";
echo "<td>".escape($caller_number)."&nbsp;</td>\n";
echo "<td>".escape($state)."</td>\n";
if (if_group("admin") || if_group("superadmin")) {
echo "<td>";
if ($state != "Abandoned") {
$orig_command="{origination_caller_id_name=eavesdrop,origination_caller_id_number=".escape($q_caller_number)."}user/".escape($_SESSION['user']['extension'][0]['user'])."@".escape($_SESSION['domain_name'])." %26eavesdrop(".escape($session_uuid).")";
echo button::create(['type'=>'button','class'=>'link','label'=>$text['label-eavesdrop'],'onclick'=>"if (confirm('".$text['message-confirm']."')) { send_command('call_center_exec.php?command=eavesdrop&caller_id_number=".urlencode($caller_number)."&uuid=".urlencode($session_uuid)."'); } else { this.blur(); return false; }"]);
}
else {
echo "&nbsp;";
}
echo "</td>";
}
echo "<td>".escape($serving_agent_name)."&nbsp;</td>\n";
echo "</tr>\n";
}
}
echo "</table>\n";
}
?>

View File

@ -0,0 +1,148 @@
<?php
/* $Id$ */
/*
v_exec.php
Copyright (C) 2008 - 2019 Mark J Crane
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('call_center_active_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//http get variables set to php variables
if (count($_GET) > 0) {
$command = trim($_GET["command"]);
$uuid = trim($_GET["uuid"]);
$extension = trim($_GET["extension"]);
$caller_id_name = trim($_GET["extension"]);
$caller_id_number = trim($_GET["extension"]);
}
//validate the extension
if (!is_numeric($extension)) {
$extension = null;
}
//validate the uuid
if (!is_uuid($uuid)) {
$uuid = null;
}
//validate the caller_id_name
if (isset($caller_id_name) && strlen($caller_id_name)) {
$caller_id_name = substr($caller_id_name, 0, 10);
}
//validate the caller_id_number
if (!is_numeric($caller_id_number)) {
$caller_id_number = null;
}
//validate the command
switch ($command) {
case "eavesdrop":
$switch_command = "originate {origination_caller_id_name=eavesdrop,origination_caller_id_number=".$extension."}user/".$_SESSION['user']['extension'][0]['user']."@".$_SESSION['domain_name']." &eavesdrop(".$uuid.")";
break;
case "uuid_transfer":
$switch_command = "uuid_transfer ".$uuid." -bleg ".$_SESSION['user']['extension'][0]['user']." XML ".$_SESSION['domain_name'];
break;
case "bridge":
$switch_command = "originate {origination_caller_id_name=".$caller_id_name.",origination_caller_id_number=".$caller_id_number."}user/".$_SESSION['user']['extension'][0]['user']."@".$_SESSION['domain_name']." bridge(user/".$extension."@".$_SESSION['domain_name'].")";
break;
default:
echo "access denied";
exit;
}
//run the command
if (isset($switch_command)) {
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
$response = event_socket_request($fp, 'api '.$switch_command);
}
/*
//set the username
if (if_group("admin") || if_group("superadmin")) {
//use the username that was provided
}
else {
$username = $_SESSION['username'];
}
//get to php variables
if (count($_GET) > 0) {
if ($_GET['action'] == "user_status") {
//validate the user status
$user_status = $_GET['data'];
switch ($user_status) {
case "Available":
case "Available (On Demand)":
case "On Break":
case "Do Not Disturb":
case "Logged Out":
break;
default:
$user_status = null;
}
$user_status = $data;
$sql = "update v_users set ";
$sql .= "user_status = :user_status ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and username = '".$username."' ";
$parameters['user_status'] = trim($user_status, "'");
$database = new database;
$database->execute($sql, $parameters);
unset($sql, $parameters);
}
//fs cmd
if (strlen($switch_cmd) > 0) {
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//ensure the connection exists
if ($fp) {
//send the command
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
//set the user state
$cmd = "api callcenter_config agent set state ".$username."@".$_SESSION['domain_name']." Waiting";
$response = event_socket_request($fp, $cmd);
}
}
}
*/
?>

View File

@ -0,0 +1,160 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/paging.php";
//check permissions
if (permission_exists('call_center_active_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get the variables
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//add the search term
$search = strtolower($_GET["search"]);
if (strlen($search) > 0) {
$sql_search = " (";
$sql_search .= "lower(queue_name) like :search ";
$sql_search .= "or lower(queue_description) like :search ";
$sql_search .= ") ";
$parameters['search'] = '%'.$search.'%';
}
//get the call center queue count
$sql = "select count(*) from v_call_center_queues ";
$sql .= "where domain_uuid = :domain_uuid ";
if (isset($sql_search)) {
$sql .= "and ".$sql_search;
}
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
//paging the records
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = "&search=".$search;
$page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
$offset = $rows_per_page * $page;
//get the call center queues
$sql = str_replace('count(*)', '*', $sql);
$sql .= order_by($order_by, $order);
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$call_center_queues = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//include header
$document['title'] = $text['title-active_call_center'];
require_once "resources/header.php";
//show the content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['header-active_call_center']." (".$num_rows.")</b></div>\n";
echo " <div class='actions'>\n";
echo "<form id='form_search' class='inline' method='get'>\n";
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown='list_search_reset();'>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]);
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'call_center_queue.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
}
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
echo $text['description-active_call_center']."\n";
echo "<br /><br />\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
echo th_order_by('queue_name', $text['label-queue_name'], $order_by, $order);
echo th_order_by('queue_extension', $text['label-extension'], $order_by, $order);
echo th_order_by('queue_strategy', $text['label-strategy'], $order_by, $order);
//echo th_order_by('queue_moh_sound', $text['label-music_on_hold'], $order_by, $order);
//echo th_order_by('queue_record_template', $text['label-record_template'], $order_by, $order);
//echo th_order_by('queue_time_base_score', $text['label-time_base_score'], $order_by, $order);
//echo th_order_by('queue_max_wait_time', $text['label-max_wait_time'], $order_by, $order);
//echo th_order_by('queue_max_wait_time_with_no_agent', $text['label-max_wait_time_with_no_agent'], $order_by, $order);
//echo th_order_by('queue_tier_rules_apply', $text['label-tier_rules_apply'], $order_by, $order);
//echo th_order_by('queue_tier_rule_wait_second', $text['label-tier_rule_wait_second'], $order_by, $order);
//echo th_order_by('queue_tier_rule_no_agent_no_wait', $text['label-tier_rule_no_agent_no_wait'], $order_by, $order);
//echo th_order_by('queue_discard_abandoned_after', $text['label-discard_abandoned_after'], $order_by, $order);
//echo th_order_by('queue_abandoned_resume_allowed', $text['label-abandoned_resume_allowed'], $order_by, $order);
//echo th_order_by('queue_tier_rule_wait_multiply_level', $text['label-tier_rule_wait_multiply_level'], $order_by, $order);
echo th_order_by('queue_description', $text['label-description'], $order_by, $order);
echo "</tr>\n";
if (is_array($call_center_queues)) {
$x = 0;
foreach($call_center_queues as $row) {
$list_row_url = PROJECT_PATH."/app/call_center_active/call_center_active.php?queue_name=".escape($row['call_center_queue_uuid'])."&name=".urlencode(escape($row['queue_name']));
echo "<tr class='list-row' href='".$list_row_url."'>\n";
echo " <td><a href='".$list_row_url."'>".escape($row['queue_name'])."</a></td>\n";
echo " <td>".escape($row['queue_extension'])."</td>\n";
echo " <td>".escape($row['queue_strategy'])."</td>\n";
//echo " <td>".escape($row[queue_moh_sound])."</td>\n";
//echo " <td>".escape($row[queue_record_template])."</td>\n";
//echo " <td>".escape($row[queue_time_base_score])."</td>\n";
//echo " <td>".escape($row[queue_max_wait_time])."</td>\n";
//echo " <td>".escape($row[queue_max_wait_time_with_no_agent])."</td>\n";
//echo " <td>".escape($row[queue_tier_rules_apply])."</td>\n";
//echo " <td>".escape($row[queue_tier_rule_wait_second])."</td>\n";
//echo " <td>".escape($row[queue_tier_rule_no_agent_no_wait])."</td>\n";
//echo " <td>".escape($row[queue_discard_abandoned_after])."</td>\n";
//echo " <td>".escape($row[queue_abandoned_resume_allowed])."</td>\n";
//echo " <td>".escape($row[queue_tier_rule_wait_multiply_level])."</td>\n";
echo " <td class='description overflow hide-xs'>".escape($row['queue_description'])."</td>\n";
echo "</tr>\n";
$x++;
}
unset($call_center_queues);
}
echo "</table>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
//show the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,90 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,500 @@
<?php
//application details
$apps[$x]['name'] = "Call Center";
$apps[$x]['uuid'] = "95788e50-9500-079e-2807-fd530b0ea370";
$apps[$x]['category'] = "Switch";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.1";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Queues for managing inbound calls and routing those calls to available agents.";
$apps[$x]['description']['en-gb'] = "Queues for managing inbound calls and routing those calls to available agents.";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Warteschlangen um eingehende Anrufe zu verwalten und diese an verfügbare Agenten weiterzuleiten.";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Warteschlangen um eingehende Anrufe zu verwalten und diese an verfügbare Agenten weiterzuleiten.";
$apps[$x]['description']['el-gr'] = "Ουρές για διαχείριση εισερχόμενων κλήσεων και δρομολόγησης των κλήσεων σε διαθέσιμους τηλεφωνητές/τηλεφωνήτριες.";
$apps[$x]['description']['es-cl'] = "Colas pra administar las llamadas entrantes y enviarlas a los agentes disponibles";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "Queues pour envoyer les appels entrants vers les agents disponibles.";
$apps[$x]['description']['fr-fr'] = "Files d'attente d'appels entrants distribu%uFFFDs aux agents disponibles.";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "Wachtrijen voor beheer van inkomede gesprekken en routering naar beschikbare agenten.";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "As filas servem para gerenciar as chamadas que entram e encaminhar as mesmas para os agentes disponíveis.";
$apps[$x]['description']['pt-pt'] = "As filas servem para gerenciamento de chamadas de entrada e encaminhamento das mesmas para os agentes dispon%uFFFDveis.";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$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'] = "call_centers";
$apps[$x]['destinations'][$y]['name'] = "call_centers";
$apps[$x]['destinations'][$y]['sql'] = "select queue_name as name, queue_extension as destination, queue_extension as extension, queue_description as description from v_call_center_queues";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' ";
$apps[$x]['destinations'][$y]['order_by'] = "queue_name asc";
$apps[$x]['destinations'][$y]['field']['name'] = "queue_name";
$apps[$x]['destinations'][$y]['field']['destination'] = "queue_extension";
$apps[$x]['destinations'][$y]['field']['extension'] = "queue_extension";
$apps[$x]['destinations'][$y]['field']['description'] = "queue_description";
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${name} \${description}";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "call_center_queue_view";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "6c072b29-5b6c-49fc-008e-95e24c77de99";
$apps[$x]['permissions'][$y]['groups'][] = "agent";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_queue_add";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_queue_edit";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_queue_delete";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_all";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_agent_view";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "597c483a-51a9-f95a-8d54-ea7d87ada2b8";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_agent_add";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_agent_edit";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_agent_delete";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_tier_view";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "6c072b29-5b6c-49fc-008e-95e24c77de99";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_tier_add";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_tier_edit";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_tier_delete";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_log_view";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "6c072b29-5b6c-49fc-008e-95e24c77de99";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_log_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_log_edit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_log_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_destinations";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_outbound_caller_id_name";
//$apps[$x]['permissions'][$y]['groups'][] = "admin";
//$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_outbound_caller_id_number";
//$apps[$x]['permissions'][$y]['groups'][] = "admin";
//$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_announce_position";
//$apps[$x]['permissions'][$y]['groups'][] = "admin";
//$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_announce_sound";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_announce_frequency";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
//default settings
$y = 0;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "8ebeb864-f03e-406c-b82f-6eb47cb1bd39";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "limit";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "call_center_queues";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "3";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b32179ad-96a4-4d83-8677-1fd8fc5ef6df";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "call_center";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "agent_add_rows";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "5";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "533eac69-887f-47aa-bf27-0751797555f5";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "call_center";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "agent_edit_rows";
$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_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "bc73c8eb-f3eb-4182-adc0-9ac5aeedae2a";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "call_center";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "agent_contact_method";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "user";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Options: user (default)";
//cache details
$apps[$x]['cache']['key'] = "dialplan.\${domain_name}";
//schema details
$y=0;
$apps[$x]['db'][$y]['table']['name'] = "v_call_center_agents";
$apps[$x]['db'][$y]['table']['parent'] = "";
$z=0;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "id";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "call_center_agent_id";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_center_agent_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_users";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "user_uuid";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_type";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_call_timeout";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_id";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_password";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_contact";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_status";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_logout";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_max_no_answer";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_wrap_up_time";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_reject_delay_time";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_busy_delay_time";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_no_answer_delay_time";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_record";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$y++;
$apps[$x]['db'][$y]['table']['name'] = "v_call_center_queues";
$apps[$x]['db'][$y]['table']['parent'] = "";
$z=0;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "id";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "call_center_queue_id";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_center_queue_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_dialplans";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "dialplan_uuid";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_extension";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_greeting";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the greeting.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_strategy";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_moh_sound";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_record_template";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_time_base_score";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_time_base_score_sec";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Used to set the time base score of the Call Center to prioritize one call center over another.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_max_wait_time";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_max_wait_time_with_no_agent";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_max_wait_time_with_no_agent_time_reached";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rules_apply";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rule_wait_second";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rule_no_agent_no_wait";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_timeout_action";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_discard_abandoned_after";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_abandoned_resume_allowed";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rule_wait_multiply_level";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_cid_prefix";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_outbound_caller_id_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_outbound_caller_id_number";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_announce_position";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_announce_sound";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_announce_frequency";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_cc_exit_keys";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_description";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$y++;
$apps[$x]['db'][$y]['table']['name'] = "v_call_center_tiers";
$apps[$x]['db'][$y]['table']['parent'] = "";
$z=0;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "id";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "call_center_tier_id";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_center_tier_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_center_queue_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_call_center_queues";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "call_center_queue_uuid";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_center_agent_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_call_center_agents";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "call_center_agent_uuid";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "tier_level";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "tier_position";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
?>

View File

@ -0,0 +1,178 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2018 - 2022
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
if ($domains_processed == 1) {
//list the missing call center queue and agent uuids
$sql = "select t.call_center_tier_uuid, t.call_center_queue_uuid, t.call_center_agent_uuid, t.queue_name, t.agent_name, d.domain_name, ";
$sql .= "(select call_center_queue_uuid from v_call_center_queues where replace(queue_name, ' ', '-') = t.queue_name and domain_uuid = t.domain_uuid) as queue_uuid, ";
$sql .= "(select call_center_agent_uuid from v_call_center_agents where agent_name = t.agent_name and domain_uuid = t.domain_uuid) as agent_uuid ";
$sql .= "from v_call_center_tiers as t, v_domains as d ";
$sql .= "where t.domain_uuid = d.domain_uuid ";
$sql .= "and (t.call_center_queue_uuid is null or t.call_center_agent_uuid is null) ";
$database = new database;
$tiers = $database->select($sql, null, 'all');
if (is_array($tiers) && @sizeof($tiers) != 0) {
foreach ($tiers as $index => &$row) {
if ($row['call_center_queue_uuid'] == null && $row['queue_uuid'] != null) {
$array['call_center_tiers'][$index]['call_center_queue_uuid'] = $row['queue_uuid'];
}
if ($row['call_center_agent_uuid'] == null && $row['agent_uuid'] != null) {
$array['call_center_tiers'][$index]['call_center_agent_uuid'] = $row['agent_uuid'];
}
if (is_array($array['call_center_tiers'][$index]) && @sizeof($array['call_center_tiers'][$index]) != 0) {
$array['call_center_tiers'][$index]['call_center_tier_uuid'] = $row['call_center_tier_uuid'];
}
}
if (is_array($array) && @sizeof($array) != 0) {
$p = new permissions;
$p->add('call_center_tier_edit', 'temp');
$database = new database;
$database->app_name = 'call_centers';
$database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370';
$database->save($array, false);
$response = $database->message;
unset($array);
$p->delete('call_center_tier_edit', 'temp');
}
}
unset($sql);
//update all callcenter dialplans to have the @domain in the queue name
$sql = "select q.domain_uuid, d.domain_name, q.call_center_queue_uuid, q.dialplan_uuid, ";
$sql .= "q.queue_name, q.queue_extension, q.queue_timeout_action, q.queue_cid_prefix, q.queue_cc_exit_keys, ";
$sql .= "q.queue_description, q.queue_time_base_score_sec, q.queue_greeting ";
$sql .= "from v_call_center_queues as q, v_domains as d ";
$sql .= "where q.domain_uuid = d.domain_uuid ";
$database = new database;
$call_center_queues = $database->select($sql, null, 'all');
$id = 0;
if (is_array($call_center_queues)) {
foreach ($call_center_queues as $row) {
//get the application and data
$action_array = explode(":",$row['queue_timeout_action']);
$queue_timeout_app = $action_array[0];
unset($action_array[0]);
$queue_timeout_data = implode($action_array);
//add the recording path if needed
if ($row['queue_greeting'] != '') {
if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$row['domain_name'].'/'.$row['queue_greeting'])) {
$queue_greeting_path = $_SESSION['switch']['recordings']['dir'].'/'.$row['domain_name'].'/'.$row['queue_greeting'];
}
else {
$queue_greeting_path = trim($row['queue_greeting']);
}
}
//build the xml dialplan
$dialplan_xml = "<extension name=\"".$row["queue_name"]."\" continue=\"\" uuid=\"".$row["dialplan_uuid"]."\">\n";
$dialplan_xml .= " <condition field=\"destination_number\" expression=\"^([^#]+#)(.*)\$\" break=\"never\">\n";
$dialplan_xml .= " <action application=\"set\" data=\"caller_id_name=\$2\"/>\n";
$dialplan_xml .= " </condition>\n";
$dialplan_xml .= " <condition field=\"destination_number\" expression=\"^(callcenter\+)?".$row["queue_extension"]."$\">\n";
$dialplan_xml .= " <action application=\"answer\" data=\"\"/>\n";
if (is_uuid($row['call_center_queue_uuid'])) {
$dialplan_xml .= " <action application=\"set\" data=\"call_center_queue_uuid=".$row['call_center_queue_uuid']."\"/>\n";
}
if (is_numeric($row['queue_extension'])) {
$dialplan_xml .= " <action application=\"set\" data=\"queue_extension=".$row['queue_extension']."\"/>\n";
}
$dialplan_xml .= " <action application=\"set\" data=\"cc_export_vars=call_center_queue_uuid,sip_h_Alert-Info\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"hangup_after_bridge=true\"/>\n";
if ($row['queue_time_base_score_sec'] != '') {
$dialplan_xml .= " <action application=\"set\" data=\"cc_base_score=".$row['queue_time_base_score_sec']."\"/>\n";
}
if ($row['queue_greeting'] != '') {
$greeting_array = explode(':', $row['queue_greeting']);
if (count($greeting_array) == 1) {
$dialplan_xml .= " <action application=\"playback\" data=\"".$queue_greeting_path."\"/>\n";
}
else {
if ($greeting_array[0] == 'say' || $greeting_array[0] == 'tone_stream' || $greeting_array[0] == 'phrase') {
$dialplan_xml .= " <action application=\"".$greeting_array[0]."\" data=\"".$greeting_array[1]."\"/>\n";
}
}
}
if (strlen($row['queue_cid_prefix']) > 0) {
$dialplan_xml .= " <action application=\"set\" data=\"effective_caller_id_name=".$row['queue_cid_prefix']."#\${caller_id_name}\"/>\n";
}
if (strlen($row['queue_cc_exit_keys']) > 0) {
$dialplan_xml .= " <action application=\"set\" data=\"cc_exit_keys=".$row['queue_cc_exit_keys']."\"/>\n";
}
$dialplan_xml .= " <action application=\"callcenter\" data=\"".$row['queue_extension']."@".$row['domain_name']."\"/>\n";
//if ($destination->valid($queue_timeout_app.':'.$queue_timeout_data)) {
$dialplan_xml .= " <action application=\"".$queue_timeout_app."\" data=\"".$queue_timeout_data."\"/>\n";
//}
$dialplan_xml .= " </condition>\n";
$dialplan_xml .= "</extension>\n";
//build the dialplan array
$array['dialplans'][$id]["domain_uuid"] = $row["domain_uuid"];
$array['dialplans'][$id]["dialplan_uuid"] = $row["dialplan_uuid"];
$array['dialplans'][$id]["dialplan_name"] = $row["queue_name"];
$array['dialplans'][$id]["dialplan_number"] = $row["queue_extension"];
$array['dialplans'][$id]["dialplan_context"] = $row['domain_name'];
$array['dialplans'][$id]["dialplan_continue"] = "false";
$array['dialplans'][$id]["dialplan_xml"] = $dialplan_xml;
$array['dialplans'][$id]["dialplan_order"] = "230";
$array['dialplans'][$id]["dialplan_enabled"] = "true";
$array['dialplans'][$id]["dialplan_description"] = $row["queue_description"];
$array['dialplans'][$id]["app_uuid"] = "95788e50-9500-079e-2807-fd530b0ea370";
//increment the array id
$id++;
}
}
unset ($prep_statement);
//save the array to the database
if (is_array($array)) {
//add the dialplan permission
$p = new permissions;
$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, false);
$message = $database->message;
//remove the temporary permission
$p->delete("dialplan_add", "temp");
$p->delete("dialplan_edit", "temp");
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,58 @@
<?php
$y=0;
$apps[$x]['menu'][$y]['title']['en-us'] = "Call Centers";
$apps[$x]['menu'][$y]['title']['en-gb'] = "Call Centers";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
$apps[$x]['menu'][$y]['title']['de-at'] = "Callcenter";
$apps[$x]['menu'][$y]['title']['de-ch'] = "";
$apps[$x]['menu'][$y]['title']['de-de'] = "Callcenter";
$apps[$x]['menu'][$y]['title']['es-cl'] = "Centro de Llamadas";
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "Centre d' appels";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "Centre d'appel";
$apps[$x]['menu'][$y]['title']['he-il'] = "";
$apps[$x]['menu'][$y]['title']['it-it'] = "Stato Agenti";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "Call-Centers";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Call Center ";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Call Center";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "Centro de Chamadas";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Колл-центр";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Call Center";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "Кол-центр";
$apps[$x]['menu'][$y]['uuid'] = "6c072b29-5b6c-49fc-008e-95e24c77de99";
$apps[$x]['menu'][$y]['parent_uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['path'] = "/app/call_centers/call_center_queues.php";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
$apps[$x]['menu'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['menu'][$y]['title']['en-us'] = "Agent Status";
$apps[$x]['menu'][$y]['title']['en-gb'] = "Agent Status";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
$apps[$x]['menu'][$y]['title']['de-at'] = "Agenten Status";
$apps[$x]['menu'][$y]['title']['de-ch'] = "";
$apps[$x]['menu'][$y]['title']['de-de'] = "Agenten Status";
$apps[$x]['menu'][$y]['title']['es-cl'] = "Estado de Agente";
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "État de l'agent";
$apps[$x]['menu'][$y]['title']['he-il'] = "";
$apps[$x]['menu'][$y]['title']['it-it'] = "";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "Agent status";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Status agenta";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Estado do agente";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "Estado do Agente";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Статус агента";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Agent Status";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "Статус оператора";
$apps[$x]['menu'][$y]['uuid'] = "597c483a-51a9-f95a-8d54-ea7d87ada2b8";
$apps[$x]['menu'][$y]['parent_uuid'] = "0438b504-8613-7887-c420-c837ffb20cb1";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['path'] = "/app/call_centers/call_center_agent_status.php";
$apps[$x]['menu'][$y]['groups'][] = "admin";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
?>

View File

@ -0,0 +1,624 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2020
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('call_center_agent_add') || permission_exists('call_center_agent_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//check for duplicates
if ($_GET["check"] == 'duplicate') {
//agent id
if ($_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 (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 (is_array($row) && sizeof($row) != 0 && $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 (is_uuid($_REQUEST["id"])) {
$action = "update";
$call_center_agent_uuid = $_REQUEST["id"];
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (is_array($_POST)) {
$call_center_agent_uuid = $_POST["call_center_agent_uuid"];
$user_uuid = $_POST["user_uuid"];
$agent_name = $_POST["agent_name"];
$agent_type = $_POST["agent_type"];
$agent_call_timeout = $_POST["agent_call_timeout"];
$agent_id = $_POST["agent_id"];
$agent_password = $_POST["agent_password"];
$agent_status = $_POST["agent_status"];
$agent_contact = $_POST["agent_contact"];
$agent_no_answer_delay_time = $_POST["agent_no_answer_delay_time"];
$agent_max_no_answer = $_POST["agent_max_no_answer"];
$agent_wrap_up_time = $_POST["agent_wrap_up_time"];
$agent_reject_delay_time = $_POST["agent_reject_delay_time"];
$agent_busy_delay_time = $_POST["agent_busy_delay_time"];
$agent_record = $_POST["agent_record"];
//$agent_logout = $_POST["agent_logout"];
}
//process the user data and save it to the database
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: call_center_agents.php');
exit;
}
//check for all required data
$msg = '';
//if (strlen($call_center_agent_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-call_center_agent_uuid']."<br>\n"; }
//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."<br>\n"; }
//if (strlen($user_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-user_uuid']."<br>\n"; }
if (strlen($agent_name) == 0) { $msg .= $text['message-required']." ".$text['label-agent_name']."<br>\n"; }
if (strlen($agent_type) == 0) { $msg .= $text['message-required']." ".$text['label-agent_type']."<br>\n"; }
if (strlen($agent_call_timeout) == 0) { $msg .= $text['message-required']." ".$text['label-agent_call_timeout']."<br>\n"; }
//if (strlen($agent_id) == 0) { $msg .= $text['message-required']." ".$text['label-agent_id']."<br>\n"; }
//if (strlen($agent_password) == 0) { $msg .= $text['message-required']." ".$text['label-agent_password']."<br>\n"; }
//if (strlen($agent_status) == 0) { $msg .= $text['message-required']." ".$text['label-agent_status']."<br>\n"; }
if (strlen($agent_contact) == 0) { $msg .= $text['message-required']." ".$text['label-agent_contact']."<br>\n"; }
if (strlen($agent_no_answer_delay_time) == 0) { $msg .= $text['message-required']." ".$text['label-agent_no_answer_delay_time']."<br>\n"; }
if (strlen($agent_max_no_answer) == 0) { $msg .= $text['message-required']." ".$text['label-agent_max_no_answer']."<br>\n"; }
if (strlen($agent_wrap_up_time) == 0) { $msg .= $text['message-required']." ".$text['label-agent_wrap_up_time']."<br>\n"; }
if (strlen($agent_reject_delay_time) == 0) { $msg .= $text['message-required']." ".$text['label-agent_reject_delay_time']."<br>\n"; }
if (strlen($agent_busy_delay_time) == 0) { $msg .= $text['message-required']." ".$text['label-agent_busy_delay_time']."<br>\n"; }
//if (strlen($agent_logout) == 0) { $msg .= $text['message-required']." ".$text['label-agent_logout']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "resources/footer.php";
return;
}
//add the call_center_agent_uuid
if (strlen($call_center_agent_uuid) == 0) {
$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);
$agent_contact = str_replace("@", "/", $agent_contact);
}
//prepare the array
$array['call_center_agents'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['call_center_agents'][0]['call_center_agent_uuid'] = $call_center_agent_uuid;
$array['call_center_agents'][0]['agent_name'] = $agent_name;
$array['call_center_agents'][0]['agent_type'] = $agent_type;
$array['call_center_agents'][0]['agent_call_timeout'] = $agent_call_timeout;
$array['call_center_agents'][0]['user_uuid'] = $user_uuid;
$array['call_center_agents'][0]['agent_id'] = $agent_id;
$array['call_center_agents'][0]['agent_password'] = $agent_password;
$array['call_center_agents'][0]['agent_contact'] = $agent_contact;
$array['call_center_agents'][0]['agent_status'] = $agent_status;
$array['call_center_agents'][0]['agent_no_answer_delay_time'] = $agent_no_answer_delay_time;
$array['call_center_agents'][0]['agent_max_no_answer'] = $agent_max_no_answer;
$array['call_center_agents'][0]['agent_wrap_up_time'] = $agent_wrap_up_time;
$array['call_center_agents'][0]['agent_reject_delay_time'] = $agent_reject_delay_time;
$array['call_center_agents'][0]['agent_busy_delay_time'] = $agent_busy_delay_time;
$array['call_center_agents'][0]['agent_record'] = $agent_record;
if (is_uuid($user_uuid)) {
$array['users'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['users'][0]['user_uuid'] = $user_uuid;
$array['users'][0]['user_status'] = $agent_status;
}
//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();
//clear the cache
$cache = new cache;
$cache->delete('configuration:callcenter.conf');
//get and then set the complete agent_contact with the call_timeout and when necessary confirm
//if you change this variable, also change resources/switch.php
$confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1,group_confirm_read_timeout=2000,leg_timeout=".$agent_call_timeout;
if(strstr($agent_contact, '}') === FALSE) {
//not found
if(stristr($agent_contact, 'sofia/gateway') === FALSE) {
//add the call_timeout
$agent_contact = "{call_timeout=".$agent_call_timeout.",sip_invite_domain=".$_SESSION['domain_name']."}".$agent_contact;
}
else {
//add the call_timeout and confirm
$agent_contact = "{".$confirm.",call_timeout=".$agent_call_timeout.",sip_invite_domain=".$_SESSION['domain_name']."}".$agent_contact;
}
}
else {
$position = strrpos($agent_contact, "}");
$first = substr($agent_contact, 0, $position);
$last = substr($agent_contact, $position);
//add call_timeout and sip_invite_domain, only if missing
$call_timeout = (stristr($agent_contact, 'call_timeout') === FALSE) ? ',call_timeout='.$agent_call_timeout : null;
$sip_invite_domain = (stristr($agent_contact, 'sip_invite_domain') === FALSE) ? ',sip_invite_domain='.$_SESSION['domain_name'] : null;
//compose
if(stristr($agent_contact, 'sofia/gateway') === FALSE) {
$agent_contact = $first.$sip_invite_domain.$call_timeout.$last;
}
else {
$agent_contact = $first.','.$confirm.$sip_invite_domain.$call_timeout.$last;
}
}
//add the agent
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//add the agent using event socket
if ($fp) {
//add the agent
$cmd = "api callcenter_config agent add ".$call_center_agent_uuid." ".$agent_type;
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set contact
$cmd = "api callcenter_config agent set contact ".$call_center_agent_uuid." ".$agent_contact;
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set status
$cmd = "api callcenter_config agent set status ".$call_center_agent_uuid." '".$agent_status."'";
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set reject_delay_time
$cmd = "api callcenter_config agent set reject_delay_time ".$call_center_agent_uuid." ".$agent_reject_delay_time;
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set busy_delay_time
$cmd = "api callcenter_config agent set busy_delay_time ".$call_center_agent_uuid." ".$agent_busy_delay_time;
$response = event_socket_request($fp, $cmd);
//agent set no_answer_delay_time
$cmd = "api callcenter_config agent set no_answer_delay_time ".$call_center_agent_uuid." ".$agent_no_answer_delay_time;
$response = event_socket_request($fp, $cmd);
//agent set max_no_answer
$cmd = "api callcenter_config agent set max_no_answer ".$call_center_agent_uuid." ".$agent_max_no_answer;
$response = event_socket_request($fp, $cmd);
//agent set wrap_up_time
$cmd = "api callcenter_config agent set wrap_up_time ".$call_center_agent_uuid." ".$agent_wrap_up_time;
$response = event_socket_request($fp, $cmd);
}
//redirect the user
if (isset($action)) {
if ($action == "add") {
message::add($text['message-add']);
}
if ($action == "update") {
message::add($text['message-update']);
}
header("Location: call_center_agents.php");
return;
}
} //(is_array($_POST) && strlen($_POST["persistformvar"]) == 0)
//initialize the destinations object
$destination = new destinations;
//pre-populate the form
if (is_uuid($_GET["id"]) && $_POST["persistformvar"] != "true") {
$call_center_agent_uuid = $_GET["id"];
$sql = "select * from v_call_center_agents ";
$sql .= "where domain_uuid = :domain_uuid ";
$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 (is_array($row) && @sizeof($row) != 0) {
$call_center_agent_uuid = $row["call_center_agent_uuid"];
$user_uuid = $row["user_uuid"];
$agent_name = $row["agent_name"];
$agent_type = $row["agent_type"];
$agent_call_timeout = $row["agent_call_timeout"];
$agent_id = $row["agent_id"];
$agent_password = $row["agent_password"];
$agent_status = $row["agent_status"];
$agent_contact = $row["agent_contact"];
$agent_no_answer_delay_time = $row["agent_no_answer_delay_time"];
$agent_max_no_answer = $row["agent_max_no_answer"];
$agent_wrap_up_time = $row["agent_wrap_up_time"];
$agent_reject_delay_time = $row["agent_reject_delay_time"];
$agent_busy_delay_time = $row["agent_busy_delay_time"];
$agent_record = $row["agent_record"];
//$agent_logout = $row["agent_logout"];
}
unset($sql, $parameters, $row);
}
//set default values
if (strlen($agent_type) == 0) { $agent_type = "callback"; }
if (strlen($agent_call_timeout) == 0) { $agent_call_timeout = "20"; }
if (strlen($agent_max_no_answer) == 0) { $agent_max_no_answer = "0"; }
if (strlen($agent_wrap_up_time) == 0) { $agent_wrap_up_time = "10"; }
if (strlen($agent_no_answer_delay_time) == 0) { $agent_no_answer_delay_time = "30"; }
if (strlen($agent_reject_delay_time) == 0) { $agent_reject_delay_time = "90"; }
if (strlen($agent_busy_delay_time) == 0) { $agent_busy_delay_time = "90"; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
if ($action == "add") {
$document['title'] = $text['title-call_center_agent_add'];
}
if ($action == "update") {
$document['title'] = $text['title-call_center_agent_edit'];
}
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 "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'>";
if ($action == "add") {
echo "<b>".$text['header-call_center_agent_add']."</b>";
}
if ($action == "update") {
echo "<b>".$text['header-call_center_agent_edit']."</b>";
}
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','link'=>'call_center_agents.php']);
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','style'=>'margin-left: 15px;']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\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='nowrap'>\n";
echo " ".$text['label-agent_name']."\n";
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";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-type']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='agent_type' maxlength='255' value=\"".escape($agent_type)."\" pattern='^(callback|uuid-standby)$'>\n";
echo "<br />\n";
echo $text['description-type']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_timeout']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='agent_call_timeout' maxlength='255' min='1' step='1' value='".escape($agent_call_timeout)."'>\n";
echo "<br />\n";
echo $text['description-call_timeout']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>";
echo " <td class='vncell' valign='top'>".$text['label-username']."</td>";
echo " <td class='vtable' align='left'>";
echo " <select name=\"user_uuid\" class='formfld' style='width: auto;'>\n";
echo " <option value=\"\"></option>\n";
foreach($users as $field) {
if ($user_uuid == $field['user_uuid']) {
echo " <option value='".escape($field['user_uuid'])."' selected='selected'>".escape($field['username'])."</option>\n";
}
else {
echo " <option value='".escape($field['user_uuid'])."' $selected>".escape($field['username'])."</option>\n";
}
}
echo " </select>";
unset($users);
echo " <br>\n";
echo " ".$text['description-users']."\n";
echo " </td>";
echo " </tr>";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-agent_id']."\n";
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";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-agent_password']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='password' name='agent_password' autocomplete='off' onmouseover=\"this.type='text';\" onfocus=\"this.type='text';\" onmouseout=\"if (!\$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" maxlength='255' min='1' step='1' value='".escape($agent_password)."'>\n";
echo "<br />\n";
echo $text['description-agent_password']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-contact']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo $destination->select('user_contact', 'agent_contact', $agent_contact);
echo "<br />\n";
echo $text['description-contact']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-status']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='agent_status'>\n";
echo " <option value=''></option>\n";
if ($agent_status == "Logged Out") {
echo " <option value='Logged Out' SELECTED >".$text['option-logged_out']."</option>\n";
}
else {
echo " <option value='Logged Out'>".$text['option-logged_out']."</option>\n";
}
if ($agent_status == "Available") {
echo " <option value='Available' SELECTED >".$text['option-available']."</option>\n";
}
else {
echo " <option value='Available'>".$text['option-available']."</option>\n";
}
if ($agent_status == "Available (On Demand)") {
echo " <option value='Available (On Demand)' SELECTED >".$text['option-available_on_demand']."</option>\n";
}
else {
echo " <option value='Available (On Demand)'>".$text['option-available_on_demand']."</option>\n";
}
if ($agent_status == "On Break") {
echo " <option value='On Break' SELECTED >".$text['option-on_break']."</option>\n";
}
else {
echo " <option value='On Break'>".$text['option-on_break']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-status']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-no_answer_delay_time']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='agent_no_answer_delay_time' maxlength='255' min='0' step='1' value='".escape($agent_no_answer_delay_time)."'>\n";
echo "<br />\n";
echo $text['description-no_answer_delay_time']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-max_no_answer']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='agent_max_no_answer' maxlength='255' min='0' step='1' value='".escape($agent_max_no_answer)."'>\n";
echo "<br />\n";
echo $text['description-max_no_answer']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-wrap_up_time']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='agent_wrap_up_time' maxlength='255' min='0' step='1' value='".escape($agent_wrap_up_time)."'>\n";
echo "<br />\n";
echo $text['description-wrap_up_time']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-reject_delay_time']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='agent_reject_delay_time' maxlength='255' min='0' step='1' value='".escape($agent_reject_delay_time)."'>\n";
echo "<br />\n";
echo $text['description-reject_delay_time']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-busy_delay_time']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='agent_busy_delay_time' maxlength='255' min='1' step='1' value='".escape($agent_busy_delay_time)."'>\n";
echo "<br />\n";
echo $text['description-busy_delay_time']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-record_template']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='agent_record'>\n";
echo " <option value='true' ".($agent_record == "true" ? "selected='selected'" : '')." >".$text['option-true']."</option>\n";
echo " <option value='false' ".($agent_record != "true" ? "selected='selected'" : '').">".$text['option-false']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['description-record_template']."\n";
echo "</td>\n";
echo "</tr>\n";
/*
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-agent_logout']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='agent_logout' maxlength='255' value='".escape($agent_logout)."'>\n";
echo "<br />\n";
echo $text['description-agent_logout']."\n";
echo "</td>\n";
echo "</tr>\n";
*/
echo "</table>";
echo "<br /><br />";
if ($action == "update") {
echo "<input type='hidden' name='call_center_agent_uuid' value='".escape($call_center_agent_uuid)."'>\n";
}
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,431 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/paging.php";
//check permissions
if (permission_exists('call_center_agent_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get the agents from the database
$sql = "select * from v_call_center_tiers ";
$sql .= "where domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$tiers = $database->select($sql, $parameters, 'all');
if (is_array($tiers) && count($tiers) == 0) {
$per_queue_login = true;
}
else {
$per_queue_login = false;
}
unset($sql, $parameters);
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//get the agents from the database
$sql = "select * from v_call_center_agents ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "order by agent_name asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$agents = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//get the agent list from event socket
$switch_cmd = 'callcenter_config agent list';
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
$agent_list = csv_to_named_array($event_socket_str, '|');
//get the agent list from event socket
$switch_cmd = 'callcenter_config tier list';
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
$call_center_tiers = csv_to_named_array($event_socket_str, '|');
//get the call center queues from the database
$sql = "select q.*, d.domain_name ";
$sql .= "from v_call_center_queues as q, v_domains as d ";
$sql .= "where q.domain_uuid = :domain_uuid ";
$sql .= "and d.domain_uuid = :domain_uuid ";
$sql .= "and q.domain_uuid = d.domain_uuid ";
$sql .= "order by queue_name asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$call_center_queues = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//view_array($call_center_queues, false);
//add the status to the call_center_queues array
$x = 0;
if (is_array($call_center_queues)) {
foreach ($call_center_queues as $queue) {
//set the queue id
$queue_id = $queue['queue_extension'].'@'.$queue['domain_name'];
//get the queue list from event socket
$switch_cmd = "callcenter_config queue list agents ".$queue_id;
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
$queue_list = csv_to_named_array($event_socket_str, '|');
$call_center_queues[$x]['queue_list'] = $queue_list;
$x++;
}
}
//get the agent status from mod_callcenter and update the agent status in the agents array
$x = 0;
if (is_array($agents)) {
foreach ($agents as $row) {
//add the domain name
$domain_name = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
$agents[$x]['domain_name'] = $domain_name;
//update the queue status
$i = 0;
if (is_array($call_center_queues)) {
foreach ($call_center_queues as $queue) {
$agents[$x]['queues'][$i]['agent_name'] = $row['agent_name'];
$agents[$x]['queues'][$i]['queue_name'] = $queue['queue_name'];
$agents[$x]['queues'][$i]['call_center_agent_uuid'] = $row['call_center_agent_uuid'];
$agents[$x]['queues'][$i]['call_center_queue_uuid'] = $queue['call_center_queue_uuid'];
$agents[$x]['queues'][$i]['queue_status'] = 'Logged Out';
if (is_array($queue['queue_list'])) {
foreach ($queue['queue_list'] as $queue_list) {
if ($row['call_center_agent_uuid'] == $queue_list['name']) {
$agents[$x]['queues'][$i]['queue_status'] = 'Available';
}
}
}
$i++;
}
}
//update the agent status
if (is_array($agent_list)) {
foreach ($agent_list as $r) {
if ($r['name'] == $row['call_center_agent_uuid']) {
$agents[$x]['agent_status'] = $r['status'];
}
}
}
//increment x
$x++;
}
}
//remove rows from the http post array where the status has not changed
if (is_array($_POST['agents']) && !$per_queue_login) {
foreach($_POST['agents'] as $key => $row) {
foreach($agents as $k => $field) {
if ($field['agent_name'] === $row['agent_name'] && $field['agent_status'] === $row['agent_status']) {
unset($_POST['agents'][$key]);
}
}
}
}
//use the http post array to change the status
if (is_array($_POST['agents'])) {
foreach($_POST['agents'] as $row) {
if (isset($row['agent_status'])) {
//agent set status
if ($fp) {
//set the user_status
if (!isset($row['queue_name'])) {
$array['users'][0]['user_uuid'] = $row['user_uuid'];
$array['users'][0]['user_status'] = $row['agent_status'];
$array['users'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$p = new permissions;
$p->add('user_edit', 'temp');
$database = new database;
$database->app_name = 'call_centers';
$database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370';
$database->save($array);
$response = $database->message;
unset($array);
$p->delete('user_edit', 'temp');
}
//validate the agent status
$agent_status = $row['agent_status'];
switch ($agent_status) {
case "Available" :
break;
case "Available (On Demand)" :
break;
case "On Break" :
break;
case "Do Not Disturb" :
break;
case "Logged Out" :
break;
default :
$agent_status = null;
}
//set the call center status
$command = '';
if (!isset($row['queue_name'])) {
if ($agent_status == "Do Not Disturb") {
//set the default dnd action
$dnd_action = "add";
//set the call center status to Logged Out
if (is_uuid($row['agent_uuid'])) {
$command = "api callcenter_config agent set status ".$row['agent_uuid']." 'Logged Out' ";
}
}
else {
if (is_uuid($row['agent_uuid'])) {
$command = "api callcenter_config agent set status ".$row['agent_uuid']." '".$agent_status."'";
}
}
$response = event_socket_request($fp, $command);
}
//echo $command."\n";
//get the queue_id
if (isset($row['queue_uuid']) && is_uuid($row['queue_uuid'])) {
if (is_array($call_center_queues)) {
foreach ($call_center_queues as $queue) {
if ($queue['call_center_queue_uuid'] == $row['queue_uuid']) {
$queue_id = $queue['queue_extension'].'@'.$queue['domain_name'];
}
}
}
}
//set the agent status to available and assign the agent to the queue with the tier
if (isset($row['queue_uuid']) && $row['agent_status'] == 'Available') {
//set the call center status
//$command = "api callcenter_config agent set status ".$row['agent_name']."@".$_SESSION['domain_name']." '".$row['agent_status']."'";
//$response = event_socket_request($fp, $command);
//assign the agent to the queue
if (is_uuid($row['queue_uuid']) && is_uuid($row['agent_uuid'])) {
$command = "api callcenter_config tier add ".$queue_id." ".$row['agent_uuid']." 1 1";
//echo $command."<br />\n";
$response = event_socket_request($fp, $command);
}
}
//un-assign the agent from the queue
if (isset($row['queue_uuid']) && $row['agent_status'] == 'Logged Out') {
if (is_uuid($row['queue_uuid']) && is_uuid($row['agent_uuid'])) {
$command = "api callcenter_config tier del ".$queue_id." ".$row['agent_uuid'];
//echo $command."<br />\n";
$response = event_socket_request($fp, $command);
}
}
usleep(200);
//set the blf status
//get the agents from the database
$sql = "select agent_name from v_call_center_agents ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and call_center_agent_uuid = :call_center_agent_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['call_center_agent_uuid'] = $row['agent_uuid'];
$database = new database;
$agent_name = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
if ($row['agent_status'] == 'Available') {
$answer_state = 'confirmed';
}
else {
$answer_state = 'terminated';
}
$call_center_notify = new call_center_notify;
$call_center_notify->domain_name = $_SESSION['domain_name'];
$call_center_notify->agent_name = $agent_name[0]['agent_name'];
$call_center_notify->answer_state = $answer_state;
$call_center_notify->agent_uuid = $row['agent_uuid'];
$call_center_notify->send_call_center_notify();
unset($call_center_notify);
} //end fp
} //strlen
} //foreach
//send a message
message::add($text['confirm-add']);
header("Location: call_center_agent_status.php");
return;
} //post
//includes the header
$document['title'] = $text['title-call_center_agent_status'];
require_once "resources/header.php";
//radio button cycle script
echo "<script>\n";
echo " function get_selected(radio_group) {\n";
echo " for (var i = 0; i < radio_group.length; i++) {\n";
echo " if (radio_group[i].checked) { return i; }\n";
echo " }\n";
echo " return 0;\n";
echo " }\n";
echo " function cycle(radio_group_name) {\n";
echo " var radios = document.getElementsByName(radio_group_name);\n";
echo " var i = get_selected(radios);\n";
echo " if (i+1 == radios.length) {\n";
echo " radios[0].checked = true;\n";
echo " }\n";
echo " else {\n";
echo " radios[i+1].checked = true;\n";
echo " }\n";
echo " }\n";
echo "</script>\n";
//show the content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['header-call_center_agent_status']."</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','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'call_center_queues.php']);
echo button::create(['type'=>'button','label'=>$text['button-refresh'],'icon'=>$_SESSION['theme']['button_icon_refresh'],'collapse'=>'hide-xs','link'=>'call_center_agent_status.php']);
echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','collapse'=>'hide-xs','style'=>'margin-left: 15px;','onclick'=>"list_form_submit('form_list');"]);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if (is_array($_POST['agents']) && !$per_queue_login) {
echo $text['description-call_center_agent_status']."\n";
echo "<br /><br />\n";
}
echo "<form id='form_list' method='post'>\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
echo " <th class='pct-20'>".$text['label-agent']."</th>\n";
if (!$per_queue_login) {
echo " <th class='shrink'>".$text['label-status']."</th>\n";
}
echo " <th class='pct-20 hide-sm-dn'>&nbsp;</th>\n";
if ($per_queue_login) {
echo " <th class='pct-40'>".$text['label-options']."</th>\n";
}
echo "</tr>\n";
if (is_array($agents) && @sizeof($agents) != 0) {
$x = 0;
foreach ($agents as $row) {
$onclick = "onclick=\"cycle('agents[".$x."][agent_status]');\"";
$html = "<tr class='list-row'>\n";
$html .= " <td ".$onclick.">".escape($row['agent_name'])."&nbsp;</td>\n";
if (!$per_queue_login) {
$html .= " <td class='no-wrap'>";
$html .= " <input type='hidden' name='agents[".$x."][agent_name]' value='".escape($row['agent_name'])."'>\n";
$html .= " <input type='hidden' name='agents[".$x."][agent_uuid]' value='".escape($row['call_center_agent_uuid'])."'>\n";
$html .= " <label style='margin: 0; cursor: pointer; margin-right: 10px;'><input type='radio' name='agents[".$x."][agent_status]' value='Available' ".($row['agent_status'] == 'Available' ? "checked='checked'" : null).">&nbsp;".$text['option-available']."</label>\n";
$html .= " <label style='margin: 0; cursor: pointer; margin-right: 10px;'><input type='radio' name='agents[".$x."][agent_status]' value='Logged Out' ".($row['agent_status'] == 'Logged Out' ? "checked='checked'" : null).">&nbsp;".$text['option-logged_out']."</label>\n";
$html .= " <label style='margin: 0; cursor: pointer;'><input type='radio' name='agents[".$x."][agent_status]' value='On Break' ".($row['agent_status'] == 'On Break' ? "checked='checked'" : null).">&nbsp;".$text['option-on_break']."</label>\n";
//$html .= " <label><input type='radio' name='agents[".$x."][agent_status]' value='Do Not Disturb' ".($row['agent_status'] == 'Do Not Disturb' ? "checked='checked'" : null).">&nbsp;".$text['option-do_not_disturb']."</label>\n";
$html .= " </td>\n";
}
$html .= " <td ".$onclick." class='hide-sm-dn'>&nbsp;</td>\n";
if ($per_queue_login) {
$html .= " <td class='description'>";
if (is_array($row['queues'])) {
$html .= " <table class='list' >\n";
$html .= " <tr>\n";
$html .= " <th>".$text['label-queue']."</th>\n";
$html .= " <th>".$text['label-status']."</th>\n";
$html .= " <th>".$text['label-options']."</th>\n";
$html .= " </tr>\n";
if (is_array($row['queues'])) {
foreach ($row['queues'] as $queue) {
$x++;
$onclick = "onclick=\"cycle('agents[".$x."][agent_status]');\"";
$html .= " <tr class='list-row'>\n";
$html .= " <td ".$onclick." class='pct-80 no-wrap'>".$queue['queue_name']."</td>\n";
$html .= " <td>\n";
if ($queue['queue_status'] == "Available") {
$html .= " ".$text['option-available']."\n";
}
if ($queue['queue_status'] == "Logged Out") {
$html .= " ".$text['option-logged_out']."\n";
}
$html .= " </td>\n";
$html .= " <td class='no-wrap right'>";
$html .= " <input type='hidden' name='agents[".$x."][queue_name]' value='".escape($queue['queue_name'])."'>\n";
$html .= " <input type='hidden' name='agents[".$x."][agent_name]' value='".escape($row['agent_name'])."'>\n";
$html .= " <input type='hidden' name='agents[".$x."][user_uuid]' value='".escape($row['user_uuid'])."'>\n";
$html .= " <input type='hidden' name='agents[".$x."][queue_uuid]' value='".escape($queue['call_center_queue_uuid'])."'>\n";
$html .= " <input type='hidden' name='agents[".$x."][agent_uuid]' value='".escape($row['call_center_agent_uuid'])."'>\n";
$html .= " <label style='margin: 0; cursor: pointer; margin-right: 10px;'><input type='radio' name='agents[".$x."][agent_status]' value='Available' ".($queue['queue_status'] == 'Available' ? "checked='checked'" : null).">&nbsp;".$text['option-available']."</label>&nbsp;\n";
$html .= " <label style='margin: 0; cursor: pointer;'><input type='radio' name='agents[".$x."][agent_status]' value='Logged Out' ".($queue['queue_status'] == 'Logged Out' ? "checked='checked'" : null).">&nbsp;".$text['option-logged_out']."</label>\n";
$html .= " </td>\n";
$html .= " </tr>\n";
}
}
$html .= " </table>\n";
}
$html .= " </td>\n";
}
$html .= "</tr>\n";
if (count($_SESSION['domains']) > 1) {
if ($row['domain_name'] == $_SESSION['domain_name']) {
echo $html;
}
}
else {
echo $html;
}
$x++;
}
unset($agents);
}
echo "</table>\n";
echo "<br />\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//show the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,274 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2018
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/paging.php";
//check permissions
if (permission_exists('call_center_agent_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get posted data
if (is_array($_POST['call_center_agents'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$call_center_agents = $_POST['call_center_agents'];
}
//process the http post data by action
if ($action != '' && is_array($call_center_agents) && @sizeof($call_center_agents) != 0) {
switch ($action) {
case 'delete':
if (permission_exists('call_center_agent_delete')) {
$obj = new call_center;
$obj->delete_agents($call_center_agents);
}
break;
}
header('Location: call_center_agents.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
}
//get http variables and set them to php variables
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//add the search term
$search = strtolower($_GET["search"]);
if (strlen($search) > 0) {
$sql_search = " (";
$sql_search .= "lower(agent_name) like :search ";
$sql_search .= "or lower(agent_id) like :search ";
$sql_search .= ") ";
$parameters['search'] = '%'.$search.'%';
}
//get total call center agent count from the database
$sql = "select count(*) from v_call_center_agents ";
$sql .= "where true ";
if ($_GET['show'] != "all" || !permission_exists('call_center_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
if (isset($sql_search)) {
$sql .= "and ".$sql_search;
}
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
//prepare to page the results
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = "&search=".urlencode($search);
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
$param .= "&show=all";
}
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
$offset = $rows_per_page * $page;
//get the list
$sql = str_replace('count(*)', '*', $sql);
$sql .= order_by($order_by, $order, 'agent_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$result = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//includes and title
$document['title'] = $text['title-call_center_agents'];
require_once "resources/header.php";
//show content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['header-call_center_agents']." (".$num_rows.")</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'=>'call_center_queues.php','style'=>'margin-right: 15px;']);
if (permission_exists('call_center_imports')) {
echo button::create(['type'=>'button','label'=>$text['button-import'],'icon'=>$_SESSION['theme']['button_icon_import'],'link'=>PROJECT_PATH.'/app/call_center_imports/call_center_imports.php?import_type=call_center_agents']);
}
if ($num_rows) {
echo button::create(['type'=>'button','label'=>$text['button-status'],'icon'=>'user-clock','style'=>'margin-right: 15px;','link'=>'call_center_agent_status.php']);
}
if (permission_exists('call_center_agent_add')) {
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','link'=>'call_center_agent_edit.php']);
}
if (permission_exists('call_center_agent_delete') && $result) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo "<form id='form_search' class='inline' method='get'>";
if (permission_exists('call_center_all')) {
if ($_GET['show'] == 'all') {
echo " <input type='hidden' name='show' value='all'>";
}
else {
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?type=&show=all'.($search != '' ? "&search=".urlencode($search) : null)]);
}
}
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown='list_search_reset();'>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]);
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'call_center_agents.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
}
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if (permission_exists('call_center_agent_delete') && $result) {
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');"])]);
}
echo $text['description-call_center_agents']."\n";
echo "<br /><br />\n";
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('call_center_agent_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($result ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
}
//echo th_order_by('domain_uuid', 'domain_uuid', $order_by, $order);
echo th_order_by('agent_name', $text['label-agent_name'], $order_by, $order);
echo th_order_by('agent_id', $text['label-agent_id'], $order_by, $order);
echo th_order_by('agent_type', $text['label-type'], $order_by, $order);
echo th_order_by('agent_call_timeout', $text['label-call_timeout'], $order_by, $order);
echo th_order_by('agent_contact', $text['label-contact'], $order_by, $order);
echo th_order_by('agent_max_no_answer', $text['label-max_no_answer'], $order_by, $order);
echo th_order_by('agent_status', $text['label-default_status'], $order_by, $order);
//echo th_order_by('agent_wrap_up_time', $text['label-wrap_up_time'], $order_by, $order);
//echo th_order_by('agent_reject_delay_time', $text['label-reject_delay_time'], $order_by, $order);
//echo th_order_by('agent_busy_delay_time', $text['label-busy_delay_time'], $order_by, $order);
if (permission_exists('call_center_agent_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($result)) {
$x = 0;
foreach($result as $row) {
if (permission_exists('call_center_agent_edit')) {
$list_row_url = "call_center_agent_edit.php?id=".urlencode($row['call_center_agent_uuid']);
}
echo "<tr class='list-row' href='".$list_row_url."'>\n";
if (permission_exists('call_center_agent_delete')) {
echo " <td class='checkbox'>\n";
echo " <input type='checkbox' name='call_center_agents[$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='call_center_agents[$x][uuid]' value='".escape($row['call_center_agent_uuid'])."' />\n";
echo " </td>\n";
}
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
if (strlen($_SESSION['domains'][$row['domain_uuid']]['domain_name']) > 0) {
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
}
else {
$domain = $text['label-global'];
}
echo " <td>".escape($domain)."</td>\n";
}
echo " <td>";
if (permission_exists('call_center_agent_edit')) {
echo "<a href='call_center_agent_edit.php?id=".escape($row['call_center_agent_uuid'])."'>".escape($row['agent_name'])."</a>";
}
else {
echo escape($row['agent_name']);
}
echo " </td>\n";
echo " <td>".escape($row['agent_id'])."</td>\n";
echo " <td>".escape($row['agent_type'])."</td>\n";
echo " <td>".escape($row['agent_call_timeout'])."</td>\n";
$agent_contact = $row['agent_contact'];
// parse out gateway uuid
$bridge_statement = explode('/', $row['agent_contact']);
if ($bridge_statement[0] == 'sofia' && $bridge_statement[1] == 'gateway' && is_uuid($bridge_statement[2])) {
// retrieve gateway name from db
$sql = "select gateway from v_gateways ";
$sql .= "where gateway_uuid = :gateway_uuid ";
$parameters['gateway_uuid'] = $bridge_statement[2];
$database = new database;
$result = $database->select($sql, $parameters, 'all');
if (count($result) > 0) {
$gateway_name = $result[0]['gateway'];
$agent_contact = str_replace($bridge_statement[2], $gateway_name, $agent_contact);
}
unset($sql, $parameters, $bridge_statement);
}
echo " <td>".escape($agent_contact)."</td>\n";
echo " <td>".escape($row['agent_max_no_answer'])."</td>\n";
echo " <td>".escape($row['agent_status'])."</td>\n";
//echo " <td>".$row[agent_wrap_up_time]."</td>\n";
//echo " <td>".$row[agent_reject_delay_time]."</td>\n";
//echo " <td>".$row[agent_busy_delay_time]."</td>\n";
if (permission_exists('call_center_agent_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";
}
echo "</tr>\n";
$x++;
}
unset($result);
}
echo "</table>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//show the footer
require_once "resources/footer.php";
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,287 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2020
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/paging.php";
//check permisission
if (permission_exists('call_center_queue_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get posted data
if (is_array($_POST['call_center_queues'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$call_center_queues = $_POST['call_center_queues'];
}
//process the http post data by action
if ($action != '' && is_array($call_center_queues) && @sizeof($call_center_queues) != 0) {
switch ($action) {
case 'copy':
if (permission_exists('call_center_queue_add')) {
$obj = new call_center;
$obj->copy_queues($call_center_queues);
}
break;
case 'delete':
if (permission_exists('call_center_queue_delete')) {
$obj = new call_center;
$obj->delete_queues($call_center_queues);
}
break;
}
header('Location: call_center_queues.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
}
//get http variables and set as php variables
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//add the search term
$search = strtolower($_GET["search"]);
if (strlen($search) > 0) {
$sql_search = " (";
$sql_search .= "lower(queue_name) like :search ";
$sql_search .= "or lower(queue_description) like :search ";
$sql_search .= ") ";
$parameters['search'] = '%'.$search.'%';
}
//get total call center queues count from the database
$sql = "select count(*) from v_call_center_queues ";
$sql .= "where true ";
if ($_GET['show'] != "all" || !permission_exists('call_center_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
if (isset($sql_search)) {
$sql .= "and ".$sql_search;
}
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
//prepare to page the results
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = "&search=".urlencode($search);
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
$param .= "&show=all";
}
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
$offset = $rows_per_page * $page;
//get the list
$sql = str_replace('count(*)', '*', $sql);
$sql .= order_by($order_by, $order, 'queue_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$result = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//includes and title
$document['title'] = $text['title-call_center_queues'];
require_once "resources/header.php";
//show the content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['header-call_center_queues']." (".$num_rows.")</b></div>\n";
echo " <div class='actions'>\n";
if (permission_exists('call_center_imports')) {
echo button::create(['type'=>'button','label'=>$text['button-import'],'icon'=>$_SESSION['theme']['button_icon_import'],'link'=>PROJECT_PATH.'/app/call_center_imports/call_center_imports.php?import_type=call_center_queues']);
}
if (permission_exists('call_center_agent_view')) {
echo button::create(['type'=>'button','label'=>$text['button-agents'],'icon'=>'users','link'=>'call_center_agents.php']);
}
if (permission_exists('call_center_wallboard')) {
echo button::create(['type'=>'button','label'=>$text['button-wallboard'],'icon'=>'th','link'=>PROJECT_PATH.'/app/call_center_wallboard/call_center_wallboard.php']);
}
$margin_left = permission_exists('call_center_agent_view') || permission_exists('call_center_wallboard') ? 'margin-left: 15px;' : null;
if (permission_exists('call_center_queue_add') && (!is_numeric($_SESSION['limit']['call_center_queues']['numeric']) || $num_rows <= $_SESSION['limit']['call_center_queues']['numeric'])) {
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','style'=>$margin_left,'link'=>'call_center_queue_edit.php']);
unset($margin_left);
}
if (permission_exists('call_center_queue_add') && $result && (!is_numeric($_SESSION['limit']['call_center_queues']['numeric']) || $num_rows <= $_SESSION['limit']['call_center_queues']['numeric'])) {
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none; '.$margin_left,'onclick'=>"modal_open('modal-copy','btn_copy');"]);
unset($margin_left);
}
if (permission_exists('call_center_queue_delete') && $result) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; '.$margin_left,'onclick'=>"modal_open('modal-delete','btn_delete');"]);
unset($margin_left);
}
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('call_center_all')) {
if ($_GET['show'] == 'all') {
echo " <input type='hidden' name='show' value='all'>";
}
else {
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?type=&show=all'.($search != '' ? "&search=".urlencode($search) : null)]);
}
}
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'call_center_queues.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
}
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if (permission_exists('call_center_queue_add') && $result && (!is_numeric($_SESSION['limit']['call_center_queues']['numeric']) || $num_rows <= $_SESSION['limit']['call_center_queues']['numeric'])) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
}
if (permission_exists('call_center_queue_delete') && $result) {
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');"])]);
}
echo $text['description-call_center_queues']."\n";
echo "<br /><br />\n";
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('call_center_queue_add') || permission_exists('call_center_queue_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($result ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
}
echo th_order_by('queue_name', $text['label-queue_name'], $order_by, $order);
echo th_order_by('queue_extension', $text['label-extension'], $order_by, $order);
echo th_order_by('queue_strategy', $text['label-strategy'], $order_by, $order);
//echo th_order_by('queue_moh_sound', $text['label-music_on_hold'], $order_by, $order);
//echo th_order_by('queue_record_template', $text['label-record_template'], $order_by, $order);
//echo th_order_by('queue_time_base_score', $text['label-time_base_score'], $order_by, $order);
//echo th_order_by('queue_time_base_score_sec', $text['label-time_base_score_sec'], $order_by, $order);
//echo th_order_by('queue_max_wait_time', $text['label-max_wait_time'], $order_by, $order);
//echo th_order_by('queue_max_wait_time_with_no_agent', $text['label-max_wait_time_with_no_agent'], $order_by, $order);
echo th_order_by('queue_tier_rules_apply', $text['label-tier_rules_apply'], $order_by, $order);
//echo th_order_by('queue_tier_rule_wait_second', $text['label-tier_rule_wait_second'], $order_by, $order);
//echo th_order_by('queue_tier_rule_no_agent_no_wait', $text['label-tier_rule_no_agent_no_wait'], $order_by, $order);
//echo th_order_by('queue_discard_abandoned_after', $text['label-discard_abandoned_after'], $order_by, $order);
//echo th_order_by('queue_abandoned_resume_allowed', $text['label-abandoned_resume_allowed'], $order_by, $order);
//echo th_order_by('queue_tier_rule_wait_multiply_level', $text['label-tier_rule_wait_multiply_level'], $order_by, $order);
echo th_order_by('queue_description', $text['label-description'], $order_by, $order, null, "class='hide-sm-dn'");
if (permission_exists('call_center_queue_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($result)) {
$x = 0;
foreach($result as $row) {
if (permission_exists('call_center_queue_edit')) {
$list_row_url = "call_center_queue_edit.php?id=".urlencode($row['call_center_queue_uuid']);
}
echo "<tr class='list-row' href='".$list_row_url."'>\n";
if (permission_exists('call_center_queue_add') || permission_exists('call_center_queue_delete')) {
echo " <td class='checkbox'>\n";
echo " <input type='checkbox' name='call_center_queues[$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='call_center_queues[$x][uuid]' value='".escape($row['call_center_queue_uuid'])."' />\n";
echo " </td>\n";
}
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
if (strlen($_SESSION['domains'][$row['domain_uuid']]['domain_name']) > 0) {
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
}
else {
$domain = $text['label-global'];
}
echo " <td>".escape($domain)."</td>\n";
}
echo " <td>";
if (permission_exists('call_center_queue_edit')) {
echo " <a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['queue_name'])."</a>";
}
else {
echo " ".escape($row[queue_name]);
}
echo " </td>\n";
echo " <td>".escape($row['queue_extension'])."</td>\n";
echo " <td>".escape($row['queue_strategy'])."</td>\n";
//echo " <td>".escape($row[queue_moh_sound])."&nbsp;</td>\n";
//echo " <td>".escape($row[queue_record_template])."&nbsp;</td>\n";
//echo " <td>".escape($row[queue_time_base_score])."&nbsp;</td>\n";
//echo " <td>".escape($row[queue_time_base_score_sec])."&nbsp;</td>\n";
//echo " <td>".escape($row[queue_max_wait_time])."&nbsp;</td>\n";
//echo " <td>".escape($row[queue_max_wait_time_with_no_agent])."&nbsp;</td>\n";
echo " <td>".ucwords(escape($row['queue_tier_rules_apply']))."</td>\n";
//echo " <td>".escape($row[queue_tier_rule_wait_second])."&nbsp;</td>\n";
//echo " <td>".escape($row[queue_tier_rule_no_agent_no_wait])."&nbsp;</td>\n";
//echo " <td>".escape($row[queue_discard_abandoned_after])."&nbsp;</td>\n";
//echo " <td>".escape($row[queue_abandoned_resume_allowed])."&nbsp;</td>\n";
//echo " <td>".escape($row[queue_tier_rule_wait_multiply_level])."&nbsp;</td>\n";
echo " <td class='description overflow hide-sm-dn'>".escape($row['queue_description'])."</td>\n";
if (permission_exists('call_center_queue_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";
}
echo "</tr>\n";
$x++;
}
unset($result);
}
echo "</table>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//show the footer
require_once "resources/footer.php";
?>

89
app/call_centers/cmd.php Normal file
View File

@ -0,0 +1,89 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('call_center_queue_add') || permission_exists('call_center_queue_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//get the variables
$cmd = $_GET['cmd'];
//pre-populate the form
if (is_array($_GET) && is_uuid($_GET["id"]) && $_POST["persistformvar"] != "true") {
$call_center_queue_uuid = $_GET["id"];
$sql = "select queue_extension from v_call_center_queues ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and call_center_queue_uuid = :call_center_queue_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['call_center_queue_uuid'] = $call_center_queue_uuid;
$database = new database;
$queue_extension = $database->select($sql, $parameters, 'column');
unset($sql, $parameters);
}
//validate the variables
switch ($cmd) {
case "load":
//allow the command
break;
case "unload":
//allow the command
break;
case "reload":
//allow the command
break;
default:
unset($cmd);
}
//connect to event socket
if (isset($queue_extension) && isset($cmd)) {
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$response = event_socket_request($fp, 'api reloadxml');
$response = event_socket_request($fp, 'api callcenter_config queue '.$cmd. ' '.$queue_extension."@".$_SESSION["domain_name"]);
fclose($fp);
}
else {
$response = '';
}
}
//send the redirect
$_SESSION["message"] = $response;
header("Location: call_center_queues.php?savemsg=".urlencode($response));
?>

View File

@ -0,0 +1,640 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Copyright (C) 2015 - 2021
All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
/**
* cache class provides an abstracted cache
*
* @method string dialplan - builds the dialplan for call center
*/
//define the call center class
if (!class_exists('call_center')) {
class call_center {
/**
* define the variables
*/
public $domain_uuid;
public $call_center_queue_uuid;
public $dialplan_uuid;
public $queue_name;
public $queue_description;
public $destination_number;
public $queue_cc_exit_keys;
/**
* declare private variables
*/
private $app_name;
private $app_uuid;
private $permission_prefix;
private $list_page;
private $table;
private $uuid_prefix;
/**
* Called when the object is created
*/
public function __construct() {
//assign private variables
$this->app_name = 'call_center';
$this->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370';
}
/**
* Called when there are no references to a particular object
* unset the variables used in the class
*/
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
/**
* Add a dialplan for call center
* @var string $domain_uuid the multi-tenant id
* @var string $value string to be cached
*/
public function dialplan() {
//delete previous dialplan
if (is_uuid($this->dialplan_uuid)) {
//build delete array
$array['dialplans'][0]['dialplan_uuid'] = $this->dialplan_uuid;
$array['dialplans'][0]['domain_uuid'] = $this->domain_uuid;
$array['dialplan_details'][0]['dialplan_uuid'] = $this->dialplan_uuid;
$array['dialplan_details'][0]['domain_uuid'] = $this->domain_uuid;
//grant temporary permissions
$p = new permissions;
$p->add('dialplan_delete', 'temp');
$p->add('dialplan_detail_delete', 'temp');
//execute delete
$database = new database;
$database->app_name = 'call_centers';
$database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370';
$database->delete($array);
unset($array);
//revoke temporary permissions
$p->delete('dialplan_delete', 'temp');
$p->delete('dialplan_detail_delete', 'temp');
}
//build the dialplan array
$dialplan["app_uuid"] = "95788e50-9500-079e-2807-fd530b0ea370";
$dialplan["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_name"] = ($this->queue_name != '') ? $this->queue_name : format_phone($this->destination_number);
$dialplan["dialplan_number"] = $this->destination_number;
$dialplan["dialplan_context"] = $_SESSION['domain_name'];
$dialplan["dialplan_continue"] = "false";
$dialplan["dialplan_order"] = "210";
$dialplan["dialplan_enabled"] = "true";
$dialplan["dialplan_description"] = $this->queue_description;
$dialplan_detail_order = 10;
//add the public condition
$y = 1;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "condition";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "\${caller_id_name}";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "^([^#]+#)(.*)$";
$dialplan["dialplan_details"][$y]["dialplan_detail_break"] = "never";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "1";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "caller_id_name=$2";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "1";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "condition";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "destination_number";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "^".$this->destination_number."\$";
$dialplan["dialplan_details"][$y]["dialplan_detail_break"] = "";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "answer";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "hangup_after_bridge=true";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
if (strlen($this->queue_cid_prefix) > 0) {
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "effective_caller_id_name=".$this->queue_cid_prefix."#\${caller_id_name}";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
}
if (strlen($this->queue_greeting) > 0) {
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "sleep";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "1000";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
}
if (strlen($this->queue_greeting) > 0) {
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "playback";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "".$this->queue_greeting;
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
}
if (strlen($this->queue_cc_exit_keys) > 0) {
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "cc_exit_keys=".$this->queue_cc_exit_keys;
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
}
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "callcenter";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = $this->queue_name.'@'.$_SESSION["domain_name"];
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
if (strlen($this->queue_timeout_action) > 0) {
$action_array = explode(":",$this->queue_timeout_action);
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = $action_array[0];
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = substr($this->queue_timeout_action, strlen($action_array[0])+1, strlen($this->queue_timeout_action));
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
}
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "hangup";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
//prepare the array
$array["dialplans"][0] = $dialplan;
//add temporary permissions
$p = new permissions;
$p->add("dialplan_add", 'temp');
$p->add("dialplan_detail_add", 'temp');
$p->add("dialplan_edit", 'temp');
$p->add("dialplan_detail_edit", 'temp');
//save the dialplan
$database = new database;
$database->app_name = 'call_centers';
$database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370';
$database->save($array);
$dialplan_response = $database->message;
$this->dialplan_uuid = $dialplan_response['uuid'];
unset($array);
//remove temporary permissions
$p->delete("dialplan_add", 'temp');
$p->delete("dialplan_detail_add", 'temp');
$p->delete("dialplan_edit", 'temp');
$p->delete("dialplan_detail_edit", 'temp');
//build call center queue update array
$array['call_center_queues'][0]['call_center_queue_uuid'] = $this->call_center_queue_uuid;
$array['call_center_queues'][0]['dialplan_uuid'] = $this->dialplan_uuid;
//grant temporary permissions
$p = new permissions;
$p->add('call_center_queue_edit', 'temp');
//execute update
$database = new database;
$database->app_name = 'call_centers';
$database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370';
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('call_center_queue_edit', 'temp');
//clear the cache
$cache = new cache;
$cache->delete("dialplan:".$_SESSION['domain_name']);
//return the dialplan_uuid
return $dialplan_response;
}
/**
* delete records
*/
public function delete_queues($records) {
//assign private variables
$this->permission_prefix = 'call_center_queue_';
$this->list_page = 'call_center_queues.php';
$this->table = 'call_center_queues';
$this->uuid_prefix = 'call_center_queue_';
if (permission_exists($this->permission_prefix.'delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//delete multiple records
if (is_array($records) && @sizeof($records) != 0) {
//filter out unchecked, build where clause for below
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//get necessary details
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select ".$this->uuid_prefix."uuid as uuid, dialplan_uuid, queue_name, queue_extension from v_".$this->table." ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
$call_center_queues[$row['uuid']]['dialplan_uuid'] = $row['dialplan_uuid'];
$call_center_queues[$row['uuid']]['queue_name'] = $row['queue_name'];
$call_center_queues[$row['uuid']]['queue_extension'] = $row['queue_extension'];
}
}
unset($sql, $parameters, $rows, $row);
}
//build the delete array
$x = 0;
foreach ($call_center_queues as $call_center_queue_uuid => $call_center_queue) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $call_center_queue_uuid;
$array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['dialplans'][$x]['dialplan_uuid'] = $call_center_queue['dialplan_uuid'];
$array['dialplans'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['dialplan_details'][$x]['dialplan_uuid'] = $call_center_queue['dialplan_uuid'];
$array['dialplan_details'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['call_center_tiers'][$x][$this->uuid_prefix.'uuid'] = $call_center_queue_uuid;
$array['call_center_tiers'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$x++;
$array['call_center_tiers'][$x]['queue_name'] = $call_center_queue['queue_extension']."@".$_SESSION['domain_name'];
$array['call_center_tiers'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$x++;
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//delete the queue in the switch
if ($fp) {
foreach ($uuids as $uuid) {
$cmd = "api callcenter_config queue unload ".$call_center_queues[$uuid]['queue_extension']."@".$_SESSION["domin_name"];
$response = event_socket_request($fp, $cmd);
}
}
//grant temporary permissions
$p = new permissions;
$p->add('call_center_tier_delete', 'temp');
$p->add('dialplan_delete', 'temp');
$p->add('dialplan_detail_delete', 'temp');
//execute delete
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->delete($array);
unset($array);
//revoke temporary permissions
$p->delete('call_center_tier_delete', 'temp');
$p->delete('dialplan_delete', 'temp');
$p->delete('dialplan_detail_delete', 'temp');
//clear the cache
$cache = new cache;
$cache->delete("dialplan:".$_SESSION["domain_name"]);
remove_config_from_cache('configuration:callcenter.conf');
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
//synchronize configuration
save_call_center_xml();
//apply settings reminder
$_SESSION["reload_xml"] = true;
//set message
message::add($text['message-delete']);
}
unset($records);
}
}
}
public function delete_agents($records) {
//assign private variables
$this->permission_prefix = 'call_center_agent_';
$this->list_page = 'call_center_agents.php';
$this->table = 'call_center_agents';
$this->uuid_prefix = 'call_center_agent_';
if (permission_exists($this->permission_prefix.'delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//delete multiple records
if (is_array($records) && @sizeof($records) != 0) {
//filter out unchecked
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = $record['uuid'];
}
}
//build the delete array
if (is_array($uuids) && @sizeof($uuids) != 0) {
foreach ($uuids as $x => $uuid) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
$array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['call_center_tiers'][$x]['call_center_agent_uuid'] = $uuid;
$array['call_center_tiers'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
}
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//delete the agent in the switch
if ($fp) {
foreach ($uuids as $uuid) {
$cmd = "api callcenter_config agent del ".$uuid;
$response = event_socket_request($fp, $cmd);
}
}
//grant temporary permissions
$p = new permissions;
$p->add('call_center_tier_delete', 'temp');
//execute delete
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->delete($array);
unset($array);
//revoke temporary permissions
$p->delete('call_center_tier_delete', 'temp');
//synchronize configuration
save_call_center_xml();
remove_config_from_cache('configuration:callcenter.conf');
//set message
message::add($text['message-delete']);
}
unset($records);
}
}
}
/**
* copy records
*/
public function copy_queues($records) {
//assign private variables
$this->permission_prefix = 'call_center_queue_';
$this->list_page = 'call_center_queues.php';
$this->table = 'call_center_queues';
$this->uuid_prefix = 'call_center_queue_';
if (permission_exists($this->permission_prefix.'add')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//copy the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get checked records
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//create insert array from existing data
if (is_array($uuids) && @sizeof($uuids) != 0) {
//primary table
$sql = "select * from v_".$this->table." ";
$sql .= "where ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
$y = 0;
foreach ($rows as $x => $row) {
$new_call_center_queue_uuid = uuid();
$new_dialplan_uuid = uuid();
//copy data
$array[$this->table][$x] = $row;
//overwrite
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $new_call_center_queue_uuid;
$array[$this->table][$x]['dialplan_uuid'] = $new_dialplan_uuid;
$array[$this->table][$x]['queue_description'] = trim($row['queue_description'].' ('.$text['label-copy'].')');
//call center tiers sub table
$sql_2 = "select * from v_call_center_tiers where call_center_queue_uuid = :call_center_queue_uuid";
$parameters_2['call_center_queue_uuid'] = $row['call_center_queue_uuid'];
$database = new database;
$rows_2 = $database->select($sql_2, $parameters_2, 'all');
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
foreach ($rows_2 as $row_2) {
//copy data
$array['call_center_tiers'][$y] = $row_2;
//overwrite
$array['call_center_tiers'][$y]['call_center_tier_uuid'] = uuid();
$array['call_center_tiers'][$y]['call_center_queue_uuid'] = $new_call_center_queue_uuid;
$y++;
}
}
unset($sql_2, $parameters_2, $rows_2, $row_2);
//call center queue dialplan record
$sql_3 = "select * from v_dialplans where dialplan_uuid = :dialplan_uuid";
$parameters_3['dialplan_uuid'] = $row['dialplan_uuid'];
$database = new database;
$dialplan = $database->select($sql_3, $parameters_3, 'row');
if (is_array($dialplan) && @sizeof($dialplan) != 0) {
//copy data
$array['dialplans'][$x] = $dialplan;
//overwrite
$array['dialplans'][$x]['dialplan_uuid'] = $new_dialplan_uuid;
$dialplan_xml = $dialplan['dialplan_xml'];
$dialplan_xml = str_replace($row['call_center_queue_uuid'], $new_call_center_queue_uuid, $dialplan_xml); //replace source call_center_queue_uuid with new
$dialplan_xml = str_replace($dialplan['dialplan_uuid'], $new_dialplan_uuid, $dialplan_xml); //replace source dialplan_uuid with new
$array['dialplans'][$x]['dialplan_xml'] = $dialplan_xml;
$array['dialplans'][$x]['dialplan_description'] = trim($dialplan['dialplan_description'].' ('.$text['label-copy'].')');
}
unset($sql_3, $parameters_3, $dialplan);
}
}
unset($sql, $parameters, $rows, $row);
}
//save the changes and set the message
if (is_array($array) && @sizeof($array) != 0) {
//grant temporary permissions
$p = new permissions;
$p->add('call_center_tier_add', 'temp');
$p->add('dialplan_add', 'temp');
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('call_center_tier_add', 'temp');
$p->delete('dialplan_add', 'temp');
//apply settings reminder
$_SESSION["reload_xml"] = true;
//clear the cache
$cache = new cache;
$cache->delete("dialplan:".$_SESSION["domain_name"]);
//set message
message::add($text['message-copy']);
}
unset($records);
}
}
} //method
} //class
}
/*
$o = new call_center;
$c->domain_uuid = "";
$c->dialplan_uuid = "";
$c->queue_name = "";
$c->queue_cid_prefix = "";
$c->queue_timeout_action = "";
$c->queue_description = "";
$c->destination_number = "";
$c->queue_cc_exit_keys = "";
$c->dialplan();
*/
?>

View File

@ -0,0 +1,209 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2017-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('call_center_queue_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get($_SESSION['domain']['language']['code'], 'app/call_centers');
//get http variables and set as php variables
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//get the http post values and set them as php variables
if (count($_POST) > 0) {
foreach ($_POST['agents'] as $row) {
if (strlen($row['agent_status']) > 0) {
//agent set status
if ($fp) {
// update the database
$array['call_center_agents'][0]['call_center_agent_uuid'] = $row['id'];
$array['call_center_agents'][0]['domain_uuid'] = $_SESSION['user']['domain_uuid'];
$array['call_center_agents'][0]['agent_status'] = $row['agent_status'];
$database = new database;
$database->app_name = 'call_centers_dashboard';
$database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370';
$database->save($array);
//set the call center status
$cmd = "api callcenter_config agent set status ".$row['id']." '".$row['agent_status']."'";
$response = event_socket_request($fp, $cmd);
//set the agent status to available and assign the agent to the queue with the tier
if ($row['agent_status'] == 'Available') {
//assign the agent to the queue
$cmd = "api callcenter_config tier add ".$row['queue_extension']."@".$_SESSION['domain_name']." ".$row['id']." 1 1";
$response = event_socket_request($fp, $cmd);
}
//un-assign the agent from the queue
if ($row['agent_status'] == 'Logged Out') {
$cmd = "api callcenter_config tier del ".$row['queue_extension']."@".$_SESSION['domain_name']." ".$row['id'];
$response = event_socket_request($fp, $cmd);
}
usleep(200);
unset($parameters);
}
}
}
//redirect
header('Location: '.PROJECT_PATH.'/core/dashboard/');
exit;
}
//get the agent list from event socket
$switch_cmd = 'callcenter_config tier list';
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
$call_center_tiers = csv_to_named_array($event_socket_str, '|');
//get the call center queues from the database
$sql = "select * from v_call_center_queues ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "order by queue_extension asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$call_center_queues = $database->select($sql, $parameters, 'all');
$num_rows = !is_array($call_center_queues) ? 0 : @sizeof($call_center_queues);
unset($sql, $parameters);
//get the agents from the database
$sql = "select * from v_call_center_agents ";
$sql .= "where user_uuid = :user_uuid ";
$sql .= "and domain_uuid = :domain_uuid";
$parameters['user_uuid'] = $_SESSION['user_uuid'];
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$agents = $database->select($sql, $parameters, 'all');
if (count($agents) > 0) {
$agent = $agents[0];
}
unset($sql, $parameters);
//update the queue status
$x = 0;
foreach ($call_center_queues as $queue) {
$call_center_queues[$x]['queue_status'] = 'Logged Out';
foreach ($call_center_tiers as $tier) {
if ($queue['queue_extension'] .'@'. $_SESSION['user']['domain_name'] == $tier['queue'] && $agent['call_center_agent_uuid'] == $tier['agent']) {
$call_center_queues[$x]['queue_status'] = $agent['agent_status'];
}
}
$x++;
}
//includes the header
require_once "resources/header.php";
//radio button cycle script
echo "<script>\n";
echo " function get_selected(radio_group) {\n";
echo " for (var i = 0; i < radio_group.length; i++) {\n";
echo " if (radio_group[i].checked) { return i; }\n";
echo " }\n";
echo " return 0;\n";
echo " }\n";
echo " function cycle(radio_group_name) {\n";
echo " var radios = document.getElementsByName(radio_group_name);\n";
echo " var i = get_selected(radios);\n";
echo " if (i+1 == radios.length) {\n";
echo " radios[0].checked = true;\n";
echo " }\n";
echo " else {\n";
echo " radios[i+1].checked = true;\n";
echo " }\n";
echo " }\n";
echo "</script>\n";
//show the content
echo "<div class='action_bar sub'>\n";
echo " <div class='heading'><b>".$text['header-call_center_queues'].($agent['agent_name'] != '' ? "&nbsp;&nbsp;&nbsp;</b> Agent: <strong>".$agent['agent_name']."</strong>" : "</b>")."</div>\n";
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'collapse'=>false,'onclick'=>"list_form_submit('form_list_call_center_agent_dashboard');"]);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
echo "<form id='form_list_call_center_agent_dashboard' method='post'>\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
echo " <th>".$text['label-queue_name']."</th>\n";
echo " <th class='shrink'>".$text['label-status']."</th>\n";
// echo " <th>".$text['label-options']."</th>\n";
echo "</tr>\n";
if (is_array($call_center_queues) && @sizeof($call_center_queues) != 0) {
$x = 0;
foreach ($call_center_queues as $row) {
$onclick = "onclick=\"cycle('agents[".$x."][agent_status]');\"";
echo "<tr class='list-row'>\n";
echo " <td ".$onclick.">".escape($row['queue_name'])."</td>\n";
// echo " <td>";
// if ($row['queue_status'] == "Available") {
// echo $text['option-available'];
// }
// if ($row['queue_status'] == "Logged Out") {
// echo $text['option-logged_out'];
// }
// echo " </td>\n";
echo " <td class='no-wrap right'>\n";
echo " <input type='hidden' name='agents[".$x."][queue_extension]' value='".escape($row['queue_extension'])."'>\n";
echo " <input type='hidden' name='agents[".$x."][agent_name]' value='".escape($agent['agent_name'])."'>\n";
echo " <input type='hidden' name='agents[".$x."][id]' value='".escape($agent['call_center_agent_uuid'])."'>\n";
echo " <label style='margin: 0; cursor: pointer; margin-right: 10px;'><input type='radio' name='agents[".$x."][agent_status]' value='Available' ".($row['queue_status'] == 'Available' ? "checked='checked'" : null).">&nbsp;".$text['option-available']."</label>\n";
echo " <label style='margin: 0; cursor: pointer; margin-right: 10px;'><input type='radio' name='agents[".$x."][agent_status]' value='Logged Out' ".($row['queue_status'] == 'Logged Out' ? "checked='checked'" : null).">&nbsp;".$text['option-logged_out']."</label>\n";
echo " <label style='margin: 0; cursor: pointer;'><input type='radio' name='agents[".$x."][agent_status]' value='On Break' ".($row['queue_status'] == 'On Break' ? "checked='checked'" : null).">&nbsp;".$text['option-on_break']."</label>\n";
echo " </td>\n";
echo "</tr>\n";
$x++;
}
unset($call_center_queues);
}
echo "</table>\n";
echo "<br />\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
?>

View File

@ -0,0 +1,14 @@
<?php
$array['dashboard'][$x]['dashboard_uuid'] = '9083305a-ebb4-4b67-bb9b-8c09cf030261';
$array['dashboard'][$x]['dashboard_name'] = 'Call Center Agents';
$array['dashboard'][$x]['dashboard_path'] = 'app/call_centers/resources/dashboard/call_center_agents.php';
$array['dashboard'][$x]['dashboard_order'] = '180';
$array['dashboard'][$x]['dashboard_enabled'] = 'false';
$array['dashboard'][$x]['dashboard_description'] = 'Status for agent in a call center.';
$y = 0;
$array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_group_uuid'] = '22d8937c-a9b3-4458-b34c-0ebeda15ffad';
$array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_uuid'] = '9083305a-ebb4-4b67-bb9b-8c09cf030261';
$array['dashboard'][$x]['dashboard_groups'][$y]['group_name'] = 'agent';
?>

90
app/call_centers/root.php Normal file
View File

@ -0,0 +1,90 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,201 @@
<?php
//application details
$apps[$x]['name'] = "Call Flows";
$apps[$x]['uuid'] = "b1b70f85-6b42-429b-8c5a-60c8b02b7d14";
$apps[$x]['category'] = "";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Direct calls between two destinations by calling a feature code.";
$apps[$x]['description']['en-gb'] = "Direct calls between two destinations by calling a feature code.";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Anrufe zwischen zwei Ziele anhand eines Funktions-Codes steuern.";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Anrufe zwischen zwei Ziele anhand eines Funktions-Codes steuern.";
$apps[$x]['description']['es-cl'] = "";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "";
$apps[$x]['description']['fr-fr'] = "";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "Directe oproepen tussen twee bestemmingen via een feature code.";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "";
$apps[$x]['description']['pt-pt'] = "";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$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'] = "call_flows";
$apps[$x]['destinations'][$y]['name'] = "call_flows";
$apps[$x]['destinations'][$y]['sql'] = "select call_flow_name as name, call_flow_uuid as uuid, call_flow_extension as destination, call_flow_context as context from v_call_flows ";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and call_flow_enabled = 'true' ";
$apps[$x]['destinations'][$y]['order_by'] = "call_flow_name asc";
$apps[$x]['destinations'][$y]['field']['call_flow_uuid'] = "call_flow_uuid";
$apps[$x]['destinations'][$y]['field']['name'] = "call_flow_name";
$apps[$x]['destinations'][$y]['field']['destination'] = "destination";
$apps[$x]['destinations'][$y]['field']['extension'] = "destination";
$apps[$x]['destinations'][$y]['field']['context'] = "context";
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${name}";
$y++;
$apps[$x]['destinations'][$y]['type'] = "sql";
$apps[$x]['destinations'][$y]['label'] = "call_flows";
$apps[$x]['destinations'][$y]['name'] = "call_flows";
$apps[$x]['destinations'][$y]['sql'] = "select call_flow_name as name, call_flow_uuid as uuid, call_flow_extension as extension, call_flow_feature_code as destination, call_flow_context as context from v_call_flows ";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and call_flow_enabled = 'true' ";
$apps[$x]['destinations'][$y]['order_by'] = "call_flow_extension asc";
$apps[$x]['destinations'][$y]['field']['uuid'] = "uuid";
$apps[$x]['destinations'][$y]['field']['name'] = "name";
$apps[$x]['destinations'][$y]['field']['destination'] = "destination";
$apps[$x]['destinations'][$y]['field']['extension'] = "extension";
$apps[$x]['destinations'][$y]['field']['context'] = "context";
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${name}";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "call_flow_view";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "b0939384-7055-44e8-8b4c-9f72293e1878";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_flow_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_flow_edit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_flow_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_flow_all";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_flow_context";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_flow_destinations";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
//cache details
$apps[$x]['cache']['key'] = "dialplan.\${call_flow_context}";
//schema details
$y=0;
$apps[$x]['db'][$y]['table']['name'] = "v_call_flows";
$apps[$x]['db'][$y]['table']['parent'] = "";
$z=0;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_dialplans";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "dialplan_uuid";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_extension";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the extension number.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_feature_code";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the feature code.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_context";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the context.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_status";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the status.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_pin_number";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the PIN number.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_label";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the label.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_sound";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the sound.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_app";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the application.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_data";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the application data.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_flow_alternate_label";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "call_flow_anti_label";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the alternate label.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_alternate_sound";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the alternate sound.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_flow_alternate_app";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "call_flow_anti_app";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the alternate application.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_flow_alternate_data";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "call_flow_anti_data";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the alernate application data.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to enable or disable the call flow";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_description";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description.";
?>

View File

@ -0,0 +1,38 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2020
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//process this only one time
if ($domains_processed == 1) {
//update the dialplan order
$database = new database;
$sql = "update v_call_flows set call_flow_enabled = 'true' where call_flow_enabled is null;\n";
$database->execute($sql);
unset($sql);
}
?>

View File

@ -0,0 +1,739 @@
<?php
#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
$text['title-call_flows']['en-us'] = "Call Flows";
$text['title-call_flows']['en-gb'] = "Call Flows";
$text['title-call_flows']['ar-eg'] = "";
$text['title-call_flows']['de-at'] = "Anruf Steuerung"; //copied from de-de
$text['title-call_flows']['de-ch'] = "Anruf Steuerung"; //copied from de-de
$text['title-call_flows']['de-de'] = "Anruf Steuerung";
$text['title-call_flows']['es-cl'] = "Flujo de Llamada";
$text['title-call_flows']['es-mx'] = "Flujo de Llamada"; //copied from es-cl
$text['title-call_flows']['fr-ca'] = "Flux d'appel"; //copied from fr-fr
$text['title-call_flows']['fr-fr'] = "Flux d'appel";
$text['title-call_flows']['he-il'] = "";
$text['title-call_flows']['it-it'] = "Deviatori di Chiamata";
$text['title-call_flows']['nl-nl'] = "Oproep besturing";
$text['title-call_flows']['pl-pl'] = "Przepływ rozmów";
$text['title-call_flows']['pt-br'] = "Fluxo de chamadas";
$text['title-call_flows']['pt-pt'] = "Fluxo de Chamadas";
$text['title-call_flows']['ro-ro'] = "";
$text['title-call_flows']['ru-ru'] = "Переключатели вызовов";
$text['title-call_flows']['sv-se'] = "Samtalsflöden";
$text['title-call_flows']['uk-ua'] = "Потоки дзвінків";
$text['title-call_flow']['en-us'] = "Call Flow";
$text['title-call_flow']['en-gb'] = "Call Flow";
$text['title-call_flow']['ar-eg'] = "";
$text['title-call_flow']['de-at'] = "Anruf Steuerung"; //copied from de-de
$text['title-call_flow']['de-ch'] = "Anruf Steuerung"; //copied from de-de
$text['title-call_flow']['de-de'] = "Anruf Steuerung";
$text['title-call_flow']['es-cl'] = "Flujo de Llamada";
$text['title-call_flow']['es-mx'] = "Flujo de Llamada"; //copied from es-cl
$text['title-call_flow']['fr-ca'] = "Editer le flux"; //copied from fr-fr
$text['title-call_flow']['fr-fr'] = "Editer le flux";
$text['title-call_flow']['he-il'] = "";
$text['title-call_flow']['it-it'] = "";
$text['title-call_flow']['nl-nl'] = "Oproep besturing";
$text['title-call_flow']['pl-pl'] = "Przepływ rozmów";
$text['title-call_flow']['pt-br'] = "Fluxo de chamada";
$text['title-call_flow']['pt-pt'] = "Fluxo de Chamada";
$text['title-call_flow']['ro-ro'] = "";
$text['title-call_flow']['ru-ru'] = "Переключатель вызовов";
$text['title-call_flow']['sv-se'] = "Samtalsflöde";
$text['title-call_flow']['uk-ua'] = "Потік дзвінків";
$text['title-call_flow_extension']['en-us'] = "Call Flows - Extension";
$text['title-call_flow_extension']['en-gb'] = "Call Flows - Extension";
$text['title-call_flow_extension']['ar-eg'] = "";
$text['title-call_flow_extension']['de-at'] = "Anruf Steuerung - Ziel"; //copied from de-de
$text['title-call_flow_extension']['de-ch'] = "Anruf Steuerung - Ziel"; //copied from de-de
$text['title-call_flow_extension']['de-de'] = "Anruf Steuerung - Ziel";
$text['title-call_flow_extension']['es-cl'] = "Flujo de Llamada - Destino";
$text['title-call_flow_extension']['es-mx'] = "Flujo de Llamada - Destino"; //copied from es-cl
$text['title-call_flow_extension']['fr-ca'] = "Flux d'appel - Destination"; //copied from fr-fr
$text['title-call_flow_extension']['fr-fr'] = "Flux d'appel - Destination";
$text['title-call_flow_extension']['he-il'] = "";
$text['title-call_flow_extension']['it-it'] = "Deviatori di Chiamata - Destinazione";
$text['title-call_flow_extension']['nl-nl'] = "Oproep besturing - Bestemming";
$text['title-call_flow_extension']['pl-pl'] = "Przepływ rozmów - Destynacja";
$text['title-call_flow_extension']['pt-br'] = "Fluxo de chamadas - Destino";
$text['title-call_flow_extension']['pt-pt'] = "Fluxo de Chamadas - Desvio";
$text['title-call_flow_extension']['ro-ro'] = "";
$text['title-call_flow_extension']['ru-ru'] = "Переключатели вызовов - Направление";
$text['title-call_flow_extension']['sv-se'] = "Samtalsflöden - Destination";
$text['title-call_flow_extension']['uk-ua'] = "Потоки дзвінків - Номер";
$text['title-call_flow_feature']['en-us'] = "Call Flows - Feature";
$text['title-call_flow_feature']['en-gb'] = "Call Flows - Feature";
$text['title-call_flow_feature']['ar-eg'] = "";
$text['title-call_flow_feature']['de-at'] = "Anruf Steuerung - Funktions"; //copied from de-de
$text['title-call_flow_feature']['de-ch'] = "Anruf Steuerung - Funktions"; //copied from de-de
$text['title-call_flow_feature']['de-de'] = "Anruf Steuerung - Funktions";
$text['title-call_flow_feature']['es-cl'] = "Flujo de Llamada - distintivo";
$text['title-call_flow_feature']['es-mx'] = "Flujo de Llamada - distintivo"; //copied from es-cl
$text['title-call_flow_feature']['fr-ca'] = "Flux d'appel - Fonction"; //copied from fr-fr
$text['title-call_flow_feature']['fr-fr'] = "Flux d'appel - Fonction";
$text['title-call_flow_feature']['he-il'] = "";
$text['title-call_flow_feature']['it-it'] = "Deviatori di Chiamata ";
$text['title-call_flow_feature']['nl-nl'] = "Oproep besturing - Functie";
$text['title-call_flow_feature']['pl-pl'] = "Przepływ rozmów ";
$text['title-call_flow_feature']['pt-br'] = "Fluxo de chamadas - Função";
$text['title-call_flow_feature']['pt-pt'] = "Fluxo de Chamadas - Função";
$text['title-call_flow_feature']['ro-ro'] = "";
$text['title-call_flow_feature']['ru-ru'] = "Переключатели вызовов - Код функции";
$text['title-call_flow_feature']['sv-se'] = "Samtalsflöden - Funktionskod";
$text['title-call_flow_feature']['uk-ua'] = "Потоки дзвінків";
$text['label-call_flow_name']['en-us'] = "Name";
$text['label-call_flow_name']['en-gb'] = "Name";
$text['label-call_flow_name']['ar-eg'] = "";
$text['label-call_flow_name']['de-at'] = "Name"; //copied from de-de
$text['label-call_flow_name']['de-ch'] = "Name"; //copied from de-de
$text['label-call_flow_name']['de-de'] = "Name";
$text['label-call_flow_name']['es-cl'] = "Nombre";
$text['label-call_flow_name']['es-mx'] = "Nombre"; //copied from es-cl
$text['label-call_flow_name']['fr-ca'] = "Nom"; //copied from fr-fr
$text['label-call_flow_name']['fr-fr'] = "Nom";
$text['label-call_flow_name']['he-il'] = "";
$text['label-call_flow_name']['it-it'] = "";
$text['label-call_flow_name']['nl-nl'] = "Naam";
$text['label-call_flow_name']['pl-pl'] = "Nazwa";
$text['label-call_flow_name']['pt-br'] = "Nome"; //copied from pt-pt
$text['label-call_flow_name']['pt-pt'] = "Nome";
$text['label-call_flow_name']['ro-ro'] = "";
$text['label-call_flow_name']['ru-ru'] = "Имя";
$text['label-call_flow_name']['sv-se'] = "Namn";
$text['label-call_flow_name']['uk-ua'] = "Назва";
$text['label-call_flow_status']['en-us'] = "Status";
$text['label-call_flow_status']['en-gb'] = "Status";
$text['label-call_flow_status']['ar-eg'] = "";
$text['label-call_flow_status']['de-at'] = "Aktiviert"; //copied from de-de
$text['label-call_flow_status']['de-ch'] = "Aktiviert"; //copied from de-de
$text['label-call_flow_status']['de-de'] = "Aktiviert";
$text['label-call_flow_status']['es-cl'] = "Estado";
$text['label-call_flow_status']['es-mx'] = "Estado"; //copied from es-cl
$text['label-call_flow_status']['fr-ca'] = "Etat"; //copied from fr-fr
$text['label-call_flow_status']['fr-fr'] = "Etat";
$text['label-call_flow_status']['he-il'] = "";
$text['label-call_flow_status']['it-it'] = "";
$text['label-call_flow_status']['nl-nl'] = "Status";
$text['label-call_flow_status']['pl-pl'] = "Status";
$text['label-call_flow_status']['pt-br'] = "Estado"; //copied from pt-pt
$text['label-call_flow_status']['pt-pt'] = "Estado";
$text['label-call_flow_status']['ro-ro'] = "";
$text['label-call_flow_status']['ru-ru'] = "Статус";
$text['label-call_flow_status']['sv-se'] = "Status";
$text['label-call_flow_status']['uk-ua'] = "Статус";
$text['label-call_flow_pin_number']['en-us'] = "PIN Number";
$text['label-call_flow_pin_number']['en-gb'] = "PIN Number";
$text['label-call_flow_pin_number']['ar-eg'] = "";
$text['label-call_flow_pin_number']['de-at'] = "PIN Nummer"; //copied from de-de
$text['label-call_flow_pin_number']['de-ch'] = "PIN Nummer"; //copied from de-de
$text['label-call_flow_pin_number']['de-de'] = "PIN Nummer";
$text['label-call_flow_pin_number']['es-cl'] = "Número PIN";
$text['label-call_flow_pin_number']['es-mx'] = "Número PIN"; //copied from es-cl
$text['label-call_flow_pin_number']['fr-ca'] = "Code PIN"; //copied from fr-fr
$text['label-call_flow_pin_number']['fr-fr'] = "Code PIN";
$text['label-call_flow_pin_number']['he-il'] = "";
$text['label-call_flow_pin_number']['it-it'] = "";
$text['label-call_flow_pin_number']['nl-nl'] = "PIN code";
$text['label-call_flow_pin_number']['pl-pl'] = "Numer PIN";
$text['label-call_flow_pin_number']['pt-br'] = "Código PIN"; //copied from pt-pt
$text['label-call_flow_pin_number']['pt-pt'] = "Código PIN";
$text['label-call_flow_pin_number']['ro-ro'] = "";
$text['label-call_flow_pin_number']['ru-ru'] = "PIN код";
$text['label-call_flow_pin_number']['sv-se'] = "PIN Kod";
$text['label-call_flow_pin_number']['uk-ua'] = "PIN-код";
$text['label-call_flow_feature_code']['en-us'] = "Feature Code";
$text['label-call_flow_feature_code']['en-gb'] = "Feature Code";
$text['label-call_flow_feature_code']['ar-eg'] = "";
$text['label-call_flow_feature_code']['de-at'] = "Funktions-Code"; //copied from de-de
$text['label-call_flow_feature_code']['de-ch'] = "Funktions-Code"; //copied from de-de
$text['label-call_flow_feature_code']['de-de'] = "Funktions-Code";
$text['label-call_flow_feature_code']['es-cl'] = "Código distintivo";
$text['label-call_flow_feature_code']['es-mx'] = "Código distintivo"; //copied from es-cl
$text['label-call_flow_feature_code']['fr-ca'] = "Code Fonction"; //copied from fr-fr
$text['label-call_flow_feature_code']['fr-fr'] = "Code Fonction";
$text['label-call_flow_feature_code']['he-il'] = "";
$text['label-call_flow_feature_code']['it-it'] = "";
$text['label-call_flow_feature_code']['nl-nl'] = "Functie-code";
$text['label-call_flow_feature_code']['pl-pl'] = "Kod Funkcji";
$text['label-call_flow_feature_code']['pt-br'] = "Código de função";
$text['label-call_flow_feature_code']['pt-pt'] = "Código de Função";
$text['label-call_flow_feature_code']['ro-ro'] = "";
$text['label-call_flow_feature_code']['ru-ru'] = "Код функции";
$text['label-call_flow_feature_code']['sv-se'] = "Funktionskod";
$text['label-call_flow_feature_code']['uk-ua'] = "";
$text['label-call_flow_extension']['en-us'] = "Extension";
$text['label-call_flow_extension']['en-gb'] = "Extension";
$text['label-call_flow_extension']['ar-eg'] = "";
$text['label-call_flow_extension']['de-at'] = "Nebenstelle"; //copied from de-de
$text['label-call_flow_extension']['de-ch'] = "Nebenstelle"; //copied from de-de
$text['label-call_flow_extension']['de-de'] = "Nebenstelle";
$text['label-call_flow_extension']['es-cl'] = "Extensión";
$text['label-call_flow_extension']['es-mx'] = "Extensión"; //copied from es-cl
$text['label-call_flow_extension']['fr-ca'] = "Extension"; //copied from fr-fr
$text['label-call_flow_extension']['fr-fr'] = "Extension";
$text['label-call_flow_extension']['he-il'] = "";
$text['label-call_flow_extension']['it-it'] = "";
$text['label-call_flow_extension']['nl-nl'] = "Toestel";
$text['label-call_flow_extension']['pl-pl'] = "Numer wewnętrzny";
$text['label-call_flow_extension']['pt-br'] = "Ramal";
$text['label-call_flow_extension']['pt-pt'] = "Extensão";
$text['label-call_flow_extension']['ro-ro'] = "";
$text['label-call_flow_extension']['ru-ru'] = "Внутренний номер";
$text['label-call_flow_extension']['sv-se'] = "Anknytning";
$text['label-call_flow_extension']['uk-ua'] = "Розширення (Extention)";
$text['label-call_flow_label']['en-us'] = "Destination Label";
$text['label-call_flow_label']['en-gb'] = "Destination Label";
$text['label-call_flow_label']['ar-eg'] = "";
$text['label-call_flow_label']['de-at'] = "Ziel Kennzeichnung"; //copied from de-de
$text['label-call_flow_label']['de-ch'] = "Ziel Kennzeichnung"; //copied from de-de
$text['label-call_flow_label']['de-de'] = "Ziel Kennzeichnung";
$text['label-call_flow_label']['es-cl'] = "Etiqueta de Destino";
$text['label-call_flow_label']['es-mx'] = "Etiqueta de Destino"; //copied from es-cl
$text['label-call_flow_label']['fr-ca'] = "Label de la destination"; //copied from fr-fr
$text['label-call_flow_label']['fr-fr'] = "Label de la destination";
$text['label-call_flow_label']['he-il'] = "";
$text['label-call_flow_label']['it-it'] = "";
$text['label-call_flow_label']['nl-nl'] = "Bestemmingskenmerk";
$text['label-call_flow_label']['pl-pl'] = "Etykieta destynacji";
$text['label-call_flow_label']['pt-br'] = "Etiqueta de destino";
$text['label-call_flow_label']['pt-pt'] = "Destino";
$text['label-call_flow_label']['ro-ro'] = "";
$text['label-call_flow_label']['ru-ru'] = "Название направления";
$text['label-call_flow_label']['sv-se'] = "Destination Etikett";
$text['label-call_flow_label']['uk-ua'] = "призначення етикетки";
$text['label-call_flow_destination']['en-us'] = "Destination";
$text['label-call_flow_destination']['en-gb'] = "Destination";
$text['label-call_flow_destination']['ar-eg'] = "";
$text['label-call_flow_destination']['de-at'] = "Ziel"; //copied from de-de
$text['label-call_flow_destination']['de-ch'] = "Ziel"; //copied from de-de
$text['label-call_flow_destination']['de-de'] = "Ziel";
$text['label-call_flow_destination']['es-cl'] = "Destino";
$text['label-call_flow_destination']['es-mx'] = "Destino"; //copied from es-cl
$text['label-call_flow_destination']['fr-ca'] = "Destination"; //copied from fr-fr
$text['label-call_flow_destination']['fr-fr'] = "Destination";
$text['label-call_flow_destination']['he-il'] = "";
$text['label-call_flow_destination']['it-it'] = "";
$text['label-call_flow_destination']['nl-nl'] = "Bestemming";
$text['label-call_flow_destination']['pl-pl'] = "Destynacja";
$text['label-call_flow_destination']['pt-br'] = "Número de destino";
$text['label-call_flow_destination']['pt-pt'] = "Destino";
$text['label-call_flow_destination']['ro-ro'] = "";
$text['label-call_flow_destination']['ru-ru'] = "Направление";
$text['label-call_flow_destination']['sv-se'] = "Destination";
$text['label-call_flow_destination']['uk-ua'] = "Номер";
$text['label-call_flow_context']['en-us'] = "Context";
$text['label-call_flow_context']['en-gb'] = "Context";
$text['label-call_flow_context']['ar-eg'] = "";
$text['label-call_flow_context']['de-at'] = "Kontext"; //copied from de-de
$text['label-call_flow_context']['de-ch'] = "Kontext"; //copied from de-de
$text['label-call_flow_context']['de-de'] = "Kontext";
$text['label-call_flow_context']['es-cl'] = "Contexto";
$text['label-call_flow_context']['es-mx'] = "Contexto"; //copied from es-cl
$text['label-call_flow_context']['fr-ca'] = "Contexte"; //copied from fr-fr
$text['label-call_flow_context']['fr-fr'] = "Contexte";
$text['label-call_flow_context']['he-il'] = "";
$text['label-call_flow_context']['it-it'] = "";
$text['label-call_flow_context']['nl-nl'] = "Context";
$text['label-call_flow_context']['pl-pl'] = "Kontekst";
$text['label-call_flow_context']['pt-br'] = "Contexto"; //copied from pt-pt
$text['label-call_flow_context']['pt-pt'] = "Contexto";
$text['label-call_flow_context']['ro-ro'] = "";
$text['label-call_flow_context']['ru-ru'] = "Контекст";
$text['label-call_flow_context']['sv-se'] = "Context";
$text['label-call_flow_context']['uk-ua'] = "Контекст";
$text['label-call_flow_alternate_label']['en-us'] = "Alternate Label";
$text['label-call_flow_alternate_label']['en-gb'] = "Alternate Label";
$text['label-call_flow_alternate_label']['ar-eg'] = "";
$text['label-call_flow_alternate_label']['de-at'] = "Alternative Bezeichnung"; //copied from de-de
$text['label-call_flow_alternate_label']['de-ch'] = "Alternative Bezeichnung"; //copied from de-de
$text['label-call_flow_alternate_label']['de-de'] = "Alternative Bezeichnung";
$text['label-call_flow_alternate_label']['es-cl'] = "Etiqueta alternativa";
$text['label-call_flow_alternate_label']['es-mx'] = "Etiqueta alternativa"; //copied from es-cl
$text['label-call_flow_alternate_label']['fr-ca'] = "Label alternatif"; //copied from fr-fr
$text['label-call_flow_alternate_label']['fr-fr'] = "Label alternatif";
$text['label-call_flow_alternate_label']['he-il'] = "";
$text['label-call_flow_alternate_label']['it-it'] = "";
$text['label-call_flow_alternate_label']['nl-nl'] = "Alternatief kenmerk";
$text['label-call_flow_alternate_label']['pl-pl'] = "Alternatywna etykieta";
$text['label-call_flow_alternate_label']['pt-br'] = "Etqueta alternativa";
$text['label-call_flow_alternate_label']['pt-pt'] = "Etiqueta Alternativa";
$text['label-call_flow_alternate_label']['ro-ro'] = "";
$text['label-call_flow_alternate_label']['ru-ru'] = "Название альтернативного направления";
$text['label-call_flow_alternate_label']['sv-se'] = "Alternativ Etikett";
$text['label-call_flow_alternate_label']['uk-ua'] = "альтернативні етикетки";
$text['label-call_flow_alternate_destination']['en-us'] = "Alternate Destination";
$text['label-call_flow_alternate_destination']['en-gb'] = "Alternate Destination";
$text['label-call_flow_alternate_destination']['ar-eg'] = "";
$text['label-call_flow_alternate_destination']['de-at'] = "Alternatives Ziel"; //copied from de-de
$text['label-call_flow_alternate_destination']['de-ch'] = "Alternatives Ziel"; //copied from de-de
$text['label-call_flow_alternate_destination']['de-de'] = "Alternatives Ziel";
$text['label-call_flow_alternate_destination']['es-cl'] = "Destino Alternativo";
$text['label-call_flow_alternate_destination']['es-mx'] = "Destino Alternativo"; //copied from es-cl
$text['label-call_flow_alternate_destination']['fr-ca'] = "Destination alternative"; //copied from fr-fr
$text['label-call_flow_alternate_destination']['fr-fr'] = "Destination alternative";
$text['label-call_flow_alternate_destination']['he-il'] = "";
$text['label-call_flow_alternate_destination']['it-it'] = "";
$text['label-call_flow_alternate_destination']['nl-nl'] = "Alternatieve bestemming";
$text['label-call_flow_alternate_destination']['pl-pl'] = "Alternatywna destynacja";
$text['label-call_flow_alternate_destination']['pt-br'] = "Destino alternativo";
$text['label-call_flow_alternate_destination']['pt-pt'] = "Destino Alternativo";
$text['label-call_flow_alternate_destination']['ro-ro'] = "";
$text['label-call_flow_alternate_destination']['ru-ru'] = "Альтернативное направление";
$text['label-call_flow_alternate_destination']['sv-se'] = "Alternativ Destination";
$text['label-call_flow_alternate_destination']['uk-ua'] = "альтернативні варіанти призначення";
$text['label-call_flow_sound']['en-us'] = "Sound";
$text['label-call_flow_sound']['en-gb'] = "Sound";
$text['label-call_flow_sound']['ar-eg'] = "";
$text['label-call_flow_sound']['de-at'] = "Rufton"; //copied from de-de
$text['label-call_flow_sound']['de-ch'] = "Rufton"; //copied from de-de
$text['label-call_flow_sound']['de-de'] = "Rufton";
$text['label-call_flow_sound']['es-cl'] = "Sonar";
$text['label-call_flow_sound']['es-mx'] = "Sonar"; //copied from es-cl
$text['label-call_flow_sound']['fr-ca'] = "Sonner"; //copied from fr-fr
$text['label-call_flow_sound']['fr-fr'] = "Sonner";
$text['label-call_flow_sound']['he-il'] = "";
$text['label-call_flow_sound']['it-it'] = "";
$text['label-call_flow_sound']['nl-nl'] = "Geluid";
$text['label-call_flow_sound']['pl-pl'] = "Dźwięk";
$text['label-call_flow_sound']['pt-br'] = "Som"; //copied from pt-pt
$text['label-call_flow_sound']['pt-pt'] = "Som";
$text['label-call_flow_sound']['ro-ro'] = "";
$text['label-call_flow_sound']['ru-ru'] = "Звук";
$text['label-call_flow_sound']['sv-se'] = "Ljud";
$text['label-call_flow_sound']['uk-ua'] = "звук";
$text['label-call_flow_alternate_sound']['en-us'] = "Alternate Sound";
$text['label-call_flow_alternate_sound']['en-gb'] = "Alternate Sound";
$text['label-call_flow_alternate_sound']['ar-eg'] = "";
$text['label-call_flow_alternate_sound']['de-at'] = "Alternativer Rufton"; //copied from de-de
$text['label-call_flow_alternate_sound']['de-ch'] = "Alternativer Rufton"; //copied from de-de
$text['label-call_flow_alternate_sound']['de-de'] = "Alternativer Rufton";
$text['label-call_flow_alternate_sound']['es-cl'] = "sonido alternativo";
$text['label-call_flow_alternate_sound']['es-mx'] = "sonido alternativo"; //copied from es-cl
$text['label-call_flow_alternate_sound']['fr-ca'] = "son suppléant"; //copied from fr-fr
$text['label-call_flow_alternate_sound']['fr-fr'] = "son suppléant";
$text['label-call_flow_alternate_sound']['he-il'] = "";
$text['label-call_flow_alternate_sound']['it-it'] = "";
$text['label-call_flow_alternate_sound']['nl-nl'] = "Alternatief geluid";
$text['label-call_flow_alternate_sound']['pl-pl'] = "Alternatywny dźwięk";
$text['label-call_flow_alternate_sound']['pt-br'] = "Som alternativo";
$text['label-call_flow_alternate_sound']['pt-pt'] = "som alternativo";
$text['label-call_flow_alternate_sound']['ro-ro'] = "";
$text['label-call_flow_alternate_sound']['ru-ru'] = "Альтернативный звук";
$text['label-call_flow_alternate_sound']['sv-se'] = "alternativt ljud";
$text['label-call_flow_alternate_sound']['uk-ua'] = "альтернативний звук";
$text['label-call_flow_description']['en-us'] = "Description";
$text['label-call_flow_description']['en-gb'] = "Description";
$text['label-call_flow_description']['ar-eg'] = "";
$text['label-call_flow_description']['de-at'] = "Beschreibung"; //copied from de-de
$text['label-call_flow_description']['de-ch'] = "Beschreibung"; //copied from de-de
$text['label-call_flow_description']['de-de'] = "Beschreibung";
$text['label-call_flow_description']['es-cl'] = "Descripción";
$text['label-call_flow_description']['es-mx'] = "Descripción"; //copied from es-cl
$text['label-call_flow_description']['fr-ca'] = "Description"; //copied from fr-fr
$text['label-call_flow_description']['fr-fr'] = "Description";
$text['label-call_flow_description']['he-il'] = "";
$text['label-call_flow_description']['it-it'] = "";
$text['label-call_flow_description']['nl-nl'] = "Omschrijving";
$text['label-call_flow_description']['pl-pl'] = "Opis";
$text['label-call_flow_description']['pt-br'] = "Descrição";
$text['label-call_flow_description']['pt-pt'] = "Descripção";
$text['label-call_flow_description']['ro-ro'] = "";
$text['label-call_flow_description']['ru-ru'] = "Описание";
$text['label-call_flow_description']['sv-se'] = "Beskrivning";
$text['label-call_flow_description']['uk-ua'] = "Опис";
$text['header-call_flows']['en-us'] = "Call Flows";
$text['header-call_flows']['en-gb'] = "Call Flows";
$text['header-call_flows']['ar-eg'] = "";
$text['header-call_flows']['de-at'] = "Anruf Steuerung"; //copied from de-de
$text['header-call_flows']['de-ch'] = "Anruf Steuerung"; //copied from de-de
$text['header-call_flows']['de-de'] = "Anruf Steuerung";
$text['header-call_flows']['es-cl'] = "flujo de Llamada";
$text['header-call_flows']['es-mx'] = "flujo de Llamada"; //copied from es-cl
$text['header-call_flows']['fr-ca'] = "Flux d'appel"; //copied from fr-fr
$text['header-call_flows']['fr-fr'] = "Flux d'appel";
$text['header-call_flows']['he-il'] = "";
$text['header-call_flows']['it-it'] = "Deviatori di Chiamata";
$text['header-call_flows']['nl-nl'] = "Oproep besturing";
$text['header-call_flows']['pl-pl'] = "Przepływ rozmów";
$text['header-call_flows']['pt-br'] = "Fluxo de chamadas";
$text['header-call_flows']['pt-pt'] = "Fluxo de Chamadas";
$text['header-call_flows']['ro-ro'] = "";
$text['header-call_flows']['ru-ru'] = "Переключатель вызовов";
$text['header-call_flows']['sv-se'] = "Samtalsflöden";
$text['header-call_flows']['uk-ua'] = "Потоки дзвінків";
$text['header-call_flow']['en-us'] = "Call Flow";
$text['header-call_flow']['en-gb'] = "Call Flow";
$text['header-call_flow']['ar-eg'] = "";
$text['header-call_flow']['de-at'] = "Anruf Steuerung"; //copied from de-de
$text['header-call_flow']['de-ch'] = "Anruf Steuerung"; //copied from de-de
$text['header-call_flow']['de-de'] = "Anruf Steuerung";
$text['header-call_flow']['es-cl'] = "Flujo de Llamada";
$text['header-call_flow']['es-mx'] = "Flujo de Llamada"; //copied from es-cl
$text['header-call_flow']['fr-ca'] = "Editer le flux"; //copied from fr-fr
$text['header-call_flow']['fr-fr'] = "Editer le flux";
$text['header-call_flow']['he-il'] = "";
$text['header-call_flow']['it-it'] = "";
$text['header-call_flow']['nl-nl'] = "Oproep besturing";
$text['header-call_flow']['pl-pl'] = "Przepływ rozmów";
$text['header-call_flow']['pt-br'] = "Fluxo de chamada";
$text['header-call_flow']['pt-pt'] = "Fluxo de Chamada";
$text['header-call_flow']['ro-ro'] = "";
$text['header-call_flow']['ru-ru'] = "Переключатель вызовов";
$text['header-call_flow']['sv-se'] = "Samtalsflöde";
$text['header-call_flow']['uk-ua'] = "Потік дзвінка";
$text['description-call_flow_status']['en-us'] = "Select the status.";
$text['description-call_flow_status']['en-gb'] = "Select the status.";
$text['description-call_flow_status']['ar-eg'] = "";
$text['description-call_flow_status']['de-at'] = "Status festlegen."; //copied from de-de
$text['description-call_flow_status']['de-ch'] = "Status festlegen."; //copied from de-de
$text['description-call_flow_status']['de-de'] = "Status festlegen.";
$text['description-call_flow_status']['es-cl'] = "Seleccione el estado.";
$text['description-call_flow_status']['es-mx'] = "Seleccione el estado."; //copied from es-cl
$text['description-call_flow_status']['fr-ca'] = "Choisir le statut."; //copied from fr-fr
$text['description-call_flow_status']['fr-fr'] = "Choisir le statut.";
$text['description-call_flow_status']['he-il'] = "";
$text['description-call_flow_status']['it-it'] = "";
$text['description-call_flow_status']['nl-nl'] = "Kies de status";
$text['description-call_flow_status']['pl-pl'] = "Wybierz status użytkownika";
$text['description-call_flow_status']['pt-br'] = "Escolha o estado.";
$text['description-call_flow_status']['pt-pt'] = "Seleccione o estado.";
$text['description-call_flow_status']['ro-ro'] = "";
$text['description-call_flow_status']['ru-ru'] = "Виберите состояние.";
$text['description-call_flow_status']['sv-se'] = "Välj Status";
$text['description-call_flow_status']['uk-ua'] = "Виберіть статус користувача";
$text['description-call_flow_pin_number']['en-us'] = "Enter the pin number.";
$text['description-call_flow_pin_number']['en-gb'] = "Enter the pin number.";
$text['description-call_flow_pin_number']['ar-eg'] = "";
$text['description-call_flow_pin_number']['de-at'] = "Geben Sie eine PIN ein."; //copied from de-de
$text['description-call_flow_pin_number']['de-ch'] = "Geben Sie eine PIN ein."; //copied from de-de
$text['description-call_flow_pin_number']['de-de'] = "Geben Sie eine PIN ein.";
$text['description-call_flow_pin_number']['es-cl'] = "Ingrese el número PIN.";
$text['description-call_flow_pin_number']['es-mx'] = "Ingrese el número PIN."; //copied from es-cl
$text['description-call_flow_pin_number']['fr-ca'] = "Choisir le code PIN."; //copied from fr-fr
$text['description-call_flow_pin_number']['fr-fr'] = "Choisir le code PIN.";
$text['description-call_flow_pin_number']['he-il'] = "";
$text['description-call_flow_pin_number']['it-it'] = "";
$text['description-call_flow_pin_number']['nl-nl'] = "Voer de PIN code in.";
$text['description-call_flow_pin_number']['pl-pl'] = "Wprowadź numer PIN";
$text['description-call_flow_pin_number']['pt-br'] = "Insira o código PIN.";
$text['description-call_flow_pin_number']['pt-pt'] = "Introduza o código PIN";
$text['description-call_flow_pin_number']['ro-ro'] = "";
$text['description-call_flow_pin_number']['ru-ru'] = "Введите пин-код.";
$text['description-call_flow_pin_number']['sv-se'] = "Ange PIN Kod.";
$text['description-call_flow_pin_number']['uk-ua'] = "Введіть пін - код.";
$text['description-call_flow_name']['en-us'] = "Enter the name.";
$text['description-call_flow_name']['en-gb'] = "Enter the name.";
$text['description-call_flow_name']['ar-eg'] = "";
$text['description-call_flow_name']['de-at'] = "Geben Sie den Namen an"; //copied from de-de
$text['description-call_flow_name']['de-ch'] = "Geben Sie den Namen an"; //copied from de-de
$text['description-call_flow_name']['de-de'] = "Geben Sie den Namen an";
$text['description-call_flow_name']['es-cl'] = "Ingrese el nombre.";
$text['description-call_flow_name']['es-mx'] = "Ingrese el nombre."; //copied from es-cl
$text['description-call_flow_name']['fr-ca'] = "Choisir le nom."; //copied from fr-fr
$text['description-call_flow_name']['fr-fr'] = "Choisir le nom.";
$text['description-call_flow_name']['he-il'] = "";
$text['description-call_flow_name']['it-it'] = "";
$text['description-call_flow_name']['nl-nl'] = "Voer de naam in.";
$text['description-call_flow_name']['pl-pl'] = "Wprowadź nazwę";
$text['description-call_flow_name']['pt-br'] = "Insira o nome.";
$text['description-call_flow_name']['pt-pt'] = "Introduza o nome.";
$text['description-call_flow_name']['ro-ro'] = "";
$text['description-call_flow_name']['ru-ru'] = "Введите имя.";
$text['description-call_flow_name']['sv-se'] = "Ange Namn.";
$text['description-call_flow_name']['uk-ua'] = "Введіть назву меню";
$text['description-call_flow_feature_code']['en-us'] = "Enter the feature code.";
$text['description-call_flow_feature_code']['en-gb'] = "Enter the feature code.";
$text['description-call_flow_feature_code']['ar-eg'] = "";
$text['description-call_flow_feature_code']['de-at'] = "Geben Sie den Funktions-Code an."; //copied from de-de
$text['description-call_flow_feature_code']['de-ch'] = "Geben Sie den Funktions-Code an."; //copied from de-de
$text['description-call_flow_feature_code']['de-de'] = "Geben Sie den Funktions-Code an.";
$text['description-call_flow_feature_code']['es-cl'] = "Ingrese el código distintivo.";
$text['description-call_flow_feature_code']['es-mx'] = "Ingrese el código distintivo."; //copied from es-cl
$text['description-call_flow_feature_code']['fr-ca'] = "Choisir le code la fonction"; //copied from fr-fr
$text['description-call_flow_feature_code']['fr-fr'] = "Choisir le code la fonction";
$text['description-call_flow_feature_code']['he-il'] = "";
$text['description-call_flow_feature_code']['it-it'] = "";
$text['description-call_flow_feature_code']['nl-nl'] = "Voer de functie-code in";
$text['description-call_flow_feature_code']['pl-pl'] = "Dodaj specjalny kod";
$text['description-call_flow_feature_code']['pt-br'] = "Insira o código de função.";
$text['description-call_flow_feature_code']['pt-pt'] = "Introduza o código de função.";
$text['description-call_flow_feature_code']['ro-ro'] = "";
$text['description-call_flow_feature_code']['ru-ru'] = "Введите код функции.";
$text['description-call_flow_feature_code']['sv-se'] = "Ange Funktionskoden.";
$text['description-call_flow_feature_code']['uk-ua'] = "Введіть код об'єкта.";
$text['description-call_flow_extension']['en-us'] = "Enter the extension number.";
$text['description-call_flow_extension']['en-gb'] = "Enter the extension number.";
$text['description-call_flow_extension']['ar-eg'] = "";
$text['description-call_flow_extension']['de-at'] = "Weisen Sie die Nebenstelle aus."; //copied from de-de
$text['description-call_flow_extension']['de-ch'] = "Weisen Sie die Nebenstelle aus."; //copied from de-de
$text['description-call_flow_extension']['de-de'] = "Weisen Sie die Nebenstelle aus.";
$text['description-call_flow_extension']['es-cl'] = "Ingrese el número de extensión.";
$text['description-call_flow_extension']['es-mx'] = "Ingrese el número de extensión."; //copied from es-cl
$text['description-call_flow_extension']['fr-ca'] = "Choisir le numéro d'extension."; //copied from fr-fr
$text['description-call_flow_extension']['fr-fr'] = "Choisir le numéro d'extension.";
$text['description-call_flow_extension']['he-il'] = "";
$text['description-call_flow_extension']['it-it'] = "";
$text['description-call_flow_extension']['nl-nl'] = "Voer het toestelnummer in";
$text['description-call_flow_extension']['pl-pl'] = "Wprowadź alfanumeryczny numer wewnętrzny. Domyślna konfiguracja pozwala na 2-7 cyfrowe numery wewnętrzne";
$text['description-call_flow_extension']['pt-br'] = "Atribua o número de ramal.";
$text['description-call_flow_extension']['pt-pt'] = "Introduza o número da extensão.";
$text['description-call_flow_extension']['ro-ro'] = "";
$text['description-call_flow_extension']['ru-ru'] = "Введите внутренний номер.";
$text['description-call_flow_extension']['sv-se'] = "Ange anknytningsnumret.";
$text['description-call_flow_extension']['uk-ua'] = "Введіть номер розширення.";
$text['description-call_flow_destination_label']['en-us'] = "Enter the destination label.";
$text['description-call_flow_destination_label']['en-gb'] = "Enter the destination label.";
$text['description-call_flow_destination_label']['ar-eg'] = "";
$text['description-call_flow_destination_label']['de-at'] = "Geben Sie eine Beschreibung für das Ziel an."; //copied from de-de
$text['description-call_flow_destination_label']['de-ch'] = "Geben Sie eine Beschreibung für das Ziel an."; //copied from de-de
$text['description-call_flow_destination_label']['de-de'] = "Geben Sie eine Beschreibung für das Ziel an.";
$text['description-call_flow_destination_label']['es-cl'] = "Ingrese la etiqueta de destino.";
$text['description-call_flow_destination_label']['es-mx'] = "Ingrese la etiqueta de destino."; //copied from es-cl
$text['description-call_flow_destination_label']['fr-ca'] = "Choisir le label de la destination."; //copied from fr-fr
$text['description-call_flow_destination_label']['fr-fr'] = "Choisir le label de la destination.";
$text['description-call_flow_destination_label']['he-il'] = "";
$text['description-call_flow_destination_label']['it-it'] = "";
$text['description-call_flow_destination_label']['nl-nl'] = "Voer het bestemmingskenmerk in.";
$text['description-call_flow_destination_label']['pl-pl'] = "Wprowadź opis destynacji";
$text['description-call_flow_destination_label']['pt-br'] = "Insira o destino.";
$text['description-call_flow_destination_label']['pt-pt'] = "Introduza o destino.";
$text['description-call_flow_destination_label']['ro-ro'] = "";
$text['description-call_flow_destination_label']['ru-ru'] = "Введите название направления.";
$text['description-call_flow_destination_label']['sv-se'] = "Ange Destinations Etiketten.";
$text['description-call_flow_destination_label']['uk-ua'] = "Введіть мітку призначення.";
$text['description-call_flow_destination']['en-us'] = "Select the destination.";
$text['description-call_flow_destination']['en-gb'] = "Select the destination.";
$text['description-call_flow_destination']['ar-eg'] = "";
$text['description-call_flow_destination']['de-at'] = "Wählen Sie das Ziel."; //copied from de-de
$text['description-call_flow_destination']['de-ch'] = "Wählen Sie das Ziel."; //copied from de-de
$text['description-call_flow_destination']['de-de'] = "Wählen Sie das Ziel.";
$text['description-call_flow_destination']['es-cl'] = "Seleccione el destino.";
$text['description-call_flow_destination']['es-mx'] = "Seleccione el destino."; //copied from es-cl
$text['description-call_flow_destination']['fr-ca'] = "Choisir la destination."; //copied from fr-fr
$text['description-call_flow_destination']['fr-fr'] = "Choisir la destination.";
$text['description-call_flow_destination']['he-il'] = "";
$text['description-call_flow_destination']['it-it'] = "";
$text['description-call_flow_destination']['nl-nl'] = "Voer de bestemming in.";
$text['description-call_flow_destination']['pl-pl'] = "Wybierz numer docelowy.";
$text['description-call_flow_destination']['pt-br'] = "Selecionar o destino da chamada.";
$text['description-call_flow_destination']['pt-pt'] = "Seleccione o destino.";
$text['description-call_flow_destination']['ro-ro'] = "";
$text['description-call_flow_destination']['ru-ru'] = "Выберите назначение.";
$text['description-call_flow_destination']['sv-se'] = "Välj destinationen.";
$text['description-call_flow_destination']['uk-ua'] = "Відправити дзвінок на розширення, меню IVR, конференцію, або будь-який інший номер.";
$text['description-call_flow_context']['en-us'] = "Enter the context.";
$text['description-call_flow_context']['en-gb'] = "Enter the context.";
$text['description-call_flow_context']['ar-eg'] = "";
$text['description-call_flow_context']['de-at'] = "Geben Sie den Kontext hier an."; //copied from de-de
$text['description-call_flow_context']['de-ch'] = "Geben Sie den Kontext hier an."; //copied from de-de
$text['description-call_flow_context']['de-de'] = "Geben Sie den Kontext hier an.";
$text['description-call_flow_context']['es-cl'] = "Ingrese el contexto.";
$text['description-call_flow_context']['es-mx'] = "Ingrese el contexto."; //copied from es-cl
$text['description-call_flow_context']['fr-ca'] = "Choisir le contexte."; //copied from fr-fr
$text['description-call_flow_context']['fr-fr'] = "Choisir le contexte.";
$text['description-call_flow_context']['he-il'] = "";
$text['description-call_flow_context']['it-it'] = "";
$text['description-call_flow_context']['nl-nl'] = "Voer de Context in.";
$text['description-call_flow_context']['pl-pl'] = "Wprowadź kontekst";
$text['description-call_flow_context']['pt-br'] = "Insira o contexto.";
$text['description-call_flow_context']['pt-pt'] = "Introduza o contexto";
$text['description-call_flow_context']['ro-ro'] = "";
$text['description-call_flow_context']['ru-ru'] = "Введите контекст.";
$text['description-call_flow_context']['sv-se'] = "Ange Context.";
$text['description-call_flow_context']['uk-ua'] = "Введіть контекст.";
$text['description-call_flows']['en-us'] = "Direct calls between two destinations by calling a feature code.";
$text['description-call_flows']['en-gb'] = "Direct calls between two destinations by calling a feature code.";
$text['description-call_flows']['ar-eg'] = "";
$text['description-call_flows']['de-at'] = "Leiten Sie Anrufe zwischen zwei Zielen um indem Sie einen Funktions-Code wählen."; //copied from de-de
$text['description-call_flows']['de-ch'] = "Leiten Sie Anrufe zwischen zwei Zielen um indem Sie einen Funktions-Code wählen."; //copied from de-de
$text['description-call_flows']['de-de'] = "Leiten Sie Anrufe zwischen zwei Zielen um indem Sie einen Funktions-Code wählen.";
$text['description-call_flows']['es-cl'] = "Llamadas directas entre dos destinatarios llamando a un código distintivo.";
$text['description-call_flows']['es-mx'] = "Llamadas directas entre dos destinatarios llamando a un código distintivo."; //copied from es-cl
$text['description-call_flows']['fr-ca'] = "Appels directs entre deux destinations en appelant une fonction."; //copied from fr-fr
$text['description-call_flows']['fr-fr'] = "Appels directs entre deux destinations en appelant une fonction.";
$text['description-call_flows']['he-il'] = "";
$text['description-call_flows']['it-it'] = "Devia le chiamate tra due destinazioni chiamando un codice di attivazione.";
$text['description-call_flows']['nl-nl'] = "Direkte oproepen tussen tw bestemmingen via een functie-code.";
$text['description-call_flows']['pl-pl'] = "Kieruj rozmowy bezpośrednio pomiędzy dwoma destynacjami poprzez prowadzenie specjalnego kodu.";
$text['description-call_flows']['pt-br'] = "Chamadas diretas para dois dispositivos utilizando o código de função.";
$text['description-call_flows']['pt-pt'] = "Chamadas directas entre dois destinos recorrendo a um código de função.";
$text['description-call_flows']['ro-ro'] = "";
$text['description-call_flows']['ru-ru'] = "Переключите вызовы между двумя направлениями с помощью кода дополнительного вида обслуживания.";
$text['description-call_flows']['sv-se'] = "Samtal mellan två destinationer genom att ringa en funktionskod.";
$text['description-call_flows']['uk-ua'] = "Прямі виклики між двома пунктами шляхом виклику коду функції.";
$text['description-call_flow_alternate_label']['en-us'] = "Enter the alternate destination label.";
$text['description-call_flow_alternate_label']['en-gb'] = "Enter the alternate destination label.";
$text['description-call_flow_alternate_label']['ar-eg'] = "";
$text['description-call_flow_alternate_label']['de-at'] = "Geben Sie eine Beschreibung für das alternative Ziel ein."; //copied from de-de
$text['description-call_flow_alternate_label']['de-ch'] = "Geben Sie eine Beschreibung für das alternative Ziel ein."; //copied from de-de
$text['description-call_flow_alternate_label']['de-de'] = "Geben Sie eine Beschreibung für das alternative Ziel ein.";
$text['description-call_flow_alternate_label']['es-cl'] = "Ingrese la etiqueta de destino alternativo.";
$text['description-call_flow_alternate_label']['es-mx'] = "Ingrese la etiqueta de destino alternativo."; //copied from es-cl
$text['description-call_flow_alternate_label']['fr-ca'] = "Choisir le label de la destination alternative."; //copied from fr-fr
$text['description-call_flow_alternate_label']['fr-fr'] = "Choisir le label de la destination alternative.";
$text['description-call_flow_alternate_label']['he-il'] = "";
$text['description-call_flow_alternate_label']['it-it'] = "";
$text['description-call_flow_alternate_label']['nl-nl'] = "Voer alternatieve bestemmingskenmerk in";
$text['description-call_flow_alternate_label']['pl-pl'] = "Wprowadź alternatywny opis destynacji";
$text['description-call_flow_alternate_label']['pt-br'] = "Insira um destino alternativo.";
$text['description-call_flow_alternate_label']['pt-pt'] = "Introduza um destino alternativo.";
$text['description-call_flow_alternate_label']['ro-ro'] = "";
$text['description-call_flow_alternate_label']['ru-ru'] = "Введите название альтернативного направления.";
$text['description-call_flow_alternate_label']['sv-se'] = "Ange den alternativa destinations etiketten.";
$text['description-call_flow_alternate_label']['uk-ua'] = "Введіть альтернативний ярлик призначення.";
$text['description-call_flow_alternate_destination']['en-us'] = "Select the alternate destination.";
$text['description-call_flow_alternate_destination']['en-gb'] = "Select the alternate destination.";
$text['description-call_flow_alternate_destination']['ar-eg'] = "";
$text['description-call_flow_alternate_destination']['de-at'] = "Wählen Sie ein alternatives Ziel."; //copied from de-de
$text['description-call_flow_alternate_destination']['de-ch'] = "Wählen Sie ein alternatives Ziel."; //copied from de-de
$text['description-call_flow_alternate_destination']['de-de'] = "Wählen Sie ein alternatives Ziel.";
$text['description-call_flow_alternate_destination']['es-cl'] = "Seleccione el destino alternativo.";
$text['description-call_flow_alternate_destination']['es-mx'] = "Seleccione el destino alternativo."; //copied from es-cl
$text['description-call_flow_alternate_destination']['fr-ca'] = "Choisir la destination alternative."; //copied from fr-fr
$text['description-call_flow_alternate_destination']['fr-fr'] = "Choisir la destination alternative.";
$text['description-call_flow_alternate_destination']['he-il'] = "";
$text['description-call_flow_alternate_destination']['it-it'] = "";
$text['description-call_flow_alternate_destination']['nl-nl'] = "Kies alternatieve bestemming.";
$text['description-call_flow_alternate_destination']['pl-pl'] = "Wybierz alternatywną destynację";
$text['description-call_flow_alternate_destination']['pt-br'] = "Selecione um destino alternativo.";
$text['description-call_flow_alternate_destination']['pt-pt'] = "Seleccione um destino alternativo.";
$text['description-call_flow_alternate_destination']['ro-ro'] = "";
$text['description-call_flow_alternate_destination']['ru-ru'] = "Выберите альтернативное направление.";
$text['description-call_flow_alternate_destination']['sv-se'] = "Välj den alternativa destinationen.";
$text['description-call_flow_alternate_destination']['uk-ua'] = "Виберіть інше розташування.";
$text['description-call_flow_sound']['en-us'] = "Select the sound to play when the status is set to the destinations.";
$text['description-call_flow_sound']['en-gb'] = "Select the sound to play when the status is set to the destinations.";
$text['description-call_flow_sound']['ar-eg'] = "";
$text['description-call_flow_sound']['de-at'] = "Wählen Sie den zu spielenden Rufton aus, wenn das primäre Ziel ausgewählt ist."; //copied from de-de
$text['description-call_flow_sound']['de-ch'] = "Wählen Sie den zu spielenden Rufton aus, wenn das primäre Ziel ausgewählt ist."; //copied from de-de
$text['description-call_flow_sound']['de-de'] = "Wählen Sie den zu spielenden Rufton aus, wenn das primäre Ziel ausgewählt ist.";
$text['description-call_flow_sound']['es-cl'] = "Seleccione el sonido a reproducir cuando el estado se establece en el destino.";
$text['description-call_flow_sound']['es-mx'] = "Seleccione el sonido a reproducir cuando el estado se establece en el destino."; //copied from es-cl
$text['description-call_flow_sound']['fr-ca'] = "Sélectionnez le son à jouer lorsque l'état est réglé sur la destination."; //copied from fr-fr
$text['description-call_flow_sound']['fr-fr'] = "Sélectionnez le son à jouer lorsque l'état est réglé sur la destination.";
$text['description-call_flow_sound']['he-il'] = "";
$text['description-call_flow_sound']['it-it'] = "";
$text['description-call_flow_sound']['nl-nl'] = "Kies het geluid om af te spelen als status bestemming is. ";
$text['description-call_flow_sound']['pl-pl'] = "Wybierz dźwięk do odtworzenia, gdy status jest ustawiony do miejsca przeznaczenia.";
$text['description-call_flow_sound']['pt-br'] = "Selecione o som para tocar quando o status é definido para o destino.";
$text['description-call_flow_sound']['pt-pt'] = "Selecione o som para tocar quando o status é definido como o destino.";
$text['description-call_flow_sound']['ro-ro'] = "";
$text['description-call_flow_sound']['ru-ru'] = "Выберите звук для воспроизведения, когда состояние устанавливается в пункты назначения.";
$text['description-call_flow_sound']['sv-se'] = "Välj ljud att spela när status är inställd på destinationen.";
$text['description-call_flow_sound']['uk-ua'] = "Виберіть звук для відтворення , коли статус встановлений в пункти призначення.";
$text['description-call_flow_alternate_sound']['en-us'] = "Select the sound to play when status is set to the alternate destination.";
$text['description-call_flow_alternate_sound']['en-gb'] = "Select the sound to play when status is set to the alternate destination.";
$text['description-call_flow_alternate_sound']['ar-eg'] = "";
$text['description-call_flow_alternate_sound']['de-at'] = "Wählen Sie den zu spielenden Rufton aus, wenn das alternative Ziel ausgewählt ist."; //copied from de-de
$text['description-call_flow_alternate_sound']['de-ch'] = "Wählen Sie den zu spielenden Rufton aus, wenn das alternative Ziel ausgewählt ist."; //copied from de-de
$text['description-call_flow_alternate_sound']['de-de'] = "Wählen Sie den zu spielenden Rufton aus, wenn das alternative Ziel ausgewählt ist.";
$text['description-call_flow_alternate_sound']['es-cl'] = "Seleccione el sonido a reproducir cuando el estado se establece en el destino alternativo.";
$text['description-call_flow_alternate_sound']['es-mx'] = "Seleccione el sonido a reproducir cuando el estado se establece en el destino alternativo."; //copied from es-cl
$text['description-call_flow_alternate_sound']['fr-ca'] = "Sélectionnez le son à jouer lorsque l'état est réglé sur la destination alternative."; //copied from fr-fr
$text['description-call_flow_alternate_sound']['fr-fr'] = "Sélectionnez le son à jouer lorsque l'état est réglé sur la destination alternative.";
$text['description-call_flow_alternate_sound']['he-il'] = "";
$text['description-call_flow_alternate_sound']['it-it'] = "";
$text['description-call_flow_alternate_sound']['nl-nl'] = "Kies het geluid om af te spelen als de status alternatieve bestemming is.";
$text['description-call_flow_alternate_sound']['pl-pl'] = "Wybierz dźwięk do odtworzenia, gdy status jest ustawiony na alternatywnego przeznaczenia.";
$text['description-call_flow_alternate_sound']['pt-br'] = "Selecione o som para tocar quando o status é definido para o destino alternativo.";
$text['description-call_flow_alternate_sound']['pt-pt'] = "Selecione o som para tocar quando o status é definido como o destino alternativo.";
$text['description-call_flow_alternate_sound']['ro-ro'] = "";
$text['description-call_flow_alternate_sound']['ru-ru'] = "Выберите звук, который воспроизводится когда статус устанавливается в альтернативное направление.";
$text['description-call_flow_alternate_sound']['sv-se'] = "Välj ljud att spela när status är inställd på den alternativa destinationen.";
$text['description-call_flow_alternate_sound']['uk-ua'] = "Виберіть звук для відтворення , коли встановлено стан альтернативного призначення.";
$text['recordings']['en-us'] = "Recordings";
$text['recordings']['en-gb'] = "Recordings";
$text['recordings']['ar-eg'] = "";
$text['recordings']['de-at'] = "Aufnahmen"; //copied from de-de
$text['recordings']['de-ch'] = "Aufnahmen"; //copied from de-de
$text['recordings']['de-de'] = "Aufnahmen";
$text['recordings']['es-cl'] = "grabaciones";
$text['recordings']['es-mx'] = "grabaciones"; //copied from es-cl
$text['recordings']['fr-ca'] = "Enregistrements d'appels"; //copied from fr-fr
$text['recordings']['fr-fr'] = "Enregistrements d'appels";
$text['recordings']['he-il'] = "";
$text['recordings']['it-it'] = "Registrazioni";
$text['recordings']['nl-nl'] = "Opnamen";
$text['recordings']['pl-pl'] = "nagrania";
$text['recordings']['pt-br'] = "Gravações";
$text['recordings']['pt-pt'] = "gravações";
$text['recordings']['ro-ro'] = "";
$text['recordings']['ru-ru'] = "Записи";
$text['recordings']['sv-se'] = "inspelningar";
$text['recordings']['uk-ua'] = "записи";
$text['miscellaneous']['en-us'] = "Miscellaneous";
$text['miscellaneous']['en-gb'] = "Miscellaneous";
$text['miscellaneous']['ar-eg'] = "";
$text['miscellaneous']['de-at'] = "Sonstiges"; //copied from de-de
$text['miscellaneous']['de-ch'] = "Sonstiges"; //copied from de-de
$text['miscellaneous']['de-de'] = "Sonstiges";
$text['miscellaneous']['es-cl'] = "Diverso";
$text['miscellaneous']['es-mx'] = "Diverso"; //copied from es-cl
$text['miscellaneous']['fr-ca'] = "Divers"; //copied from fr-fr
$text['miscellaneous']['fr-fr'] = "Divers";
$text['miscellaneous']['he-il'] = "";
$text['miscellaneous']['it-it'] = "Varie";
$text['miscellaneous']['nl-nl'] = "Overigen";
$text['miscellaneous']['pl-pl'] = "Różne";
$text['miscellaneous']['pt-br'] = "Diversos";
$text['miscellaneous']['pt-pt'] = "Variado";
$text['miscellaneous']['ro-ro'] = "";
$text['miscellaneous']['ru-ru'] = "Разное";
$text['miscellaneous']['sv-se'] = "Diverse";
$text['miscellaneous']['uk-ua'] = "Різне";
$text['sounds']['en-us'] = "Sounds";
$text['sounds']['en-gb'] = "Sounds";
$text['sounds']['ar-eg'] = "";
$text['sounds']['de-at'] = "Ruftöne"; //copied from de-de
$text['sounds']['de-ch'] = "Ruftöne"; //copied from de-de
$text['sounds']['de-de'] = "Ruftöne";
$text['sounds']['es-cl'] = "Sonidos";
$text['sounds']['es-mx'] = "Sonidos"; //copied from es-cl
$text['sounds']['fr-ca'] = "des sons"; //copied from fr-fr
$text['sounds']['fr-fr'] = "des sons";
$text['sounds']['he-il'] = "";
$text['sounds']['it-it'] = "Audio";
$text['sounds']['nl-nl'] = "Geluiden";
$text['sounds']['pl-pl'] = "Dźwięki";
$text['sounds']['pt-br'] = "Sons"; //copied from pt-pt
$text['sounds']['pt-pt'] = "Sons";
$text['sounds']['ro-ro'] = "";
$text['sounds']['ru-ru'] = "Звуки";
$text['sounds']['sv-se'] = "Ljud";
$text['sounds']['uk-ua'] = "звуки";
?>

View File

@ -0,0 +1,31 @@
<?php
$y=0;
$apps[$x]['menu'][$y]['title']['en-us'] = "Call Flows";
$apps[$x]['menu'][$y]['title']['en-gb'] = "Call Flows";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
$apps[$x]['menu'][$y]['title']['de-at'] = "Anruf Steuerung";
$apps[$x]['menu'][$y]['title']['de-ch'] = "";
$apps[$x]['menu'][$y]['title']['de-de'] = "Anruf Steuerung";
$apps[$x]['menu'][$y]['title']['es-cl'] = "Flujo de Llamada";
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "Circulation d'Appel";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "cinématiques d'Appel";
$apps[$x]['menu'][$y]['title']['he-il'] = "";
$apps[$x]['menu'][$y]['title']['it-it'] = "Deviatori di Chiamata";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "Oproep besturing";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Przepływ rozmów";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Fluxo de chamadas";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Переключатель вызовов";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Samtalsflöden";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "Потоки дзвінків";
$apps[$x]['menu'][$y]['uuid'] = "b0939384-7055-44e8-8b4c-9f72293e1878";
$apps[$x]['menu'][$y]['parent_uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['path'] = "/app/call_flows/call_flows.php";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
$apps[$x]['menu'][$y]['groups'][] = "admin";
?>

View File

@ -0,0 +1,732 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Lewis Hallam <lewishallam80@gmail.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
//check permissions
require_once "resources/check_auth.php";
if (permission_exists('call_flow_add') || permission_exists('call_flow_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
$action = "update";
$call_flow_uuid = $_REQUEST["id"];
}
else {
$action = "add";
}
//initialize the destinations object
$destination = new destinations;
//get http post variables and set them to php variables
if (is_array($_POST)) {
//set the variables from the http values
$call_flow_uuid = $_POST["call_flow_uuid"];
$dialplan_uuid = $_POST["dialplan_uuid"];
$call_flow_name = $_POST["call_flow_name"];
$call_flow_extension = $_POST["call_flow_extension"];
$call_flow_feature_code = $_POST["call_flow_feature_code"];
$call_flow_status = $_POST["call_flow_status"];
$call_flow_pin_number = $_POST["call_flow_pin_number"];
$call_flow_label = $_POST["call_flow_label"];
$call_flow_sound = $_POST["call_flow_sound"];
$call_flow_destination = $_POST["call_flow_destination"];
$call_flow_alternate_label = $_POST["call_flow_alternate_label"];
$call_flow_alternate_sound = $_POST["call_flow_alternate_sound"];
$call_flow_alternate_destination = $_POST["call_flow_alternate_destination"];
$call_flow_context = $_POST["call_flow_context"];
$call_flow_enabled = $_POST["call_flow_enabled"];
$call_flow_description = $_POST["call_flow_description"];
//seperate the action and the param
$destination_array = explode(":", $call_flow_destination);
$call_flow_app = array_shift($destination_array);
$call_flow_data = join(':', $destination_array);
//seperate the action and the param call_flow_alternate_app
$alternate_destination_array = explode(":", $call_flow_alternate_destination);
$call_flow_alternate_app = array_shift($alternate_destination_array);
$call_flow_alternate_data = join(':', $alternate_destination_array);
}
//process the user data and save it to the database
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//get the uuid from the POST
if ($action == "update") {
$call_flow_uuid = $_POST["call_flow_uuid"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: call_flows.php');
exit;
}
//check for all required data
$msg = '';
//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."<br>\n"; }
//if (strlen($call_flow_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_uuid']."<br>\n"; }
//if (strlen($dialplan_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-dialplan_uuid']."<br>\n"; }
//if (strlen($call_flow_name) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_name']."<br>\n"; }
if (strlen($call_flow_extension) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_extension']."<br>\n"; }
if (strlen($call_flow_feature_code) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_feature_code']."<br>\n"; }
//if (strlen($call_flow_context) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_context']."<br>\n"; }
//if (strlen($call_flow_status) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_status']."<br>\n"; }
//if (strlen($call_flow_pin_number) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_pin_number']."<br>\n"; }
//if (strlen($call_flow_label) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_label']."<br>\n"; }
//if (strlen($call_flow_sound) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_sound']."<br>\n"; }
if (strlen($call_flow_app) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_app']."<br>\n"; }
if (strlen($call_flow_data) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_data']."<br>\n"; }
//if (strlen($call_flow_alternate_label) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_alternate_label']."<br>\n"; }
//if (strlen($call_flow_alternate_sound) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_alternate_sound']."<br>\n"; }
//if (strlen($call_flow_alternate_app) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_alternate_app']."<br>\n"; }
//if (strlen($call_flow_alternate_data) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_alternate_data']."<br>\n"; }
//if (strlen($call_flow_description) == 0) { $msg .= $text['message-required']." ".$text['label-call_flow_description']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "resources/footer.php";
return;
}
//add the call_flow_uuid
if (!is_uuid($call_flow_uuid)) {
$call_flow_uuid = uuid();
}
//add the dialplan_uuid
if (!is_uuid($dialplan_uuid)) {
$dialplan_uuid = uuid();
}
//set the default context
if (permission_exists("call_flow_context")) {
//allow a user assigned to super admin to change the call_flow_context
}
else {
//if the call_flow_context was not set then set the default value
$call_flow_context = $_SESSION['domain_name'];
}
//escape special characters
$destination_extension = $call_flow_extension;
$destination_extension = str_replace("*", "\*", $destination_extension);
$destination_extension = str_replace("+", "\+", $destination_extension);
$destination_feature = $call_flow_feature_code;
// Allows dial feature code as `flow+<feature_code>`
if (substr($destination_feature, 0, 5) != 'flow+') {
$destination_feature = '(?:flow+)?' . $destination_feature;
}
$destination_feature = str_replace("*", "\*", $destination_feature);
$destination_feature = str_replace("+", "\+", $destination_feature);
//build the xml dialplan
$dialplan_xml = "<extension name=\"".$call_flow_name."\" continue=\"\" uuid=\"".$dialplan_uuid."\">\n";
$dialplan_xml .= " <condition field=\"destination_number\" expression=\"^".$destination_feature."$\" break=\"on-true\">\n";
$dialplan_xml .= " <action application=\"answer\" data=\"\"/>\n";
$dialplan_xml .= " <action application=\"sleep\" data=\"200\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"feature_code=true\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"call_flow_uuid=".$call_flow_uuid."\"/>\n";
$dialplan_xml .= " <action application=\"lua\" data=\"call_flow.lua\"/>\n";
$dialplan_xml .= " </condition>\n";
$dialplan_xml .= " <condition field=\"destination_number\" expression=\"^".$destination_extension."$\">\n";
$dialplan_xml .= " <action application=\"set\" data=\"call_flow_uuid=".$call_flow_uuid."\"/>\n";
$dialplan_xml .= " <action application=\"lua\" data=\"call_flow.lua\"/>\n";
$dialplan_xml .= " </condition>\n";
$dialplan_xml .= "</extension>\n";
//set the row id
$i = 0;
//build the dialplan array
$array["dialplans"][$i]["domain_uuid"] = $_SESSION['domain_uuid'];
$array["dialplans"][$i]["dialplan_uuid"] = $dialplan_uuid;
$array["dialplans"][$i]["dialplan_name"] = $call_flow_name;
$array["dialplans"][$i]["dialplan_number"] = $call_flow_extension;
$array["dialplans"][$i]["dialplan_context"] = $call_flow_context;
$array["dialplans"][$i]["dialplan_continue"] = "false";
$array["dialplans"][$i]["dialplan_xml"] = $dialplan_xml;
$array["dialplans"][$i]["dialplan_order"] = "333";
$array["dialplans"][$i]["dialplan_enabled"] = $call_flow_enabled;
$array["dialplans"][$i]["dialplan_description"] = $call_flow_description;
$array["dialplans"][$i]["app_uuid"] = "b1b70f85-6b42-429b-8c5a-60c8b02b7d14";
$array["call_flows"][$i]["call_flow_uuid"] = $call_flow_uuid;
$array["call_flows"][$i]["domain_uuid"] = $_SESSION['domain_uuid'];
$array["call_flows"][$i]["dialplan_uuid"] = $dialplan_uuid;
$array["call_flows"][$i]["call_flow_name"] = $call_flow_name;
$array["call_flows"][$i]["call_flow_extension"] = $call_flow_extension;
$array["call_flows"][$i]["call_flow_feature_code"] = $call_flow_feature_code;
$array["call_flows"][$i]["call_flow_status"] = $call_flow_status;
$array["call_flows"][$i]["call_flow_pin_number"] = $call_flow_pin_number;
$array["call_flows"][$i]["call_flow_label"] = $call_flow_label;
$array["call_flows"][$i]["call_flow_sound"] = $call_flow_sound;
$array["call_flows"][$i]["call_flow_alternate_label"] = $call_flow_alternate_label;
$array["call_flows"][$i]["call_flow_alternate_sound"] = $call_flow_alternate_sound;
if ($destination->valid($call_flow_app.':'.$call_flow_data)) {
$array["call_flows"][$i]["call_flow_app"] = $call_flow_app;
$array["call_flows"][$i]["call_flow_data"] = $call_flow_data;
}
if ($destination->valid($call_flow_alternate_app.':'.$call_flow_alternate_data)) {
$array["call_flows"][$i]["call_flow_alternate_app"] = $call_flow_alternate_app;
$array["call_flows"][$i]["call_flow_alternate_data"] = $call_flow_alternate_data;
}
$array["call_flows"][$i]["call_flow_context"] = $call_flow_context;
$array["call_flows"][$i]["call_flow_enabled"] = $call_flow_enabled;
$array["call_flows"][$i]["call_flow_description"] = $call_flow_description;
//add the dialplan permission
$p = new permissions;
$p->add("dialplan_add", "temp");
$p->add("dialplan_edit", "temp");
//save to the data
$database = new database;
$database->app_name = 'call_flows';
$database->app_uuid = 'b1b70f85-6b42-429b-8c5a-60c8b02b7d14';
if (strlen($call_flow_uuid) > 0) {
$database->uuid($call_flow_uuid);
}
$database->save($array);
$message = $database->message;
//remove the temporary permission
$p->delete("dialplan_add", "temp");
$p->delete("dialplan_edit", "temp");
//debug info
//echo "<pre>";
//print_r($message);
//echo "</pre>";
//exit;
//apply settings reminder
$_SESSION["reload_xml"] = true;
//clear the cache
$cache = new cache;
$cache->delete("dialplan:".$call_flow_context);
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
//redirect the user
if (isset($action)) {
if ($action == "add") {
message::add($text['message-add']);
}
if ($action == "update") {
message::add($text['message-update']);
}
header("Location: call_flows.php");
return;
}
} //(is_array($_POST) && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
if (is_array($_GET) && $_POST["persistformvar"] != "true") {
$call_flow_uuid = $_GET["id"];
$sql = "select * from v_call_flows ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and call_flow_uuid = :call_flow_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['call_flow_uuid'] = $call_flow_uuid;
$database = new database;
$result = $database->select($sql, $parameters, 'all');
foreach ($result as $row) {
//set the php variables
$call_flow_uuid = $row["call_flow_uuid"];
$dialplan_uuid = $row["dialplan_uuid"];
$call_flow_name = $row["call_flow_name"];
$call_flow_extension = $row["call_flow_extension"];
$call_flow_feature_code = $row["call_flow_feature_code"];
$call_flow_context = $row["call_flow_context"];
$call_flow_status = $row["call_flow_status"];
$call_flow_pin_number = $row["call_flow_pin_number"];
$call_flow_label = $row["call_flow_label"];
$call_flow_sound = $row["call_flow_sound"];
$call_flow_app = $row["call_flow_app"];
$call_flow_data = $row["call_flow_data"];
$call_flow_alternate_label = $row["call_flow_alternate_label"];
$call_flow_alternate_sound = $row["call_flow_alternate_sound"];
$call_flow_alternate_app = $row["call_flow_alternate_app"];
$call_flow_alternate_data = $row["call_flow_alternate_data"];
$call_flow_enabled = $row["call_flow_enabled"];
$call_flow_description = $row["call_flow_description"];
//if superadmin show both the app and data
if (if_group("superadmin")) {
$destination_label = $call_flow_app.':'.$call_flow_data;
}
else {
$destination_label = $call_flow_data;
}
//if superadmin show both the app and data
if (if_group("superadmin")) {
$alternate_destination_label = $call_flow_alternate_app.':'.$call_flow_alternate_data;
}
else {
$alternate_destination_label = $call_flow_alternate_data;
}
}
unset ($sql, $parameters, $result, $row);
}
//set the context for users that are not in the superadmin group
if (strlen($call_flow_context) == 0) {
$call_flow_context = $_SESSION['domain_name'];
}
//get the recordings
$sql = "select recording_name, recording_filename from v_recordings ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "order by recording_name asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$recordings = $database->select($sql, $parameters, 'all');
unset($parameters, $sql);
if (if_group("superadmin")) {
echo "<script>\n";
echo "var Objs;\n";
echo "\n";
echo "function changeToInput(obj){\n";
echo " tb=document.createElement('INPUT');\n";
echo " tb.type='text';\n";
echo " tb.name=obj.name;\n";
echo " tb.setAttribute('class', 'formfld');\n";
//echo " tb.setAttribute('style', 'width: 380px;');\n";
echo " tb.value=obj.options[obj.selectedIndex].value;\n";
echo " tbb=document.createElement('INPUT');\n";
echo " tbb.setAttribute('class', 'btn');\n";
echo " tbb.setAttribute('style', 'margin-left: 4px;');\n";
echo " tbb.type='button';\n";
echo " tbb.value=$('<div />').html('&#9665;').text();\n";
echo " tbb.objs=[obj,tb,tbb];\n";
echo " tbb.onclick=function(){ Replace(this.objs); }\n";
echo " obj.parentNode.insertBefore(tb,obj);\n";
echo " obj.parentNode.insertBefore(tbb,obj);\n";
echo " obj.parentNode.removeChild(obj);\n";
echo "}\n";
echo "\n";
echo "function Replace(obj){\n";
echo " obj[2].parentNode.insertBefore(obj[0],obj[2]);\n";
echo " obj[0].parentNode.removeChild(obj[1]);\n";
echo " obj[0].parentNode.removeChild(obj[2]);\n";
echo "}\n";
echo "</script>\n";
echo "\n";
}
function sound_select_list($var, $name, $description_name, $load_sound=false) {
global $text, $recordings, $db;
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-' . $description_name]."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo "<select name='".escape($name)."' class='formfld' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null).">\n";
echo " <option value=''></option>\n";
//misc optgroup
if (if_group("superadmin")) {
echo "<optgroup label=".$text['miscellaneous'].">\n";
echo " <option value='say:'>say:</option>\n";
echo " <option value='tone_stream:'>tone_stream:</option>\n";
echo "</optgroup>\n";
}
//recordings
$tmp_selected = false;
if (count($recordings) > 0) {
echo "<optgroup label=".$text['recordings'].">\n";
foreach ($recordings as &$row) {
$recording_name = $row["recording_name"];
$recording_filename = $row["recording_filename"];
if ($var == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename && strlen($var) > 0) {
$tmp_selected = true;
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".escape($recording_filename)."' selected='selected'>".escape($recording_name)."</option>\n";
}
else if ($var == $recording_filename && strlen($var) > 0) {
$tmp_selected = true;
echo " <option value='".escape($recording_filename)."' selected='selected'>".escape($recording_name)."</option>\n";
}
else {
echo " <option value='".escape($recording_filename)."'>".escape($recording_name)."</option>\n";
}
}
echo "</optgroup>\n";
}
//phrases
$sql = "select * from v_phrases where domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$result = $database->select($sql, $parameters, 'all');
unset($parameters, $sql);
if (is_array($result)) {
echo "<optgroup label='Phrases'>\n";
foreach ($result as &$row) {
if ($var == "phrase:".$row["phrase_uuid"]) {
$tmp_selected = true;
echo " <option value='phrase:".escape($row["phrase_uuid"])."' selected='selected'>".escape($row["phrase_name"])."</option>\n";
}
else {
echo " <option value='phrase:".escape($row["phrase_uuid"])."'>".escape($row["phrase_name"])."</option>\n";
}
}
echo "</optgroup>\n";
}
//sounds
if ($load_sound) {
$file = new file;
$sound_files = $file->sounds();
if (is_array($sound_files)) {
echo "<optgroup label=".$text["sounds"].">\n";
foreach ($sound_files as $value) {
if (strlen($value) > 0) {
if (substr($var, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
$var = substr($var, 71);
}
if ($var == $value) {
$tmp_selected = true;
echo " <option value='".escape($value)."' selected='selected'>".escape($value)."</option>\n";
}
else {
echo " <option value='".escape($value)."'>".escape($value)."</option>\n";
}
}
}
echo "</optgroup>\n";
}
}
//select
if (if_group("superadmin")) {
if (!$tmp_selected && strlen($var) > 0) {
echo "<optgroup label='Selected'>\n";
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$var)) {
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".escape($var)."' selected='selected'>".escape($var)."</option>\n";
}
else if (substr($var, -3) == "wav" || substr($var, -3) == "mp3") {
echo " <option value='".escape($var)."' selected='selected'>".escape($var)."</option>\n";
}
else {
echo " <option value='".escape($var)."' selected='selected'>".escape($var)."</option>\n";
}
echo "</optgroup>\n";
}
unset($tmp_selected);
}
echo " </select>\n";
echo " <br />\n";
echo $text['description-' . $description_name]."\n";
echo "</td>\n";
echo "</tr>\n";
}
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
$document['title'] = $text['title-call_flow'];
require_once "resources/header.php";
//show the content
echo "<form name='frm' id='frm' method='post'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-call_flow']."</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'=>'call_flows.php']);
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','style'=>'margin-left: 15px;']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\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='nowrap'>\n";
echo " ".$text['label-call_flow_name']."\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_name' maxlength='255' value=\"".escape($call_flow_name)."\">\n";
echo "<br />\n";
echo $text['description-call_flow_name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_extension']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_extension' maxlength='255' value=\"".escape($call_flow_extension)."\">\n";
echo "<br />\n";
echo $text['description-call_flow_extension']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_feature_code']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_feature_code' maxlength='255' value=\"".escape($call_flow_feature_code)."\">\n";
echo "<br />\n";
echo $text['description-call_flow_feature_code']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_status']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='call_flow_status'>\n";
echo " <option value=''></option>\n";
if ($call_flow_status == "true") {
if (strlen($call_flow_label) > 0) {
echo " <option value='true' selected='selected'>".escape($call_flow_label)."</option>\n";
}
else {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
}
else {
if (strlen($call_flow_label) > 0) {
echo " <option value='true'>".escape($call_flow_label)."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
}
if ($call_flow_status == "false") {
if (strlen($call_flow_alternate_label) > 0) {
echo " <option value='false' selected='selected'>".escape($call_flow_alternate_label)."</option>\n";
}
else {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
}
else {
if (strlen($call_flow_alternate_label) > 0) {
echo " <option value='false'>".escape($call_flow_alternate_label)."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
}
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-call_flow_status']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_pin_number']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_pin_number' maxlength='255' value=\"".escape($call_flow_pin_number)."\">\n";
echo "<br />\n";
echo $text['description-call_flow_pin_number']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_label']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_label' maxlength='255' value=\"".escape($call_flow_label)."\">\n";
echo "<br />\n";
echo $text['description-call_flow_label']."\n";
echo "</td>\n";
echo "</tr>\n";
sound_select_list($call_flow_sound, 'call_flow_sound', 'call_flow_sound', true);
/*
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_sound']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_sound' maxlength='255' value=\"".escape($call_flow_sound)."\">\n";
echo "<br />\n";
echo $text['description-call_flow_sound']."\n";
echo "</td>\n";
echo "</tr>\n";
*/
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_destination']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$select_value = '';
//set the selected value
if (strlen($call_flow_app.$call_flow_data) > 0) {
$select_value = $call_flow_app.':'.$call_flow_data;
}
//show the destination list
echo $destination->select('dialplan', 'call_flow_destination', $select_value);
unset($select_value);
echo "<br />\n";
echo $text['description-call_flow_destination']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_alternate_label']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_alternate_label' maxlength='255' value=\"".escape($call_flow_alternate_label)."\">\n";
echo "<br />\n";
echo $text['description-call_flow_alternate_label']."\n";
echo "</td>\n";
echo "</tr>\n";
sound_select_list($call_flow_alternate_sound, 'call_flow_alternate_sound', 'call_flow_alternate_sound', true);
/*
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_alternate_sound']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_alternate_sound' maxlength='255' value=\"".escape($call_flow_alternate_sound)."\">\n";
echo "<br />\n";
echo $text['description-call_flow_alternate_sound']."\n";
echo "</td>\n";
echo "</tr>\n";
*/
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_alternate_destination']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$select_value = '';
if (strlen($call_flow_alternate_app.$call_flow_alternate_data) > 0) {
$select_value = $call_flow_alternate_app.':'.$call_flow_alternate_data;
}
echo $destination->select('dialplan', 'call_flow_alternate_destination', $select_value);
unset($select_value);
echo "<br />\n";
echo $text['description-call_flow_alternate_destination']."\n";
echo "</td>\n";
echo "</tr>\n";
if (permission_exists('call_flow_context')) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_context']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_context' maxlength='255' value=\"".escape($call_flow_context)."\">\n";
echo "<br />\n";
echo $text['description-call_flow_context']."\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo "<td width=\"30%\" class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-enabled']."\n";
echo "</td>\n";
echo "<td width=\"70%\" class='vtable' align='left'>\n";
echo " <select class='formfld' name='call_flow_enabled'>\n";
if ($call_flow_enabled == "true") {
echo " <option value='true' selected='selected'>".$text['option-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['option-true']."</option>\n";
}
if ($call_flow_enabled == "false") {
echo " <option value='false' selected='selected'>".$text['option-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['option-false']."</option>\n";
}
echo " </select>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-call_flow_description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_description' maxlength='255' value=\"".escape($call_flow_description)."\">\n";
echo "<br />\n";
echo $text['description-call_flow_description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "<br /><br />";
if ($action == "update") {
echo "<input type='hidden' name='call_flow_uuid' value='".escape($call_flow_uuid)."'>\n";
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>";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,303 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2020
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/paging.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('call_flow_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get posted data
if (is_array($_POST['call_flows'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$call_flows = $_POST['call_flows'];
$toggle_field = $_POST['toggle_field'];
}
//process the http post data by action
if ($action != '' && is_array($call_flows) && @sizeof($call_flows) != 0) {
switch ($action) {
case 'copy':
if (permission_exists('call_flow_add')) {
$obj = new call_flows;
$obj->copy($call_flows);
}
break;
case 'toggle':
if (permission_exists('call_flow_edit')) {
$obj = new call_flows;
$obj->toggle_field = $toggle_field;
$obj->toggle($call_flows);
}
break;
case 'delete':
if (permission_exists('call_flow_delete')) {
$obj = new call_flows;
$obj->delete($call_flows);
}
break;
}
header('Location: call_flows.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
}
//get variables used to control the order
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//add the search term
$search = strtolower($_GET["search"]);
if (strlen($search) > 0) {
$sql_search = "and (";
$sql_search .= "lower(call_flow_name) like :search ";
$sql_search .= "or lower(call_flow_extension) like :search ";
$sql_search .= "or lower(call_flow_feature_code) like :search ";
$sql_search .= "or lower(call_flow_context) like :search ";
$sql_search .= "or lower(call_flow_pin_number) like :search ";
$sql_search .= "or lower(call_flow_label) like :search ";
$sql_search .= "or lower(call_flow_alternate_label) like :search ";
$sql_search .= "or lower(call_flow_description) like :search ";
$sql_search .= ") ";
$parameters['search'] = '%'.$search.'%';
}
//prepare to page the results
$sql = "select count(*) from v_call_flows ";
$sql .= "where true ";
if ($_GET['show'] != "all" || !permission_exists('call_flow_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
$sql .= $sql_search;
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
//prepare to page the results
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = "&search=".urlencode($search);
if ($_GET['show'] == "all" && permission_exists('call_flow_all')) {
$param .= "&show=all";
}
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
$offset = $rows_per_page * $page;
//get the list
$sql = str_replace('count(*)', '*', $sql);
$sql .= order_by($order_by, $order, 'call_flow_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$call_flows = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//include header
$document['title'] = $text['title-call_flows'];
require_once "resources/header.php";
//javascript for toggle select box
echo "<script language='javascript' type='text/javascript'>\n";
echo " function toggle_select() {\n";
echo " $('#call_flow_feature').fadeToggle(400, function() {\n";
echo " document.getElementById('call_flow_feature').selectedIndex = 0;\n";
echo " document.getElementById('call_flow_feature').focus();\n";
echo " });\n";
echo " }\n";
echo "</script>\n";
//show the content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-call_flows']." (".$num_rows.")</b></div>\n";
echo " <div class='actions'>\n";
if (permission_exists('call_flow_add')) {
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','link'=>'call_flow_edit.php']);
}
if (permission_exists('call_flow_add') && $call_flows) {
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
}
if (permission_exists('call_flow_edit') && $call_flows) {
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'id'=>'btn_toggle','name'=>'btn_toggle','style'=>'display: none;','onclick'=>"toggle_select(); this.blur();"]);
echo "<select class='formfld' style='display: none; width: auto;' id='call_flow_feature' onchange=\"if (this.selectedIndex != 0) { modal_open('modal-toggle','btn_toggle'); }\">";
echo " <option value='' selected='selected'>".$text['label-select']."</option>";
echo " <option value='call_flow_status'>".$text['label-call_flow_status']."</option>";
echo " <option value='call_flow_enabled'>".$text['label-enabled']."</option>";
echo " </select>";
}
if (permission_exists('call_flow_delete') && $call_flows) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('call_flow_all')) {
if ($_GET['show'] == 'all') {
echo " <input type='hidden' name='show' value='all'>";
}
else {
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?type=&show=all'.($search != '' ? "&search=".urlencode($search) : null)]);
}
}
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'call_flows.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
}
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if (permission_exists('call_flow_add') && $call_flows) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
}
if (permission_exists('call_flow_edit') && $call_flows) {
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(); document.getElementById('toggle_field').value = document.getElementById('call_flow_feature').options[document.getElementById('call_flow_feature').selectedIndex].value; list_action_set('toggle'); list_form_submit('form_list');"])]);
}
if (permission_exists('call_flow_delete') && $call_flows) {
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');"])]);
}
echo $text['description-call_flows']."\n";
echo "<br /><br />\n";
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' id='toggle_field' name='toggle_field' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('call_flow_add') || permission_exists('call_flow_edit') || permission_exists('call_flow_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($call_flows ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
if ($_GET['show'] == "all" && permission_exists('call_flow_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
}
echo th_order_by('call_flow_name', $text['label-call_flow_name'], $order_by, $order);
echo th_order_by('call_flow_extension', $text['label-call_flow_extension'], $order_by, $order);
echo th_order_by('call_flow_feature_code', $text['label-call_flow_feature_code'], $order_by, $order);
echo th_order_by('call_flow_status', $text['label-call_flow_status'], $order_by, $order);
if (permission_exists('call_flow_context')) {
echo th_order_by('call_flow_context', $text['label-call_flow_context'], $order_by, $order);
}
echo th_order_by('call_flow_enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
echo th_order_by('call_flow_description', $text['label-call_flow_description'], $order_by, $order, null, "class='hide-sm-dn'");
if (permission_exists('call_flow_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($call_flows)) {
$x = 0;
foreach ($call_flows as $row) {
if (permission_exists('call_flow_edit')) {
$list_row_url = "call_flow_edit.php?id=".urlencode($row['call_flow_uuid']);
}
echo "<tr class='list-row' href='".$list_row_url."'>\n";
if (permission_exists('call_flow_add') || permission_exists('call_flow_edit') || permission_exists('call_flow_delete')) {
echo " <td class='checkbox'>\n";
echo " <input type='checkbox' name='call_flows[$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='call_flows[$x][uuid]' value='".escape($row['call_flow_uuid'])."' />\n";
echo " </td>\n";
}
if ($_GET['show'] == "all" && permission_exists('call_flow_all')) {
if (strlen($_SESSION['domains'][$row['domain_uuid']]['domain_name']) > 0) {
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
}
else {
$domain = $text['label-global'];
}
echo " <td>".escape($domain)."</td>\n";
}
echo " <td><a href='".$list_row_url."'>".escape($row['call_flow_name'])."</a>&nbsp;</td>\n";
echo " <td>".escape($row['call_flow_extension'])."&nbsp;</td>\n";
echo " <td>".escape($row['call_flow_feature_code'])."&nbsp;</td>\n";
$status_label = $row['call_flow_status'] != 'false' ? $row['call_flow_label'] : $row['call_flow_alternate_label'];
if (permission_exists('call_flow_edit')) {
echo " <td class='no-link'>";
echo button::create(['type'=>'submit','class'=>'link','label'=>escape($status_label),'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); document.getElementById('toggle_field').value = 'call_flow_status'; list_form_submit('form_list')"]);
}
else {
echo " <td>";
echo escape($status_label);
}
echo " </td>\n";
if (permission_exists('call_flow_context')) {
echo " <td>".escape($row['call_flow_context'])."&nbsp;</td>\n";
}
if (permission_exists('call_flow_edit')) {
echo " <td class='no-link center'>";
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($row['call_flow_enabled'] == "true" ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); document.getElementById('toggle_field').value = 'call_flow_enabled'; list_form_submit('form_list')"]);
}
else {
echo " <td class='center'>";
echo escape($row['call_flow_enabled']);
}
echo " <td class='description overflow hide-sm-dn'>".escape($row['call_flow_description'])."&nbsp;</td>\n";
if (permission_exists('call_flow_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";
}
echo "</tr>\n";
$x++;
}
unset($call_flows);
}
echo "</table>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,425 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008 - 2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//define the call_flows class
if (!class_exists('call_flows')) {
class call_flows {
/**
* declare public variables
*/
public $toggle_field;
/**
* declare private variables
*/
private $app_name;
private $app_uuid;
private $permission_prefix;
private $list_page;
private $table;
private $uuid_prefix;
private $toggle_values;
/**
* called when the object is created
*/
public function __construct() {
//assign private variables
$this->app_name = 'call_flows';
$this->app_uuid = 'b1b70f85-6b42-429b-8c5a-60c8b02b7d14';
$this->permission_prefix = 'call_flow_';
$this->list_page = 'call_flows.php';
$this->table = 'call_flows';
$this->uuid_prefix = 'call_flow_';
$this->toggle_values = ['true','false'];
}
/**
* called when there are no references to a particular object
* unset the variables used in the class
*/
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
/**
* delete records
*/
public function delete($records) {
if (permission_exists($this->permission_prefix.'delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//delete multiple records
if (is_array($records) && @sizeof($records) != 0) {
//filter out unchecked call flows, build where clause for below
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//get necessary call flow details
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select ".$this->uuid_prefix."uuid as uuid, dialplan_uuid, call_flow_context from v_".$this->table." ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
$call_flows[$row['uuid']]['dialplan_uuid'] = $row['dialplan_uuid'];
$call_flow_contexts[] = $row['call_flow_context'];
}
}
unset($sql, $parameters, $rows, $row);
}
//build the delete array
$x = 0;
foreach ($call_flows as $call_flow_uuid => $call_flow) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $call_flow_uuid;
$array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['dialplans'][$x]['dialplan_uuid'] = $call_flow['dialplan_uuid'];
$array['dialplans'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['dialplan_details'][$x]['dialplan_uuid'] = $call_flow['dialplan_uuid'];
$array['dialplan_details'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$x++;
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
//grant temporary permissions
$p = new permissions;
$p->add('dialplan_delete', 'temp');
$p->add('dialplan_detail_delete', 'temp');
//execute delete
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->delete($array);
unset($array);
//revoke temporary permissions
$p->delete('dialplan_delete', 'temp');
$p->delete('dialplan_detail_delete', 'temp');
//apply settings reminder
$_SESSION["reload_xml"] = true;
//clear the cache
if (is_array($call_flow_contexts) && @sizeof($call_flow_contexts) != 0) {
$call_flow_contexts = array_unique($call_flow_contexts);
$cache = new cache;
foreach ($call_flow_contexts as $call_flow_context) {
$cache->delete("dialplan:".$call_flow_context);
}
}
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
//set message
message::add($text['message-delete']);
}
unset($records);
}
}
}
/**
* toggle records
*/
public function toggle($records) {
if (permission_exists($this->permission_prefix.'edit')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//toggle the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get current toggle state
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select ".$this->uuid_prefix."uuid as uuid, ".$this->toggle_field." as toggle, ";
$sql .= "dialplan_uuid, call_flow_feature_code, call_flow_context from v_".$this->table." ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
$call_flows[$row['uuid']]['state'] = $row['toggle'];
$call_flows[$row['uuid']]['dialplan_uuid'] = $row['dialplan_uuid'];
$call_flows[$row['uuid']]['call_flow_feature_code'] = $row['call_flow_feature_code'];
$call_flow_contexts[] = $row['call_flow_context'];
}
}
unset($sql, $parameters, $rows, $row);
}
//build update array
$x = 0;
foreach($call_flows as $uuid => $call_flow) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
$array[$this->table][$x][$this->toggle_field] = $call_flow['state'] == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
if ($this->toggle_field == 'call_flow_enabled') {
$array['dialplans'][$x]['dialplan_uuid'] = $call_flow['dialplan_uuid'];
$array['dialplans'][$x]['dialplan_enabled'] = $call_flow['state'] == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
}
$x++;
}
//save the changes
if (is_array($array) && @sizeof($array) != 0) {
//grant temporary permissions
$p = new permissions;
$p->add('dialplan_edit', 'temp');
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('dialplan_edit', 'temp');
//apply settings reminder
$_SESSION["reload_xml"] = true;
//clear the cache
if (is_array($call_flow_contexts) && @sizeof($call_flow_contexts) != 0) {
$call_flow_contexts = array_unique($call_flow_contexts);
$cache = new cache;
foreach ($call_flow_contexts as $call_flow_context) {
$cache->delete("dialplan:".$call_flow_context);
}
}
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
//set message
message::add($text['message-toggle']);
}
unset($records);
//toggle the presence
if ($this->toggle_field != 'call_flow_enabled') {
foreach($call_flows as $uuid => $row) {
//prepare the event
$cmd = "sendevent PRESENCE_IN\n";
$cmd .= "proto: flow\n";
$cmd .= "login: ".$row['call_flow_feature_code']."@".$_SESSION['domain_name']."\n";
$cmd .= "from: ".$row['call_flow_feature_code']."@".$_SESSION['domain_name']."\n";
$cmd .= "status: Active (1 waiting)\n";
$cmd .= "rpid: unknown\n";
$cmd .= "event_type: presence\n";
$cmd .= "alt_event_type: dialog\n";
$cmd .= "event_count: 1\n";
$cmd .= "unique-id: ".uuid()."\n";
$cmd .= "Presence-Call-Direction: outbound\n";
if ($call_flow['state'] == 'true') {
$cmd .= "answer-state: confirmed\n";
}
else {
$cmd .= "answer-state: terminated\n";
}
//send the event
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
$switch_result = event_socket_request($fp, $cmd);
}
}
unset($call_flows);
}
}
}
/**
* copy records
*/
public function copy($records) {
if (permission_exists($this->permission_prefix.'add')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//copy the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get checked records
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//create insert array from existing data
if (is_array($uuids) && @sizeof($uuids) != 0) {
//primary table
$sql = "select * from v_".$this->table." ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $x => $row) {
$new_call_flow_uuid = uuid();
$new_dialplan_uuid = uuid();
//copy data
$array[$this->table][$x] = $row;
//overwrite
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $new_call_flow_uuid;
$array[$this->table][$x]['dialplan_uuid'] = $new_dialplan_uuid;
$array[$this->table][$x]['call_flow_description'] = trim($row['call_flow_description'].' ('.$text['label-copy'].')');
//call flow dialplan record
$sql_2 = "select * from v_dialplans where dialplan_uuid = :dialplan_uuid";
$parameters_2['dialplan_uuid'] = $row['dialplan_uuid'];
$database = new database;
$dialplan = $database->select($sql_2, $parameters_2, 'row');
if (is_array($dialplan) && @sizeof($dialplan) != 0) {
//copy data
$array['dialplans'][$x] = $dialplan;
//overwrite
$array['dialplans'][$x]['dialplan_uuid'] = $new_dialplan_uuid;
$dialplan_xml = $dialplan['dialplan_xml'];
$dialplan_xml = str_replace($row['call_flow_uuid'], $new_call_flow_uuid, $dialplan_xml); //replace source call_flow_uuid with new
$dialplan_xml = str_replace($dialplan['dialplan_uuid'], $new_dialplan_uuid, $dialplan_xml); //replace source dialplan_uuid with new
$array['dialplans'][$x]['dialplan_xml'] = $dialplan_xml;
$array['dialplans'][$x]['dialplan_description'] = trim($dialplan['dialplan_description'].' ('.$text['label-copy'].')');
}
unset($sql_2, $parameters_2, $dialplan);
//create call flow context array
$call_flow_contexts = $row['call_flow_context'];
}
}
unset($sql, $parameters, $rows, $row);
}
//save the changes and set the message
if (is_array($array) && @sizeof($array) != 0) {
//grant temporary permissions
$p = new permissions;
$p->add('dialplan_add', 'temp');
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('dialplan_add', 'temp');
//apply settings reminder
$_SESSION["reload_xml"] = true;
//clear the cache
if (is_array($call_flow_contexts) && @sizeof($call_flow_contexts) != 0) {
$call_flow_contexts = array_unique($call_flow_contexts);
$cache = new cache;
foreach ($call_flow_contexts as $call_flow_context) {
$cache->delete("dialplan:".$call_flow_context);
}
}
//set message
message::add($text['message-copy']);
}
unset($records);
}
}
} //method
} //class
}
?>

90
app/call_flows/root.php Normal file
View File

@ -0,0 +1,90 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,84 @@
<?php
//application details
$apps[$x]['name'] = "Call Forward";
$apps[$x]['uuid'] = "19806921-e8ed-dcff-b325-dd3e5da4959d";
$apps[$x]['category'] = "Switch";;
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.2";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Call Forward, Follow Me and Do Not Disturb.";
$apps[$x]['description']['en-gb'] = "Call Forward, Follow Me and Do Not Disturb.";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Anrufweiterleitung, Follow Me und Nicht-Stören.";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Anrufweiterleitung, Follow Me und Nicht-Stören.";
$apps[$x]['description']['es-cl'] = "Reenvio de llamada, Sígueme y No Molestar.";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "";
$apps[$x]['description']['fr-fr'] = "Renvoi d'appel, Follow Me et ne pas deranger.";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "Oproep doorsturen, Volg mij en Niet storen";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "Desvio de chamadas, Siga-me e Não perturbe (DND).";
$apps[$x]['description']['pt-pt'] = "Desvio de Chamadas, Seguir-me e Não Perturbar.";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "follow_me";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$apps[$x]['permissions'][$y]['groups'][] = "agent";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_forward";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$apps[$x]['permissions'][$y]['groups'][] = "agent";
$y++;
$apps[$x]['permissions'][$y]['name'] = "do_not_disturb";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$apps[$x]['permissions'][$y]['groups'][] = "agent";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_forward_all";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
//default settings
$y=0;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "655447f1-e969-4885-b3da-28889b531568";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "follow_me";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "follow_me_autocomplete";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
$apps[$x]['default_settings'][$y]['default_setting_order'] = "0";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "follow me destinations autocomplete list. true=autocomplete On, false=autocomplete Off";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "4fedc226-caca-4ebf-b4eb-31de93e5bed3";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "follow_me";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "max_destinations";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "5";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
$apps[$x]['default_settings'][$y]['default_setting_order'] = "0";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the maximum number of Follow Me Destinations.";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "ce105d64-2d1b-4d19-ae34-ccb818cc9c6e";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "follow_me";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "timeout";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "30";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
$apps[$x]['default_settings'][$y]['default_setting_order'] = "0";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the default Follow Me Timeout value.";
?>

View File

@ -0,0 +1,31 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2016
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//process this only one time
if ($domains_processed == 1) {
}
?>

View File

@ -0,0 +1,970 @@
<?php
#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
$text['title-call_forward']['en-us'] = "Call Forward";
$text['title-call_forward']['en-gb'] = "Call Forward";
$text['title-call_forward']['ar-eg'] = "";
$text['title-call_forward']['de-at'] = "Rufumleitung"; //copied from de-de
$text['title-call_forward']['de-ch'] = "Rufumleitung"; //copied from de-de
$text['title-call_forward']['de-de'] = "Rufumleitung";
$text['title-call_forward']['es-cl'] = "Reenvio de Llamadas";
$text['title-call_forward']['es-mx'] = "Reenvio de Llamadas"; //copied from es-cl
$text['title-call_forward']['fr-ca'] = "Renvoi d'appel"; //copied from fr-fr
$text['title-call_forward']['fr-fr'] = "Renvoi d'appel";
$text['title-call_forward']['he-il'] = "";
$text['title-call_forward']['it-it'] = "Inoltro";
$text['title-call_forward']['nl-nl'] = "Oproep doorsturen";
$text['title-call_forward']['pl-pl'] = "Przekierowanie";
$text['title-call_forward']['pt-br'] = "Encaminhamento de chamadas";
$text['title-call_forward']['pt-pt'] = "Encaminhamento de Chamadas";
$text['title-call_forward']['ro-ro'] = "";
$text['title-call_forward']['ru-ru'] = "Переадресация";
$text['title-call_forward']['sv-se'] = "Vidarekoppling";
$text['title-call_forward']['uk-ua'] = "Переадресація";
$text['header-call_forward']['en-us'] = "Call Forward";
$text['header-call_forward']['en-gb'] = "Call Forward";
$text['header-call_forward']['ar-eg'] = "";
$text['header-call_forward']['de-at'] = "Rufumleitung"; //copied from de-de
$text['header-call_forward']['de-ch'] = "Rufumleitung"; //copied from de-de
$text['header-call_forward']['de-de'] = "Rufumleitung";
$text['header-call_forward']['es-cl'] = "Reenvio de Llamadas";
$text['header-call_forward']['es-mx'] = "Reenvio de Llamadas"; //copied from es-cl
$text['header-call_forward']['fr-ca'] = "Renvoi d'appel"; //copied from fr-fr
$text['header-call_forward']['fr-fr'] = "Renvoi d'appel";
$text['header-call_forward']['he-il'] = "";
$text['header-call_forward']['it-it'] = "Inoltro";
$text['header-call_forward']['nl-nl'] = "Oproep doorsturen";
$text['header-call_forward']['pl-pl'] = "Przekierowanie";
$text['header-call_forward']['pt-br'] = "Encaminhamento de chamadas";
$text['header-call_forward']['pt-pt'] = "Encaminhamento de Chamadas";
$text['header-call_forward']['ro-ro'] = "";
$text['header-call_forward']['ru-ru'] = "Переадресация";
$text['header-call_forward']['sv-se'] = "Vidarekoppling";
$text['header-call_forward']['uk-ua'] = "Переадресація";
$text['table-tools']['en-us'] = "Tools";
$text['table-tools']['en-gb'] = "Tools";
$text['table-tools']['ar-eg'] = "";
$text['table-tools']['de-at'] = "Funktionen"; //copied from de-de
$text['table-tools']['de-ch'] = "Funktionen"; //copied from de-de
$text['table-tools']['de-de'] = "Funktionen";
$text['table-tools']['es-cl'] = "Herramientas";
$text['table-tools']['es-mx'] = "Herramientas"; //copied from es-cl
$text['table-tools']['fr-ca'] = "Outils"; //copied from fr-fr
$text['table-tools']['fr-fr'] = "Outils";
$text['table-tools']['he-il'] = "";
$text['table-tools']['it-it'] = "Strumenti";
$text['table-tools']['nl-nl'] = "Gereedschappen";
$text['table-tools']['pl-pl'] = "Narzędzia";
$text['table-tools']['pt-br'] = "Ferramentas"; //copied from pt-pt
$text['table-tools']['pt-pt'] = "Ferramentas";
$text['table-tools']['ro-ro'] = "";
$text['table-tools']['ru-ru'] = "Инструменты";
$text['table-tools']['sv-se'] = "Verktyg";
$text['table-tools']['uk-ua'] = "Інструменти";
$text['table-extension']['en-us'] = "Extension";
$text['table-extension']['en-gb'] = "Extension";
$text['table-extension']['ar-eg'] = "";
$text['table-extension']['de-at'] = "Nebenstelle"; //copied from de-de
$text['table-extension']['de-ch'] = "Nebenstelle"; //copied from de-de
$text['table-extension']['de-de'] = "Nebenstelle";
$text['table-extension']['es-cl'] = "Extensión";
$text['table-extension']['es-mx'] = "Extensión"; //copied from es-cl
$text['table-extension']['fr-ca'] = "Extension"; //copied from fr-fr
$text['table-extension']['fr-fr'] = "Extension";
$text['table-extension']['he-il'] = "";
$text['table-extension']['it-it'] = "Interno";
$text['table-extension']['nl-nl'] = "Toestel";
$text['table-extension']['pl-pl'] = "Numer wewnętrzny";
$text['table-extension']['pt-br'] = "Ramal";
$text['table-extension']['pt-pt'] = "Extensão";
$text['table-extension']['ro-ro'] = "";
$text['table-extension']['ru-ru'] = "Внутренний номер";
$text['table-extension']['sv-se'] = "Anknytning";
$text['table-extension']['uk-ua'] = "Розширення (Extention)";
$text['table-description']['en-us'] = "Description";
$text['table-description']['en-gb'] = "Description";
$text['table-description']['ar-eg'] = "";
$text['table-description']['de-at'] = "Beschreibung"; //copied from de-de
$text['table-description']['de-ch'] = "Beschreibung"; //copied from de-de
$text['table-description']['de-de'] = "Beschreibung";
$text['table-description']['es-cl'] = "Descripción";
$text['table-description']['es-mx'] = "Descripción"; //copied from es-cl
$text['table-description']['fr-ca'] = "Description"; //copied from fr-fr
$text['table-description']['fr-fr'] = "Description";
$text['table-description']['he-il'] = "";
$text['table-description']['it-it'] = "Descrizione";
$text['table-description']['nl-nl'] = "Omschrijving";
$text['table-description']['pl-pl'] = "Opis";
$text['table-description']['pt-br'] = "Descrição"; //copied from pt-pt
$text['table-description']['pt-pt'] = "Descrição";
$text['table-description']['ro-ro'] = "";
$text['table-description']['ru-ru'] = "Описание";
$text['table-description']['sv-se'] = "Beskrivning";
$text['table-description']['uk-ua'] = "Опис";
$text['label-ring-timeout']['en-us'] = "Timeout";
$text['label-ring-timeout']['en-gb'] = "Timeout";
$text['label-ring-timeout']['ar-eg'] = "";
$text['label-ring-timeout']['de-at'] = "Abwurfzeit"; //copied from de-de
$text['label-ring-timeout']['de-ch'] = "Abwurfzeit"; //copied from de-de
$text['label-ring-timeout']['de-de'] = "Abwurfzeit";
$text['label-ring-timeout']['es-cl'] = "Timeout";
$text['label-ring-timeout']['es-mx'] = "Timeout"; //copied from es-cl
$text['label-ring-timeout']['fr-ca'] = "Timeout"; //copied from fr-fr
$text['label-ring-timeout']['fr-fr'] = "Timeout";
$text['label-ring-timeout']['he-il'] = "";
$text['label-ring-timeout']['it-it'] = "Timeout";
$text['label-ring-timeout']['nl-nl'] = "Timeout";
$text['label-ring-timeout']['pl-pl'] = "Przekroczenie czasu oczekiwania ";
$text['label-ring-timeout']['pt-br'] = "Tempo limite";
$text['label-ring-timeout']['pt-pt'] = "Timeout";
$text['label-ring-timeout']['ro-ro'] = "";
$text['label-ring-timeout']['ru-ru'] = "Тайм-аут";
$text['label-ring-timeout']['sv-se'] = "Tidsgräns";
$text['label-ring-timeout']['uk-ua'] = "Таймаут";
$text['label-ring-order']['en-us'] = "Ring Order";
$text['label-ring-order']['en-gb'] = "Ring Order";
$text['label-ring-order']['ar-eg'] = "";
$text['label-ring-order']['de-at'] = "Ruf Reihenfolge"; //copied from de-de
$text['label-ring-order']['de-ch'] = "Ruf Reihenfolge"; //copied from de-de
$text['label-ring-order']['de-de'] = "Ruf Reihenfolge";
$text['label-ring-order']['es-cl'] = "Solicitar Llamado";
$text['label-ring-order']['es-mx'] = "Solicitar Llamado"; //copied from es-cl
$text['label-ring-order']['fr-ca'] = "Ordre de sonnerie"; //copied from fr-fr
$text['label-ring-order']['fr-fr'] = "Ordre de sonnerie";
$text['label-ring-order']['he-il'] = "";
$text['label-ring-order']['it-it'] = "Ordine di Squillo";
$text['label-ring-order']['nl-nl'] = "Oproep volgorde";
$text['label-ring-order']['pl-pl'] = "Kolejność dzwonienia";
$text['label-ring-order']['pt-br'] = "Solicitar chamada";
$text['label-ring-order']['pt-pt'] = "Pedir Chamada";
$text['label-ring-order']['ro-ro'] = "";
$text['label-ring-order']['ru-ru'] = "Последовательность вызовов";
$text['label-ring-order']['sv-se'] = "Ring Ordning";
$text['label-ring-order']['uk-ua'] = "Послідовність набору";
$text['label-ring-delay']['en-us'] = "Delay";
$text['label-ring-delay']['en-gb'] = "Delay";
$text['label-ring-delay']['ar-eg'] = "";
$text['label-ring-delay']['de-at'] = "Verzögerung"; //copied from de-de
$text['label-ring-delay']['de-ch'] = "Verzögerung"; //copied from de-de
$text['label-ring-delay']['de-de'] = "Verzögerung";
$text['label-ring-delay']['es-cl'] = "Retardo";
$text['label-ring-delay']['es-mx'] = "Retardo"; //copied from es-cl
$text['label-ring-delay']['fr-ca'] = "Délais"; //copied from fr-fr
$text['label-ring-delay']['fr-fr'] = "Délais";
$text['label-ring-delay']['he-il'] = "";
$text['label-ring-delay']['it-it'] = "Ritardo";
$text['label-ring-delay']['nl-nl'] = "Vertraging";
$text['label-ring-delay']['pl-pl'] = "Opóznienie";
$text['label-ring-delay']['pt-br'] = "Atraso"; //copied from pt-pt
$text['label-ring-delay']['pt-pt'] = "Atraso";
$text['label-ring-delay']['ro-ro'] = "";
$text['label-ring-delay']['ru-ru'] = "Задержка";
$text['label-ring-delay']['sv-se'] = "Fördröjning";
$text['label-ring-delay']['uk-ua'] = "Затримка";
$text['label-prompt']['en-us'] = "Prompt to accept the call";
$text['label-prompt']['en-gb'] = "Prompt to accept the call";
$text['label-prompt']['ar-eg'] = "";
$text['label-prompt']['de-at'] = "Ansage um den Anruf anzunehmen"; //copied from de-de
$text['label-prompt']['de-ch'] = "Ansage um den Anruf anzunehmen"; //copied from de-de
$text['label-prompt']['de-de'] = "Ansage um den Anruf anzunehmen";
$text['label-prompt']['es-cl'] = "Preguntar para aceptar una llamada";
$text['label-prompt']['es-mx'] = "Preguntar para aceptar una llamada"; //copied from es-cl
$text['label-prompt']['fr-ca'] = "Annonce pour accepter l'appel"; //copied from fr-fr
$text['label-prompt']['fr-fr'] = "Annonce pour accepter l'appel";
$text['label-prompt']['he-il'] = "";
$text['label-prompt']['it-it'] = "Domanda se accettare la chiamata";
$text['label-prompt']['nl-nl'] = "Melding om de oproep te accepteren";
$text['label-prompt']['pl-pl'] = "Podpowiedz, aby odebrać rozmowę";
$text['label-prompt']['pt-br'] = "Perguntar para aceitar a chamada"; //copied from pt-pt
$text['label-prompt']['pt-pt'] = "Perguntar para aceitar a chamada";
$text['label-prompt']['ro-ro'] = "";
$text['label-prompt']['ru-ru'] = "Подтверждение приема вызова";
$text['label-prompt']['sv-se'] = "Kräv verifiering för att ta emot samtal.";
$text['label-prompt']['uk-ua'] = "";
$text['label-on-busy']['en-us'] = "On Busy";
$text['label-on-busy']['en-gb'] = "On Busy";
$text['label-on-busy']['ar-eg'] = "";
$text['label-on-busy']['de-at'] = "Bei Besetzt"; //copied from de-de
$text['label-on-busy']['de-ch'] = "Bei Besetzt"; //copied from de-de
$text['label-on-busy']['de-de'] = "Bei Besetzt";
$text['label-on-busy']['es-cl'] = "Concurrida";
$text['label-on-busy']['es-mx'] = "Concurrida"; //copied from es-cl
$text['label-on-busy']['fr-ca'] = "Sur Occupé"; //copied from fr-fr
$text['label-on-busy']['fr-fr'] = "Sur Occupé";
$text['label-on-busy']['he-il'] = "";
$text['label-on-busy']['it-it'] = "Su Occupato";
$text['label-on-busy']['nl-nl'] = "Bij bezet";
$text['label-on-busy']['pl-pl'] = "Kiedy zajęty";
$text['label-on-busy']['pt-br'] = "Ocupado";
$text['label-on-busy']['pt-pt'] = "Movimentado";
$text['label-on-busy']['ro-ro'] = "";
$text['label-on-busy']['ru-ru'] = "При занятости";
$text['label-on-busy']['sv-se'] = "Vid Upptaget";
$text['label-on-busy']['uk-ua'] = "Якщо зайнято";
$text['label-number']['en-us'] = "Number";
$text['label-number']['en-gb'] = "Number";
$text['label-number']['ar-eg'] = "";
$text['label-number']['de-at'] = "Nummer"; //copied from de-de
$text['label-number']['de-ch'] = "Nummer"; //copied from de-de
$text['label-number']['de-de'] = "Nummer";
$text['label-number']['es-cl'] = "Número";
$text['label-number']['es-mx'] = "Número"; //copied from es-cl
$text['label-number']['fr-ca'] = "Numéro"; //copied from fr-fr
$text['label-number']['fr-fr'] = "Numéro";
$text['label-number']['he-il'] = "";
$text['label-number']['it-it'] = "Numero";
$text['label-number']['nl-nl'] = "Nummer";
$text['label-number']['pl-pl'] = "Numer";
$text['label-number']['pt-br'] = "Número"; //copied from pt-pt
$text['label-number']['pt-pt'] = "Número";
$text['label-number']['ro-ro'] = "";
$text['label-number']['ru-ru'] = "Номер";
$text['label-number']['sv-se'] = "Nummer";
$text['label-number']['uk-ua'] = "Номер";
$text['label-no_answer']['en-us'] = "No Answer";
$text['label-no_answer']['en-gb'] = "No Answer";
$text['label-no_answer']['ar-eg'] = "";
$text['label-no_answer']['de-at'] = "Keine Antwort"; //copied from de-de
$text['label-no_answer']['de-ch'] = "Keine Antwort"; //copied from de-de
$text['label-no_answer']['de-de'] = "Keine Antwort";
$text['label-no_answer']['es-cl'] = "Sin Respuesta";
$text['label-no_answer']['es-mx'] = "Sin Respuesta"; //copied from es-cl
$text['label-no_answer']['fr-ca'] = "Pas de réponse"; //copied from fr-fr
$text['label-no_answer']['fr-fr'] = "Pas de réponse";
$text['label-no_answer']['he-il'] = "";
$text['label-no_answer']['it-it'] = "Su Mancata Risposta";
$text['label-no_answer']['nl-nl'] = "Geen antwoord";
$text['label-no_answer']['pl-pl'] = "Brak odpowiedzi";
$text['label-no_answer']['pt-br'] = "Sem resposta";
$text['label-no_answer']['pt-pt'] = "Sem Resposta";
$text['label-no_answer']['ro-ro'] = "";
$text['label-no_answer']['ru-ru'] = "Нет ответа";
$text['label-no_answer']['sv-se'] = "Inget Svar";
$text['label-no_answer']['uk-ua'] = "Без відповіді";
$text['label-not_registered']['en-us'] = "Not Registered";
$text['label-not_registered']['en-gb'] = "Not Registered";
$text['label-not_registered']['ar-eg'] = "";
$text['label-not_registered']['de-at'] = "Nicht registriert"; //copied from de-de
$text['label-not_registered']['de-ch'] = "Nicht registriert"; //copied from de-de
$text['label-not_registered']['de-de'] = "Nicht registriert";
$text['label-not_registered']['es-cl'] = "";
$text['label-not_registered']['es-mx'] = "";
$text['label-not_registered']['fr-ca'] = "Non enregistré";
$text['label-not_registered']['fr-fr'] = "Non enregistré";
$text['label-not_registered']['he-il'] = "";
$text['label-not_registered']['it-it'] = "Su Mancata Registrazione";
$text['label-not_registered']['nl-nl'] = "Niet geregistreerd";
$text['label-not_registered']['pl-pl'] = "";
$text['label-not_registered']['pt-br'] = "Sem registro"; //copied from pt-pt
$text['label-not_registered']['pt-pt'] = "Sem registro";
$text['label-not_registered']['ro-ro'] = "";
$text['label-not_registered']['ru-ru'] = "Не зарегистрирован";
$text['label-not_registered']['sv-se'] = "Ej Registrerad";
$text['label-not_registered']['uk-ua'] = "";
$text['label-ignore_busy']['en-us'] = "Ignore Busy";
$text['label-ignore_busy']['en-gb'] = "Ignore Busy";
$text['label-ignore_busy']['ar-eg'] = "";
$text['label-ignore_busy']['de-at'] = "Besetzt ignorieren"; //copied from de-de
$text['label-ignore_busy']['de-ch'] = "Besetzt ignorieren"; //copied from de-de
$text['label-ignore_busy']['de-de'] = "Besetzt ignorieren";
$text['label-ignore_busy']['es-cl'] = "";
$text['label-ignore_busy']['es-mx'] = "";
$text['label-ignore_busy']['fr-ca'] = "Ignorer occupé";
$text['label-ignore_busy']['fr-fr'] = "Ignorer occupé";
$text['label-ignore_busy']['he-il'] = "";
$text['label-ignore_busy']['it-it'] = "Ignora Occupato";
$text['label-ignore_busy']['nl-nl'] = "Bezet negeren";
$text['label-ignore_busy']['pl-pl'] = "";
$text['label-ignore_busy']['pt-br'] = "Ignorar ocupado"; //copied from pt-pt
$text['label-ignore_busy']['pt-pt'] = "Ignorar ocupado";
$text['label-ignore_busy']['ro-ro'] = "";
$text['label-ignore_busy']['ru-ru'] = "Игногировать занятость";
$text['label-ignore_busy']['sv-se'] = "Ignorera Upptaget";
$text['label-ignore_busy']['uk-ua'] = "";
$text['label-follow_me']['en-us'] = "Follow Me";
$text['label-follow_me']['en-gb'] = "Follow Me";
$text['label-follow_me']['ar-eg'] = "";
$text['label-follow_me']['de-at'] = "Anrufweiterschaltung"; //copied from de-de
$text['label-follow_me']['de-ch'] = "Anrufweiterschaltung"; //copied from de-de
$text['label-follow_me']['de-de'] = "Anrufweiterschaltung";
$text['label-follow_me']['es-cl'] = "Sígueme";
$text['label-follow_me']['es-mx'] = "Sígueme"; //copied from es-cl
$text['label-follow_me']['fr-ca'] = "Suis moi"; //copied from fr-fr
$text['label-follow_me']['fr-fr'] = "Suis moi";
$text['label-follow_me']['he-il'] = "";
$text['label-follow_me']['it-it'] = "Seguimi";
$text['label-follow_me']['nl-nl'] = "Volg mij";
$text['label-follow_me']['pl-pl'] = "Podążaj za mną";
$text['label-follow_me']['pt-br'] = "Siga-me";
$text['label-follow_me']['pt-pt'] = "Segue-me";
$text['label-follow_me']['ro-ro'] = "";
$text['label-follow_me']['ru-ru'] = "Перенаправление";
$text['label-follow_me']['sv-se'] = "Följ Mig";
$text['label-follow_me']['uk-ua'] = "";
$text['label-dnd']['en-us'] = "Do Not Disturb";
$text['label-dnd']['en-gb'] = "Do Not Disturb";
$text['label-dnd']['ar-eg'] = "";
$text['label-dnd']['de-at'] = "Bitte nicht stören"; //copied from de-de
$text['label-dnd']['de-ch'] = "Bitte nicht stören"; //copied from de-de
$text['label-dnd']['de-de'] = "Bitte nicht stören";
$text['label-dnd']['es-cl'] = "No Molestar";
$text['label-dnd']['es-mx'] = "No Molestar"; //copied from es-cl
$text['label-dnd']['fr-ca'] = "Ne pas déranger"; //copied from fr-fr
$text['label-dnd']['fr-fr'] = "Ne pas déranger";
$text['label-dnd']['he-il'] = "";
$text['label-dnd']['it-it'] = "Non Disturbare";
$text['label-dnd']['nl-nl'] = "Niet Storen";
$text['label-dnd']['pl-pl'] = "Nie przeszkadzaj (DND)";
$text['label-dnd']['pt-br'] = "Não Pertube (DND)";
$text['label-dnd']['pt-pt'] = "Não Perturbar";
$text['label-dnd']['ro-ro'] = "";
$text['label-dnd']['ru-ru'] = "Не беспокоить";
$text['label-dnd']['sv-se'] = "Stör Ej";
$text['label-dnd']['uk-ua'] = "Не турбувати";
$text['label-destinations']['en-us'] = "Destinations";
$text['label-destinations']['en-gb'] = "Destinations";
$text['label-destinations']['ar-eg'] = "";
$text['label-destinations']['de-at'] = "Ziele"; //copied from de-de
$text['label-destinations']['de-ch'] = "Ziele"; //copied from de-de
$text['label-destinations']['de-de'] = "Ziele";
$text['label-destinations']['es-cl'] = "Destinos";
$text['label-destinations']['es-mx'] = "Destinos"; //copied from es-cl
$text['label-destinations']['fr-ca'] = "Destinations"; //copied from fr-fr
$text['label-destinations']['fr-fr'] = "Destinations";
$text['label-destinations']['he-il'] = "";
$text['label-destinations']['it-it'] = "Destinazioni";
$text['label-destinations']['nl-nl'] = "Bestemmingen";
$text['label-destinations']['pl-pl'] = "Destynacje";
$text['label-destinations']['pt-br'] = "Destinos"; //copied from pt-pt
$text['label-destinations']['pt-pt'] = "Destinos";
$text['label-destinations']['ro-ro'] = "";
$text['label-destinations']['ru-ru'] = "Направления";
$text['label-destinations']['sv-se'] = "Destinationer";
$text['label-destinations']['uk-ua'] = "Номери";
$text['label-destination_timeout']['en-us'] = "Timeout";
$text['label-destination_timeout']['en-gb'] = "Timeout";
$text['label-destination_timeout']['ar-eg'] = "";
$text['label-destination_timeout']['de-at'] = "Abwurfzeit"; //copied from de-de
$text['label-destination_timeout']['de-ch'] = "Abwurfzeit"; //copied from de-de
$text['label-destination_timeout']['de-de'] = "Abwurfzeit";
$text['label-destination_timeout']['es-cl'] = "Timeout";
$text['label-destination_timeout']['es-mx'] = "Timeout"; //copied from es-cl
$text['label-destination_timeout']['fr-ca'] = "Timeout"; //copied from fr-fr
$text['label-destination_timeout']['fr-fr'] = "Timeout";
$text['label-destination_timeout']['he-il'] = "";
$text['label-destination_timeout']['it-it'] = "Timeout";
$text['label-destination_timeout']['nl-nl'] = "Timeout";
$text['label-destination_timeout']['pl-pl'] = "Limit czasowy";
$text['label-destination_timeout']['pt-br'] = "Tempo limite";
$text['label-destination_timeout']['pt-pt'] = "Timeout";
$text['label-destination_timeout']['ro-ro'] = "";
$text['label-destination_timeout']['ru-ru'] = "Тайм-аут";
$text['label-destination_timeout']['sv-se'] = "Tidsgräns";
$text['label-destination_timeout']['uk-ua'] = "Таймаут";
$text['label-destination_prompt_confirm']['en-us'] = "Confirm";
$text['label-destination_prompt_confirm']['en-gb'] = "Confirm";
$text['label-destination_prompt_confirm']['ar-eg'] = "";
$text['label-destination_prompt_confirm']['de-at'] = "Bestätigen"; //copied from de-de
$text['label-destination_prompt_confirm']['de-ch'] = "Bestätigen"; //copied from de-de
$text['label-destination_prompt_confirm']['de-de'] = "Bestätigen";
$text['label-destination_prompt_confirm']['es-cl'] = "Confirmar";
$text['label-destination_prompt_confirm']['es-mx'] = "Confirmar"; //copied from es-cl
$text['label-destination_prompt_confirm']['fr-ca'] = "Confirmer"; //copied from fr-fr
$text['label-destination_prompt_confirm']['fr-fr'] = "Confirmer";
$text['label-destination_prompt_confirm']['he-il'] = "";
$text['label-destination_prompt_confirm']['it-it'] = "Conferma";
$text['label-destination_prompt_confirm']['nl-nl'] = "Bevestig";
$text['label-destination_prompt_confirm']['pl-pl'] = "Potwierdź";
$text['label-destination_prompt_confirm']['pt-br'] = "Confirmar"; //copied from pt-pt
$text['label-destination_prompt_confirm']['pt-pt'] = "Confirmar";
$text['label-destination_prompt_confirm']['ro-ro'] = "";
$text['label-destination_prompt_confirm']['ru-ru'] = "Подтвердить";
$text['label-destination_prompt_confirm']['sv-se'] = "Bekräfta";
$text['label-destination_prompt_confirm']['uk-ua'] = "Підтвердити";
$text['label-destination_prompt_announce']['en-us'] = "Announce";
$text['label-destination_prompt_announce']['en-gb'] = "Announce";
$text['label-destination_prompt_announce']['ar-eg'] = "";
$text['label-destination_prompt_announce']['de-at'] = "Ankündigen"; //copied from de-de
$text['label-destination_prompt_announce']['de-ch'] = "Ankündigen"; //copied from de-de
$text['label-destination_prompt_announce']['de-de'] = "Ankündigen";
$text['label-destination_prompt_announce']['es-cl'] = "Anunciar";
$text['label-destination_prompt_announce']['es-mx'] = "Anunciar"; //copied from es-cl
$text['label-destination_prompt_announce']['fr-ca'] = "Annonce"; //copied from fr-fr
$text['label-destination_prompt_announce']['fr-fr'] = "Annonce";
$text['label-destination_prompt_announce']['he-il'] = "";
$text['label-destination_prompt_announce']['it-it'] = "Annuncio";
$text['label-destination_prompt_announce']['nl-nl'] = "Aankondigen";
$text['label-destination_prompt_announce']['pl-pl'] = "Rozgłoś/powiadom";
$text['label-destination_prompt_announce']['pt-br'] = "Anunciar"; //copied from pt-pt
$text['label-destination_prompt_announce']['pt-pt'] = "Anunciar";
$text['label-destination_prompt_announce']['ro-ro'] = "";
$text['label-destination_prompt_announce']['ru-ru'] = "Сообщение";
$text['label-destination_prompt_announce']['sv-se'] = "Meddela";
$text['label-destination_prompt_announce']['uk-ua'] = "";
$text['label-destination_prompt']['en-us'] = "Prompt";
$text['label-destination_prompt']['en-gb'] = "Prompt";
$text['label-destination_prompt']['ar-eg'] = "";
$text['label-destination_prompt']['de-at'] = "Nachfragen"; //copied from de-de
$text['label-destination_prompt']['de-ch'] = "Nachfragen"; //copied from de-de
$text['label-destination_prompt']['de-de'] = "Nachfragen";
$text['label-destination_prompt']['es-cl'] = "Prompt";
$text['label-destination_prompt']['es-mx'] = "Prompt"; //copied from es-cl
$text['label-destination_prompt']['fr-ca'] = "Prompt"; //copied from fr-fr
$text['label-destination_prompt']['fr-fr'] = "Prompt";
$text['label-destination_prompt']['he-il'] = "";
$text['label-destination_prompt']['it-it'] = "Prompt";
$text['label-destination_prompt']['nl-nl'] = "Navragen";
$text['label-destination_prompt']['pl-pl'] = "Potwierdź aby odebrac rozmowę";
$text['label-destination_prompt']['pt-br'] = "Prompt"; //copied from pt-pt
$text['label-destination_prompt']['pt-pt'] = "Prompt";
$text['label-destination_prompt']['ro-ro'] = "";
$text['label-destination_prompt']['ru-ru'] = "Приглашение";
$text['label-destination_prompt']['sv-se'] = "Verifiering";
$text['label-destination_prompt']['uk-ua'] = "";
$text['label-destination_number']['en-us'] = "Destination";
$text['label-destination_number']['en-gb'] = "Destination";
$text['label-destination_number']['ar-eg'] = "";
$text['label-destination_number']['de-at'] = "Ziel"; //copied from de-de
$text['label-destination_number']['de-ch'] = "Ziel"; //copied from de-de
$text['label-destination_number']['de-de'] = "Ziel";
$text['label-destination_number']['es-cl'] = "Destino";
$text['label-destination_number']['es-mx'] = "Destino"; //copied from es-cl
$text['label-destination_number']['fr-ca'] = "Destination"; //copied from fr-fr
$text['label-destination_number']['fr-fr'] = "Destination";
$text['label-destination_number']['he-il'] = "";
$text['label-destination_number']['it-it'] = "Destinazione";
$text['label-destination_number']['nl-nl'] = "Bestemming";
$text['label-destination_number']['pl-pl'] = "Destynacja";
$text['label-destination_number']['pt-br'] = "Destino"; //copied from pt-pt
$text['label-destination_number']['pt-pt'] = "Destino";
$text['label-destination_number']['ro-ro'] = "";
$text['label-destination_number']['ru-ru'] = "Назначение";
$text['label-destination_number']['sv-se'] = "Destination Nummer";
$text['label-destination_number']['uk-ua'] = "Номер";
$text['label-destination_delay']['en-us'] = "Delay";
$text['label-destination_delay']['en-gb'] = "Delay";
$text['label-destination_delay']['ar-eg'] = "";
$text['label-destination_delay']['de-at'] = "Verzögerung"; //copied from de-de
$text['label-destination_delay']['de-ch'] = "Verzögerung"; //copied from de-de
$text['label-destination_delay']['de-de'] = "Verzögerung";
$text['label-destination_delay']['es-cl'] = "Retraso";
$text['label-destination_delay']['es-mx'] = "Retraso"; //copied from es-cl
$text['label-destination_delay']['fr-ca'] = "Délais"; //copied from fr-fr
$text['label-destination_delay']['fr-fr'] = "Délais";
$text['label-destination_delay']['he-il'] = "";
$text['label-destination_delay']['it-it'] = "Ritardo";
$text['label-destination_delay']['nl-nl'] = "Vertraging";
$text['label-destination_delay']['pl-pl'] = "Opóźnienie";
$text['label-destination_delay']['pt-br'] = "Atraso"; //copied from pt-pt
$text['label-destination_delay']['pt-pt'] = "Atraso";
$text['label-destination_delay']['ro-ro'] = "";
$text['label-destination_delay']['ru-ru'] = "Задержка";
$text['label-destination_delay']['sv-se'] = "Fördröjning";
$text['label-destination_delay']['uk-ua'] = "Затримка";
$text['label-destination']['en-us'] = "Destination";
$text['label-destination']['en-gb'] = "Destination";
$text['label-destination']['ar-eg'] = "";
$text['label-destination']['de-at'] = "Ziel"; //copied from de-de
$text['label-destination']['de-ch'] = "Ziel"; //copied from de-de
$text['label-destination']['de-de'] = "Ziel";
$text['label-destination']['es-cl'] = "Destino";
$text['label-destination']['es-mx'] = "Destino"; //copied from es-cl
$text['label-destination']['fr-ca'] = "Destination"; //copied from fr-fr
$text['label-destination']['fr-fr'] = "Destination";
$text['label-destination']['he-il'] = "";
$text['label-destination']['it-it'] = "Destinazione";
$text['label-destination']['nl-nl'] = "Bestemming";
$text['label-destination']['pl-pl'] = "Destynacja";
$text['label-destination']['pt-br'] = "Número de destino";
$text['label-destination']['pt-pt'] = "Destino";
$text['label-destination']['ro-ro'] = "";
$text['label-destination']['ru-ru'] = "Назначение";
$text['label-destination']['sv-se'] = "Destination";
$text['label-destination']['uk-ua'] = "Номер";
$text['label-cid-number-prefix']['en-us'] = "Number Prefix";
$text['label-cid-number-prefix']['en-gb'] = "Number Prefix";
$text['label-cid-number-prefix']['ar-eg'] = "";
$text['label-cid-number-prefix']['de-at'] = "Anruferkennung (Nummer)"; //copied from de-de
$text['label-cid-number-prefix']['de-ch'] = "Anruferkennung (Nummer)"; //copied from de-de
$text['label-cid-number-prefix']['de-de'] = "Anruferkennung (Nummer)";
$text['label-cid-number-prefix']['es-cl'] = "Número de Caller ID";
$text['label-cid-number-prefix']['es-mx'] = "Número de Caller ID"; //copied from es-cl
$text['label-cid-number-prefix']['fr-ca'] = "CID Nombre Préfixe"; //copied from fr-fr
$text['label-cid-number-prefix']['fr-fr'] = "CID Nombre Préfixe";
$text['label-cid-number-prefix']['he-il'] = "";
$text['label-cid-number-prefix']['it-it'] = "Numero Chiamante";
$text['label-cid-number-prefix']['nl-nl'] = "Voorloopnummer";
$text['label-cid-number-prefix']['pl-pl'] = "Prefiks prezentacji numeru dzwoniącego";
$text['label-cid-number-prefix']['pt-br'] = "Número do discador";
$text['label-cid-number-prefix']['pt-pt'] = "Número do Chamador";
$text['label-cid-number-prefix']['ro-ro'] = "";
$text['label-cid-number-prefix']['ru-ru'] = "Префикс номера";
$text['label-cid-number-prefix']['sv-se'] = "Nummerpresentation";
$text['label-cid-number-prefix']['uk-ua'] = "Caller ID Номер";
$text['label-cid-number']['en-us'] = "Caller ID Number";
$text['label-cid-number']['en-gb'] = "Caller ID Number";
$text['label-cid-number']['ar-eg'] = "";
$text['label-cid-number']['de-at'] = "Anruferkennung (Nummer)"; //copied from de-de
$text['label-cid-number']['de-ch'] = "Anruferkennung (Nummer)"; //copied from de-de
$text['label-cid-number']['de-de'] = "Anruferkennung (Nummer)";
$text['label-cid-number']['es-cl'] = "Número de Caller ID";
$text['label-cid-number']['es-mx'] = "Número de Caller ID"; //copied from es-cl
$text['label-cid-number']['fr-ca'] = "CID Nombre Préfixe"; //copied from fr-fr
$text['label-cid-number']['fr-fr'] = "CID Nombre Préfixe";
$text['label-cid-number']['he-il'] = "";
$text['label-cid-number']['it-it'] = "Numero Caller ID";
$text['label-cid-number']['nl-nl'] = "CID nummer";
$text['label-cid-number']['pl-pl'] = "Prefiks prezentacji numeru dzwoniącego";
$text['label-cid-number']['pt-br'] = "Número do discador";
$text['label-cid-number']['pt-pt'] = "Número do Chamador";
$text['label-cid-number']['ro-ro'] = "";
$text['label-cid-number']['ru-ru'] = "Caller ID Номер";
$text['label-cid-number']['sv-se'] = "Nummerpresentation";
$text['label-cid-number']['uk-ua'] = "Caller ID Номер";
$text['label-cid-name-prefix']['en-us'] = "Name Prefix";
$text['label-cid-name-prefix']['en-gb'] = "Name Prefix";
$text['label-cid-name-prefix']['ar-eg'] = "";
$text['label-cid-name-prefix']['de-at'] = "Anruferkennung (Name)"; //copied from de-de
$text['label-cid-name-prefix']['de-ch'] = "Anruferkennung (Name)"; //copied from de-de
$text['label-cid-name-prefix']['de-de'] = "Anruferkennung (Name)";
$text['label-cid-name-prefix']['es-cl'] = "Nombre de Caller ID";
$text['label-cid-name-prefix']['es-mx'] = "Nombre de Caller ID"; //copied from es-cl
$text['label-cid-name-prefix']['fr-ca'] = "Préfixe de l'appelant"; //copied from fr-fr
$text['label-cid-name-prefix']['fr-fr'] = "Préfixe de l'appelant";
$text['label-cid-name-prefix']['he-il'] = "";
$text['label-cid-name-prefix']['it-it'] = "Nome Chiamante";
$text['label-cid-name-prefix']['nl-nl'] = "Voorloop Naam ";
$text['label-cid-name-prefix']['pl-pl'] = "Prefiks prezentacji nazwy dzwoniącego";
$text['label-cid-name-prefix']['pt-br'] = "Nome (ID) de origem";
$text['label-cid-name-prefix']['pt-pt'] = "Nome do Chamador";
$text['label-cid-name-prefix']['ro-ro'] = "";
$text['label-cid-name-prefix']['ru-ru'] = "Caller ID Имя";
$text['label-cid-name-prefix']['sv-se'] = "Namnpresentation";
$text['label-cid-name-prefix']['uk-ua'] = "Caller ID Ім’я";
$text['label-call-prompt']['en-us'] = "Call Prompt";
$text['label-call-prompt']['en-gb'] = "Call Prompt";
$text['label-call-prompt']['ar-eg'] = "";
$text['label-call-prompt']['de-at'] = "Nachfragen"; //copied from de-de
$text['label-call-prompt']['de-ch'] = "Nachfragen"; //copied from de-de
$text['label-call-prompt']['de-de'] = "Nachfragen";
$text['label-call-prompt']['es-cl'] = "Aviso de Llamadas";
$text['label-call-prompt']['es-mx'] = "Aviso de Llamadas"; //copied from es-cl
$text['label-call-prompt']['fr-ca'] = "Annonce d'appel"; //copied from fr-fr
$text['label-call-prompt']['fr-fr'] = "Annonce d'appel";
$text['label-call-prompt']['he-il'] = "";
$text['label-call-prompt']['it-it'] = "Prompt di chiamata";
$text['label-call-prompt']['nl-nl'] = "Oproep melden";
$text['label-call-prompt']['pl-pl'] = "Potwierdź przed odebraniem rozmowy";
$text['label-call-prompt']['pt-br'] = "Prompt de chamada";
$text['label-call-prompt']['pt-pt'] = "Espoletar Chamada";
$text['label-call-prompt']['ro-ro'] = "";
$text['label-call-prompt']['ru-ru'] = "Запрос вызова";
$text['label-call-prompt']['sv-se'] = "Samtals Verifiering";
$text['label-call-prompt']['uk-ua'] = "";
$text['label-call_forward']['en-us'] = "Call Forward";
$text['label-call_forward']['en-gb'] = "Call Forward";
$text['label-call_forward']['ar-eg'] = "";
$text['label-call_forward']['de-at'] = "Rufumleitung"; //copied from de-de
$text['label-call_forward']['de-ch'] = "Rufumleitung"; //copied from de-de
$text['label-call_forward']['de-de'] = "Rufumleitung";
$text['label-call_forward']['es-cl'] = "Reenvio de Llamadas";
$text['label-call_forward']['es-mx'] = "Reenvio de Llamadas"; //copied from es-cl
$text['label-call_forward']['fr-ca'] = "Renvoi d'appel"; //copied from fr-fr
$text['label-call_forward']['fr-fr'] = "Renvoi d'appel";
$text['label-call_forward']['he-il'] = "";
$text['label-call_forward']['it-it'] = "Inoltro";
$text['label-call_forward']['nl-nl'] = "Oproep doorsturen";
$text['label-call_forward']['pl-pl'] = "Przekierowanie";
$text['label-call_forward']['pt-br'] = "Encaminhamento de chamadas";
$text['label-call_forward']['pt-pt'] = "Encaminhamento de Chamadas";
$text['label-call_forward']['ro-ro'] = "";
$text['label-call_forward']['ru-ru'] = "Переадресация";
$text['label-call_forward']['sv-se'] = "Vidarekoppling";
$text['label-call_forward']['uk-ua'] = "Переадресація";
$text['description-on-busy']['en-us'] = "If enabled, it overrides the value of voicemail enabling in extension.";
$text['description-on-busy']['en-gb'] = "If enabled, it overrides the value of voicemail enabling in extension.";
$text['description-on-busy']['ar-eg'] = "";
$text['description-on-busy']['de-at'] = "Falls aktiviert, wird die aktive Mailbox der Nebenstelle überschrieben."; //copied from de-de
$text['description-on-busy']['de-ch'] = "Falls aktiviert, wird die aktive Mailbox der Nebenstelle überschrieben."; //copied from de-de
$text['description-on-busy']['de-de'] = "Falls aktiviert, wird die aktive Mailbox der Nebenstelle überschrieben.";
$text['description-on-busy']['es-cl'] = "Si está habilitada, anula el valor del correo de voz que permite en la extensión.";
$text['description-on-busy']['es-mx'] = "Si está habilitada, anula el valor del correo de voz que permite en la extensión."; //copied from es-cl
$text['description-on-busy']['fr-ca'] = "Remplace la messagerie vocale si activé."; //copied from fr-fr
$text['description-on-busy']['fr-fr'] = "Remplace la messagerie vocale si activé.";
$text['description-on-busy']['he-il'] = "";
$text['description-on-busy']['it-it'] = "Se abilitato, esegue l'override del valore di abilitazione voicemail nell'estensione.";
$text['description-on-busy']['nl-nl'] = "Indien aangezet, wordt de het antwoordapparaat bij het toestel genegeerd.";
$text['description-on-busy']['pl-pl'] = "Jeżeli włączone, ustawienie włączenia poczty głosowej zostaje nadpisane.";
$text['description-on-busy']['pt-br'] = "Se ativado, substitui o valor do correio de voz permitindo algum ramal atender quando estiver ocupado.";
$text['description-on-busy']['pt-pt'] = "Se ativado, ele substitui o valor de correio de voz que permite em extensão.";
$text['description-on-busy']['ro-ro'] = "";
$text['description-on-busy']['ru-ru'] = "Если включено, этот параметр переопределяет голосовую почту в настройках внутренного номера";
$text['description-on-busy']['sv-se'] = "Om aktiverad, så tar den överhand framför röstbrevlåda hos anknytningen.";
$text['description-on-busy']['uk-ua'] = "Якщо цей параметр включений, то вона перекриває значення голосової пошти, що дозволяє в розширенні.";
$text['description-no_answer']['en-us'] = "If enabled, it overrides the value of voicemail enabling in extension.";
$text['description-no_answer']['en-gb'] = "If enabled, it overrides the value of voicemail enabling in extension.";
$text['description-no_answer']['ar-eg'] = "";
$text['description-no_answer']['de-at'] = "Falls aktiviert, wird die aktive Mailbox der Nebenstelle überschrieben."; //copied from de-de
$text['description-no_answer']['de-ch'] = "Falls aktiviert, wird die aktive Mailbox der Nebenstelle überschrieben."; //copied from de-de
$text['description-no_answer']['de-de'] = "Falls aktiviert, wird die aktive Mailbox der Nebenstelle überschrieben.";
$text['description-no_answer']['es-cl'] = "Si está habilitada, anula el valor del correo de voz que permite en la extensión.";
$text['description-no_answer']['es-mx'] = "Si está habilitada, anula el valor del correo de voz que permite en la extensión."; //copied from es-cl
$text['description-no_answer']['fr-ca'] = "Remplace la messagerie vocale si activé."; //copied from fr-fr
$text['description-no_answer']['fr-fr'] = "Remplace la messagerie vocale si activé.";
$text['description-no_answer']['he-il'] = "";
$text['description-no_answer']['it-it'] = "Se abilitato, esegue l'override del valore di abilitazione voicemail nell'estensione.";
$text['description-no_answer']['nl-nl'] = "Indien aangezet, wordt de het antwoordapparaat bij het toestel genegeerd.";
$text['description-no_answer']['pl-pl'] = "Jeżeli włączone, ustawienie włączenia poczty głosowej zostaje nadpisane.";
$text['description-no_answer']['pt-br'] = "Se ativado, substitui o valor do correio de voz permitindo uma extensão quando estiver chamando";
$text['description-no_answer']['pt-pt'] = "Se ativado, ele substitui o valor de correio de voz que permite em extensão.";
$text['description-no_answer']['ro-ro'] = "";
$text['description-no_answer']['ru-ru'] = "Если включено, этот параметр переопределяет голосовую почту в настройках внутренного номера.";
$text['description-no_answer']['sv-se'] = "Om aktiverad, så tar den överhand framför röstbrevlåda hos anknytningen.";
$text['description-no_answer']['uk-ua'] = "Якщо цей параметр включений, то вона перекриває значення голосової пошти, що дозволяє в розширенні.";
$text['description-not_registered']['en-us'] = "If endpoint is not reachable, forward to this destination before going to voicemail.";
$text['description-not_registered']['en-gb'] = "If endpoint is not reachable, forward to this destination before going to voicemail.";
$text['description-not_registered']['ar-eg'] = "";
$text['description-not_registered']['de-at'] = "Rufweiterleitung an neues Ziel, wenn ursprüngliches Ziel nicht erreichbar ist, bevor die Mailbox aktiviert wird."; //copied from de-de
$text['description-not_registered']['de-ch'] = "Rufweiterleitung an neues Ziel, wenn ursprüngliches Ziel nicht erreichbar ist, bevor die Mailbox aktiviert wird."; //copied from de-de
$text['description-not_registered']['de-de'] = "Rufweiterleitung an neues Ziel, wenn ursprüngliches Ziel nicht erreichbar ist, bevor die Mailbox aktiviert wird.";
$text['description-not_registered']['es-cl'] = "Si el punto extremo no es alcanzable, remitir a este destino antes de ir al correo de voz.";
$text['description-not_registered']['es-mx'] = "Si el punto extremo no es alcanzable, remitir a este destino antes de ir al correo de voz."; //copied from es-cl
$text['description-not_registered']['fr-ca'] = "Si extrémité est pas accessible, transmettre à cette destination avant d'aller à la messagerie vocale."; //copied from fr-fr
$text['description-not_registered']['fr-fr'] = "Si extrémité est pas accessible, transmettre à cette destination avant d'aller à la messagerie vocale.";
$text['description-not_registered']['he-il'] = "";
$text['description-not_registered']['it-it'] = "Se l'endpoint non è raggiungibile, inoltra la chiamata a questa destinazione prima della voicemail.";
$text['description-not_registered']['nl-nl'] = "Als het eindpunt niet bereikbaar is, fordt dit de bestemming voordat het antwoordapparaat geactiveerd wordt.";
$text['description-not_registered']['pl-pl'] = "Jeśli punkt końcowy nie jest osiągalny, przekazania do tego celu przed udaniem się na pocztę głosową.";
$text['description-not_registered']['pt-br'] = "Se o destino não for alcançável, desvia a chamata para este destino antes de enviar para o correio de voz. ";
$text['description-not_registered']['pt-pt'] = "Se endpoint não está acessível, encaminhar para este destino antes de ir para a caixa postal.";
$text['description-not_registered']['ro-ro'] = "";
$text['description-not_registered']['ru-ru'] = "Если номер недоступен, переадресовать на это направление до голосовой почты.";
$text['description-not_registered']['sv-se'] = "Om endpoint är inte nås, vidarebefordra till denna destination innan du går till röstbrevlådan.";
$text['description-not_registered']['uk-ua'] = "Якщо кінцева точка не можна досягти, вперед до цієї мети, перш ніж йти на голосову пошту.";
$text['description-ignore_busy']['en-us'] = "Interrupt the call if a destination is busy.";
$text['description-ignore_busy']['en-gb'] = "Interrupt the call if a destination is busy.";
$text['description-ignore_busy']['ar-eg'] = "";
$text['description-ignore_busy']['de-at'] = "Anruf unterbrechen wenn ein Ziel besetzt ist."; //copied from de-de
$text['description-ignore_busy']['de-ch'] = "Anruf unterbrechen wenn ein Ziel besetzt ist."; //copied from de-de
$text['description-ignore_busy']['de-de'] = "Anruf unterbrechen wenn ein Ziel besetzt ist.";
$text['description-ignore_busy']['es-cl'] = "Interrumpir la llamada si un destino está ocupado.";
$text['description-ignore_busy']['es-mx'] = "Interrumpir la llamada si un destino está ocupado."; //copied from es-cl
$text['description-ignore_busy']['fr-ca'] = "Interrompez l'appel si une destination est occupé."; //copied from fr-fr
$text['description-ignore_busy']['fr-fr'] = "Interrompez l'appel si une destination est occupé.";
$text['description-ignore_busy']['he-il'] = "";
$text['description-ignore_busy']['it-it'] = "Interrompe la chiamata se la destinazione è occupata.";
$text['description-ignore_busy']['nl-nl'] = "Onderbreek de oproep indien de bestemming bezet is.";
$text['description-ignore_busy']['pl-pl'] = "Przerwanie połączenia, jeśli docelowy jest zajęty.";
$text['description-ignore_busy']['pt-br'] = "Interromper a chamada, se um destino está ocupado."; //copied from pt-pt
$text['description-ignore_busy']['pt-pt'] = "Interromper a chamada, se um destino está ocupado.";
$text['description-ignore_busy']['ro-ro'] = "";
$text['description-ignore_busy']['ru-ru'] = "Прервать вызов, если конечная точка занята.";
$text['description-ignore_busy']['sv-se'] = "Avbryt samtal om en destination är upptagen.";
$text['description-ignore_busy']['uk-ua'] = "Переривання виклику, якщо абонент зайнятий.";
$text['description-cid-number-prefix']['en-us'] = "Set the caller ID number prefix.";
$text['description-cid-number-prefix']['en-gb'] = "Set the caller ID number prefix.";
$text['description-cid-number-prefix']['ar-eg'] = "";
$text['description-cid-number-prefix']['de-at'] = "Setzen Sie ein Präfix für die Anruferkennung (Nummer)"; //copied from de-de
$text['description-cid-number-prefix']['de-ch'] = "Setzen Sie ein Präfix für die Anruferkennung (Nummer)"; //copied from de-de
$text['description-cid-number-prefix']['de-de'] = "Setzen Sie ein Präfix für die Anruferkennung (Nummer)";
$text['description-cid-number-prefix']['es-cl'] = "Configure el prefijo de número de caller ID.";
$text['description-cid-number-prefix']['es-mx'] = "Configure el prefijo de número de caller ID."; //copied from es-cl
$text['description-cid-number-prefix']['fr-ca'] = "Définir un préfixe sur le nombre d'ID d'appelant."; //copied from fr-fr
$text['description-cid-number-prefix']['fr-fr'] = "Définir un préfixe sur le nombre d'ID d'appelant.";
$text['description-cid-number-prefix']['he-il'] = "";
$text['description-cid-number-prefix']['it-it'] = "Imposta il prefisso per il numero chiamante.";
$text['description-cid-number-prefix']['nl-nl'] = "Stel het CID voorloopnummer in";
$text['description-cid-number-prefix']['pl-pl'] = "Prefiks prezentacji numeru dzwoniącego.";
$text['description-cid-number-prefix']['pt-br'] = "Defina o número do prefixo.";
$text['description-cid-number-prefix']['pt-pt'] = "Defina o número do Chamador";
$text['description-cid-number-prefix']['ro-ro'] = "";
$text['description-cid-number-prefix']['ru-ru'] = "Задайте префикс Caller ID Номер.";
$text['description-cid-number-prefix']['sv-se'] = "Ange nummerpresentation prefix.";
$text['description-cid-number-prefix']['uk-ua'] = "Задайте номер префікса ідентифікації абонента.";
$text['description-cid-number']['en-us'] = "Select a number to override the original caller ID number.";
$text['description-cid-number']['en-gb'] = "Select a number to override the original caller ID number.";
$text['description-cid-number']['ar-eg'] = "";
$text['description-cid-number']['de-at'] = "Wählen Sie eine Nummer mit der die ursprüngliche Anrufer-ID-Nummer überschreiben werden soll."; //copied from de-de
$text['description-cid-number']['de-ch'] = "Wählen Sie eine Nummer mit der die ursprüngliche Anrufer-ID-Nummer überschreiben werden soll."; //copied from de-de
$text['description-cid-number']['de-de'] = "Wählen Sie eine Nummer mit der die ursprüngliche Anrufer-ID-Nummer überschreiben werden soll.";
$text['description-cid-number']['es-cl'] = "Seleccionar un número para anular el número de ID de llamada original.";
$text['description-cid-number']['es-mx'] = "Seleccionar un número para anular el número de ID de llamada original."; //copied from es-cl
$text['description-cid-number']['fr-ca'] = "Sélectionnez un numéro pour remplacer le numéro d'origine identification de l'appelant."; //copied from fr-fr
$text['description-cid-number']['fr-fr'] = "Sélectionnez un numéro pour remplacer le numéro d'origine identification de l'appelant.";
$text['description-cid-number']['he-il'] = "";
$text['description-cid-number']['it-it'] = "Seleziona un numero per sovrascrivere il numero Caller ID originale.";
$text['description-cid-number']['nl-nl'] = "Selecteer een nummer dat het originele CID nummer moet vervangen.";
$text['description-cid-number']['pl-pl'] = "Wybierz numer, aby zastąpić oryginalny numer ID.";
$text['description-cid-number']['pt-br'] = "Selecione um número para substituir o número de identificação de chamada inicial."; //copied from pt-pt
$text['description-cid-number']['pt-pt'] = "Selecione um número para substituir o número de identificação de chamada inicial.";
$text['description-cid-number']['ro-ro'] = "";
$text['description-cid-number']['ru-ru'] = "Выберите номер для переопределения оригинального Caller ID Номер.";
$text['description-cid-number']['sv-se'] = "Välj ett nummer för att åsidosätta den ursprungliga uppringaren ID-nummer.";
$text['description-cid-number']['uk-ua'] = "Виберіть номер, щоб перевизначити вихідний ідентифікаційний номер абонента.";
$text['description-cid-name-prefix']['en-us'] = "Set the caller ID name prefix.";
$text['description-cid-name-prefix']['en-gb'] = "Set the caller ID name prefix.";
$text['description-cid-name-prefix']['ar-eg'] = "";
$text['description-cid-name-prefix']['de-at'] = "Setzen Sie ein Präfix für die Anruferkennung (Name)"; //copied from de-de
$text['description-cid-name-prefix']['de-ch'] = "Setzen Sie ein Präfix für die Anruferkennung (Name)"; //copied from de-de
$text['description-cid-name-prefix']['de-de'] = "Setzen Sie ein Präfix für die Anruferkennung (Name)";
$text['description-cid-name-prefix']['es-cl'] = "Configure el prefijo de nombre de caller ID";
$text['description-cid-name-prefix']['es-mx'] = "Configure el prefijo de nombre de caller ID"; //copied from es-cl
$text['description-cid-name-prefix']['fr-ca'] = "Choisir le péfixe du nom d'appelant."; //copied from fr-fr
$text['description-cid-name-prefix']['fr-fr'] = "Choisir le péfixe du nom d'appelant.";
$text['description-cid-name-prefix']['he-il'] = "";
$text['description-cid-name-prefix']['it-it'] = "Imposta il prefisso per il nome chiamante.";
$text['description-cid-name-prefix']['nl-nl'] = "Stel de CID naam prefix in.";
$text['description-cid-name-prefix']['pl-pl'] = "Prefiks prezentacji nazwy dzwoniącego.";
$text['description-cid-name-prefix']['pt-br'] = "Defina o nome (ID) do discador.";
$text['description-cid-name-prefix']['pt-pt'] = "Defina o nome do Chamador";
$text['description-cid-name-prefix']['ro-ro'] = "";
$text['description-cid-name-prefix']['ru-ru'] = "ВЗадайте префикс Caller ID Имя.";
$text['description-cid-name-prefix']['sv-se'] = "Ange namnpresentation prefix.";
$text['description-cid-name-prefix']['uk-ua'] = "Встановіть префікс ідентифікаційного імені абонента.";
$text['description-call-prompt']['en-us'] = "Prompt to accept the call for external destinations.";
$text['description-call-prompt']['en-gb'] = "Prompt to accept the call for external destinations.";
$text['description-call-prompt']['ar-eg'] = "";
$text['description-call-prompt']['de-at'] = "Nachfragen, ob der Anruf auch wirklich durchgestellt werden soll."; //copied from de-de
$text['description-call-prompt']['de-ch'] = "Nachfragen, ob der Anruf auch wirklich durchgestellt werden soll."; //copied from de-de
$text['description-call-prompt']['de-de'] = "Nachfragen, ob der Anruf auch wirklich durchgestellt werden soll.";
$text['description-call-prompt']['es-cl'] = "Preguntar para aceptar un llamado para destinos externos";
$text['description-call-prompt']['es-mx'] = "Preguntar para aceptar un llamado para destinos externos"; //copied from es-cl
$text['description-call-prompt']['fr-ca'] = "Annonce pour accepter l'appel venant de destinations externes."; //copied from fr-fr
$text['description-call-prompt']['fr-fr'] = "Annonce pour accepter l'appel venant de destinations externes.";
$text['description-call-prompt']['he-il'] = "";
$text['description-call-prompt']['it-it'] = "Prompt per accettare le chiamate per le destinazioni esterne.";
$text['description-call-prompt']['nl-nl'] = "Navragen of de oproep voor externe verbindingen acceptabel is.";
$text['description-call-prompt']['pl-pl'] = "Zapytaj czy akceptować rozmowę do zewnętrznych destynacji.";
$text['description-call-prompt']['pt-br'] = "Perguntar para aceitar chamados de destinatários externos.";
$text['description-call-prompt']['pt-pt'] = "Aceitar chamada para destinos externos.";
$text['description-call-prompt']['ro-ro'] = "";
$text['description-call-prompt']['ru-ru'] = "Сообщение о приеме вызова для внешних направлений.";
$text['description-call-prompt']['sv-se'] = "Kräv verifiering för att ta emot samtal för externa destinationer.";
$text['description-call-prompt']['uk-ua'] = "";
$text['description-call_routing']['en-us'] = "Define alternate inbound call handling for the following extensions.";
$text['description-call_routing']['en-gb'] = "Define alternate inbound call handling for the following extensions.";
$text['description-call_routing']['ar-eg'] = "";
$text['description-call_routing']['de-at'] = "Definieren Sie eine alternative Handhabung von eingehenden Anrufen für nachfolgende Nebenstellen."; //copied from de-de
$text['description-call_routing']['de-ch'] = "Definieren Sie eine alternative Handhabung von eingehenden Anrufen für nachfolgende Nebenstellen."; //copied from de-de
$text['description-call_routing']['de-de'] = "Definieren Sie eine alternative Handhabung von eingehenden Anrufen für nachfolgende Nebenstellen.";
$text['description-call_routing']['es-cl'] = "Definir alternativa para el manejo de las siguientes extensiones de llamadas entrantes.";
$text['description-call_routing']['es-mx'] = "Definir alternativa para el manejo de las siguientes extensiones de llamadas entrantes."; //copied from es-cl
$text['description-call_routing']['fr-ca'] = "Définir la manipulation pour les extensions suivantes alternent appel entrant."; //copied from fr-fr
$text['description-call_routing']['fr-fr'] = "Définir la manipulation pour les extensions suivantes alternent appel entrant.";
$text['description-call_routing']['he-il'] = "";
$text['description-call_routing']['it-it'] = "Definisce gestione alternativa per le chiamate in ingresso per i seguenti interni.";
$text['description-call_routing']['nl-nl'] = "Deinieer alternatief inkomend gesprek afhandeling in voor de volgende toestellen.";
$text['description-call_routing']['pl-pl'] = "Definiowanie alternatywnego połączenia przychodzącego obsługi dla następujących numerów wewnętrznych.";
$text['description-call_routing']['pt-br'] = "Defina o tratamento de entradas alternativas para os seguintes ramais. ";
$text['description-call_routing']['pt-pt'] = "Definir alternativo chamada de entrada assistência para as seguintes extensões.";
$text['description-call_routing']['ro-ro'] = "";
$text['description-call_routing']['ru-ru'] = "Установливает альтернативный вариант приема входящих для следующих внутренних номеров.";
$text['description-call_routing']['sv-se'] = "Definiera alternativa inkommande samtalshantering för följande tillägg.";
$text['description-call_routing']['uk-ua'] = "Визначити обробку для наступних розширень альтернативного вхідного дзвінка.";
$text['description-call_forward']['en-us'] = "Forward all calls to the specified destination.";
$text['description-call_forward']['en-gb'] = "Forward all calls to the specified destination.";
$text['description-call_forward']['ar-eg'] = "";
$text['description-call_forward']['de-at'] = "Leiten Sie alle Anrufe an das angegebene Ziel."; //copied from de-de
$text['description-call_forward']['de-ch'] = "Leiten Sie alle Anrufe an das angegebene Ziel."; //copied from de-de
$text['description-call_forward']['de-de'] = "Leiten Sie alle Anrufe an das angegebene Ziel.";
$text['description-call_forward']['es-cl'] = "Desviar todas las llamadas al destino especificado.";
$text['description-call_forward']['es-mx'] = "Desviar todas las llamadas al destino especificado."; //copied from es-cl
$text['description-call_forward']['fr-ca'] = "Transférer tous les appels vers la destination spécifiée."; //copied from fr-fr
$text['description-call_forward']['fr-fr'] = "Transférer tous les appels vers la destination spécifiée.";
$text['description-call_forward']['he-il'] = "";
$text['description-call_forward']['it-it'] = "Inoltra tutte le chiamate ad una destinazione specifica.";
$text['description-call_forward']['nl-nl'] = "Stuur all oproepen naar de ingestelde bestemming.";
$text['description-call_forward']['pl-pl'] = "Przekazywanie wszystkich połączeń do określonego przeznaczenia.";
$text['description-call_forward']['pt-br'] = "Encaminhar todas as chamadas para o destino especificado."; //copied from pt-pt
$text['description-call_forward']['pt-pt'] = "Encaminhar todas as chamadas para o destino especificado.";
$text['description-call_forward']['ro-ro'] = "";
$text['description-call_forward']['ru-ru'] = "Переадресовать все вызовы на указанные направления.";
$text['description-call_forward']['sv-se'] = "Vidarekoppla alla samtal till den angivna destinationen.";
$text['description-call_forward']['uk-ua'] = "Усі дзвінки скеровуються на вказане місце призначення.";
$text['description']['en-us'] = "Directs incoming calls for extension:";
$text['description']['en-gb'] = "Directs incoming calls for extension:";
$text['description']['ar-eg'] = "";
$text['description']['de-at'] = "Leitet eingehende Gespräche für die Nebenstelle:"; //copied from de-de
$text['description']['de-ch'] = "Leitet eingehende Gespräche für die Nebenstelle:"; //copied from de-de
$text['description']['de-de'] = "Leitet eingehende Gespräche für die Nebenstelle:";
$text['description']['es-cl'] = "Dirige las llamadas entrantes hacia una extensión:";
$text['description']['es-mx'] = "Dirige las llamadas entrantes hacia una extensión:"; //copied from es-cl
$text['description']['fr-ca'] = "Rediriger les appels entrant pour l'extension:"; //copied from fr-fr
$text['description']['fr-fr'] = "Rediriger les appels entrant pour l'extension:";
$text['description']['he-il'] = "";
$text['description']['it-it'] = "Dirotta le chiamate in ingresso per l'interno:";
$text['description']['nl-nl'] = "Verwijs inkomende oproepen voor toestel: ";
$text['description']['pl-pl'] = "Kieruj rozmowy przychodzące na numer wewnętrzny:";
$text['description']['pt-br'] = "Direciona as chamadas que estão entrando para um ramal.";
$text['description']['pt-pt'] = "Direciona as chamadas recebidas para a extensão:";
$text['description']['ro-ro'] = "";
$text['description']['ru-ru'] = "Прямые входящие для внутеннего номера:";
$text['description']['sv-se'] = "Styr inkommande samtal för anknytning:";
$text['description']['uk-ua'] = "Керування вхідними дзвінками для розширення";
$text['confirm-update']['en-us'] = "Update Complete";
$text['confirm-update']['en-gb'] = "Update Complete";
$text['confirm-update']['ar-eg'] = "";
$text['confirm-update']['de-at'] = "Aktualisierung durchgeführt"; //copied from de-de
$text['confirm-update']['de-ch'] = "Aktualisierung durchgeführt"; //copied from de-de
$text['confirm-update']['de-de'] = "Aktualisierung durchgeführt";
$text['confirm-update']['es-cl'] = "Actualización Completa";
$text['confirm-update']['es-mx'] = "Actualización Completa"; //copied from es-cl
$text['confirm-update']['fr-ca'] = "Mis à jour"; //copied from fr-fr
$text['confirm-update']['fr-fr'] = "Mis à jour";
$text['confirm-update']['he-il'] = "";
$text['confirm-update']['it-it'] = "Aggiornamento Completato";
$text['confirm-update']['nl-nl'] = "Bijwerken gereed";
$text['confirm-update']['pl-pl'] = "Zaktualizowano pomyślnie";
$text['confirm-update']['pt-br'] = "Atualização Efetuada";
$text['confirm-update']['pt-pt'] = "Actualização Efectuada";
$text['confirm-update']['ro-ro'] = "";
$text['confirm-update']['ru-ru'] = "Обновление завершено";
$text['confirm-update']['sv-se'] = "Uppdatering Klar";
$text['confirm-update']['uk-ua'] = "Оновлено";
$text['check-true']['en-us'] = "True";
$text['check-true']['en-gb'] = "True";
$text['check-true']['ar-eg'] = "";
$text['check-true']['de-at'] = "An"; //copied from de-de
$text['check-true']['de-ch'] = "An"; //copied from de-de
$text['check-true']['de-de'] = "An";
$text['check-true']['es-cl'] = "Verdadero";
$text['check-true']['es-mx'] = "Verdadero"; //copied from es-cl
$text['check-true']['fr-ca'] = "Oui"; //copied from fr-fr
$text['check-true']['fr-fr'] = "Oui";
$text['check-true']['he-il'] = "";
$text['check-true']['it-it'] = "Vero";
$text['check-true']['nl-nl'] = "Ja";
$text['check-true']['pl-pl'] = "Tak";
$text['check-true']['pt-br'] = "Sim"; //copied from pt-pt
$text['check-true']['pt-pt'] = "Sim";
$text['check-true']['ro-ro'] = "";
$text['check-true']['ru-ru'] = "Да";
$text['check-true']['sv-se'] = "Sann";
$text['check-true']['uk-ua'] = "Так";
$text['check-simultaneous']['en-us'] = "simultaneous";
$text['check-simultaneous']['en-gb'] = "simultaneous";
$text['check-simultaneous']['ar-eg'] = "";
$text['check-simultaneous']['de-at'] = "gleichzeitig"; //copied from de-de
$text['check-simultaneous']['de-ch'] = "gleichzeitig"; //copied from de-de
$text['check-simultaneous']['de-de'] = "gleichzeitig";
$text['check-simultaneous']['es-cl'] = "simultaneo";
$text['check-simultaneous']['es-mx'] = "simultaneo"; //copied from es-cl
$text['check-simultaneous']['fr-ca'] = "simultanément"; //copied from fr-fr
$text['check-simultaneous']['fr-fr'] = "simultanément";
$text['check-simultaneous']['he-il'] = "";
$text['check-simultaneous']['it-it'] = "Simultaneo";
$text['check-simultaneous']['nl-nl'] = "Gelijktijdig";
$text['check-simultaneous']['pl-pl'] = "jednoczesne";
$text['check-simultaneous']['pt-br'] = "Simultâneo";
$text['check-simultaneous']['pt-pt'] = "simultâneo";
$text['check-simultaneous']['ro-ro'] = "";
$text['check-simultaneous']['ru-ru'] = "одновременно";
$text['check-simultaneous']['sv-se'] = "Samtidig";
$text['check-simultaneous']['uk-ua'] = "одночасно";
$text['check-sequence']['en-us'] = "sequence";
$text['check-sequence']['en-gb'] = "sequence";
$text['check-sequence']['ar-eg'] = "";
$text['check-sequence']['de-at'] = "sequenziell"; //copied from de-de
$text['check-sequence']['de-ch'] = "sequenziell"; //copied from de-de
$text['check-sequence']['de-de'] = "sequenziell";
$text['check-sequence']['es-cl'] = "secuencia";
$text['check-sequence']['es-mx'] = "secuencia"; //copied from es-cl
$text['check-sequence']['fr-ca'] = "séquence"; //copied from fr-fr
$text['check-sequence']['fr-fr'] = "séquence";
$text['check-sequence']['he-il'] = "";
$text['check-sequence']['it-it'] = "Sequenza";
$text['check-sequence']['nl-nl'] = "Volgorde";
$text['check-sequence']['pl-pl'] = "kolejność";
$text['check-sequence']['pt-br'] = "Sequência";
$text['check-sequence']['pt-pt'] = "sequência";
$text['check-sequence']['ro-ro'] = "";
$text['check-sequence']['ru-ru'] = "последовательно";
$text['check-sequence']['sv-se'] = "sekvens";
$text['check-sequence']['uk-ua'] = "послідовно";
$text['check-false']['en-us'] = "False";
$text['check-false']['en-gb'] = "False";
$text['check-false']['ar-eg'] = "";
$text['check-false']['de-at'] = "Aus"; //copied from de-de
$text['check-false']['de-ch'] = "Aus"; //copied from de-de
$text['check-false']['de-de'] = "Aus";
$text['check-false']['es-cl'] = "Falso";
$text['check-false']['es-mx'] = "Falso"; //copied from es-cl
$text['check-false']['fr-ca'] = "Non"; //copied from fr-fr
$text['check-false']['fr-fr'] = "Non";
$text['check-false']['he-il'] = "";
$text['check-false']['it-it'] = "Falso";
$text['check-false']['nl-nl'] = "Nee";
$text['check-false']['pl-pl'] = "Nie";
$text['check-false']['pt-br'] = "Não"; //copied from pt-pt
$text['check-false']['pt-pt'] = "Não";
$text['check-false']['ro-ro'] = "";
$text['check-false']['ru-ru'] = "Нет";
$text['check-false']['sv-se'] = "Falsk";
$text['check-false']['uk-ua'] = "Ні";
$text['button-view_all']['en-us'] = "View All";
$text['button-view_all']['en-gb'] = "View All";
$text['button-view_all']['ar-eg'] = "";
$text['button-view_all']['de-at'] = "Alle anzeigen"; //copied from de-de
$text['button-view_all']['de-ch'] = "Alle anzeigen"; //copied from de-de
$text['button-view_all']['de-de'] = "Alle anzeigen";
$text['button-view_all']['es-cl'] = "Mostrar Todos";
$text['button-view_all']['es-mx'] = "Mostrar Todos"; //copied from es-cl
$text['button-view_all']['fr-ca'] = "Tout Montrer"; //copied from fr-fr
$text['button-view_all']['fr-fr'] = "Tout Montrer";
$text['button-view_all']['he-il'] = "הצג הכל";
$text['button-view_all']['it-it'] = "Mostra Tutto";
$text['button-view_all']['nl-nl'] = "Toon alles";
$text['button-view_all']['pl-pl'] = "Pokaż wszystkie";
$text['button-view_all']['pt-br'] = "Mostrar Todos"; //copied from pt-pt
$text['button-view_all']['pt-pt'] = "Mostrar Todos";
$text['button-view_all']['ro-ro'] = "";
$text['button-view_all']['ru-ru'] = "Показать все";
$text['button-view_all']['sv-se'] = "Visa Allt";
$text['button-view_all']['uk-ua'] = "Показати всі";
?>

View File

@ -0,0 +1,33 @@
<?php
$y=0;
$apps[$x]['menu'][$y]['title']['en-us'] = "Call Forward";
$apps[$x]['menu'][$y]['title']['en-gb'] = "Call Forward";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
$apps[$x]['menu'][$y]['title']['de-at'] = "Rufumleitung";
$apps[$x]['menu'][$y]['title']['de-ch'] = "Rufumleitung";
$apps[$x]['menu'][$y]['title']['de-de'] = "Rufumleitung";
$apps[$x]['menu'][$y]['title']['es-cl'] = "Reenvio de Llamadas";
$apps[$x]['menu'][$y]['title']['es-mx'] = "Reenvio de Llamadas";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "Renvoi d'appel";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "Renvoi d'appel";
$apps[$x]['menu'][$y]['title']['he-il'] = "";
$apps[$x]['menu'][$y]['title']['it-it'] = "Inoltro";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "Oproep doorsturen";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Przekierowanie";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Encaminhamento de chamadas";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "Encaminhamento de Chamadas";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Переадресация";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Vidarekoppling";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "Переадресація";
$apps[$x]['menu'][$y]['uuid'] = "4e4df00b-aafb-45a8-82c1-cdabc921889c";
$apps[$x]['menu'][$y]['parent_uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['path'] = "/app/call_forward/call_forward.php";
$apps[$x]['menu'][$y]['groups'][] = "user";
$apps[$x]['menu'][$y]['groups'][] = "admin";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
?>

View File

@ -0,0 +1,407 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2021
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/paging.php";
//check permissions
if (permission_exists('follow_me') || permission_exists('call_forward') || permission_exists('do_not_disturb')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get($_SESSION['domain']['language']['code'], 'app/call_forward');
//get posted data
if (is_array($_POST['extensions'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$extensions = $_POST['extensions'];
}
//process the http post data by action
if ($action != '' && is_array($extensions) && @sizeof($extensions) != 0) {
switch ($action) {
case 'toggle_call_forward':
if (permission_exists('call_forward')) {
$obj = new call_forward;
$obj->toggle($extensions);
}
break;
case 'toggle_follow_me':
if (permission_exists('follow_me')) {
$obj = new follow_me;
$obj->toggle($extensions);
}
break;
case 'toggle_do_not_disturb':
if (permission_exists('do_not_disturb')) {
$obj = new do_not_disturb;
$obj->toggle($extensions);
}
break;
}
header('Location: call_forward.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
}
//get order and order by
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//get the search
$search = strtolower($_GET["search"]);
//define select count query
$sql = "select count(*) from v_extensions ";
if ($_GET['show'] == "all" && permission_exists('call_forward_all')) {
$sql .= "where true ";
}
else {
$sql .= "where domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
if (strlen($search) > 0) {
$sql .= "and ( ";
$sql .= "extension like :search ";
$sql .= "or lower(description) like :search ";
$sql .= ") ";
$parameters['search'] = '%'.$search.'%';
}
$sql .= "and enabled = 'true' ";
if (!permission_exists('extension_edit')) {
if (is_array($_SESSION['user']['extension']) && count($_SESSION['user']['extension']) > 0) {
$sql .= "and (";
$x = 0;
foreach($_SESSION['user']['extension'] as $row) {
if ($x > 0) { $sql .= "or "; }
$sql .= "extension = '".$row['user']."' ";
$x++;
}
$sql .= ")";
}
else {
//used to hide any results when a user has not been assigned an extension
$sql .= "and extension = 'disabled' ";
}
}
$sql .= $sql_search;
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
unset($parameters);
//prepare the paging
if ($is_included) {
$rows_per_page = 10;
}
else {
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
}
$params[] = "app_uuid=".$app_uuid;
if ($search) { $params[] = "search=".$search; }
if ($order_by) { $params[] = "order_by=".$order_by; }
if ($order) { $params[] = "order=".$order; }
if ($_GET['show'] == "all" && permission_exists('call_forward_all')) {
$params[] .= "show=all";
}
$param = $params ? implode('&', $params) : null;
unset($params);
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
$offset = $rows_per_page * $page;
//get the list
$sql = "select * from v_extensions ";
if ($_GET['show'] == "all" && permission_exists('call_forward_all')) {
$sql .= "where true ";
}
else {
$sql .= "where domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
if (strlen($search) > 0) {
$sql .= "and ( ";
$sql .= "extension like :search ";
$sql .= "or lower(description) like :search ";
$sql .= ") ";
$parameters['search'] = '%'.$search.'%';
}
$sql .= "and enabled = 'true' ";
if (!permission_exists('extension_edit')) {
if (is_array($_SESSION['user']['extension']) && count($_SESSION['user']['extension']) > 0) {
$sql .= "and (";
$x = 0;
foreach($_SESSION['user']['extension'] as $row) {
if ($x > 0) { $sql .= "or "; }
$sql .= "extension = '".$row['user']."' ";
$x++;
}
$sql .= ")";
}
else {
//used to hide any results when a user has not been assigned an extension
$sql .= "and extension = 'disabled' ";
}
}
$sql .= $sql_search;
$sql .= order_by($order_by, $order, 'extension', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$extensions = $database->select($sql, $parameters, 'all');
unset($parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//include header
if (!$is_included) {
$document['title'] = $text['title-call_forward'];
}
require_once "resources/header.php";
//show the content
if ($is_included) {
echo "<div class='action_bar sub'>\n";
echo " <div class='heading'><b>".$text['header-call_forward']."</b></div>\n";
echo " <div class='actions'>\n";
if ($num_rows > 10) {
echo button::create(['type'=>'button','label'=>$text['button-view_all'],'icon'=>'project-diagram','collapse'=>false,'link'=>PROJECT_PATH.'/app/call_forward/call_forward.php']);
}
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
}
else {
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['header-call_forward']." (".$num_rows.")</b></div>\n";
echo " <div class='actions'>\n";
if ($extensions) {
if (permission_exists('call_forward')) {
echo button::create(['type' => 'button', 'label' => $text['label-call_forward'], 'icon' => $_SESSION['theme']['button_icon_toggle'], 'collapse' => false, 'name' => 'btn_toggle_cfwd', 'onclick' => "list_action_set('toggle_call_forward'); modal_open('modal-toggle','btn_toggle');"]);
}
if (permission_exists('follow_me')) {
echo button::create(['type' => 'button', 'label' => $text['label-follow_me'], 'icon' => $_SESSION['theme']['button_icon_toggle'], 'collapse' => false, 'name' => 'btn_toggle_follow', 'onclick' => "list_action_set('toggle_follow_me'); modal_open('modal-toggle','btn_toggle');"]);
}
if (permission_exists('do_not_disturb')) {
echo button::create(['type' => 'button', 'label' => $text['label-dnd'], 'icon' => $_SESSION['theme']['button_icon_toggle'], 'collapse' => false, 'name' => 'btn_toggle_dnd', 'onclick' => "list_action_set('toggle_do_not_disturb'); modal_open('modal-toggle','btn_toggle');"]);
}
}
if ($_GET['show'] !== 'all' && permission_exists('call_forward_all')) {
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all'.($params ? '&'.implode('&', $params) : null)]);
}
echo "<form id='form_search' class='inline' method='get'>\n";
if ($_GET['show'] == 'all' && permission_exists('call_forward_all')) {
echo " <input type='hidden' name='show' value='all'>";
}
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'call_forward.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
}
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if ($extensions) {
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_form_submit('form_list');"])]);
}
echo $text['description-call_routing']."\n";
echo "<br /><br />\n";
echo "<form id='form_list' method='post'>\n";
if ($_GET['show'] == 'all' && permission_exists('call_forward_all')) {
echo " <input type='hidden' name='show' value='all'>";
}
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
}
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (!$is_included) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle();' ".($extensions ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
if ($_GET['show'] == "all" && permission_exists('call_forward_all')) {
echo "<th>".$text['label-domain']."</th>\n";
}
}
echo " <th>".$text['label-extension']."</th>\n";
if (permission_exists('call_forward')) {
echo " <th>".$text['label-call_forward']."</th>\n";
}
if (permission_exists('follow_me')) {
echo " <th>".$text['label-follow_me']."</th>\n";
}
if (permission_exists('do_not_disturb')) {
echo " <th>".$text['label-dnd']."</th>\n";
}
echo " <th class='".($is_included ? 'hide-md-dn' : 'hide-sm-dn')."'>".$text['label-description']."</th>\n";
if ($_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($extensions)) {
$x = 0;
foreach($extensions as $row) {
$list_row_url = PROJECT_PATH."/app/call_forward/call_forward_edit.php?id=".$row['extension_uuid']."&return_url=".urlencode($_SERVER['REQUEST_URI']);
echo "<tr class='list-row' href='".$list_row_url."'>\n";
if (!$is_included && $extensions) {
echo " <td class='checkbox'>\n";
echo " <input type='checkbox' name='extensions[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
echo " <input type='hidden' name='extensions[$x][uuid]' value='".escape($row['extension_uuid'])."' />\n";
echo " </td>\n";
if ($_GET['show'] == "all" && permission_exists('call_forward_all')) {
if (strlen($_SESSION['domains'][$row['domain_uuid']]['domain_name']) > 0) {
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
}
else {
$domain = $text['label-global'];
}
echo " <td>".escape($domain)."</td>\n";
}
}
echo " <td><a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['extension'])."</a></td>\n";
if (permission_exists('call_forward')) {
//-- inline toggle -----------------
//$button_label = $row['forward_all_enabled'] == 'true' ? ($row['forward_all_destination'] != '' ? escape(format_phone($row['forward_all_destination'])) : '('.$text['label-invalid'].')') : null;
//if (!$is_included) {
// echo " <td class='no-link'>";
// echo button::create(['type'=>'submit','class'=>'link','label'=>($button_label != '' ? $button_label : $text['label-disabled']),'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle_call_forward'); list_form_submit('form_list')"]);
// echo " </td>\n";
//}
//else {
// echo " <td>".$button_label."</td>";
//}
//unset($button_label);
//----------------------------------
echo " <td>\n";
echo $row['forward_all_enabled'] == 'true' ? escape(format_phone($row['forward_all_destination'])) : '&nbsp;';
echo " </td>\n";
}
if (permission_exists('follow_me')) {
//-- inline toggle -----------------
//get destination count
//if ($row['follow_me_enabled'] == 'true' && is_uuid($row['follow_me_uuid'])) {
// $sql = "select count(*) from v_follow_me_destinations ";
// $sql .= "where follow_me_uuid = :follow_me_uuid ";
// $sql .= "and domain_uuid = :domain_uuid ";
// $parameters['follow_me_uuid'] = $row['follow_me_uuid'];
// $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
// $database = new database;
// $follow_me_destination_count = $database->select($sql, $parameters, 'column');
// $button_label = $follow_me_destination_count ? $text['label-enabled'].' ('.$follow_me_destination_count.')' : $text['label-invalid'];
// unset($sql, $parameters);
//}
//if (!$is_included) {
// echo " <td class='no-link'>\n";
// echo button::create(['type'=>'submit','class'=>'link','label'=>($button_label != '' ? $button_label : $text['label-disabled']),'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle_follow_me'); list_form_submit('form_list')"]);
// echo " </td>\n";
//}
//else {
// echo " <td>".$button_label."</td>";
//}
//unset($button_label);
//----------------------------------
//get destination count
$follow_me_destination_count = 0;
if ($row['follow_me_enabled'] == 'true' && is_uuid($row['follow_me_uuid'])) {
$sql = "select count(*) from v_follow_me_destinations ";
$sql .= "where follow_me_uuid = :follow_me_uuid ";
$sql .= "and domain_uuid = :domain_uuid ";
$parameters['follow_me_uuid'] = $row['follow_me_uuid'];
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$follow_me_destination_count = $database->select($sql, $parameters, 'column');
unset($sql, $parameters);
}
echo " <td>\n";
echo $follow_me_destination_count ? $text['label-enabled'].' ('.$follow_me_destination_count.')' : '&nbsp;';
echo " </td>\n";
}
if (permission_exists('do_not_disturb')) {
//-- inline toggle -----------------
//$button_label = $row['do_not_disturb'] == 'true' ? $text['label-enabled'] : null;
//if (!$is_included) {
// echo " <td class='no-link'>";
// echo button::create(['type'=>'submit','class'=>'link','label'=>($button_label != '' ? $button_label : $text['label-disabled']),'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle_do_not_disturb'); list_form_submit('form_list')"]);
// echo " </td>\n";
//}
//else {
// echo " <td>".$button_label."</td>";
//}
//----------------------------------
echo " <td>\n";
echo $row['do_not_disturb'] == 'true' ? $text['label-enabled'] : '&nbsp;';
echo " </td>\n";
}
echo " <td class='description overflow ".($is_included ? 'hide-md-dn' : 'hide-sm-dn')."'>".escape($row['description'])."&nbsp;</td>\n";
if ($_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";
}
echo "</tr>\n";
$x++;
}
unset($extensions);
}
echo "</table>\n";
if (!$is_included) {
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
require_once "resources/footer.php";
}
?>

View File

@ -0,0 +1,756 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2022
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('follow_me') || permission_exists('call_forward') || permission_exists('do_not_disturb')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//define the destination_select function
function destination_select($select_name, $select_value, $select_default) {
if (strlen($select_value) == 0) { $select_value = $select_default; }
echo " <select class='formfld' style='width: 55px;' name='$select_name'>\n";
$i = 0;
while($i <= 100) {
echo " <option value='".$i."' ".(($select_value == $i) ? "selected='selected'" : null).">".$i."</option>\n";
$i = $i + 5;
}
echo "</select>\n";
}
//get the extension_uuid
$extension_uuid = $_REQUEST["id"];
//get the extension number
$sql = "select * from v_extensions ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and extension_uuid = :extension_uuid ";
if (!permission_exists('extension_edit')) {
if (count($_SESSION['user']['extension']) > 0) {
$sql .= "and (";
$x = 0;
foreach($_SESSION['user']['extension'] as $index => $row) {
if ($x > 0) { $sql .= "or "; }
$sql .= "extension = :extension_".$index." ";
$parameters['extension_'.$index] = $row['user'];
$x++;
}
$sql .= ")";
}
else {
//hide any results when a user has not been assigned an extension
$sql .= "and extension = 'disabled' ";
}
}
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['extension_uuid'] = $extension_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && sizeof($row) != 0) {
$extension = $row["extension"];
$number_alias = $row["number_alias"];
$accountcode = $row["accountcode"];
$effective_caller_id_name = $row["effective_caller_id_name"];
$effective_caller_id_number = $row["effective_caller_id_number"];
$outbound_caller_id_name = $row["outbound_caller_id_name"];
$outbound_caller_id_number = $row["outbound_caller_id_number"];
$do_not_disturb = $row["do_not_disturb"] != '' ? $row["do_not_disturb"] : 'false';
$forward_all_destination = $row["forward_all_destination"];
$forward_all_enabled = $row["forward_all_enabled"];
$forward_busy_destination = $row["forward_busy_destination"];
$forward_busy_enabled = $row["forward_busy_enabled"];
$forward_no_answer_destination = $row["forward_no_answer_destination"];
$forward_no_answer_enabled = $row["forward_no_answer_enabled"];
$forward_user_not_registered_destination = $row["forward_user_not_registered_destination"];
$forward_user_not_registered_enabled = $row["forward_user_not_registered_enabled"];
$follow_me_uuid = $row["follow_me_uuid"];
}
else {
echo "access denied";
exit;
}
unset($sql, $parameters, $row);
//process post vars
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//get http post variables and set them to php variables
if (count($_POST) > 0) {
$forward_all_enabled = $_POST["forward_all_enabled"];
$forward_all_destination = $_POST["forward_all_destination"];
$forward_busy_enabled = $_POST["forward_busy_enabled"];
$forward_busy_destination = $_POST["forward_busy_destination"];
$forward_no_answer_enabled = $_POST["forward_no_answer_enabled"];
$forward_no_answer_destination = $_POST["forward_no_answer_destination"];
$forward_user_not_registered_enabled = $_POST["forward_user_not_registered_enabled"];
$forward_user_not_registered_destination = $_POST["forward_user_not_registered_destination"];
$cid_name_prefix = $_POST["cid_name_prefix"];
$cid_number_prefix = $_POST["cid_number_prefix"];
$follow_me_enabled = $_POST["follow_me_enabled"];
$follow_me_ignore_busy = $_POST["follow_me_ignore_busy"];
$n = 0;
$destination_found = false;
foreach ($_POST["destinations"] as $field) {
$destinations[$n]['uuid'] = $field['uuid'];
$destinations[$n]['destination'] = $field['destination'];
$destinations[$n]['delay'] = $field['delay'];
$destinations[$n]['prompt'] = $field['prompt'];
$destinations[$n]['timeout'] = $field['timeout'];
if ($field['destination'] != '') {
$destination_found = true;
}
$n++;
}
$dnd_enabled = $_POST["dnd_enabled"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: call_forward.php');
exit;
}
//check for all required data
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
$document['title'] = $text['title-call_routing'];
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "resources/footer.php";
return;
}
//include the classes
include "resources/classes/call_forward.php";
include "resources/classes/follow_me.php";
include "resources/classes/do_not_disturb.php";
//call forward config
if (permission_exists('call_forward')) {
//sanitize the destinations
$forward_all_destination = preg_replace('#[^\*0-9]#', '', $forward_all_destination);
$forward_busy_destination = preg_replace('#[^\*0-9]#', '', $forward_busy_destination);
$forward_no_answer_destination = preg_replace('#[^\*0-9]#', '', $forward_no_answer_destination);
$forward_user_not_registered_destination = preg_replace('#[^\*0-9]#', '', $forward_user_not_registered_destination);
//build the array
$array['extensions'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['extensions'][0]['extension_uuid'] = $extension_uuid;
$array['extensions'][0]['forward_all_enabled'] = $forward_all_enabled;
$array['extensions'][0]['forward_all_destination'] = $forward_all_destination;
$array['extensions'][0]['forward_busy_enabled'] = $forward_busy_enabled;
$array['extensions'][0]['forward_busy_destination'] = $forward_busy_destination;
$array['extensions'][0]['forward_no_answer_enabled'] = $forward_no_answer_enabled;
$array['extensions'][0]['forward_no_answer_destination'] = $forward_no_answer_destination;
$array['extensions'][0]['forward_user_not_registered_enabled'] = $forward_user_not_registered_enabled;
$array['extensions'][0]['forward_user_not_registered_destination'] = $forward_user_not_registered_destination;
}
//do not disturb (dnd) config
if (permission_exists('do_not_disturb')) {
$array['extensions'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['extensions'][0]['extension_uuid'] = $extension_uuid;
$array['extensions'][0]['do_not_disturb'] = $dnd_enabled;
}
//follow me config
if (permission_exists('follow_me')) {
//add follow_me_uuid and follow_me_enabled to the extensions array
if ($follow_me_uuid == '') {
$follow_me_uuid = uuid();
$array['extensions'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['extensions'][0]['extension_uuid'] = $extension_uuid;
$array['extensions'][0]['follow_me_uuid'] = $follow_me_uuid;
}
if ($destination_found) {
$array['extensions'][0]['follow_me_enabled'] = $follow_me_enabled;
}
else {
$array['extensions'][0]['follow_me_enabled'] = 'false';
}
//build the follow me array
$array['follow_me'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['follow_me'][0]['follow_me_uuid'] = $follow_me_uuid;
$array['follow_me'][0]['cid_name_prefix'] = $cid_name_prefix;
$array['follow_me'][0]['cid_number_prefix'] = $cid_number_prefix;
$array['follow_me'][0]['follow_me_ignore_busy'] = $follow_me_ignore_busy;
if ($destination_found) {
$array['follow_me'][0]['follow_me_enabled'] = $follow_me_enabled;
}
else {
$array['follow_me'][0]['follow_me_enabled'] = 'false';
}
$d = 0;
$destination_found = false;
foreach ($destinations as $field) {
if ($field['destination'] != '') {
//sanitize the destination
$field['destination'] = preg_replace('#[^\*0-9]#', '', $field['destination']);
//build the array
$array['follow_me'][0]['follow_me_destinations'][$d]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['follow_me'][0]['follow_me_destinations'][$d]['follow_me_uuid'] = $follow_me_uuid;
$array['follow_me'][0]['follow_me_destinations'][$d]['follow_me_destination_uuid'] = $field['uuid'];
$array['follow_me'][0]['follow_me_destinations'][$d]['follow_me_destination'] = $field['destination'];
$array['follow_me'][0]['follow_me_destinations'][$d]['follow_me_delay'] = $field['delay'];
$array['follow_me'][0]['follow_me_destinations'][$d]['follow_me_prompt'] = $field['prompt'];
$array['follow_me'][0]['follow_me_destinations'][$d]['follow_me_timeout'] = $field['timeout'];
$array['follow_me'][0]['follow_me_destinations'][$d]['follow_me_order'] = $d;
$destination_found = true;
$d++;
}
else {
$follow_me_delete_uuids[] = $field['uuid'];
}
}
}
//add the dialplan permission
$p = new permissions;
$p->add("extension_edit", "temp");
//save the data
$database = new database;
$database->app_name = 'call_routing';
$database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d';
$database->save($array);
unset($array);
//$message = $database->message;
//remove the temporary permission
$p->delete("extension_edit", "temp");
//delete empty destination records
if (is_array($follow_me_delete_uuids) && sizeof($follow_me_delete_uuids) > 0) {
foreach ($follow_me_delete_uuids as $follow_me_delete_uuid) {
$array['follow_me_destinations'][]['follow_me_destination_uuid'] = $follow_me_delete_uuid;
}
$database = new database;
$database->app_name = 'call_routing';
$database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d';
$database->delete($array);
unset($array);
}
/*
//call forward config
if (permission_exists('call_forward')) {
$call_forward = new call_forward;
$call_forward->domain_uuid = $_SESSION['domain_uuid'];
$call_forward->domain_name = $_SESSION['domain_name'];
$call_forward->extension_uuid = $extension_uuid;
$call_forward->forward_all_destination = $forward_all_destination;
$call_forward->forward_all_enabled = $forward_all_enabled;
}
//do not disturb (dnd) config
if (permission_exists('do_not_disturb')) {
$dnd = new do_not_disturb;
$dnd->domain_uuid = $_SESSION['domain_uuid'];
$dnd->domain_name = $_SESSION['domain_name'];
$dnd->extension_uuid = $extension_uuid;
$dnd->extension = $extension;
$dnd->enabled = $dnd_enabled;
}
//if follow me is enabled then process call forward and dnd first
if ($follow_me_enabled == "true") {
//call forward
$call_forward->set();
unset($call_forward);
//dnd
$dnd->set();
$dnd->user_status();
unset($dnd);
}
//follow me config and process
if (permission_exists('follow_me')) {
$follow_me = new follow_me;
$follow_me->domain_uuid = $_SESSION['domain_uuid'];
$follow_me->extension_uuid = $extension_uuid;
$follow_me->follow_me_uuid = $follow_me_uuid;
$follow_me->follow_me_ignore_busy = $follow_me_ignore_busy;
$follow_me->follow_me_enabled = $follow_me_enabled;
$follow_me->set();
unset($follow_me);
}
//if dnd or call forward are enabled process them last
if ($follow_me_enabled != "true") {
if ($forward_all_enabled == "true") {
//dnd
$dnd->set();
$dnd->user_status();
unset($dnd);
//call forward
$call_forward->set();
unset($call_forward);
}
else{
//call forward
$call_forward->set();
unset($call_forward);
//dnd
$dnd->set();
$dnd->user_status();
unset($dnd);
}
}
*/
//send feature event notify to the phone
if ($_SESSION['device']['feature_sync']['boolean'] == "true") {
$ring_count = ceil($call_timeout / 6);
$feature_event_notify = new feature_event_notify;
$feature_event_notify->domain_name = $_SESSION['domain_name'];
$feature_event_notify->extension = $extension;
$feature_event_notify->do_not_disturb = $dnd_enabled;
$feature_event_notify->ring_count = $ring_count;
$feature_event_notify->forward_all_enabled = $forward_all_enabled;
$feature_event_notify->forward_busy_enabled = $forward_busy_enabled;
$feature_event_notify->forward_no_answer_enabled = $forward_no_answer_enabled;
//workaround for freeswitch not sending NOTIFY when destination values are nil. Send 0.
if ($forward_all_destination == "") {
$feature_event_notify->forward_all_destination = "0";
}
else {
$feature_event_notify->forward_all_destination = $forward_all_destination;
}
if ($forward_busy_destination == "") {
$feature_event_notify->forward_busy_destination = "0";
}
else {
$feature_event_notify->forward_busy_destination = $forward_busy_destination;
}
if ($forward_no_answer_destination == "") {
$feature_event_notify->forward_no_answer_destination = "0";
}
else {
$feature_event_notify->forward_no_answer_destination = $forward_no_answer_destination;
}
$feature_event_notify->send_notify();
unset($feature_event_notify);
}
//send presence event
if (permission_exists('do_not_disturb')) {
if ($dnd_enabled == 'true') {
//build the event
$cmd = "sendevent PRESENCE_IN\n";
$cmd .= "proto: sip\n";
$cmd .= "login: ".$extension."@".$_SESSION['domain_name']."\n";
$cmd .= "from: ".$extension."@".$_SESSION['domain_name']."\n";
$cmd .= "status: Active (1 waiting)\n";
$cmd .= "rpid: unknown\n";
$cmd .= "event_type: presence\n";
$cmd .= "alt_event_type: dialog\n";
$cmd .= "event_count: 1\n";
$cmd .= "unique-id: ".uuid()."\n";
$cmd .= "Presence-Call-Direction: outbound\n";
$cmd .= "answer-state: confirmed\n";
//send the event
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
$switch_result = event_socket_request($fp, $cmd);
unset($fp);
}
else {
$presence = new presence;
if (!$presence->active($extension."@".$_SESSION['domain_name'])) {
//build the event
$cmd = "sendevent PRESENCE_IN\n";
$cmd .= "proto: sip\n";
$cmd .= "login: ".$extension."@".$_SESSION['domain_name']."\n";
$cmd .= "from: ".$extension."@".$_SESSION['domain_name']."\n";
$cmd .= "status: Active (1 waiting)\n";
$cmd .= "rpid: unknown\n";
$cmd .= "event_type: presence\n";
$cmd .= "alt_event_type: dialog\n";
$cmd .= "event_count: 1\n";
$cmd .= "unique-id: ".uuid()."\n";
$cmd .= "Presence-Call-Direction: outbound\n";
$cmd .= "answer-state: terminated\n";
//send the event
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
$switch_result = event_socket_request($fp, $cmd);
unset($fp);
}
}
}
//synchronize configuration
if (is_readable($_SESSION['switch']['extensions']['dir'])) {
require_once "app/extensions/resources/classes/extension.php";
$ext = new extension;
$ext->xml();
unset($ext);
}
//clear the cache
$cache = new cache;
$cache->delete("directory:".$extension."@".$_SESSION['domain_name']);
if (strlen($number_alias) > 0) {
$cache->delete("directory:".$number_alias."@".$_SESSION['domain_name']);
}
//add the message
message::add($text['confirm-update']);
}
//show the header
$document['title'] = $text['title-call_routing'];
require_once "resources/header.php";
//pre-populate the form
if (is_uuid($follow_me_uuid)) {
$sql = "select * from v_follow_me ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and follow_me_uuid = :follow_me_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['follow_me_uuid'] = $follow_me_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
unset($sql, $parameters);
if (is_array($row) && sizeof($row) != 0) {
$cid_name_prefix = $row["cid_name_prefix"];
$cid_number_prefix = $row["cid_number_prefix"];
$follow_me_enabled = $row["follow_me_enabled"];
$follow_me_ignore_busy = $row["follow_me_ignore_busy"];
unset($row);
$sql = "select * from v_follow_me_destinations ";
$sql .= "where follow_me_uuid = :follow_me_uuid ";
$sql .= "order by follow_me_order asc ";
$parameters['follow_me_uuid'] = $follow_me_uuid;
$database = new database;
$result = $database->select($sql, $parameters, 'all');
unset($destinations);
foreach ($result as $x => &$row) {
$destinations[$x]['uuid'] = $row["follow_me_destination_uuid"];
$destinations[$x]['destination'] = $row["follow_me_destination"];
$destinations[$x]['delay'] = $row["follow_me_delay"];
$destinations[$x]['prompt'] = $row["follow_me_prompt"];
$destinations[$x]['timeout'] = $row["follow_me_timeout"];
}
unset($sql, $parameters, $result, $row);
}
}
//get the extensions array - used with autocomplete
$sql = "select * from v_extensions ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "order by extension, number_alias asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$extensions = $database->select($sql, $parameters, 'all');
unset($sql, $parameters, $row);
//set the default
if (!isset($dnd_enabled)) {
//set the value from the database
$dnd_enabled = $do_not_disturb;
}
//prepare the autocomplete
if($_SESSION['follow_me']['follow_me_autocomplete']['boolean'] == 'true') {
echo "<link rel=\"stylesheet\" href=\"".PROJECT_PATH."/resources/jquery/jquery-ui.min.css\" />\n";
echo "<script src=\"".PROJECT_PATH."/resources/jquery/jquery-ui.min.js\"></script>\n";
echo "<script type=\"text/javascript\">\n";
echo "\$(function() {\n";
echo " var extensions = [\n";
foreach ($extensions as &$row) {
if (strlen($number_alias) == 0) {
echo " \"".escape($row["extension"])."\",\n";
}
else {
echo " \"".escape($row["number_alias"])."\",\n";
}
}
echo " ];\n";
for ($n = 0; $n <= ((($_SESSION['follow_me']['max_destinations']['numeric'] != '') ? $_SESSION['follow_me']['max_destinations']['numeric'] : 5) - 1); $n++) {
echo " \$(\"#destination_".$n."\").autocomplete({\n";
echo " source: extensions\n";
echo " });\n";
}
echo "});\n";
echo "</script>\n";
}
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the content
echo "<form method='post' name='frm' id='frm'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-call_forward']."</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'=>'call_forward.php']);
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','style'=>'margin-left: 15px;']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
echo $text['description']." <strong>".escape($extension)."</strong>\n";
echo "<br /><br />\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " <strong>".$text['label-call_forward']."</strong>\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
$on_click .= "$('#tr_follow_me_settings').slideUp('fast'); ";
$on_click .= "document.getElementById('dnd_disabled').checked=true; ";
$on_click .= "document.getElementById('forward_all_destination').focus(); ";
$on_click2 .= "(document.getElementById('follow_me_enabled').checked) ? $('#tr_follow_me_settings').slideDown('fast') : '' ";
echo " <label for='forward_all_disabled'><input type='radio' name='forward_all_enabled' id='forward_all_disabled' onclick=\"$on_click2\" value='false' ".(($forward_all_enabled == "false" || $forward_all_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='forward_all_enabled'><input type='radio' name='forward_all_enabled' id='forward_all_enabled' onclick=\"$on_click\" value='true' ".(($forward_all_enabled == "true") ? "checked='checked'" : null)." /> ".$text['label-enabled']."</label> \n";
unset($on_click);
echo "&nbsp;&nbsp;&nbsp;";
echo " <input class='formfld' type='text' name='forward_all_destination' id='forward_all_destination' maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_all_destination)."\">\n";
echo " <br />".$text['description-call_forward']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-on-busy']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$on_click = "document.getElementById('dnd_disabled').checked=true;";
$on_click .= "document.getElementById('forward_busy_destination').focus();";
echo " <label for='forward_busy_disabled'><input type='radio' name='forward_busy_enabled' id='forward_busy_disabled' onclick=\"\" value='false' ".(($forward_busy_enabled == "false" || $forward_busy_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='forward_busy_enabled'><input type='radio' name='forward_busy_enabled' id='forward_busy_enabled' onclick=\"$on_click\" value='true' ".(($forward_busy_enabled == "true") ? "checked='checked'" : null)."/> ".$text['label-enabled']."</label> \n";
unset($on_click);
echo "&nbsp;&nbsp;&nbsp;";
echo " <input class='formfld' type='text' name='forward_busy_destination' id='forward_busy_destination' maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_busy_destination)."\">\n";
echo " <br />".$text['description-on-busy']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-no_answer']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$on_click = "document.getElementById('dnd_disabled').checked=true;";
$on_click .= "document.getElementById('forward_no_answer_destination').focus();";
echo " <label for='forward_no_answer_disabled'><input type='radio' name='forward_no_answer_enabled' id='forward_no_answer_disabled' onclick=\"\" value='false' ".(($forward_no_answer_enabled == "false" || $forward_no_answer_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='forward_no_answer_enabled'><input type='radio' name='forward_no_answer_enabled' id='forward_no_answer_enabled' onclick=\"$on_click\" value='true' ".(($forward_no_answer_enabled == "true") ? "checked='checked'" : null)."/> ".$text['label-enabled']."</label> \n";
unset($on_click);
echo "&nbsp;&nbsp;&nbsp;";
echo " <input class='formfld' type='text' name='forward_no_answer_destination' id='forward_no_answer_destination' maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_no_answer_destination)."\">\n";
echo " <br />".$text['description-no_answer']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-not_registered']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$on_click = "document.getElementById('forward_user_not_registered_destination').focus();";
echo " <label for='forward_user_not_registered_disabled'><input type='radio' name='forward_user_not_registered_enabled' id='forward_user_not_registered_disabled' onclick=\"\" value='false' ".(($forward_user_not_registered_enabled == "false" || $forward_user_not_registered_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='forward_user_not_registered_enabled'><input type='radio' name='forward_user_not_registered_enabled' id='forward_user_not_registered_enabled' onclick=\"$on_click\" value='true' ".(($forward_user_not_registered_enabled == "true") ? "checked='checked'" : null)."/> ".$text['label-enabled']."</label> \n";
unset($on_click);
echo "&nbsp;&nbsp;&nbsp;";
echo " <input class='formfld' type='text' name='forward_user_not_registered_destination' id='forward_user_not_registered_destination' maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_user_not_registered_destination)."\">\n";
echo " <br />".$text['description-not_registered']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan='2'><br /></td></tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " <strong>".$text['label-follow_me']."</strong>\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$on_click = "document.getElementById('forward_all_disabled').checked=true; ";
$on_click .= "document.getElementById('dnd_disabled').checked=true; ";
echo " <label for='follow_me_disabled'><input type='radio' name='follow_me_enabled' id='follow_me_disabled' onclick=\"$('#tr_follow_me_settings').slideUp('fast');\" value='false' ".(($follow_me_enabled == "false" || $follow_me_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='follow_me_enabled'><input type='radio' name='follow_me_enabled' id='follow_me_enabled' onclick=\"$('#tr_follow_me_settings').slideDown('fast'); $on_click\" value='true' ".(($follow_me_enabled == "true") ? "checked='checked'" : null)."/> ".$text['label-enabled']."</label> \n";
unset($on_click);
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
if ($follow_me_enabled == "true" && $dnd_enabled != "true" && $forward_all_enabled != "true") { $style = ''; } else { $style = 'display: none;'; }
echo "<div id='tr_follow_me_settings' style='$style'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-destinations']."\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <table border='0' cellpadding='2' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td class='vtable'>".$text['label-destination_number']."</td>\n";
echo " <td class='vtable'>".$text['label-destination_delay']."</td>\n";
echo " <td class='vtable'>".$text['label-destination_timeout']."</td>\n";
if (permission_exists('follow_me_prompt')) {
echo " <td class='vtable'>".$text['label-destination_prompt']."</td>\n";
}
echo " </tr>\n";
//output destinations
for ($n = 0; $n <= ((($_SESSION['follow_me']['max_destinations']['numeric'] != '') ? $_SESSION['follow_me']['max_destinations']['numeric'] : 5) - 1); $n++) {
echo " <input type='hidden' name='destinations[".$n."][uuid]' value='".(($destinations[$n]['uuid'] != '') ? $destinations[$n]['uuid'] : uuid())."'>\n";
echo " <tr>\n";
echo " <td><input class='formfld' style='min-width: 135px;' type='text' name='destinations[".$n."][destination]' id='destination_".$n."' maxlength='255' value=\"".escape($destinations[$n]['destination'])."\"></td>\n";
echo " <td>\n";
destination_select('destinations['.$n.'][delay]', $destinations[$n]['delay'], '0');
echo " </td>\n";
echo " <td>\n";
destination_select('destinations['.$n.'][timeout]', $destinations[$n]['timeout'], (($_SESSION['follow_me']['timeout']['numeric'] != '') ? $_SESSION['follow_me']['timeout']['numeric'] : 30));
echo " </td>\n";
if (permission_exists('follow_me_prompt')) {
echo " <td>\n";
echo " <select class='formfld' style='width: 90px;' name='destinations[".$n."][prompt]'>\n";
echo " <option value=''></option>\n";
echo " <option value='1' ".(($destinations[$n]['prompt'])?"selected='selected'":null).">".$text['label-destination_prompt_confirm']."</option>\n";
//echo " <option value='2'>".$text['label-destination_prompt_announce]."</option>\n";
echo " </select>\n";
echo " </td>\n";
}
echo " </tr>\n";
}
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
if (permission_exists('follow_me_ignore_busy')) {
echo " <tr>\n";
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'>";
echo $text['label-ignore_busy'];
echo " </td>\n";
echo " <td class='vtable' align='left'>\n";
echo " <label for='follow_me_ignore_busy_false'><input type='radio' name='follow_me_ignore_busy' id='follow_me_ignore_busy_false' value='false' onclick=\"\" ".(($follow_me_ignore_busy == "false" || $follow_me_ignore_busy == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='follow_me_ignore_busy_true'><input type='radio' name='follow_me_ignore_busy' id='follow_me_ignore_busy_true' value='true' onclick=\"$on_click\" ".(($follow_me_ignore_busy == "true") ? "checked='checked'" : null)." /> ".$text['label-enabled']."</label> \n";
echo " <br />\n";
echo $text['description-ignore_busy']."\n";
echo " </td>\n";
echo " </tr>\n";
}
if (permission_exists('follow_me_cid_name_prefix')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-cid-name-prefix']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='cid_name_prefix' maxlength='255' value='".escape($cid_name_prefix)."'>\n";
echo "<br />\n";
echo $text['description-cid-name-prefix']."\n";
echo "</td>\n";
echo "</tr>\n";
}
if (permission_exists('follow_me_cid_number_prefix')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-cid-number-prefix']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='cid_number_prefix' maxlength='255' value='".escape($cid_number_prefix)."'>\n";
echo "<br />\n";
echo $text['description-cid-number-prefix']."\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
echo "</div>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr><td colspan='2'><br /></td></tr>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " <strong>".$text['label-dnd']."</strong>\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
$on_click = "document.getElementById('forward_all_disabled').checked=true;";
$on_click .= "$('#tr_follow_me_settings').slideUp('fast'); ";
$on_click2 .= "(document.getElementById('follow_me_enabled').checked) ? $('#tr_follow_me_settings').slideDown('fast') : '' ";
echo " <label for='dnd_disabled'><input type='radio' name='dnd_enabled' id='dnd_disabled' value='false' onclick=\"$on_click2\" ".(($dnd_enabled == "false" || $dnd_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='dnd_enabled'><input type='radio' name='dnd_enabled' id='dnd_enabled' value='true' onclick=\"$on_click\" ".(($dnd_enabled == "true") ? "checked='checked'" : null)." /> ".$text['label-enabled']."</label> \n";
echo " <br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "<br /><br />";
if ($action == "update") {
echo "<input type='hidden' name='id' value='".escape($extension_uuid)."'>\n";
}
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,279 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Copyright (C) 2010 - 2016
All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
Errol Samuels <voiptology@gmail.com>
*/
include "root.php";
//define the call_forward class
class call_forward {
public $debug;
public $domain_uuid;
public $domain_name;
public $extension_uuid;
private $extension;
private $number_alias;
public $forward_all_destination;
public $forward_all_enabled;
private $toll_allow;
public $accountcode;
public $outbound_caller_id_name;
public $outbound_caller_id_number;
public function set() {
//determine whether to update the dial string
$sql = "select * from v_extensions ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and extension_uuid = :extension_uuid ";
$parameters['domain_uuid'] = $this->domain_uuid;
$parameters['extension_uuid'] = $this->extension_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) {
$this->extension = $row["extension"];
$this->number_alias = $row["number_alias"];
$this->accountcode = $row["accountcode"];
$this->toll_allow = $row["toll_allow"];
$this->outbound_caller_id_name = $row["outbound_caller_id_name"];
$this->outbound_caller_id_number = $row["outbound_caller_id_number"];
}
unset($sql, $parameters, $row);
//build extension update array
$array['extensions'][0]['extension_uuid'] = $this->extension_uuid;
$array['extensions'][0]['forward_all_destination'] = strlen($this->forward_all_destination) != 0 ? $this->forward_all_destination : null;
if (strlen($this->forward_all_destination) == 0 || $this->forward_all_enabled == "false") {
$array['extensions'][0]['forward_all_enabled'] = 'false';
}
else {
$array['extensions'][0]['forward_all_enabled'] = 'true';
}
//grant temporary permissions
$p = new permissions;
$p->add('extension_add', 'temp');
//execute update
$database = new database;
$database->app_name = 'calls';
$database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d';
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('extension_add', 'temp');
//delete extension from the cache
$cache = new cache;
$cache->delete("directory:".$this->extension."@".$this->domain_name);
if(strlen($this->number_alias) > 0){
$cache->delete("directory:".$this->number_alias."@".$this->domain_name);
}
}
/**
* declare private variables
*/
private $app_name;
private $app_uuid;
private $permission;
private $list_page;
private $table;
private $uuid_prefix;
private $toggle_field;
private $toggle_values;
/**
* toggle records
*/
public function toggle($records) {
//assign private variables
$this->app_name = 'calls';
$this->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d';
$this->permission = 'call_forward';
$this->list_page = 'calls.php';
$this->table = 'extensions';
$this->uuid_prefix = 'extension_';
$this->toggle_field = 'forward_all_enabled';
$this->toggle_values = ['true','false'];
if (permission_exists($this->permission)) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//toggle the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get current toggle state
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select ".$this->uuid_prefix."uuid as uuid, extension, number_alias, ";
$sql .= "call_timeout, do_not_disturb, ";
$sql .= "forward_all_enabled, forward_all_destination, ";
$sql .= "forward_busy_enabled, forward_busy_destination, ";
$sql .= "forward_no_answer_enabled, forward_no_answer_destination, ";
$sql .= $this->toggle_field." as toggle, follow_me_uuid ";
$sql .= "from v_".$this->table." ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
$extensions[$row['uuid']]['extension'] = $row['extension'];
$extensions[$row['uuid']]['number_alias'] = $row['number_alias'];
$extensions[$row['uuid']]['call_timeout'] = $row['call_timeout'];
$extensions[$row['uuid']]['do_not_disturb'] = $row['do_not_disturb'];
$extensions[$row['uuid']]['forward_all_enabled'] = $row['forward_all_enabled'];
$extensions[$row['uuid']]['forward_all_destination'] = $row['forward_all_destination'];
$extensions[$row['uuid']]['forward_busy_enabled'] = $row['forward_busy_enabled'];
$extensions[$row['uuid']]['forward_busy_destination'] = $row['forward_busy_destination'];
$extensions[$row['uuid']]['forward_no_answer_enabled'] = $row['forward_no_answer_enabled'];
$extensions[$row['uuid']]['forward_no_answer_destination'] = $row['forward_no_answer_destination'];
$extensions[$row['uuid']]['state'] = $row['toggle'];
$extensions[$row['uuid']]['follow_me_uuid'] = $row['follow_me_uuid'];
}
}
unset($sql, $parameters, $rows, $row);
}
//build update array
$x = 0;
foreach ($extensions as $uuid => $extension) {
//check destination
$destination_exists = $extension['forward_all_destination'] != '' ? true : false;
//determine new state
$new_state = $extension['state'] == $this->toggle_values[1] && $destination_exists ? $this->toggle_values[0] : $this->toggle_values[1];
//toggle feature
if ($new_state != $extension['state']) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
$array[$this->table][$x][$this->toggle_field] = $new_state;
}
//disable other features
if ($new_state == $this->toggle_values[0]) { //true
$array[$this->table][$x]['do_not_disturb'] = $this->toggle_values[1]; //false
$array[$this->table][$x]['follow_me_enabled'] = $this->toggle_values[1]; //false
if (is_uuid($extension['follow_me_uuid'])) {
$array['follow_me'][$x]['follow_me_uuid'] = $extension['follow_me_uuid'];
$array['follow_me'][$x]['follow_me_enabled'] = $this->toggle_values[1]; //false
}
}
//increment counter
$x++;
}
//save the changes
if (is_array($array) && @sizeof($array) != 0) {
//grant temporary permissions
$p = new permissions;
$p->add('extension_edit', 'temp');
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('extension_edit', 'temp');
//send feature event notify to the phone
if ($_SESSION['device']['feature_sync']['boolean'] == "true") {
foreach ($extensions as $uuid => $extension) {
$feature_event_notify = new feature_event_notify;
$feature_event_notify->domain_name = $_SESSION['domain_name'];
$feature_event_notify->extension = $extension['extension'];
$feature_event_notify->do_not_disturb = $extension['do_not_disturb'];
$feature_event_notify->ring_count = ceil($extension['call_timeout'] / 6);
$feature_event_notify->forward_all_enabled = $extension['forward_all_enabled'];
$feature_event_notify->forward_busy_enabled = $extension['forward_busy_enabled'];
$feature_event_notify->forward_no_answer_enabled = $extension['forward_no_answer_enabled'];
//workarounds: send 0 as freeswitch doesn't send NOTIFY when destination values are nil
$feature_event_notify->forward_all_destination = $extension['forward_all_destination'] != '' ? $extension['forward_all_destination'] : '0';
$feature_event_notify->forward_busy_destination = $extension['forward_busy_destination'] != '' ? $extension['forward_busy_destination'] : '0';
$feature_event_notify->forward_no_answer_destination = $extension['forward_no_answer_destination'] != '' ? $extension['forward_no_answer_destination'] : '0';
$feature_event_notify->send_notify();
unset($feature_event_notify);
}
}
//synchronize configuration
if (is_readable($_SESSION['switch']['extensions']['dir'])) {
require_once "app/extensions/resources/classes/extension.php";
$ext = new extension;
$ext->xml();
unset($ext);
}
//clear the cache
$cache = new cache;
foreach ($extensions as $uuid => $extension) {
$cache->delete("directory:".$extension['extension']."@".$_SESSION['domain_name']);
if ($extension['number_alias'] != '') {
$cache->delete("directory:".$extension['number_alias']."@".$_SESSION['domain_name']);
}
}
//set message
message::add($text['message-toggle']);
}
unset($records, $extensions, $extension);
}
}
} //function
}// class
?>

View File

@ -0,0 +1,293 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Copyright (C) 2010 - 2016
All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
//define the dnd class
class do_not_disturb {
public $debug;
public $domain_uuid;
public $domain_name;
public $extension_uuid;
public $extension;
public $enabled;
//update the user_status
public function user_status() {
//update the status
if ($this->enabled == "true") {
//update the call center status
$user_status = "Logged Out";
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$switch_cmd .= "callcenter_config agent set status ".$_SESSION['username']."@".$this->domain_name." '".$user_status."'";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
//update the database user_status
$user_status = "Do Not Disturb";
$sql = "update v_users set ";
$sql .= "user_status = :user_status ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and username = :username ";
$parameters['user_status'] = "Do Not Disturb";
$parameters['domain_uuid'] = $this->domain_uuid;
$parameters['username'] = $_SESSION['username'];
$database = new database;
$database->execute($sql);
}
}
public function set() {
//determine whether to update the dial string
$sql = "select extension_uuid, extension, number_alias ";
$sql .= "from v_extensions ";
$sql .= "where domain_uuid = :domain_uuid ";
if (is_uuid($this->extension_uuid)) {
$sql .= "and extension_uuid = :extension_uuid ";
$parameters['extension_uuid'] = $this->extension_uuid;
}
else {
$sql .= "and extension = :extension ";
$parameters['extension'] = $this->extension;
}
$parameters['domain_uuid'] = $this->domain_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) {
if (is_uuid($this->extension_uuid)) {
$this->extension_uuid = $row["extension_uuid"];
}
if (strlen($this->extension) == 0) {
if (strlen($row["number_alias"]) == 0) {
$this->extension = $row["extension"];
}
else {
$this->extension = $row["number_alias"];
}
}
}
unset($sql, $parameters, $row);
//build extension update array
$array['extensions'][0]['extension_uuid'] = $this->extension_uuid;
$array['extensions'][0]['do_not_disturb'] = $this->enabled;
//grant temporary permissions
$p = new permissions;
$p->add('extension_edit', 'temp');
//execute update
$database = new database;
$database->app_name = 'calls';
$database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d';
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('extension_edit', 'temp');
//delete extension from the cache
$cache = new cache;
$cache->delete("directory:".$this->extension."@".$this->domain_name);
if(strlen($this->number_alias) > 0){
$cache->delete("directory:".$this->number_alias."@".$this->domain_name);
}
} //function
/**
* declare private variables
*/
private $app_name;
private $app_uuid;
private $permission;
private $list_page;
private $table;
private $uuid_prefix;
private $toggle_field;
private $toggle_values;
/**
* toggle records
*/
public function toggle($records) {
//assign private variables
$this->app_name = 'calls';
$this->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d';
$this->permission = 'do_not_disturb';
$this->list_page = 'calls.php';
$this->table = 'extensions';
$this->uuid_prefix = 'extension_';
$this->toggle_field = 'do_not_disturb';
$this->toggle_values = ['true','false'];
if (permission_exists($this->permission)) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//toggle the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get current toggle state
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select ".$this->uuid_prefix."uuid as uuid, extension, number_alias, ";
$sql .= "call_timeout, do_not_disturb, ";
$sql .= "forward_all_enabled, forward_all_destination, ";
$sql .= "forward_busy_enabled, forward_busy_destination, ";
$sql .= "forward_no_answer_enabled, forward_no_answer_destination, ";
$sql .= $this->toggle_field." as toggle, follow_me_uuid ";
$sql .= "from v_".$this->table." ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
$extensions[$row['uuid']]['extension'] = $row['extension'];
$extensions[$row['uuid']]['number_alias'] = $row['number_alias'];
$extensions[$row['uuid']]['call_timeout'] = $row['call_timeout'];
$extensions[$row['uuid']]['do_not_disturb'] = $row['do_not_disturb'];
$extensions[$row['uuid']]['forward_all_enabled'] = $row['forward_all_enabled'];
$extensions[$row['uuid']]['forward_all_destination'] = $row['forward_all_destination'];
$extensions[$row['uuid']]['forward_busy_enabled'] = $row['forward_busy_enabled'];
$extensions[$row['uuid']]['forward_busy_destination'] = $row['forward_busy_destination'];
$extensions[$row['uuid']]['forward_no_answer_enabled'] = $row['forward_no_answer_enabled'];
$extensions[$row['uuid']]['forward_no_answer_destination'] = $row['forward_no_answer_destination'];
$extensions[$row['uuid']]['state'] = $row['toggle'];
$extensions[$row['uuid']]['follow_me_uuid'] = $row['follow_me_uuid'];
}
}
unset($sql, $parameters, $rows, $row);
}
//build update array
$x = 0;
foreach ($extensions as $uuid => $extension) {
//toggle feature
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
$array[$this->table][$x][$this->toggle_field] = $extension['state'] == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
//disable other features
if ($array[$this->table][$x][$this->toggle_field] == $this->toggle_values[0]) { //true
$array[$this->table][$x]['forward_all_enabled'] = $this->toggle_values[1]; //false
$array[$this->table][$x]['follow_me_enabled'] = $this->toggle_values[1]; //false
if (is_uuid($extension['follow_me_uuid'])) {
$array['follow_me'][$x]['follow_me_uuid'] = $extension['follow_me_uuid'];
$array['follow_me'][$x]['follow_me_enabled'] = $this->toggle_values[1]; //false
}
}
//increment counter
$x++;
}
//save the changes
if (is_array($array) && @sizeof($array) != 0) {
//grant temporary permissions
$p = new permissions;
$p->add('extension_edit', 'temp');
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('extension_edit', 'temp');
//send feature event notify to the phone
if ($_SESSION['device']['feature_sync']['boolean'] == "true") {
foreach ($extensions as $uuid => $extension) {
$feature_event_notify = new feature_event_notify;
$feature_event_notify->domain_name = $_SESSION['domain_name'];
$feature_event_notify->extension = $extension['extension'];
$feature_event_notify->do_not_disturb = $extension['do_not_disturb'];
$feature_event_notify->ring_count = ceil($extension['call_timeout'] / 6);
$feature_event_notify->forward_all_enabled = $extension['forward_all_enabled'];
$feature_event_notify->forward_busy_enabled = $extension['forward_busy_enabled'];
$feature_event_notify->forward_no_answer_enabled = $extension['forward_no_answer_enabled'];
//workarounds: send 0 as freeswitch doesn't send NOTIFY when destination values are nil
$feature_event_notify->forward_all_destination = $extension['forward_all_destination'] != '' ? $extension['forward_all_destination'] : '0';
$feature_event_notify->forward_busy_destination = $extension['forward_busy_destination'] != '' ? $extension['forward_busy_destination'] : '0';
$feature_event_notify->forward_no_answer_destination = $extension['forward_no_answer_destination'] != '' ? $extension['forward_no_answer_destination'] : '0';
$feature_event_notify->send_notify();
unset($feature_event_notify);
}
}
//synchronize configuration
if (is_readable($_SESSION['switch']['extensions']['dir'])) {
require_once "app/extensions/resources/classes/extension.php";
$ext = new extension;
$ext->xml();
unset($ext);
}
//clear the cache
$cache = new cache;
foreach ($extensions as $uuid => $extension) {
$cache->delete("directory:".$extension['extension']."@".$_SESSION['domain_name']);
if ($extension['number_alias'] != '') {
$cache->delete("directory:".$extension['number_alias']."@".$_SESSION['domain_name']);
}
}
//set message
message::add($text['message-toggle']);
}
unset($records, $extensions, $extension);
}
}
} //function
} //class
?>

Some files were not shown because too many files have changed in this diff Show More