fusionpbx/app/ring_groups/ring_group_edit.php

966 lines
40 KiB
PHP
Raw Normal View History

<?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>
2019-07-13 17:31:54 +02:00
Portions created by the Initial Developer are Copyright (C) 2010-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
2014-12-21 20:33:54 +01:00
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/
2016-09-30 00:31:42 +02:00
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/classes/ringbacks.php";
//check permissions
if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//delete the user from the ring group
if (
$_GET["a"] == "delete"
&& is_uuid($_REQUEST["user_uuid"])
&& permission_exists("ring_group_edit")
) {
//set the variables
$user_uuid = $_REQUEST["user_uuid"];
$ring_group_uuid = $_REQUEST["id"];
//build array
$array['ring_group_users'][0]['domain_uuid'] = $domain_uuid;
$array['ring_group_users'][0]['ring_group_uuid'] = $ring_group_uuid;
$array['ring_group_users'][0]['user_uuid'] = $user_uuid;
//grant temporary permissions
$p = new permissions;
$p->add('ring_group_user_delete', 'temp');
//execute delete
$database = new database;
$database->app_name = 'ring_groups';
$database->app_uuid = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2';
$database->delete($array);
unset($array);
//revoke temporary permissions
$p->delete('ring_group_user_delete', 'temp');
//save the message to a session variable
2018-08-31 05:09:01 +02:00
message::add($text['message-delete']);
//redirect the browser
header("Location: ring_group_edit.php?id=$ring_group_uuid");
exit;
}
//action add or update
if (is_uuid($_REQUEST["id"]) || is_uuid($_REQUEST["ring_group_uuid"])) {
$action = "update";
2019-08-07 03:50:44 +02:00
$ring_group_uuid = $_REQUEST["id"];
if (is_uuid($_REQUEST["ring_group_uuid"])) {
$ring_group_uuid = $_REQUEST["ring_group_uuid"];
}
}
else {
$action = "add";
2019-07-13 17:31:54 +02:00
$ring_group_uuid = uuid();
}
//get total ring group count from the database, check limit, if defined
if ($action == 'add') {
if ($_SESSION['limit']['ring_groups']['numeric'] != '') {
$sql = "select count(*) from v_ring_groups ";
$sql .= "where domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$total_ring_groups = $database->select($sql, $parameters, 'column');
unset($sql, $parameters);
if (is_numeric($_SESSION['limit']['ring_groups']['numeric']) && $total_ring_groups >= $_SESSION['limit']['ring_groups']['numeric']) {
2018-08-31 05:09:01 +02:00
message::add($text['message-maximum_ring_groups'].' '.$_SESSION['limit']['ring_groups']['numeric'], 'negative');
header('Location: ring_groups.php');
exit;
}
}
}
//get http post variables and set them to php variables
if (count($_POST) > 0) {
//set variables from http values
$ring_group_name = $_POST["ring_group_name"];
$ring_group_extension = $_POST["ring_group_extension"];
$ring_group_greeting = $_POST["ring_group_greeting"];
$ring_group_strategy = $_POST["ring_group_strategy"];
$ring_group_timeout_action = $_POST["ring_group_timeout_action"];
$ring_group_call_timeout = $_POST["ring_group_call_timeout"];
$ring_group_caller_id_name = $_POST["ring_group_caller_id_name"];
$ring_group_caller_id_number = $_POST["ring_group_caller_id_number"];
$ring_group_cid_name_prefix = $_POST["ring_group_cid_name_prefix"];
$ring_group_cid_number_prefix = $_POST["ring_group_cid_number_prefix"];
$ring_group_distinctive_ring = $_POST["ring_group_distinctive_ring"];
$ring_group_ringback = $_POST["ring_group_ringback"];
$ring_group_missed_call_app = $_POST["ring_group_missed_call_app"];
$ring_group_missed_call_data = $_POST["ring_group_missed_call_data"];
$ring_group_forward_enabled = $_POST["ring_group_forward_enabled"];
$ring_group_forward_destination = $_POST["ring_group_forward_destination"];
$ring_group_forward_toll_allow = $_POST["ring_group_forward_toll_allow"];
$ring_group_enabled = $_POST["ring_group_enabled"];
$ring_group_description = $_POST["ring_group_description"];
$dialplan_uuid = $_POST["dialplan_uuid"];
//$ring_group_timeout_action = "transfer:1001 XML default";
$ring_group_timeout_array = explode(":", $ring_group_timeout_action);
$ring_group_timeout_app = array_shift($ring_group_timeout_array);
$ring_group_timeout_data = join(':', $ring_group_timeout_array);
$destination_number = $_POST["destination_number"];
$destination_delay = $_POST["destination_delay"];
$destination_timeout = $_POST["destination_timeout"];
$destination_prompt = $_POST["destination_prompt"];
2019-08-07 03:50:44 +02:00
//set the context for users that do not have the permission
if (permission_exists('ring_group_context')) {
$ring_group_context = $_POST["ring_group_context"];
}
else if ($action == 'add') {
$ring_group_context = $_SESSION['domain_name'];
}
}
//assign the user to the ring group
if (is_uuid($_REQUEST["user_uuid"]) && is_uuid($_REQUEST["id"]) && $_GET["a"] != "delete" && permission_exists("ring_group_edit")) {
//set the variables
$user_uuid = $_REQUEST["user_uuid"];
$extension_uuid = $_REQUEST["id"];
//build array
$array['ring_group_users'][0]['ring_group_user_uuid'] = uuid();
$array['ring_group_users'][0]['domain_uuid'] = $domain_uuid;
$array['ring_group_users'][0]['ring_group_uuid'] = $ring_group_uuid;
$array['ring_group_users'][0]['user_uuid'] = $user_uuid;
//grant temporary permissions
$p = new permissions;
$p->add('ring_group_user_add', 'temp');
//execute delete
$database = new database;
$database->app_name = 'ring_groups';
$database->app_uuid = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2';
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('ring_group_user_add', 'temp');
//set message
2018-08-31 05:09:01 +02:00
message::add($text['message-add']);
//redirect the browser
header("Location: ring_group_edit.php?id=".$ring_group_uuid);
exit;
}
//process the HTTP POST
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
2019-09-19 15:34:03 +02:00
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: ring_groups.php');
exit;
}
//check for all required data
$msg = '';
if (strlen($ring_group_name) == 0) { $msg .= $text['message-name']."<br>\n"; }
if (strlen($ring_group_extension) == 0) { $msg .= $text['message-extension']."<br>\n"; }
2018-02-10 21:16:23 +01:00
//if (strlen($ring_group_greeting) == 0) { $msg .= $text['message-greeting']."<br>\n"; }
if (strlen($ring_group_strategy) == 0) { $msg .= $text['message-strategy']."<br>\n"; }
//if (strlen($ring_group_timeout_app) == 0) { $msg .= $text['message-timeout-action']."<br>\n"; }
//if (strlen($ring_group_cid_name_prefix) == 0) { $msg .= "Please provide: Caller ID Name Prefix<br>\n"; }
//if (strlen($ring_group_cid_number_prefix) == 0) { $msg .= "Please provide: Caller ID Number Prefix<br>\n"; }
//if (strlen($ring_group_ringback) == 0) { $msg .= "Please provide: Ringback<br>\n"; }
if (strlen($ring_group_enabled) == 0) { $msg .= $text['message-enabled']."<br>\n"; }
//if (strlen($ring_group_description) == 0) { $msg .= "Please provide: 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 or update the database
if ($_POST["persistformvar"] != "true") {
//prep missed call values for db insert/update
switch ($ring_group_missed_call_app) {
case 'email':
$ring_group_missed_call_data = str_replace(';',',',$ring_group_missed_call_data);
$ring_group_missed_call_data = str_replace(' ','',$ring_group_missed_call_data);
if (substr_count($ring_group_missed_call_data, ',') > 0) {
$ring_group_missed_call_data_array = explode(',', $ring_group_missed_call_data);
foreach ($ring_group_missed_call_data_array as $array_index => $email_address) {
if (!valid_email($email_address)) { unset($ring_group_missed_call_data_array[$array_index]); }
}
//echo "<pre>".print_r($ring_group_missed_call_data_array, true)."</pre><br><br>";
if (sizeof($ring_group_missed_call_data_array) > 0) {
$ring_group_missed_call_data = implode(',', $ring_group_missed_call_data_array);
}
else {
unset($ring_group_missed_call_app, $ring_group_missed_call_data);
}
//echo "Multiple Emails = ".$ring_group_missed_call_data;
}
else {
//echo "Single Email = ".$ring_group_missed_call_data."<br>";
if (!valid_email($ring_group_missed_call_data)) {
//echo "Invalid Email<br><br>";
unset($ring_group_missed_call_app, $ring_group_missed_call_data);
}
}
break;
case 'text':
$ring_group_missed_call_data = str_replace('-','',$ring_group_missed_call_data);
$ring_group_missed_call_data = str_replace('.','',$ring_group_missed_call_data);
$ring_group_missed_call_data = str_replace('(','',$ring_group_missed_call_data);
$ring_group_missed_call_data = str_replace(')','',$ring_group_missed_call_data);
$ring_group_missed_call_data = str_replace(' ','',$ring_group_missed_call_data);
if (!is_numeric($ring_group_missed_call_data)) { unset($ring_group_missed_call_app, $ring_group_missed_call_data); }
break;
}
//set the app and data
$ring_group_timeout_array = explode(":", $ring_group_timeout_action);
$ring_group_timeout_app = array_shift($ring_group_timeout_array);
$ring_group_timeout_data = join(':', $ring_group_timeout_array);
//add the domain_uuid
if (!is_uuid($_POST["domain_uuid"])) {
$_POST["domain_uuid"] = $_SESSION['domain_uuid'];
}
//add the dialplan_uuid
if (!is_uuid($_POST["dialplan_uuid"])) {
$dialplan_uuid = uuid();
}
2019-08-07 03:50:44 +02:00
//build the array
$array["ring_groups"][0]["ring_group_uuid"] = $ring_group_uuid;
$array["ring_groups"][0]["domain_uuid"] = $domain_uuid;
$array['ring_groups'][0]["ring_group_name"] = $ring_group_name;
$array['ring_groups'][0]["ring_group_extension"] = $ring_group_extension;
$array['ring_groups'][0]["ring_group_greeting"] = $ring_group_greeting;
$array['ring_groups'][0]["ring_group_strategy"] = $ring_group_strategy;
$array["ring_groups"][0]["ring_group_call_timeout"] = $ring_group_call_timeout;
$array["ring_groups"][0]["ring_group_caller_id_name"] = $ring_group_caller_id_name;
$array["ring_groups"][0]["ring_group_caller_id_number"] = $ring_group_caller_id_number;
if (permission_exists('ring_group_cid_name_prefix')) {
$array["ring_groups"][0]["ring_group_cid_name_prefix"] = $ring_group_cid_name_prefix;
}
if (permission_exists('ring_group_cid_number_prefix')) {
$array["ring_groups"][0]["ring_group_cid_number_prefix"] = $ring_group_cid_number_prefix;
}
2019-08-07 03:50:44 +02:00
$array["ring_groups"][0]["ring_group_distinctive_ring"] = $ring_group_distinctive_ring;
$array["ring_groups"][0]["ring_group_ringback"] = $ring_group_ringback;
if (permission_exists('ring_group_missed_call')) {
$array["ring_groups"][0]["ring_group_missed_call_app"] = $ring_group_missed_call_app;
$array["ring_groups"][0]["ring_group_missed_call_data"] = $ring_group_missed_call_data;
}
$array["ring_groups"][0]["ring_group_forward_enabled"] = $ring_group_forward_enabled;
$array["ring_groups"][0]["ring_group_forward_destination"] = $ring_group_forward_destination;
$array["ring_groups"][0]["ring_group_forward_toll_allow"] = $ring_group_forward_toll_allow;
if (isset($ring_group_context)) {
$array["ring_groups"][0]["ring_group_context"] = $ring_group_context;
}
$array["ring_groups"][0]["ring_group_enabled"] = $ring_group_enabled;
$array["ring_groups"][0]["ring_group_description"] = $ring_group_description;
$array["ring_groups"][0]["dialplan_uuid"] = $dialplan_uuid;
$array["ring_groups"][0]["ring_group_timeout_app"] = $ring_group_timeout_app;
$array["ring_groups"][0]["ring_group_timeout_data"] = $ring_group_timeout_data;
2017-04-14 10:23:48 +02:00
2019-08-07 03:50:44 +02:00
$y = 0;
foreach ($_POST["ring_group_destinations"] as $row) {
if (is_uuid($row['ring_group_destination_uuid'])) {
2019-08-07 03:50:44 +02:00
$ring_group_destination_uuid = $row['ring_group_destination_uuid'];
}
else {
$ring_group_destination_uuid = uuid();
}
if (strlen($row['destination_number']) > 0) {
$array["ring_groups"][0]["ring_group_destinations"][$y]["ring_group_uuid"] = $ring_group_uuid;
$array['ring_groups'][0]["ring_group_destinations"][$y]["ring_group_destination_uuid"] = $ring_group_destination_uuid;
$array['ring_groups'][0]["ring_group_destinations"][$y]["destination_number"] = $row['destination_number'];
$array['ring_groups'][0]["ring_group_destinations"][$y]["destination_delay"] = $row['destination_delay'];
$array['ring_groups'][0]["ring_group_destinations"][$y]["destination_timeout"] = $row['destination_timeout'];
$array['ring_groups'][0]["ring_group_destinations"][$y]["destination_prompt"] = $row['destination_prompt'];
$array['ring_groups'][0]["ring_group_destinations"][$y]["domain_uuid"] = $_SESSION['domain_uuid'];
}
$y++;
}
2016-09-30 00:31:42 +02:00
//build the xml dialplan
2016-10-02 09:03:45 +02:00
$dialplan_xml = "<extension name=\"ring group\" continue=\"\" uuid=\"".$dialplan_uuid."\">\n";
2018-10-15 17:49:35 +02:00
$dialplan_xml .= " <condition field=\"destination_number\" expression=\"^".$ring_group_extension."$\">\n";
$dialplan_xml .= " <action application=\"ring_ready\" data=\"\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"ring_group_uuid=".$ring_group_uuid."\"/>\n";
$dialplan_xml .= " <action application=\"lua\" data=\"app.lua ring_groups\"/>\n";
$dialplan_xml .= " </condition>\n";
2016-09-30 00:31:42 +02:00
$dialplan_xml .= "</extension>\n";
//build the dialplan array
2019-08-07 03:50:44 +02:00
$array["dialplans"][0]["domain_uuid"] = $_SESSION["domain_uuid"];
$array["dialplans"][0]["dialplan_uuid"] = $dialplan_uuid;
$array["dialplans"][0]["dialplan_name"] = $ring_group_name;
$array["dialplans"][0]["dialplan_number"] = $ring_group_extension;
2019-08-14 10:01:18 +02:00
if (isset($ring_group_context)) {
$array["dialplans"][0]["dialplan_context"] = $ring_group_context;
}
2019-08-07 03:50:44 +02:00
$array["dialplans"][0]["dialplan_continue"] = "false";
$array["dialplans"][0]["dialplan_xml"] = $dialplan_xml;
$array["dialplans"][0]["dialplan_order"] = "101";
$array["dialplans"][0]["dialplan_enabled"] = "true";
$array["dialplans"][0]["dialplan_description"] = $ring_group_description;
$array["dialplans"][0]["app_uuid"] = "1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2";
2016-10-06 02:38:07 +02:00
//add the dialplan permission
$p = new permissions;
$p->add("dialplan_add", "temp");
$p->add("dialplan_edit", "temp");
//save to the data
2016-10-16 18:43:00 +02:00
$database = new database;
$database->app_name = 'ring_groups';
$database->app_uuid = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2';
$database->save($array);
$message = $database->message;
2016-10-06 02:38:07 +02:00
//remove the temporary permission
$p->delete("dialplan_add", "temp");
$p->delete("dialplan_edit", "temp");
2014-02-23 08:48:21 +01:00
}
//save the xml
save_dialplan_xml();
//apply settings reminder
$_SESSION["reload_xml"] = true;
//clear the cache
$cache = new cache;
$cache->delete("dialplan:".$ring_group_context);
//set the message
if ($action == "add") {
//save the message to a session variable
2018-08-31 05:09:01 +02:00
message::add($text['message-add']);
//redirect the browser
header("Location: ring_group_edit.php?id=".urlencode($ring_group_uuid));
exit;
}
if ($action == "update") {
//save the message to a session variable
2018-08-31 05:09:01 +02:00
message::add($text['message-update']);
}
}
//initialize the destinations object
$destination = new destinations;
//pre-populate the form
if (is_uuid($ring_group_uuid)) {
$sql = "select * from v_ring_groups ";
2019-08-07 03:50:44 +02:00
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and ring_group_uuid = :ring_group_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['ring_group_uuid'] = $ring_group_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) {
$ring_group_name = $row["ring_group_name"];
$ring_group_extension = $row["ring_group_extension"];
2018-02-10 21:16:23 +01:00
$ring_group_greeting = $row["ring_group_greeting"];
$ring_group_context = $row["ring_group_context"];
$ring_group_strategy = $row["ring_group_strategy"];
$ring_group_timeout_app = $row["ring_group_timeout_app"];
$ring_group_timeout_data = $row["ring_group_timeout_data"];
2018-05-08 03:46:28 +02:00
$ring_group_call_timeout = $row["ring_group_call_timeout"];
2018-04-05 22:53:36 +02:00
$ring_group_caller_id_name = $row["ring_group_caller_id_name"];
$ring_group_caller_id_number = $row["ring_group_caller_id_number"];
$ring_group_cid_name_prefix = $row["ring_group_cid_name_prefix"];
$ring_group_cid_number_prefix = $row["ring_group_cid_number_prefix"];
2015-06-04 07:26:12 +02:00
$ring_group_distinctive_ring = $row["ring_group_distinctive_ring"];
2012-10-22 22:09:37 +02:00
$ring_group_ringback = $row["ring_group_ringback"];
$ring_group_missed_call_app = $row["ring_group_missed_call_app"];
$ring_group_missed_call_data = $row["ring_group_missed_call_data"];
$ring_group_forward_enabled = $row["ring_group_forward_enabled"];
$ring_group_forward_destination = $row["ring_group_forward_destination"];
Ring group toll allow (#2520) * Merge (#4) * Added variables to disable call waiting and t.38 faxing * HT702 config file variables: grandstream_disable_call_waiting, grandstream_disable_fax_t38 * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update app_config.php * Corrected bug with expansion board and call park value. Was 19, should be 16. * MAC detection for some Grandstream phones (#2486) Some GS models send the Mac address in the user agent * Add/Update German and Austrian translations (#2483) Updates to the following apps: call_broadcast call_flows devices dialplan_inbound dialplan_outbound edit emails exec extensions fax fifo fifo_list gateways ivr_menus * Update destinations.php * Update xml_cdr_inc.php * Update status_registrations.php * Update y000000000028.cfg * Update y000000000066.cfg * Update y000000000035.cfg * Update y000000000065.cfg * Update y000000000051.cfg * Update y000000000023.cfg * Update y000000000025.cfg * Update y000000000029.cfg * Update y000000000036.cfg * Update y000000000038.cfg * Update y000000000032.cfg * Update y000000000046.cfg * Update y000000000000.cfg * Update y000000000054.cfg * Update y000000000045.cfg * Update y000000000069.cfg * Update y000000000004.cfg * Update y000000000044.cfg * Update y000000000044.cfg * Update y000000000005.cfg * Update y000000000052.cfg * Update y000000000007.cfg * Update y000000000037.cfg * BugFix for VM Transcription (#2491) Records as MP3 and skips transcription steps if a user has transcription set to false. * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Yet another ip phone reporting MAC in the UserAgent (#2492) * Update app_config.php Begin adding uuid's for key functions. * Update app_config.php * Update app_config.php * Update app_config.php * Update app_config.php * Update app_config.php * Update app_config.php * Create 560_extension_queue.xml * Update y000000000037.cfg * Update y000000000007.cfg * Update app_config.php * Update y000000000052.cfg * Update y000000000028.cfg * Update y000000000005.cfg * Update y000000000044.cfg * Update y000000000044.cfg * Update y000000000004.cfg * Update y000000000069.cfg * Update y000000000045.cfg * Update y000000000000.cfg * Update y000000000046.cfg * Update y000000000032.cfg * Update y000000000038.cfg * Update y000000000054.cfg * Update y000000000036.cfg * Update y000000000029.cfg * Update y000000000066.cfg * Update y000000000035.cfg * Update y000000000065.cfg * Update y000000000051.cfg * Update y000000000023.cfg * Update y000000000025.cfg * Update app_config.php * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update app_config.php * Fix. Add new sip profile setting. (#2500) * BugFix [master] system information git (#2499) fix for if the .git folder is present but corrupt * Fix. Redirect back to correct profile after delete setting. (#2501) Fix. Add setting (seems need also set sip_profile_uuid) Change. Order settings by name when output. * Restore Button + Audiocodes preliminary support (#2502) * Audiocodes phone support + restore default for vendors * Restore button * Restore script * Update device_vendors.php * Some FR & ES translation fixes (#2503) * Update app_config.php * Update app_config.php * Create {$mac}.cfg * Create directory.xml * Create favorite_setting.xml * Create y000000000025.cfg * Fix. Add extension with non numeric extension number. (#2508) * Update ring_group_edit.php * Update call_edit.php * Create 080_default_caller_id * Update 080_default_caller_id * Rename 080_default_caller_id to 080_default_caller_id.xml * Fix. Create needed number of extensions (#2509) * Update dialplan_edit.php * Update switch.php * Update index.php * Update switch.php * Update voicemail_edit.php * Update app_config.php (#2515) Add the necessary permissions in order to use the database save function (fusion 4.3) when coding for voicemail option adds/deletes/updates. I realize these voicemail permissions overall will probably get cleaned up even more once the whole app is updated to use the database function, but this is a stop gap measure. I am working on adding voicemail options to the Bulk Account Settings app and I'm stuck without these permissions. The function is kicking a out 403 Forbidden. * Update app_config.php * Really use configured transcribe_language for transcription (#2513) * Fix renaming domains (#2512) * Make presence for conferences work out of the box (#2514) Use '@' instead of '-' for separating conference name and domain, which is what FreeSWITCH mod_conference uses. * Add. Speed dial respects contacts user. (#2249) * Add. Speed dial respects contacts user. One user can not use speed dial numbers from contacts associated with another user * Make SQL query more efficient * Add. Support find contacts by user groups as well If contact has set any `user` or `group` then only this users can use speed dial numbers in other case speed dial numbers are global for domain. * Fixup for renaming domains (#2517) The previous fix was incomplete, this one should do it. * Create app_defaults.php * Update page.lua * CC Key Support for Call Center (#2518) * Exit Keys support * Multilanguage support * CC Key Support * Update call_center.php * Update code to iterate over numbers. (#1727) * Update code to iterate over numbers. This code fixes some problems * range like `009-010` current code produce numbers `009` and `0010` * range like `200-100` now raise error so it will be easy to debug * range like `010-20` now generate error. * `destination` is string so condition `destination == tonumber(sip_from_user)` is always false so change it `destination == sip_from_user` * Fix. handle ranges like `100-100` * Update app_config.php * Update app_languages.php * Update ring_group_edit.php * Update index.lua
2017-04-19 22:12:14 +02:00
$ring_group_forward_toll_allow = $row["ring_group_forward_toll_allow"];
$ring_group_enabled = $row["ring_group_enabled"];
$ring_group_description = $row["ring_group_description"];
$dialplan_uuid = $row["dialplan_uuid"];
}
unset($sql, $parameters, $row);
if (strlen($ring_group_timeout_app) > 0) {
$ring_group_timeout_action = $ring_group_timeout_app.":".$ring_group_timeout_data;
}
}
//set the default
if (strlen($ring_group_ringback) == 0) {
$ring_group_ringback = '${us-ring}';
}
//get the ring group destination array
if ($action == "add") {
$x = 0;
$limit = 5;
}
if (is_uuid($ring_group_uuid)) {
$sql = "select * from v_ring_group_destinations ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and ring_group_uuid = :ring_group_uuid ";
$sql .= "order by destination_delay, destination_number asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['ring_group_uuid'] = $ring_group_uuid;
$database = new database;
$ring_group_destinations = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
}
2017-01-12 11:19:38 +01:00
//add an empty row to the options array
if (count($ring_group_destinations) == 0) {
$rows = $_SESSION['ring_group']['destination_add_rows']['numeric'];
$id = 0;
}
if (count($ring_group_destinations) > 0) {
$rows = $_SESSION['ring_group']['destination_edit_rows']['numeric'];
$id = count($ring_group_destinations)+1;
}
for ($x = 0; $x < $rows; $x++) {
$ring_group_destinations[$id]['destination_number'] = '';
$ring_group_destinations[$id]['destination_delay'] = '';
$ring_group_destinations[$id]['destination_timeout'] = '';
$ring_group_destinations[$id]['destination_prompt'] = '';
$id++;
}
//get the ring group users
if (is_uuid($ring_group_uuid)) {
$sql = "select u.username, r.user_uuid, r.ring_group_uuid ";
$sql .= "from v_ring_group_users as r, v_users as u ";
$sql .= "where r.user_uuid = u.user_uuid ";
$sql .= "and u.user_enabled = 'true' ";
$sql .= "and r.domain_uuid = :domain_uuid ";
$sql .= "and r.ring_group_uuid = :ring_group_uuid ";
$sql .= "order by u.username asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['ring_group_uuid'] = $ring_group_uuid;
$database = new database;
$ring_group_users = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
}
2016-09-30 00:31:42 +02:00
//get the users
$sql = "select * from v_users ";
$sql .= "where domain_uuid = :domain_uuid ";
2016-09-30 00:31:42 +02:00
$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);
2016-09-30 00:31:42 +02:00
//set defaults
if (strlen($ring_group_enabled) == 0) { $ring_group_enabled = 'true'; }
2012-09-15 18:23:23 +02:00
2018-11-14 07:25:14 +01:00
//set the default ring group context
if (strlen($ring_group_context) == 0) {
$ring_group_context = $_SESSION['domain_name'];
}
2016-09-30 00:31:42 +02:00
//get the ring backs
$ringbacks = new ringbacks;
$ringbacks = $ringbacks->select('ring_group_ringback', $ring_group_ringback);
2018-02-10 21:16:23 +01:00
//get the sounds
$sounds = new sounds;
$sounds = $sounds->get();
2019-09-19 15:34:03 +02:00
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
require_once "resources/header.php";
2018-02-10 21:16:23 +01:00
//option to change select to text
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";
}
//show the content
echo "<form method='post' name='frm' action=''>\n";
2015-02-15 08:59:02 +01:00
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap='nowrap' valign='top'><b>".$text['label-ring-group']."</b></td>\n";
2014-01-12 08:12:08 +01:00
echo "<td width='70%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='ring_groups.php'\" value='".$text['button-back']."'>\n";
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
2014-01-12 08:12:08 +01:00
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2' valign='top'>\n";
echo $text['description']."<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' 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='ring_group_name' maxlength='255' value=\"".escape($ring_group_name)."\" required='required'>\n";
echo "<br />\n";
echo $text['description-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-extension']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ring_group_extension' maxlength='255' value=\"".escape($ring_group_extension)."\" required='required'>\n";
echo "<br />\n";
echo $text['description-extension']."\n";
echo "</td>\n";
echo "</tr>\n";
2018-02-10 21:16:23 +01:00
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-greeting']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
2018-02-11 01:19:54 +01:00
echo "<select name='ring_group_greeting' class='formfld' style='width: 200px;' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null).">\n";
2018-02-10 21:16:23 +01:00
echo " <option value=''></option>\n";
foreach($sounds as $key => $value) {
echo "<optgroup label=".$text['label-'.$key].">\n";
$selected = false;
foreach ($value as $row) {
2018-02-10 21:16:23 +01:00
if ($ring_group_greeting == $row["value"]) {
$selected = true;
echo " <option value='".escape($row["value"])."' selected='selected'>".escape($row["name"])."</option>\n";
2018-02-10 21:16:23 +01:00
}
else {
echo " <option value='".escape($row["value"])."'>".escape($row["name"])."</option>\n";
2018-02-10 21:16:23 +01:00
}
}
echo "</optgroup>\n";
}
if (if_group("superadmin")) {
if (!$selected && strlen($ring_group_greeting) > 0) {
echo " <option value='".escape($ring_group_greeting)."' selected='selected'>".escape($ring_group_greeting)."</option>\n";
2018-02-10 21:16:23 +01:00
}
unset($selected);
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-greeting']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-strategy']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='ring_group_strategy' onchange=\"getElementById('destination_delayorder').innerHTML = (this.selectedIndex == 1 || this.selectedIndex == 3) ? '".$text['label-destination_order']."' : '".$text['label-destination_delay']."';\">\n";
echo " <option value='simultaneous' ".(($ring_group_strategy == "simultaneous") ? "selected='selected'" : null).">".$text['option-simultaneous']."</option>\n";
echo " <option value='sequence' ".(($ring_group_strategy == "sequence") ? "selected='selected'" : null).">".$text['option-sequence']."</option>\n";
echo " <option value='enterprise' ".(($ring_group_strategy == "enterprise") ? "selected='selected'" : null).">".$text['option-enterprise']."</option>\n";
echo " <option value='rollover' ".(($ring_group_strategy == "rollover") ? "selected='selected'" : null).">".$text['option-rollover']."</option>\n";
2015-09-01 18:33:26 +02:00
echo " <option value='random' ".(($ring_group_strategy == "random") ? "selected='selected'" : null).">".$text['option-random']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['description-strategy']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>";
echo " <td class='vncellreq' valign='top'>".$text['label-destinations']."</td>";
echo " <td class='vtable' align='left'>";
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' id='destination_delayorder'>";
echo ($ring_group_strategy == 'sequence' || $ring_group_strategy == 'rollover') ? $text['label-destination_order'] : $text['label-destination_delay'];
echo " </td>\n";
echo " <td class='vtable'>".$text['label-destination_timeout']."</td>\n";
if (permission_exists('ring_group_prompt')) {
echo " <td class='vtable'>".$text['label-destination_prompt']."</td>\n";
}
echo " <td></td>\n";
echo " </tr>\n";
$x = 0;
foreach ($ring_group_destinations as $row) {
if (strlen($row['destination_delay']) == 0) { $row['destination_delay'] = "0"; }
if (strlen($row['destination_timeout']) == 0) { $row['destination_timeout'] = "30"; }
if (strlen($row['ring_group_destination_uuid']) > 0) {
echo " <input name='ring_group_destinations[".$x."][ring_group_destination_uuid]' type='hidden' value=\"".escape($row['ring_group_destination_uuid'])."\">\n";
}
echo " <tr>\n";
echo " <td>\n";
echo " <input type=\"text\" name=\"ring_group_destinations[".$x."][destination_number]\" class=\"formfld\" style=\"width: 90%;\"value=\"".escape($row['destination_number'])."\">\n";
echo " </td>\n";
echo " <td>\n";
echo " <select name='ring_group_destinations[".$x."][destination_delay]' class='formfld' style='width:55px'>\n";
$i=0;
while ($i <= 300) {
if ($i == $row['destination_delay']) {
echo " <option value='$i' selected='selected'>$i</option>\n";
}
else {
echo " <option value='$i'>$i</option>\n";
}
$i = $i + 5;
}
echo " </select>\n";
echo " </td>\n";
echo " <td>\n";
echo " <select name='ring_group_destinations[".$x."][destination_timeout]' class='formfld' style='width:55px'>\n";
$i = 5;
while($i <= 300) {
if ($i == $row['destination_timeout']) {
echo " <option value='$i' selected='selected'>$i</option>\n";
}
else {
echo " <option value='$i'>$i</option>\n";
}
$i = $i + 5;
}
echo " </select>\n";
echo " </td>\n";
if (permission_exists('ring_group_prompt')) {
echo " <td>\n";
echo " <select class='formfld' style='width: 90px;' name='ring_group_destinations[".$x."][destination_prompt]'>\n";
echo " <option value=''></option>\n";
echo " <option value='1' ".(($row['destination_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 " <td>&nbsp;</td>\n";
echo " <td class='list_control_icons' style='width: 25px;'>";
if (strlen($row['ring_group_destination_uuid']) > 0) {
echo " <a href='ring_group_destination_delete.php?id=".escape($row['ring_group_destination_uuid'])."&ring_group_uuid=".escape($row['ring_group_uuid'])."&a=delete' alt='delete' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>";
}
echo " </td>\n";
echo " </tr>\n";
$x++;
}
echo " </table>\n";
echo " ".$text['description-destinations']."\n";
echo " <br />\n";
echo " </td>";
echo " </tr>";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-timeout_destination']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo $destination->select('dialplan', 'ring_group_timeout_action', $ring_group_timeout_action);
echo " <br />\n";
echo " ".$text['description-timeout_destination']."\n";
echo "</td>\n";
echo "</tr>\n";
2018-05-08 03:46:28 +02:00
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
2018-05-08 03:52:55 +02:00
echo " ".$text['label-call_timeout']."\n";
2018-05-08 03:46:28 +02:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ring_group_call_timeout' maxlength='255' value='".escape($ring_group_call_timeout)."'>\n";
2018-05-08 03:46:28 +02:00
echo "<br />\n";
echo $text['description-ring_group_call_timeout']." \n";
echo "</td>\n";
echo "</tr>\n";
2018-04-05 23:48:38 +02:00
if (permission_exists('ring_group_caller_id_name')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='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='ring_group_caller_id_name' maxlength='255' value='".escape($ring_group_caller_id_name)."'>\n";
2018-04-05 23:48:38 +02:00
echo "<br />\n";
echo $text['description-caller_id_name']." \n";
echo "</td>\n";
echo "</tr>\n";
}
2018-04-05 22:53:36 +02:00
2018-04-05 23:48:38 +02:00
if (permission_exists('ring_group_caller_id_number')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-caller_id_number']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='ring_group_caller_id_number' maxlength='255' min='0' step='1' value='".escape($ring_group_caller_id_number)."'>\n";
2018-04-05 23:48:38 +02:00
echo "<br />\n";
echo $text['description-caller_id_number']." \n";
echo "</td>\n";
echo "</tr>\n";
}
2018-04-05 22:53:36 +02:00
2018-04-05 23:48:38 +02:00
if (permission_exists('ring_group_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='ring_group_cid_name_prefix' maxlength='255' value='".escape($ring_group_cid_name_prefix)."'>\n";
2018-04-05 23:48:38 +02:00
echo "<br />\n";
echo $text['description-cid-name-prefix']." \n";
echo "</td>\n";
echo "</tr>\n";
}
2018-04-05 23:48:38 +02:00
if (permission_exists('ring_group_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='number' name='ring_group_cid_number_prefix' maxlength='255' min='0' step='1' value='".escape($ring_group_cid_number_prefix)."'>\n";
2018-04-05 23:48:38 +02:00
echo "<br />\n";
echo $text['description-cid-number-prefix']." \n";
echo "</td>\n";
echo "</tr>\n";
}
2015-06-04 07:26:12 +02:00
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-distinctive_ring']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ring_group_distinctive_ring' maxlength='255' value='".escape($ring_group_distinctive_ring)."'>\n";
2015-06-04 07:26:12 +02:00
echo "<br />\n";
echo $text['description-distinctive_ring']." \n";
echo "</td>\n";
echo "</tr>\n";
2012-10-22 22:09:37 +02:00
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-ringback']."\n";
2012-10-22 22:09:37 +02:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
2016-09-30 00:31:42 +02:00
echo " ".$ringbacks;
2012-10-22 22:09:37 +02:00
echo "<br />\n";
echo $text['description-ringback']."\n";
2012-10-22 22:09:37 +02:00
echo "</td>\n";
echo "</tr>\n";
echo " <tr>";
echo " <td class='vncell' valign='top'>".$text['label-user_list']."</td>";
echo " <td class='vtable'>";
2018-02-11 01:19:54 +01:00
echo " <table width='300px'>\n";
if (is_array($ring_group_users) && @sizeof($ring_group_users) != 0) {
foreach($ring_group_users as $field) {
echo " <tr>\n";
echo " <td class='vtable'>".escape($field['username'])."</td>\n";
echo " <td>\n";
echo " <a href='ring_group_edit.php?id=".escape($ring_group_uuid)."&user_uuid=".escape($field['user_uuid'])."&a=delete' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>\n";
echo " </td>\n";
echo " </tr>\n";
}
}
echo " </table>\n";
echo " <br />\n";
echo " <select name=\"user_uuid\" class='formfld' style='width: auto;'>\n";
echo " <option value=\"\"></option>\n";
if (is_array($users) && @sizeof($users) != 0) {
foreach($users as $field) {
echo " <option value='".escape($field['user_uuid'])."'>".escape($field['username'])."</option>\n";
}
}
echo " </select>";
echo " <input type=\"submit\" class='btn' value=\"".$text['button-add']."\">\n";
echo " <br>\n";
echo " ".$text['description-user_list']."\n";
echo " <br />\n";
echo " </td>";
echo " </tr>";
if (permission_exists('ring_group_missed_call')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-missed_call']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='ring_group_missed_call_app' id='ring_group_missed_call_app' onchange=\"if (this.selectedIndex != 0) { document.getElementById('ring_group_missed_call_data').style.display = ''; document.getElementById('ring_group_missed_call_data').focus(); } else { document.getElementById('ring_group_missed_call_data').style.display='none'; }\">\n";
echo " <option value=''></option>\n";
echo " <option value='email' ".(($ring_group_missed_call_app == "email" && $ring_group_missed_call_data != '') ? "selected='selected'" : null).">".$text['label-email']."</option>\n";
//echo " <option value='text' ".(($ring_group_missed_call_app == "text" && $ring_group_missed_call_data != '') ? "selected='selected'" : null).">".$text['label-text']."</option>\n";
//echo " <option value='url' ".(($ring_group_missed_call_app == "url" && $ring_group_missed_call_data != '') ? "selected='selected'" : null).">".$text['label-url']."</option>\n";
echo " </select>\n";
$ring_group_missed_call_data = ($ring_group_missed_call_app == 'text') ? format_phone($ring_group_missed_call_data) : $ring_group_missed_call_data;
echo " <input class='formfld' type='text' name='ring_group_missed_call_data' id='ring_group_missed_call_data' maxlength='255' value=\"".escape($ring_group_missed_call_data)."\" style='min-width: 200px; width: 200px; ".(($ring_group_missed_call_app == '' || $ring_group_missed_call_data == '') ? "display: none;" : null)."'>\n";
echo "<br />\n";
echo $text['description-missed_call']."\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
2019-10-02 20:19:36 +02:00
echo " ".$text['label-ring_group_forward']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='ring_group_forward_enabled' id='ring_group_forward_enabled' onchange=\"(this.selectedIndex == 1) ? document.getElementById('ring_group_forward_destination').focus() : null;\">";
echo " <option value='false'>".$text['option-disabled']."</option>";
echo " <option value='true' ".(($ring_group_forward_enabled == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>";
echo " </select>";
echo "<input class='formfld' style='min-width: 95px;' type='text' name='ring_group_forward_destination' id='ring_group_forward_destination' placeholder=\"".$text['label-forward_destination']."\" maxlength='255' value=\"".escape($ring_group_forward_destination)."\">";
echo "<br />\n";
echo $text['description-ring-group-forward']."\n";
echo "</td>\n";
echo "</tr>\n";
Ring group toll allow (#2520) * Merge (#4) * Added variables to disable call waiting and t.38 faxing * HT702 config file variables: grandstream_disable_call_waiting, grandstream_disable_fax_t38 * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update app_config.php * Corrected bug with expansion board and call park value. Was 19, should be 16. * MAC detection for some Grandstream phones (#2486) Some GS models send the Mac address in the user agent * Add/Update German and Austrian translations (#2483) Updates to the following apps: call_broadcast call_flows devices dialplan_inbound dialplan_outbound edit emails exec extensions fax fifo fifo_list gateways ivr_menus * Update destinations.php * Update xml_cdr_inc.php * Update status_registrations.php * Update y000000000028.cfg * Update y000000000066.cfg * Update y000000000035.cfg * Update y000000000065.cfg * Update y000000000051.cfg * Update y000000000023.cfg * Update y000000000025.cfg * Update y000000000029.cfg * Update y000000000036.cfg * Update y000000000038.cfg * Update y000000000032.cfg * Update y000000000046.cfg * Update y000000000000.cfg * Update y000000000054.cfg * Update y000000000045.cfg * Update y000000000069.cfg * Update y000000000004.cfg * Update y000000000044.cfg * Update y000000000044.cfg * Update y000000000005.cfg * Update y000000000052.cfg * Update y000000000007.cfg * Update y000000000037.cfg * BugFix for VM Transcription (#2491) Records as MP3 and skips transcription steps if a user has transcription set to false. * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Yet another ip phone reporting MAC in the UserAgent (#2492) * Update app_config.php Begin adding uuid's for key functions. * Update app_config.php * Update app_config.php * Update app_config.php * Update app_config.php * Update app_config.php * Update app_config.php * Create 560_extension_queue.xml * Update y000000000037.cfg * Update y000000000007.cfg * Update app_config.php * Update y000000000052.cfg * Update y000000000028.cfg * Update y000000000005.cfg * Update y000000000044.cfg * Update y000000000044.cfg * Update y000000000004.cfg * Update y000000000069.cfg * Update y000000000045.cfg * Update y000000000000.cfg * Update y000000000046.cfg * Update y000000000032.cfg * Update y000000000038.cfg * Update y000000000054.cfg * Update y000000000036.cfg * Update y000000000029.cfg * Update y000000000066.cfg * Update y000000000035.cfg * Update y000000000065.cfg * Update y000000000051.cfg * Update y000000000023.cfg * Update y000000000025.cfg * Update app_config.php * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update app_config.php * Fix. Add new sip profile setting. (#2500) * BugFix [master] system information git (#2499) fix for if the .git folder is present but corrupt * Fix. Redirect back to correct profile after delete setting. (#2501) Fix. Add setting (seems need also set sip_profile_uuid) Change. Order settings by name when output. * Restore Button + Audiocodes preliminary support (#2502) * Audiocodes phone support + restore default for vendors * Restore button * Restore script * Update device_vendors.php * Some FR & ES translation fixes (#2503) * Update app_config.php * Update app_config.php * Create {$mac}.cfg * Create directory.xml * Create favorite_setting.xml * Create y000000000025.cfg * Fix. Add extension with non numeric extension number. (#2508) * Update ring_group_edit.php * Update call_edit.php * Create 080_default_caller_id * Update 080_default_caller_id * Rename 080_default_caller_id to 080_default_caller_id.xml * Fix. Create needed number of extensions (#2509) * Update dialplan_edit.php * Update switch.php * Update index.php * Update switch.php * Update voicemail_edit.php * Update app_config.php (#2515) Add the necessary permissions in order to use the database save function (fusion 4.3) when coding for voicemail option adds/deletes/updates. I realize these voicemail permissions overall will probably get cleaned up even more once the whole app is updated to use the database function, but this is a stop gap measure. I am working on adding voicemail options to the Bulk Account Settings app and I'm stuck without these permissions. The function is kicking a out 403 Forbidden. * Update app_config.php * Really use configured transcribe_language for transcription (#2513) * Fix renaming domains (#2512) * Make presence for conferences work out of the box (#2514) Use '@' instead of '-' for separating conference name and domain, which is what FreeSWITCH mod_conference uses. * Add. Speed dial respects contacts user. (#2249) * Add. Speed dial respects contacts user. One user can not use speed dial numbers from contacts associated with another user * Make SQL query more efficient * Add. Support find contacts by user groups as well If contact has set any `user` or `group` then only this users can use speed dial numbers in other case speed dial numbers are global for domain. * Fixup for renaming domains (#2517) The previous fix was incomplete, this one should do it. * Create app_defaults.php * Update page.lua * CC Key Support for Call Center (#2518) * Exit Keys support * Multilanguage support * CC Key Support * Update call_center.php * Update code to iterate over numbers. (#1727) * Update code to iterate over numbers. This code fixes some problems * range like `009-010` current code produce numbers `009` and `0010` * range like `200-100` now raise error so it will be easy to debug * range like `010-20` now generate error. * `destination` is string so condition `destination == tonumber(sip_from_user)` is always false so change it `destination == sip_from_user` * Fix. handle ranges like `100-100` * Update app_config.php * Update app_languages.php * Update ring_group_edit.php * Update index.lua
2017-04-19 22:12:14 +02:00
if (permission_exists('ring_group_forward_toll_allow')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-ring_group_forward_toll_allow']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ring_group_forward_toll_allow' maxlength='255' value=".escape($ring_group_forward_toll_allow).">\n";
Ring group toll allow (#2520) * Merge (#4) * Added variables to disable call waiting and t.38 faxing * HT702 config file variables: grandstream_disable_call_waiting, grandstream_disable_fax_t38 * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update {$mac}.cfg * Update app_config.php * Corrected bug with expansion board and call park value. Was 19, should be 16. * MAC detection for some Grandstream phones (#2486) Some GS models send the Mac address in the user agent * Add/Update German and Austrian translations (#2483) Updates to the following apps: call_broadcast call_flows devices dialplan_inbound dialplan_outbound edit emails exec extensions fax fifo fifo_list gateways ivr_menus * Update destinations.php * Update xml_cdr_inc.php * Update status_registrations.php * Update y000000000028.cfg * Update y000000000066.cfg * Update y000000000035.cfg * Update y000000000065.cfg * Update y000000000051.cfg * Update y000000000023.cfg * Update y000000000025.cfg * Update y000000000029.cfg * Update y000000000036.cfg * Update y000000000038.cfg * Update y000000000032.cfg * Update y000000000046.cfg * Update y000000000000.cfg * Update y000000000054.cfg * Update y000000000045.cfg * Update y000000000069.cfg * Update y000000000004.cfg * Update y000000000044.cfg * Update y000000000044.cfg * Update y000000000005.cfg * Update y000000000052.cfg * Update y000000000007.cfg * Update y000000000037.cfg * BugFix for VM Transcription (#2491) Records as MP3 and skips transcription steps if a user has transcription set to false. * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Yet another ip phone reporting MAC in the UserAgent (#2492) * Update app_config.php Begin adding uuid's for key functions. * Update app_config.php * Update app_config.php * Update app_config.php * Update app_config.php * Update app_config.php * Update app_config.php * Create 560_extension_queue.xml * Update y000000000037.cfg * Update y000000000007.cfg * Update app_config.php * Update y000000000052.cfg * Update y000000000028.cfg * Update y000000000005.cfg * Update y000000000044.cfg * Update y000000000044.cfg * Update y000000000004.cfg * Update y000000000069.cfg * Update y000000000045.cfg * Update y000000000000.cfg * Update y000000000046.cfg * Update y000000000032.cfg * Update y000000000038.cfg * Update y000000000054.cfg * Update y000000000036.cfg * Update y000000000029.cfg * Update y000000000066.cfg * Update y000000000035.cfg * Update y000000000065.cfg * Update y000000000051.cfg * Update y000000000023.cfg * Update y000000000025.cfg * Update app_config.php * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update {$mac}.xml * Update app_config.php * Fix. Add new sip profile setting. (#2500) * BugFix [master] system information git (#2499) fix for if the .git folder is present but corrupt * Fix. Redirect back to correct profile after delete setting. (#2501) Fix. Add setting (seems need also set sip_profile_uuid) Change. Order settings by name when output. * Restore Button + Audiocodes preliminary support (#2502) * Audiocodes phone support + restore default for vendors * Restore button * Restore script * Update device_vendors.php * Some FR & ES translation fixes (#2503) * Update app_config.php * Update app_config.php * Create {$mac}.cfg * Create directory.xml * Create favorite_setting.xml * Create y000000000025.cfg * Fix. Add extension with non numeric extension number. (#2508) * Update ring_group_edit.php * Update call_edit.php * Create 080_default_caller_id * Update 080_default_caller_id * Rename 080_default_caller_id to 080_default_caller_id.xml * Fix. Create needed number of extensions (#2509) * Update dialplan_edit.php * Update switch.php * Update index.php * Update switch.php * Update voicemail_edit.php * Update app_config.php (#2515) Add the necessary permissions in order to use the database save function (fusion 4.3) when coding for voicemail option adds/deletes/updates. I realize these voicemail permissions overall will probably get cleaned up even more once the whole app is updated to use the database function, but this is a stop gap measure. I am working on adding voicemail options to the Bulk Account Settings app and I'm stuck without these permissions. The function is kicking a out 403 Forbidden. * Update app_config.php * Really use configured transcribe_language for transcription (#2513) * Fix renaming domains (#2512) * Make presence for conferences work out of the box (#2514) Use '@' instead of '-' for separating conference name and domain, which is what FreeSWITCH mod_conference uses. * Add. Speed dial respects contacts user. (#2249) * Add. Speed dial respects contacts user. One user can not use speed dial numbers from contacts associated with another user * Make SQL query more efficient * Add. Support find contacts by user groups as well If contact has set any `user` or `group` then only this users can use speed dial numbers in other case speed dial numbers are global for domain. * Fixup for renaming domains (#2517) The previous fix was incomplete, this one should do it. * Create app_defaults.php * Update page.lua * CC Key Support for Call Center (#2518) * Exit Keys support * Multilanguage support * CC Key Support * Update call_center.php * Update code to iterate over numbers. (#1727) * Update code to iterate over numbers. This code fixes some problems * range like `009-010` current code produce numbers `009` and `0010` * range like `200-100` now raise error so it will be easy to debug * range like `010-20` now generate error. * `destination` is string so condition `destination == tonumber(sip_from_user)` is always false so change it `destination == sip_from_user` * Fix. handle ranges like `100-100` * Update app_config.php * Update app_languages.php * Update ring_group_edit.php * Update index.lua
2017-04-19 22:12:14 +02:00
echo "<br />\n";
echo $text['description-ring_group_forward_toll_allow']."\n";
echo "</td>\n";
echo "</tr>\n";
}
2018-11-03 18:28:41 +01:00
if (permission_exists("ring_group_context")) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-context']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ring_group_context' maxlength='255' value=\"".escape($ring_group_context)."\" required='required'>\n";
echo "<br />\n";
echo $text['description-enter-context']."\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo "<td class='vncellreq' 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='ring_group_enabled'>\n";
if ($ring_group_enabled == "true") {
echo " <option value='true' selected='selected'>".$text['option-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['option-true']."</option>\n";
}
if ($ring_group_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 "<br />\n";
echo $text['description-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-description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='ring_group_description' maxlength='255' value=\"".escape($ring_group_description)."\">\n";
echo "<br />\n";
echo $text['description-description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
if (is_uuid($dialplan_uuid)) {
echo " <input type='hidden' name='dialplan_uuid' value='".escape($dialplan_uuid)."'>\n";
}
if (is_uuid($ring_group_uuid)) {
echo " <input type='hidden' name='ring_group_uuid' value='".escape($ring_group_uuid)."'>\n";
}
2019-09-19 15:34:03 +02:00
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
2015-02-15 10:20:19 +01:00
echo " <br>";
2015-02-15 08:59:02 +01:00
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
2015-02-15 08:59:02 +01:00
echo "<br><br>";
echo "</form>";
//include the footer
require_once "resources/footer.php";
2016-09-30 00:31:42 +02:00
2019-08-14 10:01:18 +02:00
?>