2016-05-29 03:52:28 +02:00
|
|
|
<?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>
|
2023-06-09 19:29:33 +02:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2016-2023
|
2020-04-14 02:18:56 +02:00
|
|
|
the Initial Developer. All Rights Reserved.
|
2016-05-29 03:52:28 +02:00
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
2022-10-11 00:35:14 +02:00
|
|
|
//includes files
|
2023-06-15 19:28:23 +02:00
|
|
|
require_once dirname(__DIR__, 4) . "/resources/require.php";
|
2020-04-14 02:18:56 +02:00
|
|
|
require_once "resources/check_auth.php";
|
2016-05-29 03:52:28 +02:00
|
|
|
|
|
|
|
|
//add multi-lingual support
|
|
|
|
|
$language = new text;
|
|
|
|
|
$text = $language->get($_SESSION['domain']['language']['code'], 'app/devices');
|
|
|
|
|
|
2022-11-08 17:40:12 +01:00
|
|
|
//connect to the database
|
|
|
|
|
if (!isset($database)) {
|
|
|
|
|
$database = new database;
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-08 22:24:42 +02:00
|
|
|
//get the vendor functions
|
2024-07-23 22:29:28 +02:00
|
|
|
$sql = "select v.name as vendor_name, f.type, f.value ";
|
2019-08-04 04:21:56 +02:00
|
|
|
$sql .= "from v_device_vendors as v, v_device_vendor_functions as f ";
|
|
|
|
|
$sql .= "where v.device_vendor_uuid = f.device_vendor_uuid ";
|
|
|
|
|
$sql .= "and f.device_vendor_function_uuid in ";
|
2016-08-08 22:24:42 +02:00
|
|
|
$sql .= "(";
|
2019-08-04 04:21:56 +02:00
|
|
|
$sql .= " select device_vendor_function_uuid from v_device_vendor_function_groups ";
|
|
|
|
|
$sql .= " where device_vendor_function_uuid = f.device_vendor_function_uuid ";
|
|
|
|
|
$sql .= " and ( ";
|
2016-08-08 22:24:42 +02:00
|
|
|
if (is_array($_SESSION['groups'])) {
|
2019-08-04 04:21:56 +02:00
|
|
|
foreach($_SESSION['groups'] as $index => $row) {
|
|
|
|
|
$sql_where_or[] = "group_name = :group_name_".$index;
|
|
|
|
|
$parameters['group_name_'.$index] = $row['group_name'];
|
|
|
|
|
}
|
|
|
|
|
if (is_array($sql_where_or) && @sizeof($sql_where_or) != 0) {
|
|
|
|
|
$sql .= implode(' or ', $sql_where_or);
|
2016-08-08 22:24:42 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$sql .= " ) ";
|
|
|
|
|
$sql .= ") ";
|
2019-08-04 04:21:56 +02:00
|
|
|
$sql .= "and v.enabled = 'true' ";
|
|
|
|
|
$sql .= "and f.enabled = 'true' ";
|
2024-07-23 22:29:28 +02:00
|
|
|
$sql .= "order by v.name asc, f.type asc ";
|
2019-08-04 04:21:56 +02:00
|
|
|
$vendor_functions = $database->select($sql, (is_array($parameters) ? $parameters : null), 'all');
|
|
|
|
|
unset($sql, $sql_where_or, $parameters);
|
2016-08-08 22:24:42 +02:00
|
|
|
|
2016-05-29 03:52:28 +02:00
|
|
|
//add or update the database
|
2023-05-05 18:46:37 +02:00
|
|
|
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
|
2016-05-29 03:52:28 +02:00
|
|
|
|
|
|
|
|
//add or update the database
|
2023-06-09 19:29:33 +02:00
|
|
|
if (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true") {
|
2016-05-29 03:52:28 +02:00
|
|
|
|
2020-04-14 02:18:56 +02:00
|
|
|
//validate the token
|
|
|
|
|
$token = new token;
|
2021-11-13 23:34:33 +01:00
|
|
|
if (!$token->validate('/app/devices/resources/dashboard/device_keys.php') && !$token->validate('login')) {
|
2020-04-14 02:18:56 +02:00
|
|
|
message::add($text['message-invalid_token'],'negative');
|
2021-11-13 23:34:33 +01:00
|
|
|
header('Location: '.PROJECT_PATH."/core/dashboard/");
|
2020-04-14 02:18:56 +02:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-08 22:24:42 +02:00
|
|
|
//get device
|
2019-08-04 04:21:56 +02:00
|
|
|
$sql = "select device_uuid, device_profile_uuid from v_devices ";
|
|
|
|
|
$sql .= "where device_user_uuid = :device_user_uuid ";
|
|
|
|
|
$parameters['device_user_uuid'] = $_SESSION['user_uuid'];
|
|
|
|
|
$row = $database->select($sql, $parameters, 'row');
|
|
|
|
|
if (is_array($row) && @sizeof($row) != 0) {
|
|
|
|
|
$device_uuid = $row['device_uuid'];
|
|
|
|
|
$device_profile_uuid = $row['device_profile_uuid'];
|
|
|
|
|
}
|
|
|
|
|
unset($sql, $parameters, $row);
|
2016-07-16 20:15:22 +02:00
|
|
|
|
|
|
|
|
//get device profile keys
|
2019-08-04 04:21:56 +02:00
|
|
|
if (is_uuid($device_profile_uuid)) {
|
|
|
|
|
$sql = "select * from v_device_keys ";
|
|
|
|
|
$sql .= "where device_profile_uuid = :device_profile_uuid ";
|
|
|
|
|
$parameters['device_profile_uuid'] = $device_profile_uuid;
|
|
|
|
|
$device_profile_keys = $database->select($sql, $parameters, 'all');
|
|
|
|
|
unset($sql, $parameters);
|
2016-07-16 20:15:22 +02:00
|
|
|
}
|
|
|
|
|
|
2016-08-08 22:24:42 +02:00
|
|
|
//get device keys
|
2019-08-04 04:21:56 +02:00
|
|
|
if (is_uuid($device_uuid)) {
|
|
|
|
|
$sql = "select * from v_device_keys ";
|
|
|
|
|
$sql .= "where device_uuid = :device_uuid ";
|
|
|
|
|
$parameters['device_uuid'] = $device_uuid;
|
|
|
|
|
$device_keys = $database->select($sql, $parameters, 'all');
|
|
|
|
|
unset($sql, $parameters);
|
2016-08-08 22:24:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//create a list of protected keys - device keys
|
2019-08-04 04:21:56 +02:00
|
|
|
if (is_array($device_keys) && @sizeof($device_keys) != 0) {
|
2017-11-17 22:01:40 +01:00
|
|
|
foreach($device_keys as $row) {
|
|
|
|
|
//determine if the key is allowed
|
|
|
|
|
$device_key_authorized = false;
|
|
|
|
|
foreach($vendor_functions as $function) {
|
|
|
|
|
if ($function['vendor_name'] == $row['device_key_vendor'] && $function['value'] == $row['device_key_type']) {
|
|
|
|
|
$device_key_authorized = true;
|
|
|
|
|
}
|
2016-08-08 22:24:42 +02:00
|
|
|
}
|
2017-11-17 22:01:40 +01:00
|
|
|
//add the protected keys
|
|
|
|
|
if (!$device_key_authorized) {
|
|
|
|
|
$protected_keys[$row['device_key_id']] = 'true';
|
|
|
|
|
}
|
|
|
|
|
//add to protected
|
|
|
|
|
if ($row['device_key_protected'] == "true") {
|
|
|
|
|
$protected_keys[$row['device_key_id']] = 'true';
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-08-08 22:24:42 +02:00
|
|
|
}
|
2021-11-11 20:16:51 +01:00
|
|
|
|
2016-08-08 22:24:42 +02:00
|
|
|
//create a list of protected keys - device proile keys
|
2017-11-17 22:01:40 +01:00
|
|
|
if (is_array($device_profile_keys)) {
|
|
|
|
|
foreach($device_profile_keys as $row) {
|
|
|
|
|
//determine if the key is allowed
|
|
|
|
|
$device_key_authorized = false;
|
|
|
|
|
if (is_array($vendor_functions)) {
|
|
|
|
|
foreach($vendor_functions as $function) {
|
|
|
|
|
if ($function['vendor_name'] == $row['device_key_vendor'] && $function['value'] == $row['device_key_type']) {
|
|
|
|
|
$device_key_authorized = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-08-08 22:24:42 +02:00
|
|
|
}
|
2017-11-17 22:01:40 +01:00
|
|
|
//add the protected keys
|
|
|
|
|
if (!$device_key_authorized) {
|
|
|
|
|
$protected_keys[$row['device_key_id']] = 'true';
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-08-08 22:24:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//remove the keys the user is not allowed to edit based on the authorized vendor keys
|
|
|
|
|
$x=0;
|
2017-11-17 22:01:40 +01:00
|
|
|
if (is_array($_POST['device_keys'])) {
|
|
|
|
|
foreach($_POST['device_keys'] as $row) {
|
|
|
|
|
//loop through the authorized vendor functions
|
|
|
|
|
if ($protected_keys[$row['device_key_id']] == "true") {
|
|
|
|
|
unset($_POST['device_keys'][$x]);
|
|
|
|
|
}
|
|
|
|
|
//increment the row id
|
|
|
|
|
$x++;
|
|
|
|
|
}
|
2016-08-08 22:24:42 +02:00
|
|
|
}
|
|
|
|
|
|
2016-06-10 20:23:01 +02:00
|
|
|
//add or update the device keys
|
2017-11-17 22:01:40 +01:00
|
|
|
if (is_array($_POST['device_keys'])) {
|
2024-08-22 20:41:10 +02:00
|
|
|
foreach ($_POST['device_keys'] as $row) {
|
2017-11-17 22:01:40 +01:00
|
|
|
|
|
|
|
|
//validate the data
|
|
|
|
|
$save = true;
|
|
|
|
|
//if (!is_uuid($row["device_key_uuid"])) { $save = false; }
|
|
|
|
|
if (isset($row["device_key_id"])) {
|
|
|
|
|
if (!is_numeric($row["device_key_id"])) { $save = false; echo $row["device_key_id"]." id "; }
|
|
|
|
|
}
|
|
|
|
|
if (strlen($row["device_key_type"]) > 25) { $save = false; echo "type "; }
|
|
|
|
|
if (strlen($row["device_key_value"]) > 25) { $save = false; echo "value "; }
|
|
|
|
|
if (strlen($row["device_key_label"]) > 25) { $save = false; echo "label "; }
|
Add device key icon for dss programming (#3896)
* Expand Fanvil DSS-Key support for templating
* Add DSS key programming to Fanvil X6
* Add device key icon support.
* Additional device key icon fixes
* Fix SQL for device_key_label
* Add device_key_icon varible to X6 dss key programming
* Add new Advanced SIP Var (#3859)
Add the following advanced SIP variable. Disabling this allows Yealink phones to display the SIP error reason in the format sent by the carrier rather than Q.850 format e.g. "User Busy" rather than "NORMAL_CLEARING"
sip.call_fail_use_reason.enable = {$yealink_sip_call_fail_use_reason_enable}
* Variables for DP750 Handset Assignment, Ring Type (#3772)
New variables for the DP750 to allow the following settings:
$grandstream_repeater_mode_enable
(Enables or disables repeater mode on DP750 base)
$grandstream_hanging_group_mode
(Allows users to set hanging group mode (e.g. ring handsets at the same time, sequentially, etc.)
$grandstream_handset_X_line_Y_enable
(Allows setting of handset to line assignment)
* Update app_config.php
* Update 520_follow_me_bridge.xml (#3893)
Search through all SIP Profiles when looking up the Contact.
* Update xml_cdr_delete.php (#3891)
Fix typo in delete() query
* Make storage_path and storage_type = http_cache work (#3892)
* Make storage_path work
if storage_path was set, the script would fail. I have fixed it by removing the references to unset variables. I also made the recordings use the path.
* Update ivr.conf.lua
Add storage_path definition so storage_type of http_cache works correctly
* Fix IVR (#3898)
IVR was broken after previous update/change.
* Add Fanvil one-hit privisioning support for X6 and i30 devices (#3894)
* Update directory.xml
* Update directory.xml
* Update directory.xml
* Update directory.xml
* Update directory.xml (#3931)
* Update directory.xml (#3929)
* Update directory.xml (#3928)
* Update directory.xml (#3930)
* Update directory.xml (#3927)
* Update directory.xml (#3924)
* Update directory.xml (#3922)
* Update directory.xml (#3921)
* Update directory.xml (#3923)
* Update directory.xml (#3926)
* Update directory.xml (#3925)
* Update directory.xml (#3920)
* Update directory.xml (#3916)
* Update directory.xml (#3906)
* Update directory.xml (#3919)
* Update directory.xml (#3918)
* Update directory.xml (#3917)
* Update directory.xml (#3915)
* Update directory.xml (#3914)
* Update directory.xml (#3912)
* Update directory.xml (#3911)
* Update directory.xml (#3910)
* Update directory.xml (#3909)
* Update directory.xml (#3913)
* Update directory.xml (#3908)
* Update directory.xml (#3901)
* Update directory.xml (#3902)
* Update directory.xml (#3904)
* Update directory.xml (#3907)
* Update directory.xml (#3905)
* Update directory.xml (#3903)
* Update extensions.php
* Update domains.php
* Update dialplans.php
* Update users.php
* Update click_to_call.php
* Update app_config.php
* Update app_languages.php
* Update dialplan_edit.php
* Show enabled extension only on operator panel (#3900)
Add e.enabled = 'true' to SQL where and show only enabled extensions on the operator panel.
* Add new default_settings for Fanvil products (#3895)
* Add new default_settings for Fanvil products
* Set setting names too lowercase.
* Add additional firmware auto upgrade options
* Add intial Fanvil i30 device support (#3897)
* Update app_config.php
* Update dialplan.php (#3934)
Adds the ability to set "dialplan_destination" db field from Upgrade App Defaults and xml dialplan templates.
* Update dialplan.php
* Fanvil x6 template (#3936)
* Allow Fanvil x6 template to dynamically provision DSS memory and expansion keys
* Expand Fanvil X6 template options to match latest firmware. Use more FusionPBX default settings.
* Remove TR069 CPE serial number from template
* Have template use the 'admin_name' and 'admin_pass' default settings for admin webui login
* Fanvil i30 template fixes (#3933)
* Make varible names lowercase. follows cf76c39e977eaadc3cd1fb5d5160f432ce4e1486
* Additional i30 fixs around FusionPBX and feature enhancements.
* Add dynamic memory key programming
* Add support for configuring time to leave switch relay open on i-series devices
* Add OSD parameters, fix egs_syslog, protect RTSP streams by default
* Fix Fanvil 'Memory' keys (#3932)
* Expand Fanvil DSS-Key support for templating
* Fanvil vendor key fixes.
* Fanvil - Edit device keys to type 'memory' only
* Add Fanvil SpeedDial memory key support
* Update recordings.lua (#3937)
Bug fix. Allow for nil and blank entries.
* Add DSS key programming to Fanvil X6
* Fanvil 'icon' key for dss key profiles
* Fanvil 'icon' key for dss key profiles
Add new Advanced SIP Var (#3859)
Add the following advanced SIP variable. Disabling this allows Yealink phones to display the SIP error reason in the format sent by the carrier rather than Q.850 format e.g. "User Busy" rather than "NORMAL_CLEARING"
sip.call_fail_use_reason.enable = {$yealink_sip_call_fail_use_reason_enable}
Variables for DP750 Handset Assignment, Ring Type (#3772)
New variables for the DP750 to allow the following settings:
$grandstream_repeater_mode_enable
(Enables or disables repeater mode on DP750 base)
$grandstream_hanging_group_mode
(Allows users to set hanging group mode (e.g. ring handsets at the same time, sequentially, etc.)
$grandstream_handset_X_line_Y_enable
(Allows setting of handset to line assignment)
Update app_config.php
Update 520_follow_me_bridge.xml (#3893)
Search through all SIP Profiles when looking up the Contact.
Update xml_cdr_delete.php (#3891)
Fix typo in delete() query
Make storage_path and storage_type = http_cache work (#3892)
* Make storage_path work
if storage_path was set, the script would fail. I have fixed it by removing the references to unset variables. I also made the recordings use the path.
* Update ivr.conf.lua
Add storage_path definition so storage_type of http_cache works correctly
Fix IVR (#3898)
IVR was broken after previous update/change.
Add Fanvil one-hit privisioning support for X6 and i30 devices (#3894)
Update directory.xml
Update directory.xml
Update directory.xml
Update directory.xml
Update directory.xml (#3931)
Update directory.xml (#3929)
Update directory.xml (#3928)
Update directory.xml (#3930)
Update directory.xml (#3927)
Update directory.xml (#3924)
Update directory.xml (#3922)
Update directory.xml (#3921)
Update directory.xml (#3923)
Update directory.xml (#3926)
Update directory.xml (#3925)
Update directory.xml (#3920)
Update directory.xml (#3916)
Update directory.xml (#3906)
Update directory.xml (#3919)
Update directory.xml (#3918)
Update directory.xml (#3917)
Update directory.xml (#3915)
Update directory.xml (#3914)
Update directory.xml (#3912)
Update directory.xml (#3911)
Update directory.xml (#3910)
Update directory.xml (#3909)
Update directory.xml (#3913)
Update directory.xml (#3908)
Update directory.xml (#3901)
Update directory.xml (#3902)
Update directory.xml (#3904)
Update directory.xml (#3907)
Update directory.xml (#3905)
Update directory.xml (#3903)
Update extensions.php
Update domains.php
Update dialplans.php
Update users.php
Update click_to_call.php
Update app_config.php
Update app_languages.php
Update dialplan_edit.php
Show enabled extension only on operator panel (#3900)
Add e.enabled = 'true' to SQL where and show only enabled extensions on the operator panel.
Add new default_settings for Fanvil products (#3895)
* Add new default_settings for Fanvil products
* Set setting names too lowercase.
* Add additional firmware auto upgrade options
Update app_config.php
Update dialplan.php (#3934)
Adds the ability to set "dialplan_destination" db field from Upgrade App Defaults and xml dialplan templates.
Update dialplan.php
Fanvil x6 template (#3936)
* Allow Fanvil x6 template to dynamically provision DSS memory and expansion keys
* Expand Fanvil X6 template options to match latest firmware. Use more FusionPBX default settings.
* Remove TR069 CPE serial number from template
* Have template use the 'admin_name' and 'admin_pass' default settings for admin webui login
Fanvil i30 template fixes (#3933)
* Make varible names lowercase. follows cf76c39e977eaadc3cd1fb5d5160f432ce4e1486
* Additional i30 fixs around FusionPBX and feature enhancements.
* Add dynamic memory key programming
* Add support for configuring time to leave switch relay open on i-series devices
* Add OSD parameters, fix egs_syslog, protect RTSP streams by default
Fix Fanvil 'Memory' keys (#3932)
* Expand Fanvil DSS-Key support for templating
* Fanvil vendor key fixes.
* Fanvil - Edit device keys to type 'memory' only
* Add Fanvil SpeedDial memory key support
Update recordings.lua (#3937)
Bug fix. Allow for nil and blank entries.
Add DSS key programming to Fanvil X6
* resync3
2018-12-12 18:08:21 +01:00
|
|
|
if (strlen($row["device_key_icon"]) > 25) { $save = false; echo "icon "; }
|
2017-11-17 22:01:40 +01:00
|
|
|
|
|
|
|
|
//escape characters in the string
|
2019-08-04 04:21:56 +02:00
|
|
|
$device_uuid = $row["device_uuid"];
|
|
|
|
|
$device_key_uuid = $row["device_key_uuid"];
|
|
|
|
|
$device_key_id = $row["device_key_id"];
|
|
|
|
|
$device_key_type = $row["device_key_type"];
|
|
|
|
|
$device_key_line = $row["device_key_line"];
|
|
|
|
|
$device_key_value = $row["device_key_value"];
|
|
|
|
|
$device_key_label = $row["device_key_label"];
|
|
|
|
|
$device_key_icon = $row["device_key_icon"];
|
|
|
|
|
$device_key_category = $row["device_key_category"];
|
|
|
|
|
$device_key_vendor = $row["device_key_vendor"];
|
2017-11-17 22:01:40 +01:00
|
|
|
|
|
|
|
|
//process the profile keys
|
2023-05-05 18:46:37 +02:00
|
|
|
if (!empty($row["device_profile_uuid"])) {
|
2017-11-17 22:01:40 +01:00
|
|
|
//get the profile key settings from the array
|
2024-08-22 20:41:10 +02:00
|
|
|
foreach ($device_profile_keys as $field) {
|
2017-11-17 22:01:40 +01:00
|
|
|
if ($device_key_uuid == $field["device_key_uuid"]) {
|
|
|
|
|
$database = $field;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2016-07-16 20:15:22 +02:00
|
|
|
}
|
2017-11-17 22:01:40 +01:00
|
|
|
//determine what to do with the profile key
|
|
|
|
|
if ($device_key_id == $database["device_key_id"]
|
|
|
|
|
&& $device_key_value == $database["device_key_value"]
|
Add device key icon for dss programming (#3896)
* Expand Fanvil DSS-Key support for templating
* Add DSS key programming to Fanvil X6
* Add device key icon support.
* Additional device key icon fixes
* Fix SQL for device_key_label
* Add device_key_icon varible to X6 dss key programming
* Add new Advanced SIP Var (#3859)
Add the following advanced SIP variable. Disabling this allows Yealink phones to display the SIP error reason in the format sent by the carrier rather than Q.850 format e.g. "User Busy" rather than "NORMAL_CLEARING"
sip.call_fail_use_reason.enable = {$yealink_sip_call_fail_use_reason_enable}
* Variables for DP750 Handset Assignment, Ring Type (#3772)
New variables for the DP750 to allow the following settings:
$grandstream_repeater_mode_enable
(Enables or disables repeater mode on DP750 base)
$grandstream_hanging_group_mode
(Allows users to set hanging group mode (e.g. ring handsets at the same time, sequentially, etc.)
$grandstream_handset_X_line_Y_enable
(Allows setting of handset to line assignment)
* Update app_config.php
* Update 520_follow_me_bridge.xml (#3893)
Search through all SIP Profiles when looking up the Contact.
* Update xml_cdr_delete.php (#3891)
Fix typo in delete() query
* Make storage_path and storage_type = http_cache work (#3892)
* Make storage_path work
if storage_path was set, the script would fail. I have fixed it by removing the references to unset variables. I also made the recordings use the path.
* Update ivr.conf.lua
Add storage_path definition so storage_type of http_cache works correctly
* Fix IVR (#3898)
IVR was broken after previous update/change.
* Add Fanvil one-hit privisioning support for X6 and i30 devices (#3894)
* Update directory.xml
* Update directory.xml
* Update directory.xml
* Update directory.xml
* Update directory.xml (#3931)
* Update directory.xml (#3929)
* Update directory.xml (#3928)
* Update directory.xml (#3930)
* Update directory.xml (#3927)
* Update directory.xml (#3924)
* Update directory.xml (#3922)
* Update directory.xml (#3921)
* Update directory.xml (#3923)
* Update directory.xml (#3926)
* Update directory.xml (#3925)
* Update directory.xml (#3920)
* Update directory.xml (#3916)
* Update directory.xml (#3906)
* Update directory.xml (#3919)
* Update directory.xml (#3918)
* Update directory.xml (#3917)
* Update directory.xml (#3915)
* Update directory.xml (#3914)
* Update directory.xml (#3912)
* Update directory.xml (#3911)
* Update directory.xml (#3910)
* Update directory.xml (#3909)
* Update directory.xml (#3913)
* Update directory.xml (#3908)
* Update directory.xml (#3901)
* Update directory.xml (#3902)
* Update directory.xml (#3904)
* Update directory.xml (#3907)
* Update directory.xml (#3905)
* Update directory.xml (#3903)
* Update extensions.php
* Update domains.php
* Update dialplans.php
* Update users.php
* Update click_to_call.php
* Update app_config.php
* Update app_languages.php
* Update dialplan_edit.php
* Show enabled extension only on operator panel (#3900)
Add e.enabled = 'true' to SQL where and show only enabled extensions on the operator panel.
* Add new default_settings for Fanvil products (#3895)
* Add new default_settings for Fanvil products
* Set setting names too lowercase.
* Add additional firmware auto upgrade options
* Add intial Fanvil i30 device support (#3897)
* Update app_config.php
* Update dialplan.php (#3934)
Adds the ability to set "dialplan_destination" db field from Upgrade App Defaults and xml dialplan templates.
* Update dialplan.php
* Fanvil x6 template (#3936)
* Allow Fanvil x6 template to dynamically provision DSS memory and expansion keys
* Expand Fanvil X6 template options to match latest firmware. Use more FusionPBX default settings.
* Remove TR069 CPE serial number from template
* Have template use the 'admin_name' and 'admin_pass' default settings for admin webui login
* Fanvil i30 template fixes (#3933)
* Make varible names lowercase. follows cf76c39e977eaadc3cd1fb5d5160f432ce4e1486
* Additional i30 fixs around FusionPBX and feature enhancements.
* Add dynamic memory key programming
* Add support for configuring time to leave switch relay open on i-series devices
* Add OSD parameters, fix egs_syslog, protect RTSP streams by default
* Fix Fanvil 'Memory' keys (#3932)
* Expand Fanvil DSS-Key support for templating
* Fanvil vendor key fixes.
* Fanvil - Edit device keys to type 'memory' only
* Add Fanvil SpeedDial memory key support
* Update recordings.lua (#3937)
Bug fix. Allow for nil and blank entries.
* Add DSS key programming to Fanvil X6
* Fanvil 'icon' key for dss key profiles
* Fanvil 'icon' key for dss key profiles
Add new Advanced SIP Var (#3859)
Add the following advanced SIP variable. Disabling this allows Yealink phones to display the SIP error reason in the format sent by the carrier rather than Q.850 format e.g. "User Busy" rather than "NORMAL_CLEARING"
sip.call_fail_use_reason.enable = {$yealink_sip_call_fail_use_reason_enable}
Variables for DP750 Handset Assignment, Ring Type (#3772)
New variables for the DP750 to allow the following settings:
$grandstream_repeater_mode_enable
(Enables or disables repeater mode on DP750 base)
$grandstream_hanging_group_mode
(Allows users to set hanging group mode (e.g. ring handsets at the same time, sequentially, etc.)
$grandstream_handset_X_line_Y_enable
(Allows setting of handset to line assignment)
Update app_config.php
Update 520_follow_me_bridge.xml (#3893)
Search through all SIP Profiles when looking up the Contact.
Update xml_cdr_delete.php (#3891)
Fix typo in delete() query
Make storage_path and storage_type = http_cache work (#3892)
* Make storage_path work
if storage_path was set, the script would fail. I have fixed it by removing the references to unset variables. I also made the recordings use the path.
* Update ivr.conf.lua
Add storage_path definition so storage_type of http_cache works correctly
Fix IVR (#3898)
IVR was broken after previous update/change.
Add Fanvil one-hit privisioning support for X6 and i30 devices (#3894)
Update directory.xml
Update directory.xml
Update directory.xml
Update directory.xml
Update directory.xml (#3931)
Update directory.xml (#3929)
Update directory.xml (#3928)
Update directory.xml (#3930)
Update directory.xml (#3927)
Update directory.xml (#3924)
Update directory.xml (#3922)
Update directory.xml (#3921)
Update directory.xml (#3923)
Update directory.xml (#3926)
Update directory.xml (#3925)
Update directory.xml (#3920)
Update directory.xml (#3916)
Update directory.xml (#3906)
Update directory.xml (#3919)
Update directory.xml (#3918)
Update directory.xml (#3917)
Update directory.xml (#3915)
Update directory.xml (#3914)
Update directory.xml (#3912)
Update directory.xml (#3911)
Update directory.xml (#3910)
Update directory.xml (#3909)
Update directory.xml (#3913)
Update directory.xml (#3908)
Update directory.xml (#3901)
Update directory.xml (#3902)
Update directory.xml (#3904)
Update directory.xml (#3907)
Update directory.xml (#3905)
Update directory.xml (#3903)
Update extensions.php
Update domains.php
Update dialplans.php
Update users.php
Update click_to_call.php
Update app_config.php
Update app_languages.php
Update dialplan_edit.php
Show enabled extension only on operator panel (#3900)
Add e.enabled = 'true' to SQL where and show only enabled extensions on the operator panel.
Add new default_settings for Fanvil products (#3895)
* Add new default_settings for Fanvil products
* Set setting names too lowercase.
* Add additional firmware auto upgrade options
Update app_config.php
Update dialplan.php (#3934)
Adds the ability to set "dialplan_destination" db field from Upgrade App Defaults and xml dialplan templates.
Update dialplan.php
Fanvil x6 template (#3936)
* Allow Fanvil x6 template to dynamically provision DSS memory and expansion keys
* Expand Fanvil X6 template options to match latest firmware. Use more FusionPBX default settings.
* Remove TR069 CPE serial number from template
* Have template use the 'admin_name' and 'admin_pass' default settings for admin webui login
Fanvil i30 template fixes (#3933)
* Make varible names lowercase. follows cf76c39e977eaadc3cd1fb5d5160f432ce4e1486
* Additional i30 fixs around FusionPBX and feature enhancements.
* Add dynamic memory key programming
* Add support for configuring time to leave switch relay open on i-series devices
* Add OSD parameters, fix egs_syslog, protect RTSP streams by default
Fix Fanvil 'Memory' keys (#3932)
* Expand Fanvil DSS-Key support for templating
* Fanvil vendor key fixes.
* Fanvil - Edit device keys to type 'memory' only
* Add Fanvil SpeedDial memory key support
Update recordings.lua (#3937)
Bug fix. Allow for nil and blank entries.
Add DSS key programming to Fanvil X6
* resync3
2018-12-12 18:08:21 +01:00
|
|
|
&& $device_key_label == $database["device_key_label"]
|
|
|
|
|
&& $device_key_icon == $database["device_key_icon"]) {
|
2017-11-17 22:01:40 +01:00
|
|
|
//profile key unchanged don't save
|
|
|
|
|
$save = false;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
//profile key has changed remove save the settings to the device
|
|
|
|
|
$device_key_uuid = '';
|
2016-07-30 18:25:34 +02:00
|
|
|
}
|
2016-05-31 00:40:23 +02:00
|
|
|
}
|
2016-06-10 20:23:01 +02:00
|
|
|
|
2017-11-17 22:01:40 +01:00
|
|
|
//sql add or update
|
2019-08-04 04:21:56 +02:00
|
|
|
if (!is_uuid($device_key_uuid)) {
|
2023-05-05 18:46:37 +02:00
|
|
|
if (permission_exists('device_key_add') && strlen($device_key_type) > 0 && !empty($device_key_value)) {
|
2017-11-17 22:01:40 +01:00
|
|
|
|
|
|
|
|
//if the device_uuid is not in the array then get the device_uuid from the database
|
2023-05-05 18:46:37 +02:00
|
|
|
if (empty($device_uuid)) {
|
2019-08-04 04:21:56 +02:00
|
|
|
$sql = "select device_uuid from v_devices ";
|
|
|
|
|
$sql .= "where device_user_uuid = :device_user_uuid ";
|
|
|
|
|
$parameters['device_user_uuid'] = $_SESSION['user_uuid'];
|
|
|
|
|
$device_uuid = $database->select($sql, $parameters, 'column');
|
|
|
|
|
unset($sql, $parameters);
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//insert the keys
|
2019-08-04 04:21:56 +02:00
|
|
|
$device_key_uuid = uuid();
|
|
|
|
|
$array['device_keys'][0]['device_key_uuid'] = $device_key_uuid;
|
|
|
|
|
$array['device_keys'][0]['device_uuid'] = $device_uuid;
|
|
|
|
|
$array['device_keys'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
|
|
|
|
|
$array['device_keys'][0]['device_key_id'] = $device_key_id;
|
|
|
|
|
$array['device_keys'][0]['device_key_type'] = $device_key_type;
|
|
|
|
|
$array['device_keys'][0]['device_key_line'] = $device_key_line;
|
|
|
|
|
$array['device_keys'][0]['device_key_value'] = $device_key_value;
|
|
|
|
|
$array['device_keys'][0]['device_key_label'] = $device_key_label;
|
2022-01-25 17:53:03 +01:00
|
|
|
if (permission_exists('device_key_icon')) {
|
|
|
|
|
$array['device_keys'][0]['device_key_icon'] = $device_key_icon;
|
|
|
|
|
}
|
2019-08-04 04:21:56 +02:00
|
|
|
$array['device_keys'][0]['device_key_category'] = $device_key_category;
|
|
|
|
|
$array['device_keys'][0]['device_key_vendor'] = $device_key_vendor;
|
2017-11-17 22:01:40 +01:00
|
|
|
|
|
|
|
|
//action add or update
|
|
|
|
|
$action = "add";
|
2016-06-10 20:23:01 +02:00
|
|
|
}
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
//action add or update
|
|
|
|
|
$action = "update";
|
|
|
|
|
|
|
|
|
|
//update the device keys
|
2019-08-04 04:21:56 +02:00
|
|
|
$array['device_keys'][0]['device_key_uuid'] = $device_key_uuid;
|
|
|
|
|
$array['device_keys'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
|
2017-11-17 22:01:40 +01:00
|
|
|
if (permission_exists('device_key_id')) {
|
2019-08-04 04:21:56 +02:00
|
|
|
$array['device_keys'][0]['device_key_id'] = $device_key_id;
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
2019-08-04 04:21:56 +02:00
|
|
|
$array['device_keys'][0]['device_key_type'] = $device_key_type;
|
|
|
|
|
$array['device_keys'][0]['device_key_value'] = $device_key_value;
|
|
|
|
|
$array['device_keys'][0]['device_key_label'] = $device_key_label;
|
2022-01-25 17:53:03 +01:00
|
|
|
if (permission_exists('device_key_icon')) {
|
|
|
|
|
$array['device_keys'][0]['device_key_icon'] = $device_key_icon;
|
|
|
|
|
}
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
|
|
|
|
if ($save) {
|
2021-11-11 20:16:51 +01:00
|
|
|
//add the temporary permissions
|
2024-11-29 22:06:08 +01:00
|
|
|
$p = permissions::new();
|
2021-11-11 20:16:51 +01:00
|
|
|
$p->add('device_keys_add', 'temp');
|
|
|
|
|
$p->add('device_key_edit', 'temp');
|
|
|
|
|
|
|
|
|
|
//save the changes
|
|
|
|
|
$database->app_name = 'devices';
|
|
|
|
|
$database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e';
|
2024-07-23 22:29:28 +02:00
|
|
|
$result = $database->save($array);
|
2021-11-11 20:16:51 +01:00
|
|
|
|
|
|
|
|
//remove the temporary permissions
|
|
|
|
|
$p->delete('device_keys_add', 'temp');
|
|
|
|
|
$p->delete('device_key_edit', 'temp');
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
2019-08-04 04:21:56 +02:00
|
|
|
unset($array);
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
2016-05-29 03:52:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//write the provision files
|
2023-05-05 18:46:37 +02:00
|
|
|
if (!empty($_SESSION['provision']['path']['text'])) {
|
2016-12-06 19:24:07 +01:00
|
|
|
$prov = new provision;
|
|
|
|
|
$prov->domain_uuid = $domain_uuid;
|
|
|
|
|
$response = $prov->write();
|
|
|
|
|
}
|
2016-05-29 03:52:28 +02:00
|
|
|
|
|
|
|
|
//set the message
|
2020-04-14 02:18:56 +02:00
|
|
|
message::add($text["message-".$action]);
|
2017-06-10 04:13:40 +02:00
|
|
|
|
|
|
|
|
//redirect the browser
|
2021-11-11 20:16:51 +01:00
|
|
|
header("Location: /core/dashboard/");
|
2017-06-10 04:13:40 +02:00
|
|
|
exit;
|
2016-05-29 03:52:28 +02:00
|
|
|
|
2019-08-04 04:21:56 +02:00
|
|
|
}
|
|
|
|
|
}
|
2016-05-29 03:52:28 +02:00
|
|
|
|
|
|
|
|
//set the sub array index
|
|
|
|
|
$x = "999";
|
|
|
|
|
|
2021-11-11 20:16:51 +01:00
|
|
|
//get the device
|
2019-08-04 04:21:56 +02:00
|
|
|
$sql = "select device_uuid, device_profile_uuid from v_devices ";
|
|
|
|
|
$sql .= "where device_user_uuid = :device_user_uuid ";
|
|
|
|
|
$parameters['device_user_uuid'] = $_SESSION['user_uuid'];
|
|
|
|
|
$row = $database->select($sql, $parameters, 'row');
|
|
|
|
|
if (is_array($row) && @sizeof($row) != 0) {
|
|
|
|
|
$device_uuid = $row['device_uuid'];
|
|
|
|
|
$device_profile_uuid = $row['device_profile_uuid'];
|
|
|
|
|
}
|
|
|
|
|
unset($sql, $parameters, $row);
|
2016-06-10 20:23:01 +02:00
|
|
|
|
2016-06-19 18:00:01 +02:00
|
|
|
//get device lines
|
2024-05-13 22:20:33 +02:00
|
|
|
if (!empty($device_uuid) && is_uuid($device_uuid)) {
|
2019-08-04 04:21:56 +02:00
|
|
|
$sql = "select * from v_device_lines ";
|
|
|
|
|
$sql .= "where device_uuid = :device_uuid ";
|
|
|
|
|
$parameters['device_uuid'] = $device_uuid;
|
|
|
|
|
$device_lines = $database->select($sql, $parameters, 'all');
|
|
|
|
|
unset($sql, $parameters);
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
2016-06-19 18:00:01 +02:00
|
|
|
|
2016-06-24 17:47:13 +02:00
|
|
|
//get the user
|
2024-05-13 22:20:33 +02:00
|
|
|
if (!empty($device_lines) && is_array($device_lines)) {
|
2017-11-17 22:01:40 +01:00
|
|
|
foreach ($device_lines as $row) {
|
|
|
|
|
if ($_SESSION['domain_name'] == $row['server_address']) {
|
|
|
|
|
$user_id = $row['user_id'];
|
|
|
|
|
$server_address = $row['server_address'];
|
|
|
|
|
break;
|
|
|
|
|
}
|
2016-06-24 17:47:13 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//set the sip profile name
|
|
|
|
|
$sip_profile_name = 'internal';
|
|
|
|
|
|
2021-11-11 20:16:51 +01:00
|
|
|
//get the device keys in the right order where device keys are listed after the profile keys
|
2024-05-13 22:20:33 +02:00
|
|
|
if (!empty($device_uuid) && is_uuid($device_uuid)) {
|
2019-08-04 04:21:56 +02:00
|
|
|
$sql = "select * from v_device_keys ";
|
2024-07-23 23:58:45 +02:00
|
|
|
$sql .= "where device_uuid = :device_uuid ";
|
2019-08-04 04:21:56 +02:00
|
|
|
$sql .= "order by ";
|
|
|
|
|
$sql .= "device_key_vendor asc, ";
|
|
|
|
|
$sql .= "case device_key_category ";
|
|
|
|
|
$sql .= "when 'line' then 1 ";
|
|
|
|
|
$sql .= "when 'memory' then 2 ";
|
|
|
|
|
$sql .= "when 'programmable' then 3 ";
|
|
|
|
|
$sql .= "when 'expansion' then 4 ";
|
|
|
|
|
$sql .= "else 100 end, ";
|
|
|
|
|
$sql .= $db_type == "mysql" ? "device_key_id asc " : "cast(device_key_id as numeric) asc, ";
|
|
|
|
|
$sql .= "case when device_uuid is null then 0 else 1 end asc ";
|
|
|
|
|
$parameters['device_uuid'] = $device_uuid;
|
|
|
|
|
$keys = $database->select($sql, $parameters, 'all');
|
|
|
|
|
unset($sql, $parameters);
|
2016-05-29 03:52:28 +02:00
|
|
|
}
|
2016-07-16 11:34:51 +02:00
|
|
|
|
|
|
|
|
//override profile keys with device keys
|
2024-05-13 22:20:33 +02:00
|
|
|
if (!empty($keys) && is_array($keys) && @sizeof($keys) != 0) {
|
2017-11-17 22:01:40 +01:00
|
|
|
foreach($keys as $row) {
|
|
|
|
|
$id = $row['device_key_id'];
|
|
|
|
|
$device_keys[$id] = $row;
|
|
|
|
|
if (is_uuid($row['device_profile_uuid'])) {
|
|
|
|
|
$device_keys[$id]['device_key_owner'] = "profile";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$device_keys[$id]['device_key_owner'] = "device";
|
|
|
|
|
}
|
2016-07-16 11:34:51 +02:00
|
|
|
}
|
2017-11-17 22:01:40 +01:00
|
|
|
unset($keys);
|
2016-07-16 11:34:51 +02:00
|
|
|
}
|
2016-05-29 03:52:28 +02:00
|
|
|
|
2016-05-31 00:40:23 +02:00
|
|
|
//get the vendor count and last and device information
|
2024-05-13 22:20:33 +02:00
|
|
|
if (!empty($device_keys) && is_array($device_keys) && @sizeof($device_keys) != 0) {
|
2017-11-17 22:01:40 +01:00
|
|
|
$vendor_count = 0;
|
|
|
|
|
foreach($device_keys as $row) {
|
|
|
|
|
if ($previous_vendor != $row['device_key_vendor']) {
|
|
|
|
|
$previous_vendor = $row['device_key_vendor'];
|
|
|
|
|
$device_uuid = $row['device_uuid'];
|
|
|
|
|
$device_key_vendor = $row['device_key_vendor'];
|
|
|
|
|
$device_key_id = $row['device_key_id'];
|
|
|
|
|
$device_key_line = $row['device_key_line'];
|
|
|
|
|
$device_key_category = $row['device_key_category'];
|
|
|
|
|
$vendor_count++;
|
|
|
|
|
}
|
2016-05-31 00:40:23 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//add a new key
|
|
|
|
|
if (permission_exists('device_key_add')) {
|
2024-05-13 22:20:33 +02:00
|
|
|
$device_keys[$x]['device_key_category'] = $device_key_category ?? '';
|
2016-05-31 00:40:23 +02:00
|
|
|
$device_keys[$x]['device_key_id'] = '';
|
2024-05-13 22:20:33 +02:00
|
|
|
$device_keys[$x]['device_uuid'] = $device_uuid ?? '';
|
|
|
|
|
$device_keys[$x]['device_key_vendor'] = $device_key_vendor ?? '';
|
2016-05-31 00:40:23 +02:00
|
|
|
$device_keys[$x]['device_key_type'] = '';
|
|
|
|
|
$device_keys[$x]['device_key_line'] = '';
|
|
|
|
|
$device_keys[$x]['device_key_value'] = '';
|
|
|
|
|
$device_keys[$x]['device_key_extension'] = '';
|
|
|
|
|
$device_keys[$x]['device_key_label'] = '';
|
Add device key icon for dss programming (#3896)
* Expand Fanvil DSS-Key support for templating
* Add DSS key programming to Fanvil X6
* Add device key icon support.
* Additional device key icon fixes
* Fix SQL for device_key_label
* Add device_key_icon varible to X6 dss key programming
* Add new Advanced SIP Var (#3859)
Add the following advanced SIP variable. Disabling this allows Yealink phones to display the SIP error reason in the format sent by the carrier rather than Q.850 format e.g. "User Busy" rather than "NORMAL_CLEARING"
sip.call_fail_use_reason.enable = {$yealink_sip_call_fail_use_reason_enable}
* Variables for DP750 Handset Assignment, Ring Type (#3772)
New variables for the DP750 to allow the following settings:
$grandstream_repeater_mode_enable
(Enables or disables repeater mode on DP750 base)
$grandstream_hanging_group_mode
(Allows users to set hanging group mode (e.g. ring handsets at the same time, sequentially, etc.)
$grandstream_handset_X_line_Y_enable
(Allows setting of handset to line assignment)
* Update app_config.php
* Update 520_follow_me_bridge.xml (#3893)
Search through all SIP Profiles when looking up the Contact.
* Update xml_cdr_delete.php (#3891)
Fix typo in delete() query
* Make storage_path and storage_type = http_cache work (#3892)
* Make storage_path work
if storage_path was set, the script would fail. I have fixed it by removing the references to unset variables. I also made the recordings use the path.
* Update ivr.conf.lua
Add storage_path definition so storage_type of http_cache works correctly
* Fix IVR (#3898)
IVR was broken after previous update/change.
* Add Fanvil one-hit privisioning support for X6 and i30 devices (#3894)
* Update directory.xml
* Update directory.xml
* Update directory.xml
* Update directory.xml
* Update directory.xml (#3931)
* Update directory.xml (#3929)
* Update directory.xml (#3928)
* Update directory.xml (#3930)
* Update directory.xml (#3927)
* Update directory.xml (#3924)
* Update directory.xml (#3922)
* Update directory.xml (#3921)
* Update directory.xml (#3923)
* Update directory.xml (#3926)
* Update directory.xml (#3925)
* Update directory.xml (#3920)
* Update directory.xml (#3916)
* Update directory.xml (#3906)
* Update directory.xml (#3919)
* Update directory.xml (#3918)
* Update directory.xml (#3917)
* Update directory.xml (#3915)
* Update directory.xml (#3914)
* Update directory.xml (#3912)
* Update directory.xml (#3911)
* Update directory.xml (#3910)
* Update directory.xml (#3909)
* Update directory.xml (#3913)
* Update directory.xml (#3908)
* Update directory.xml (#3901)
* Update directory.xml (#3902)
* Update directory.xml (#3904)
* Update directory.xml (#3907)
* Update directory.xml (#3905)
* Update directory.xml (#3903)
* Update extensions.php
* Update domains.php
* Update dialplans.php
* Update users.php
* Update click_to_call.php
* Update app_config.php
* Update app_languages.php
* Update dialplan_edit.php
* Show enabled extension only on operator panel (#3900)
Add e.enabled = 'true' to SQL where and show only enabled extensions on the operator panel.
* Add new default_settings for Fanvil products (#3895)
* Add new default_settings for Fanvil products
* Set setting names too lowercase.
* Add additional firmware auto upgrade options
* Add intial Fanvil i30 device support (#3897)
* Update app_config.php
* Update dialplan.php (#3934)
Adds the ability to set "dialplan_destination" db field from Upgrade App Defaults and xml dialplan templates.
* Update dialplan.php
* Fanvil x6 template (#3936)
* Allow Fanvil x6 template to dynamically provision DSS memory and expansion keys
* Expand Fanvil X6 template options to match latest firmware. Use more FusionPBX default settings.
* Remove TR069 CPE serial number from template
* Have template use the 'admin_name' and 'admin_pass' default settings for admin webui login
* Fanvil i30 template fixes (#3933)
* Make varible names lowercase. follows cf76c39e977eaadc3cd1fb5d5160f432ce4e1486
* Additional i30 fixs around FusionPBX and feature enhancements.
* Add dynamic memory key programming
* Add support for configuring time to leave switch relay open on i-series devices
* Add OSD parameters, fix egs_syslog, protect RTSP streams by default
* Fix Fanvil 'Memory' keys (#3932)
* Expand Fanvil DSS-Key support for templating
* Fanvil vendor key fixes.
* Fanvil - Edit device keys to type 'memory' only
* Add Fanvil SpeedDial memory key support
* Update recordings.lua (#3937)
Bug fix. Allow for nil and blank entries.
* Add DSS key programming to Fanvil X6
* Fanvil 'icon' key for dss key profiles
* Fanvil 'icon' key for dss key profiles
Add new Advanced SIP Var (#3859)
Add the following advanced SIP variable. Disabling this allows Yealink phones to display the SIP error reason in the format sent by the carrier rather than Q.850 format e.g. "User Busy" rather than "NORMAL_CLEARING"
sip.call_fail_use_reason.enable = {$yealink_sip_call_fail_use_reason_enable}
Variables for DP750 Handset Assignment, Ring Type (#3772)
New variables for the DP750 to allow the following settings:
$grandstream_repeater_mode_enable
(Enables or disables repeater mode on DP750 base)
$grandstream_hanging_group_mode
(Allows users to set hanging group mode (e.g. ring handsets at the same time, sequentially, etc.)
$grandstream_handset_X_line_Y_enable
(Allows setting of handset to line assignment)
Update app_config.php
Update 520_follow_me_bridge.xml (#3893)
Search through all SIP Profiles when looking up the Contact.
Update xml_cdr_delete.php (#3891)
Fix typo in delete() query
Make storage_path and storage_type = http_cache work (#3892)
* Make storage_path work
if storage_path was set, the script would fail. I have fixed it by removing the references to unset variables. I also made the recordings use the path.
* Update ivr.conf.lua
Add storage_path definition so storage_type of http_cache works correctly
Fix IVR (#3898)
IVR was broken after previous update/change.
Add Fanvil one-hit privisioning support for X6 and i30 devices (#3894)
Update directory.xml
Update directory.xml
Update directory.xml
Update directory.xml
Update directory.xml (#3931)
Update directory.xml (#3929)
Update directory.xml (#3928)
Update directory.xml (#3930)
Update directory.xml (#3927)
Update directory.xml (#3924)
Update directory.xml (#3922)
Update directory.xml (#3921)
Update directory.xml (#3923)
Update directory.xml (#3926)
Update directory.xml (#3925)
Update directory.xml (#3920)
Update directory.xml (#3916)
Update directory.xml (#3906)
Update directory.xml (#3919)
Update directory.xml (#3918)
Update directory.xml (#3917)
Update directory.xml (#3915)
Update directory.xml (#3914)
Update directory.xml (#3912)
Update directory.xml (#3911)
Update directory.xml (#3910)
Update directory.xml (#3909)
Update directory.xml (#3913)
Update directory.xml (#3908)
Update directory.xml (#3901)
Update directory.xml (#3902)
Update directory.xml (#3904)
Update directory.xml (#3907)
Update directory.xml (#3905)
Update directory.xml (#3903)
Update extensions.php
Update domains.php
Update dialplans.php
Update users.php
Update click_to_call.php
Update app_config.php
Update app_languages.php
Update dialplan_edit.php
Show enabled extension only on operator panel (#3900)
Add e.enabled = 'true' to SQL where and show only enabled extensions on the operator panel.
Add new default_settings for Fanvil products (#3895)
* Add new default_settings for Fanvil products
* Set setting names too lowercase.
* Add additional firmware auto upgrade options
Update app_config.php
Update dialplan.php (#3934)
Adds the ability to set "dialplan_destination" db field from Upgrade App Defaults and xml dialplan templates.
Update dialplan.php
Fanvil x6 template (#3936)
* Allow Fanvil x6 template to dynamically provision DSS memory and expansion keys
* Expand Fanvil X6 template options to match latest firmware. Use more FusionPBX default settings.
* Remove TR069 CPE serial number from template
* Have template use the 'admin_name' and 'admin_pass' default settings for admin webui login
Fanvil i30 template fixes (#3933)
* Make varible names lowercase. follows cf76c39e977eaadc3cd1fb5d5160f432ce4e1486
* Additional i30 fixs around FusionPBX and feature enhancements.
* Add dynamic memory key programming
* Add support for configuring time to leave switch relay open on i-series devices
* Add OSD parameters, fix egs_syslog, protect RTSP streams by default
Fix Fanvil 'Memory' keys (#3932)
* Expand Fanvil DSS-Key support for templating
* Fanvil vendor key fixes.
* Fanvil - Edit device keys to type 'memory' only
* Add Fanvil SpeedDial memory key support
Update recordings.lua (#3937)
Bug fix. Allow for nil and blank entries.
Add DSS key programming to Fanvil X6
* resync3
2018-12-12 18:08:21 +01:00
|
|
|
$device_keys[$x]['device_key_icon'] = '';
|
2016-05-31 00:40:23 +02:00
|
|
|
}
|
|
|
|
|
|
2016-08-08 22:24:42 +02:00
|
|
|
//remove the keys the user is not allowed to edit based on the authorized vendor keys
|
2019-08-04 04:21:56 +02:00
|
|
|
if (is_array($device_keys) && @sizeof($device_keys) != 0) {
|
2017-11-17 22:01:40 +01:00
|
|
|
foreach($device_keys as $row) {
|
|
|
|
|
//loop through the authorized vendor functions
|
|
|
|
|
$device_key_authorized = false;
|
|
|
|
|
if (is_array($vendor_functions)) {
|
|
|
|
|
foreach($vendor_functions as $function) {
|
|
|
|
|
if (strlen($row['device_key_type'] == 0)) {
|
|
|
|
|
$device_key_authorized = true;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if ($function['vendor_name'] == $row['device_key_vendor'] && $function['value'] == $row['device_key_type']) {
|
|
|
|
|
$device_key_authorized = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-08-08 22:24:42 +02:00
|
|
|
}
|
|
|
|
|
}
|
2017-11-17 22:01:40 +01:00
|
|
|
//unset vendor functions the is not allowed to edit
|
|
|
|
|
if (!$device_key_authorized) {
|
|
|
|
|
unset($device_keys[$row['device_key_id']]);
|
|
|
|
|
}
|
|
|
|
|
//hide protected keys
|
2024-05-13 22:20:33 +02:00
|
|
|
if (!empty($row['device_key_protected']) && $row['device_key_protected'] == "true") {
|
2017-11-17 22:01:40 +01:00
|
|
|
unset($device_keys[$row['device_key_id']]);
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-08-08 22:24:42 +02:00
|
|
|
}
|
|
|
|
|
|
2020-04-14 02:18:56 +02:00
|
|
|
//create token
|
|
|
|
|
$object = new token;
|
2021-11-13 23:34:33 +01:00
|
|
|
$token = $object->create('/app/devices/resources/dashboard/device_keys.php');
|
2016-05-29 03:52:28 +02:00
|
|
|
|
|
|
|
|
//show the content
|
2020-04-14 02:18:56 +02:00
|
|
|
echo "<div class='action_bar sub'>\n";
|
|
|
|
|
echo " <div class='heading'><b>".$text['title-device_keys']."</b></div>\n";
|
|
|
|
|
echo " <div class='actions'>\n";
|
2024-05-13 22:20:33 +02:00
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-apply'],'icon'=>$_SESSION['theme']['button_icon_save'],'collapse'=>false,'onclick'=>"document.location.href='".PROJECT_PATH."/app/devices/cmd.php?cmd=check_sync&profile=".$sip_profile_name."&user=".($user_id ?? '')."@".($server_address ?? '')."&domain=".($server_address ?? '')."&agent=".($device_key_vendor ?? '')."';"]);
|
2020-04-14 02:18:56 +02:00
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'collapse'=>false,'onclick'=>"list_form_submit('form_list_device_keys');"]);
|
|
|
|
|
echo " </div>\n";
|
|
|
|
|
echo " <div style='clear: both;'></div>\n";
|
|
|
|
|
echo "</div>\n";
|
2016-05-29 03:52:28 +02:00
|
|
|
|
2024-05-13 22:20:33 +02:00
|
|
|
if (!empty($is_included) && !$is_included) {
|
2020-04-14 02:18:56 +02:00
|
|
|
echo $text['description-device_keys']."\n";
|
|
|
|
|
echo "<br /><br />\n";
|
2016-05-29 03:52:28 +02:00
|
|
|
}
|
|
|
|
|
|
2021-11-11 20:16:51 +01:00
|
|
|
echo "<form method='post' name='frm' id='form_list_device_keys' action=''>\n";
|
|
|
|
|
echo "<table class='list'>\n";
|
|
|
|
|
$x = 0;
|
|
|
|
|
if (is_array($device_keys) && @sizeof($device_keys) != 0) {
|
|
|
|
|
foreach ($device_keys as $row) {
|
|
|
|
|
|
|
|
|
|
//set the variables
|
|
|
|
|
$device_key_vendor = $row['device_key_vendor'];
|
|
|
|
|
$device_vendor = $row['device_key_vendor'];
|
|
|
|
|
|
|
|
|
|
//set the column names
|
2024-05-13 22:20:33 +02:00
|
|
|
if (!empty($previous_device_key_vendor) && $previous_device_key_vendor != $row['device_key_vendor'] || $row['device_key_vendor'] == '') {
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " <tr class='list-header'>\n";
|
|
|
|
|
echo " <th class='shrink'>".$text['label-device_key_id']."</th>\n";
|
2023-05-05 18:46:37 +02:00
|
|
|
if (!empty($row['device_key_vendor'])) {
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " <th>".ucwords($row['device_key_vendor'])."</th>\n";
|
2016-05-29 03:52:28 +02:00
|
|
|
}
|
2017-11-17 22:01:40 +01:00
|
|
|
else {
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " <th>".$text['label-device_key_type']."</th>\n";
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " <th>".$text['label-device_key_value']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-device_key_label']."</th>\n";
|
2022-01-25 17:53:03 +01:00
|
|
|
if (permission_exists('device_key_icon')) {
|
|
|
|
|
echo " <th class='shrink'>".$text['label-device_key_icon']."</th>\n";
|
|
|
|
|
}
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " </tr>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//determine whether to hide the element
|
2023-05-05 18:46:37 +02:00
|
|
|
if (empty($device_key_uuid)) {
|
2021-11-11 20:16:51 +01:00
|
|
|
$element['hidden'] = false;
|
|
|
|
|
$element['visibility'] = "visibility:visible;";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$element['hidden'] = true;
|
|
|
|
|
$element['visibility'] = "visibility:hidden;";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//add the primary key uuid
|
2023-05-05 18:46:37 +02:00
|
|
|
if (!empty($row['device_key_uuid'])) {
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " <input name='device_keys[".$x."][device_key_uuid]' type='hidden' value=\"".$row['device_key_uuid']."\">\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//show all the rows in the array
|
|
|
|
|
/*
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo "<td valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " <select class='formfld' name='device_keys[".$x."][device_key_category]'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
if ($row['device_key_category'] == "line") {
|
|
|
|
|
echo " <option value='line' selected='selected'>".$text['label-line']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='line'>".$text['label-line']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($row['device_key_category'] == "memory") {
|
|
|
|
|
echo " <option value='memory' selected='selected'>".$text['label-memory']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='memory'>".$text['label-memory']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($row['device_key_category'] == "programmable") {
|
|
|
|
|
echo " <option value='programmable' selected='selected'>".$text['label-programmable']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='programmable'>".$text['label-programmable']."</option>\n";
|
|
|
|
|
}
|
2023-05-05 18:46:37 +02:00
|
|
|
if (empty($device_vendor)) {
|
2021-11-11 20:16:51 +01:00
|
|
|
if ($row['device_key_category'] == "expansion") {
|
|
|
|
|
echo " <option value='expansion' selected='selected'>".$text['label-expansion']."</option>\n";
|
2016-05-29 03:52:28 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " <option value='expansion'>".$text['label-expansion']."</option>\n";
|
2016-05-29 03:52:28 +02:00
|
|
|
}
|
2021-11-11 20:16:51 +01:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (strtolower($device_vendor) == "cisco") {
|
|
|
|
|
if ($row['device_key_category'] == "expansion-1" || $row['device_key_category'] == "expansion") {
|
|
|
|
|
echo " <option value='expansion-1' selected='selected'>".$text['label-expansion']." 1</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='expansion-1'>".$text['label-expansion']." 1</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($row['device_key_category'] == "expansion-2") {
|
|
|
|
|
echo " <option value='expansion-2' selected='selected'>".$text['label-expansion']." 2</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='expansion-2'>".$text['label-expansion']." 2</option>\n";
|
|
|
|
|
}
|
2016-05-29 03:52:28 +02:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if ($row['device_key_category'] == "expansion") {
|
|
|
|
|
echo " <option value='expansion' selected='selected'>".$text['label-expansion']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='expansion'>".$text['label-expansion']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-11-11 20:16:51 +01:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
//output form rows
|
|
|
|
|
echo " <tr class='list-row'>\n";
|
|
|
|
|
echo " <td class='input'>\n";
|
|
|
|
|
if (permission_exists('device_key_id') || permission_exists('device_key_add')) {
|
|
|
|
|
$selected = "selected='selected'";
|
|
|
|
|
echo " <select class='formfld' name='device_keys[".$x."][device_key_id]'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
$i = 1;
|
|
|
|
|
while ($i < 100) {
|
|
|
|
|
echo " <option value='$i' ".($row['device_key_id'] == $i ? $selected:"").">$i</option>\n";
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " ".$row['device_key_id'];
|
|
|
|
|
}
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
|
|
|
|
|
echo " <td class='input'>\n";
|
|
|
|
|
echo " <input class='formfld' type='hidden' id='key_vendor_".$x."' name='device_keys[".$x."][device_key_vendor]' value=\"".$device_key_vendor."\">\n";
|
2024-05-13 22:20:33 +02:00
|
|
|
echo " <input class='formfld' type='hidden' id='key_category_".$x."' name='device_keys[".$x."][device_key_category]' value=\"".($device_key_category ?? '')."\">\n";
|
|
|
|
|
echo " <input class='formfld' type='hidden' id='key_uuid_".$x."' name='device_keys[".$x."][device_uuid]' value=\"".($device_uuid ?? '')."\">\n";
|
|
|
|
|
echo " <input class='formfld' type='hidden' id='key_key_line_".$x."' name='device_keys[".$x."][device_key_line]' value=\"".($device_key_line ?? '')."\">\n";
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " <select class='formfld' name='device_keys[".$x."][device_key_type]' id='key_type_".$x."'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
$previous_vendor = '';
|
|
|
|
|
$i = 0;
|
|
|
|
|
if (is_array($vendor_functions)) {
|
|
|
|
|
foreach ($vendor_functions as $function) {
|
2023-05-05 18:46:37 +02:00
|
|
|
if (empty($row['device_key_vendor']) && $function['vendor_name'] != $previous_vendor) {
|
2021-11-11 20:16:51 +01:00
|
|
|
if ($i > 0) {
|
|
|
|
|
echo " </optgroup>\n";
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " <optgroup label='".ucwords($function['vendor_name'])."'>\n";
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
2021-11-11 20:16:51 +01:00
|
|
|
$selected = '';
|
|
|
|
|
if ($row['device_key_vendor'] == $function['vendor_name'] && $row['device_key_type'] == $function['value']) {
|
|
|
|
|
$selected = "selected='selected'";
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
2023-05-05 18:46:37 +02:00
|
|
|
if (empty($row['device_key_vendor'])) {
|
2024-07-23 22:29:28 +02:00
|
|
|
echo " <option value='".$function['value']."' $selected >".$text['label-'.$function['type']]."</option>\n";
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
2023-05-05 18:46:37 +02:00
|
|
|
if (!empty($row['device_key_vendor']) && $row['device_key_vendor'] == $function['vendor_name']) {
|
2024-07-23 22:29:28 +02:00
|
|
|
echo " <option value='".$function['value']."' $selected >".$text['label-'.$function['type']]."</option>\n";
|
2017-11-17 22:01:40 +01:00
|
|
|
}
|
2021-11-11 20:16:51 +01:00
|
|
|
$previous_vendor = $function['vendor_name'];
|
|
|
|
|
$i++;
|
2016-08-03 03:39:22 +02:00
|
|
|
}
|
2021-11-11 20:16:51 +01:00
|
|
|
}
|
2023-05-05 18:46:37 +02:00
|
|
|
if (empty($row['device_key_vendor'])) {
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " </optgroup>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='input'>\n";
|
|
|
|
|
echo " <input class='formfld' style='min-width: 50px; max-width: 100px;' type='text' name='device_keys[".$x."][device_key_value]' maxlength='255' value=\"".$row['device_key_value']."\">\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='input'>\n";
|
|
|
|
|
echo " <input class='formfld' style='min-width: 50px; max-width: 100px;' type='text' name='device_keys[".$x."][device_key_label]' maxlength='255' value=\"".$row['device_key_label']."\">\n";
|
2024-05-13 22:20:33 +02:00
|
|
|
echo " <input type='hidden' name='device_keys[".$x."][device_profile_uuid]' value=\"".($row['device_profile_uuid'] ?? '')."\">\n";
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " </td>\n";
|
2022-01-25 17:53:03 +01:00
|
|
|
if (permission_exists('device_key_icon')) {
|
|
|
|
|
echo " <td class='input'>\n";
|
|
|
|
|
echo " <input class='formfld' style='min-width: 50px; max-width: 100px;' type='text' name='device_keys[".$x."][device_key_icon]' maxlength='255' value=\"".$row['device_key_icon']."\">\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
}
|
2021-11-11 20:16:51 +01:00
|
|
|
echo " </tr>\n";
|
|
|
|
|
|
|
|
|
|
//set the previous vendor
|
|
|
|
|
$previous_device_key_vendor = $row['device_key_vendor'];
|
|
|
|
|
|
|
|
|
|
//increment the array key
|
|
|
|
|
$x++;
|
2016-05-29 03:52:28 +02:00
|
|
|
}
|
|
|
|
|
}
|
2021-11-11 20:16:51 +01:00
|
|
|
echo "</table>\n";
|
2020-04-14 02:18:56 +02:00
|
|
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
2016-05-29 03:52:28 +02:00
|
|
|
echo "</form>";
|
|
|
|
|
|
2021-11-11 20:16:51 +01:00
|
|
|
?>
|