From dd9888e55e8372c95eb945cea5d7a59482511e25 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Sat, 3 Jul 2021 16:29:31 +0200 Subject: [PATCH] (re)Align Defaults and Default values with chan-sccp Ensure all defaults use same vales as chan-sccp (partial revert of earlier changes) Initialise UsingSysDefaults Clarify html --- assets/js/sccp_manager.js | 12 ++----- conf/sccpgeneral.xml.v433 | 73 ++++++++++++++++++++------------------- install.php | 18 ++++------ views/formShowSysDefs.php | 6 ++-- views/server.device.php | 1 + views/server.setting.php | 2 +- 6 files changed, 52 insertions(+), 60 deletions(-) diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index 4379f10..f146090 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -1057,14 +1057,12 @@ function sleep(milliseconds) } $(".sccp-restore").click(function() { - //input is sent by data-for where for as an attribute - var id = $(this).data("for"), input = $("#" + id), radId = id + "_"; + //input is sent by data-for where for is an attribute + var id = $(this).data("for"), input = $("#" + id); var edit_style = document.getElementById("edit_" + id).style; if ($(this).data("type") === 'radio') { input = document.getElementsByName(id); } - - console.log(input); if (input.length === 0) { return; } @@ -1109,8 +1107,6 @@ $(".sccp-edit").click(function() { if ($(this).data("type") === 'radio') { input = document.getElementsByName(id); } - - console.log(input); if (input.length === 0) { return; } @@ -1121,9 +1117,7 @@ $(".sccp-edit").click(function() { // Security - attribute should not exist. input.forEach( function(radioElement) { - if (radioElement.hasAttribute('disabled')) { - radioElement.removeAttribute('disabled'); - } + radioElement.removeAttribute('disabled'); } ); return; diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433 index 6569390..97db577 100644 --- a/conf/sccpgeneral.xml.v433 +++ b/conf/sccpgeneral.xml.v433 @@ -338,22 +338,7 @@ and open the template in the editor. Base Version before all crash :-) Call Waiting Tone: The tone played when a call is waiting. If you set this one to '0', you will not get a tone in your current call if a new call comes in, so you might want to disable call waiting for this line instead. - - echocancel - - off - - - Echo Cancel: Echo Cancellation (On or Off). - - - silencesuppression - - off - - - Silence Suppression: Slience Suppression on the phone. - + private @@ -406,9 +391,9 @@ and open the template in the editor. Base Version before all crash :-) directrtp - off - - + + + This option set global allow devices to do direct RTP sessions (default Off) @@ -447,24 +432,24 @@ and open the template in the editor. Base Version before all crash :-) cfwdall off - - + + Activate the callforward softkeys. Default is On cfwdbusy off - Call Forward - + Call Forward + Activate the callforward busy softkeys. Default is On cfwdnoanswer off - - + + Activate the callforward NOANSWER stuff and softkeys. Default is On @@ -995,8 +980,8 @@ and open the template in the editor. Base Version before all crash :-) hotline_enabled off - - + + Hotline Enabled: This allows unregistered extensions to connect to the system and dial the number listed below. @@ -1142,6 +1127,22 @@ and open the template in the editor. Base Version before all crash :-) Show numbers you can redial, but also include their current device state, so you know when they are currently busy. Note that the other phonebook entries will now also monitor the remove device state and show the current device state + + echocancel + + off + + + Echo Cancel: Echo Cancellation (On or Off). + + + silencesuppression + + off + + + Silence Suppression: Slience Suppression on the phone. + musicclass @@ -1399,24 +1400,24 @@ and open the template in the editor. Base Version before all crash :-) cfwdall off - - + + Activate the callforward softkeys. Default is On cfwdbusy off - - + + Activate the callforward busy softkeys. Default is On cfwdnoanswer on - - + + Activate the callforward NOANSWER stuff and softkeys. Default is On @@ -1621,10 +1622,10 @@ and open the template in the editor. Base Version before all crash :-) directrtp - off + Auto - - + + This option allow devices to do direct RTP sessions (default Off) diff --git a/install.php b/install.php index 33a2c48..b7f74e2 100644 --- a/install.php +++ b/install.php @@ -115,11 +115,11 @@ function Get_DB_config($sccp_compatible) 'backgroundImage' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL', 'modify' => "VARCHAR(255)"), 'ringtone' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL', 'modify' => "VARCHAR(255)"), 'transfer' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"), - 'cfwdall' => array('create' => "enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"), - 'cfwdbusy' => array('create' => "enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"), - 'cfwdnoanswer' => array('create' => "enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"), + 'cfwdall' => array('create' => "enum('yes','no') NOT NULL default 'yes'", 'modify' => "enum('yes','no')"), + 'cfwdbusy' => array('create' => "enum('yes','no') NOT NULL default 'yes'", 'modify' => "enum('yes','no')"), + 'cfwdnoanswer' => array('create' => "enum('yes','no') NOT NULL default 'yes'", 'modify' => "enum('yes','no')"), 'park' => array('create' => "enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"), - 'directrtp' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"), + 'directrtp' => array('create' => "enum('no','yes') NOT NULL default 'no'", 'modify' => "enum('no','yes')"), 'dndFeature' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"), 'earlyrtp' => array('create' => "ENUM('immediate','offHook','dialing','ringout','progress','none') NOT NULL default 'none'", 'modify' => "ENUM('immediate','offHook','dialing','ringout','progress','none')"), @@ -172,7 +172,7 @@ function Get_DB_config($sccp_compatible) 'allow' => array('create' => "VARCHAR(255) NULL DEFAULT NULL"), 'id' => array('create' => 'MEDIUMINT(9) NOT NULL AUTO_INCREMENT, ADD UNIQUE(id);', 'modify' => "MEDIUMINT(9)", 'index' => 'id'), 'echocancel' => array('create' => "enum('yes','no') NOT NULL default 'yes'", 'modify' => "enum('yes','no')"), - 'silencesuppression' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"), + 'silencesuppression' => array('create' => "enum('yes','no') NOT NULL default 'no'", 'modify' => "enum('yes','no')"), 'dnd' => array('create' => "enum('off','reject','silent','user') NOT NULL default 'reject'", 'modify' => "enum('off','reject','silent','user')", 'def_modify' => "reject") ), 'sccpuser' => array( @@ -198,7 +198,7 @@ function Get_DB_config($sccp_compatible) 'sccpdevice' => array( 'pickupexten' => array('drop' => "yes"), 'directed_pickup' => array('drop' => "yes"), - 'cfwdnoanswer' => array('create' => "enum('on','off') NULL default 'on'", 'modify' => "enum('on','off')"), + 'cfwdnoanswer' => array('create' => "enum('yes','no') NULL default 'yes'", 'modify' => "enum('yes','no')"), 'park' => array('create' => "enum('on','off') NULL default 'on'", 'modify' => "enum('on','off')"), 'monitor' => array('create' => "enum('on','off') NULL default NULL", 'modify' => "enum('on','off')"), '_description' => array('rename' => "description"), @@ -239,10 +239,6 @@ function Get_DB_config($sccp_compatible) '_enablelldpswport' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"), '_enablelldppcport' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"), '_simulate_enbloc' => array( 'create' => "enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"), - '_hotline_enabled' => array( 'create' => "enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"), - '_hotline_extension' => array( 'create' => "VARCHAR(20) NULL default '*60'", 'modify' => "VARCHAR(20)"), - '_hotline_label' => array( 'create' => "VARCHAR(20) NULL default 'hotline'", 'modify' => "VARCHAR(20)"), - '_hotline_context' => array( 'create' => "VARCHAR(20) NULL default 'default'", 'modify' => "VARCHAR(20)"), '_firstdigittimeout' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)"), '_digittimeout' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)"), '_cfwdnoanswer_timeout' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)"), @@ -253,8 +249,6 @@ function Get_DB_config($sccp_compatible) '_callwaiting_tone' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)"), '_callanswerorder' => array('create' => "enum('oldestfirst','latestfirst') NOT NULL default 'latestfirst'", 'modify' => "enum('oldestfirst','latestfirst')"), - '_echocancel' => array('create' => "enum('yes','no') NOT NULL default 'yes'", 'modify' => "enum('yes','no')"), - '_silencesuppression' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)"), '_sccp_tos' => array('create' => "VARCHAR(11) NOT NULL default '0x68'", 'modify' => "VARCHAR(11)"), '_sccp_cos' => array('create' => "VARCHAR(11) NOT NULL default '0x4'", 'modify' => "VARCHAR(11)"), '_dev_sshPassword' => array('create' => "VARCHAR(25) NOT NULL default 'cisco'"), diff --git a/views/formShowSysDefs.php b/views/formShowSysDefs.php index a2e5060..9a4c18d 100644 --- a/views/formShowSysDefs.php +++ b/views/formShowSysDefs.php @@ -396,6 +396,7 @@ foreach ($items as $child) { $res_n = (string)$child->name; $res_id = $npref.$res_n; $res_ext = str_replace($npref,'',$res_n); + $usingSysDefaults = true; if (!empty($metainfo[$res_n])) { if ($child->meta_help == '1' || $child->help == 'Help!') { $child->help = $metaInfo[$res_n]; @@ -444,7 +445,8 @@ foreach ($items as $child) { } // Output current value - echo $res_v; + // TODO: This is debug code and needs to be set to only echo res_v + echo $res_v . $res_n . $sccp_defaults[$res_n]['systemdefault'] . $usingSysDefaults; ?>
@@ -527,7 +529,7 @@ foreach ($items as $child) { } else {$val_check = "";} } echo ""; - echo ''; + echo ""; $i++; } ?> diff --git a/views/server.device.php b/views/server.device.php index dc4f74a..c6babd8 100644 --- a/views/server.device.php +++ b/views/server.device.php @@ -28,5 +28,6 @@ echo $this->showGroup('sccp_dev_advconfig', 1); echo $this->showGroup('sccp_dev_softkey', 1); echo $this->showGroup('sccp_hotline_config', 1); + echo $this->showGroup('sccp_qos_config', 1, 'sccpdevice', $def_val_device); ?> diff --git a/views/server.setting.php b/views/server.setting.php index 8de4a20..55acd1a 100644 --- a/views/server.setting.php +++ b/views/server.setting.php @@ -28,7 +28,7 @@ echo $this->showGroup('sccp_dev_time_s', 1); echo $this->showGroup('sccp_net', 1); echo $this->showGroup('sccp_lang', 1); - echo $this->showGroup('sccp_qos_config', 1, 'sccpdevice', $def_val_device); + echo $this->showGroup('sccp_extpath_config', 1); ?>