Commit graph

522 commits

Author SHA1 Message Date
steve-lad f882a66eb4 Tighten TFTP read controls
Avoid hanging if no data received by setting timeout. Thanks to @dkgroot  for soulution
2021-06-28 07:17:51 +02:00
steve-lad ee419ae193 Change SQL for adding system defaults 2021-06-27 17:46:00 +02:00
steve-lad f74978c1b3 Add timer on TFTP read; Get Metadata
TFTP read caused a hang if no server available

Set to DONTWAIT and loop and then check for valid data

Use metadat to set system defaults
2021-06-27 17:12:10 +02:00
steve-lad 7721e7a8a0
Tidy up installer
Clean SQL statements
Solidify dbsettings management
2021-06-27 12:48:24 +02:00
steve-lad b1a7fe3510
Update db exception handling in installer
DB object returns errors on warnings, so was failing.

Ignore the warnings and only die on exceptions (usually violations) as it is normal that there are warnings if we are changing VARCHAR to ENUM
2021-06-27 11:42:21 +02:00
steve-lad 4fcf16b317
Do not die on SQL warning
If we change a field from VARCHAR to enum, we will get warnings as possibly truncating data. Accept this and carry on.

Only fail on an error.
2021-06-27 11:06:33 +02:00
steve-lad d8cc6f3ba1
Remove empty - checking to find actual and overwrite any existing 2021-06-27 10:43:01 +02:00
steve-lad bab83c7e3e
Change TFTP detection logic
Accept first hit
2021-06-27 10:19:20 +02:00
steve-lad d83c3ab93f
Merge pull request #24 from chan-sccp/tftpDetection
Tftp detection
2021-06-27 10:03:54 +02:00
dkgroot 4da4f391d6 Fixes based on review by @steve-lad 2021-06-27 07:54:00 +00:00
dkgroot 838ff633aa Reverse the logic when detecting tftpserver existence and path
- write a sentinel probe file to the known/possible distro tftp directories
 - try fetching it through tftp
 - if we manage to fetch the file, we have the correct path
 - remove sentinel probe file

When creating directories in tftpboot directory we should not set write permissions, using 0755 instead.
2021-06-26 23:19:53 +00:00
steve-lad 3a03815daf Change tftp_path names
Change for clarity
2021-06-25 06:52:43 +02:00
steve-lad fb9ea64134 Fix SQL in Install Rename
Change SQL in Installer rename column
Change TFTP variable name for better clarity
2021-06-25 06:35:51 +02:00
steve-lad 97c4c93fb6 Display Device description even if not connected 2021-06-24 16:11:33 +02:00
steve-lad 852156878d Simplify method name 2021-06-24 15:40:36 +02:00
steve-lad 0e36336033 Delete sccpsimple.xml.v433
Not required and complicates maintainability
2021-06-24 15:32:07 +02:00
steve-lad 9be50bab5c Update Create_SEP_XML and defaults
Merge data_values and dev_config so that device specific settings are written to the SEP file
Add sccp general device defaults
Allow saving empty sccpvalues
Add new fields to sccpdevice
move phonepersonalization to sccpdevice from sccpline
Change advanced display block for personalisation to correctly pickup defaults
2021-06-24 15:25:26 +02:00
steve-lad e841c7cb40 Reversions and corrections to previous commit
Restore saveSccpSettings to Sccp_Manager construct (deleted in error)
Initialise ntp_timezone without check (may have been changed externally)
Load xml data in ShowGroup instead of construct.
2021-06-24 10:59:00 +02:00
steve-lad ff1c451fe1 Update Installer and Sccp_manager Construct
Move initial defaults reading from Construct to Install
Move initVarFromXml to helper functions - no longer used as defaults should come from db
Remove extraneous initialisations from Sccp_manager - these are now handled in Installer
Save TFTP structure to sccpsettings in Installer
Pass tftp_root to extconfigs ( if changed or uninitialised, was not written back to settingsFromDb before being passed to extconfigs
2021-06-24 10:02:26 +02:00
steve-lad 4d7463f341 Update sccpgeneral.xml.v433 2021-06-23 19:52:00 +02:00
steve-lad 9daf307081 Correct defaults 2021-06-23 19:46:32 +02:00
steve-lad cdac0f0276 Fix incorrect variable declaration 2021-06-23 17:43:58 +02:00
steve-lad d7e196cf21 Clean up installer and partially revert externconfigs
Remove ancillary function to traits
Move tftp directory management back to extern configs
Remove call to extern configs from InitialiseSccpPath and so from Construct
Need to add call to updateTftpStructure when settings changed ---WIP ---
2021-06-23 17:03:24 +02:00
steve-lad ec79925661 add asterisk etc dir to sccp settings 2021-06-23 13:21:19 +02:00
steve-lad d422776ad6 Create full TFTP Pro structure and save relevant settings
Default structure now created is ready for pro use and settings have been moved to sccp settings and not stored in array sccppath
2021-06-23 12:35:33 +02:00
steve-lad 4e15376181 Update install.php 2021-06-22 20:53:41 +02:00
steve-lad cb890aa264 Update installer to check TFTP server is running and usable
Use dummy put to test and locate the TFTP server
Move all TFTP tests from extconfigs to install (reduces module constructor)
2021-06-22 17:18:01 +02:00
steve-lad 95cd7b4d9b Correct getExtConfig method
sccp_lang did not accept index arg
2021-06-22 10:17:57 +02:00
steve-lad c271dbf3c2 Update edit device to apply current schema
Add defaults if they are unset for the device
If device fields are now an enum, make sure that legacy values are valid or replace with defaults
2021-06-20 16:25:44 +02:00
steve-lad 649b717ce7 Correct SQL for SET DEFAULT 2021-06-20 13:06:53 +02:00
steve-lad 34a7f6a163 Remove hidden tab in SQL 2021-06-20 12:08:37 +02:00
steve-lad be8aa5cd92 Initialise Defaults in Driver
Add Constructor to get and set line_defaults
Add defaults to SCCP tab
2021-06-20 11:53:24 +02:00
steve-lad 55285cf625 Move install functions from sccp_manager to installer
Change core driver to be an include
Move driver to sccpManClasses to improve maintainability and eliminate possible version issues
Add driver in installer (remove
from extConfigs)
Create sccp.conf in installer if it does not exist (remove from extconfigs)

Update extconfigs.class.php

Update Sccp.class.php.v433
2021-06-20 09:24:19 +02:00
steve-lad 2dad547e3d Redefine defaults from db in sccp driver 2021-06-19 17:42:01 +02:00
steve-lad 310256dc5d Update Sccp Driver class
During initial import to chan sccp, the wrong version of this class was used, and the SCCP Tab was not shown when adding or editing extensions.

Also comment out  GUI hooks as not currently used, and can present issues because of FreePBX caching.
2021-06-19 15:15:26 +02:00
steve-lad d6cfa86978 Control MAC address entry
Warning and refocus if not conform to indicated requirements
2021-06-18 16:50:15 +02:00
steve-lad 510b4259ac Optimise handlerSubmit and activate TZ
Simplify process
Reenable TZ offset test on save
2021-06-18 13:13:38 +02:00
steve-lad de3c58178b Remove Inherit processing
Remove functionality added to hide inherit in default configs - Inherit has been removed from sccpgeneral.xml
2021-06-18 12:10:26 +02:00
steve-lad 57bc13f782 Modify default values
Change sccpgeneral to remove inherit - now inherit default values automatically
Add default values to form groups
Revert changes informShow
Update getTableDefaults to better manage underscores with chan-sccp
Change Defaults in Install
2021-06-18 11:58:00 +02:00
steve-lad f36c224f87 Move most Ajax Submit functions into handleSubmit
Improves readability and simplifies variables
2021-06-17 19:23:40 +02:00
steve-lad efdf2d0469 Added sccpline fields
WIP Still have issue with def_modify in installer
2021-06-17 18:39:32 +02:00
steve-lad afe3382aed Move handleSubmit to AjaxHelper 2021-06-17 15:54:04 +02:00
steve-lad 5df918a04b Save Defaults to Db Defaults
Initial changes. Need to update other tables and fields

Minor bugfix in dbinterface

Correct XML version
2021-06-17 15:10:31 +02:00
steve-lad 416cedc425 Create new function to get device defaults
Add new function in helperFunctions and use
2021-06-17 10:18:07 +02:00
steve-lad a146cd2354 Set defaults for Add Device
Get default values from db for add new device
Tidy up AjaxHelper get phone grid removing unnecessary tests and using clearer variable names
Correct typos in sccpgeneral
2021-06-17 09:40:24 +02:00
steve-lad b420f35ad2 WIP Fix formshow prefix logic for IS
Currently only fixed for IS

FormShow was adding the prefix to the full child name, making a useless result.

Need to remove form_prefix from childname to return to db values
2021-06-16 16:58:04 +02:00
steve-lad 815b7dbd2a Update Vendor defaults from db
Use db default values instead of xml as these are dynamic.
2021-06-16 13:21:44 +02:00
steve-lad 790b5f7949 Add vendorconfig data to Edit Device
Translate DB fields to formshow fields

These field translations need to be simplified
2021-06-16 12:42:07 +02:00
steve-lad b2ee6ad853 Correct NOT NULL fields
Ensure all enums are NOT NULL
Correct variable name to lowercase
2021-06-16 10:27:28 +02:00
steve-lad 922ae3eaf7 Update fields so that ignored by chan-sccp
To avoid unnecessary changes to chan-sccp, these fields are prefixed with an underscore and should be ignored.
They are used to create the SEPXXXX file
2021-06-16 10:13:29 +02:00