diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 9489bdf..0df07df 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -697,10 +697,34 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $hdr_arprefix = 'sccp-ar_'; $save_settings = array(); $save_codec = array(); + $count_mods = 0; + $dbSaveArray = array(); $integer_msg = _("%s must be a non-negative integer"); $errors = array(); $i = 0; foreach ($get_settings as $key => $value) { + // Initallly saved all to sccpvalues. Now will save to db defaults if appropriate + // TODO: Need to verify the tables defined in showGroup - some options maybe + // device options, but if set by freePbx extensions, be in sccpline. + $key = (str_replace('sccpdevice_', '', $key, $count_mods)); + if (($count_mods) && (!empty($value))) { + // There will be some exceptions to be handled where there should be no underscore + // Handle at db write + // Have default to be saved to db sccpdevice + $dev_def = $this->getDeviceDefaults(); + if (!array_key_exists($key, $dev_def)) { + // This key needs to be prefixed with underscore + $key = '_'.$key; + } + if ((array_key_exists($key, $dev_def)) && ($dev_def[$key]['data'] == $value)) { + // Value unchanged so ignore and get next key. + continue; + } + $dbSaveArray[] = array('table' => 'sccpdevice', 'field' => $key, 'Default' => $value); + unset($get_settings[$key]); + continue; + } + $pos = strpos($key, $hdr_prefix); if ($pos !== false) { $key1 = substr_replace($key, '', 0, strlen($hdr_prefix)); @@ -780,6 +804,11 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $this->saveSccpSettings($save_settings); $this->sccpvalues = $this->dbinterface->get_db_SccpSetting(); } + + foreach ($dbSaveArray as $rowToSave) { + $this->dbinterface->updateTableDefaults($rowToSave['table'], $rowToSave['field'], $rowToSave['Default']); + } + $this->createDefaultSccpConfig(); // Rewrite Config. $save_settings[] = array('status' => true); return $save_settings; diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433 index 261de0c..4223446 100644 --- a/conf/sccpgeneral.xml.v433 +++ b/conf/sccpgeneral.xml.v433 @@ -30,7 +30,6 @@ and open the template in the editor. Base Version before all crash :-) - @@ -63,11 +62,10 @@ and open the template in the editor. Base Version before all crash :-) sccp_xml_about - XML Base ver: 11.2, Sccp ver: 431 + XML Base ver: 11.2, Sccp ver: 433 Help. - @@ -116,7 +114,6 @@ and open the template in the editor. Base Version before all crash :-) / externhost - @@ -166,6 +163,7 @@ and open the template in the editor. Base Version before all crash :-) Help! + @@ -183,8 +181,6 @@ and open the template in the editor. Base Version before all crash :-) Add Allow Range Allow network settings. Blank fields will be ignored used Network 0.0.0.0/0.0.0.0 to resolve any existing connections. You can use the 'internal' connections only from the networks connected to the server. - - localnet @@ -218,7 +214,6 @@ and open the template in the editor. Base Version before all crash :-) Add Deny network All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'. - ccm_address @@ -236,9 +231,8 @@ and open the template in the editor. Base Version before all crash :-) Add Address This function is useful when the server has many interfaces, but devices must connect only to some interfaces. - - + @@ -262,8 +256,8 @@ and open the template in the editor. Base Version before all crash :-) The user locale allows the phone to display text (menu items, soft keys etc.) native to the phone's language. - + @@ -440,6 +434,7 @@ and open the template in the editor. Base Version before all crash :-) Use simulated enbloc dialing to speedup connection when dialing while onhook (older phones) + @@ -513,8 +508,8 @@ and open the template in the editor. Base Version before all crash :-) Configure NTP Server protocol time synchronization - + @@ -907,8 +902,8 @@ and open the template in the editor. Base Version before all crash :-) - + @@ -954,6 +949,7 @@ and open the template in the editor. Base Version before all crash :-) Video Type Of Service / Class Of Service: Video Type or Class of Service - this is modifiable, but don't. + @@ -1001,7 +997,6 @@ and open the template in the editor. Base Version before all crash :-) - hotline_enabled @@ -1079,7 +1074,6 @@ and open the template in the editor. Base Version before all crash :-) Context where direct pickup search for extensions. if not set current context will be use. - pickup_modeanswer @@ -1130,7 +1124,6 @@ and open the template in the editor. Base Version before all crash :-) Other options (app_meetme: A,a,b,c,C,d,D,E,e,F,i,I,l,L,m,M,o,p,P,q,r,s,S,t,T,w,x,X,1) see meetme specific documentation - autocall_select @@ -1145,7 +1138,7 @@ and open the template in the editor. Base Version before all crash :-) true - I'm guessing on this one, but on some devices, the background image on the display can be modified at the device. I think this is the thing that allows that to take. + I'm guessing on this one, but on some devices, the background image on the display can be modified at the device. I think this is the thing that allows that to happen. phonePersonalization @@ -1153,7 +1146,7 @@ and open the template in the editor. Base Version before all crash :-) 0 - Phone personalization needs to be set to allow the server to push background or ringtones to the phone in the SEPXXXXXXXXXX.cnf.xml of each phone: + This needs to be enabled to allow the server to push background or ringtones to the phone in the SEPXXXXXXXXXX.cnf.xml of each phone: callLogBlfEnabled @@ -1161,7 +1154,7 @@ and open the template in the editor. Base Version before all crash :-) 2 - Which does 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 + 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 @@ -1171,7 +1164,6 @@ and open the template in the editor. Base Version before all crash :-) form-control Music Class: Available MOH Classes. These are the MOH classes listed in your current server. - @@ -1204,7 +1196,6 @@ and open the template in the editor. Base Version before all crash :-) Use path from provision index.cnf file. You must first make sure that you have properly configured the "Provision" - tftp_rewrite @@ -1217,7 +1208,6 @@ and open the template in the editor. Base Version before all crash :-) Support the use of regular-expression-based filename remapping - devicetable @@ -1227,7 +1217,6 @@ and open the template in the editor. Base Version before all crash :-) sccp-custom Device Table: This is the devicetable for your realtime configuration. Don't change this unless you know what you are doing and have made all the appropriate changes in the rest of your Asterisk config files. There are two reasonable settings for this - the sccpdevice table or the sccpdeviceconfig view. If you do not want to use the realtime database anymore, you can set this to blank. NOT RECOMMENDED. - @@ -1237,7 +1226,6 @@ and open the template in the editor. Base Version before all crash :-) Line Table: This is the linetable for your realtime configuration. Don't change this unless you know what you are doing and have made all the appropriate changes in the rest of your Asterisk config files. If you do not want to use the realtime database anymore, you can set this to blank. NOT RECOMMENDED. - createlangdir @@ -1246,7 +1234,6 @@ and open the template in the editor. Base Version before all crash :-) Say 'yes' if you need to create cisco default language directory in tftp path. - system_rouminguser @@ -1255,9 +1242,9 @@ and open the template in the editor. Base Version before all crash :-) Experemental Function Roaming Users - - + + @@ -1269,7 +1256,6 @@ and open the template in the editor. Base Version before all crash :-) The MAC address of the phone. You must specify 12 characters in the format XXXX.XXXX.XXXX or XX-XX-XX-XX-XX-XX or XXXXXXXXXXXX - type @@ -1332,7 +1318,6 @@ and open the template in the editor. Base Version before all crash :-) - @@ -1391,8 +1376,8 @@ and open the template in the editor. Base Version before all crash :-) The ringtone that the phone will default to. Can be overridden in the phone. The files RINGLIST.XML provice the basic phone ring tones, while DISTINCTIVERINGLIST.XML defines the list of possible ring tones for your other line types. They, along with the actual 'raw' ringtones, are stored in the /tftpboot/ringtones directory with the rest of the config files. - + @@ -1404,8 +1389,8 @@ and open the template in the editor. Base Version before all crash :-) - + @@ -1473,9 +1458,7 @@ and open the template in the editor. Base Version before all crash :-) - - useRedialMenu @@ -1524,9 +1507,8 @@ and open the template in the editor. Base Version before all crash :-) - + Do not update history for this Phonebook if answered by another extension - @@ -1572,8 +1554,10 @@ and open the template in the editor. Base Version before all crash :-) form-control Play music on hold of this class when no moderator is listening on the conference. If set to an empty string, no music on hold will be played. - + + + custom_network_acc @@ -1608,7 +1592,6 @@ and open the template in the editor. Base Version before all crash :-) Help. - @@ -1628,10 +1611,8 @@ and open the template in the editor. Base Version before all crash :-) Add Deny network All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'. - - permit NONE Inherit @@ -1650,7 +1631,6 @@ and open the template in the editor. Base Version before all crash :-) Add Allow network Allow network settings. Blank fields will be ignored used Network 0.0.0.0. - nat @@ -1661,7 +1641,6 @@ and open the template in the editor. Base Version before all crash :-) Device NAT support (default Auto) - directrtp @@ -1686,6 +1665,7 @@ and open the template in the editor. Base Version before all crash :-) The audio stream will be open in the progress and connected state. Valid options: none, progress, offhook, dial, ringout. Default may be Progress. + @@ -1696,8 +1676,8 @@ and open the template in the editor. Base Version before all crash :-) Help. - + @@ -1768,7 +1748,6 @@ and open the template in the editor. Base Version before all crash :-) - dialtemplate */10/* @@ -1815,9 +1794,7 @@ and open the template in the editor. Base Version before all crash :-) CallWaiting-4 Allow network settings. Blank fields will be ignored used Network 0.0.0.0. - -