Compare commits

...

668 commits

Author SHA1 Message Date
Diederik de Groot 5752d9f393
Revert previous change 2022-01-30 15:16:15 +01:00
Diederik de Groot b28ec36e20
Update cisco_language table
Note: I changed 'ISO8859-1' to 'ISO-8859-1', please check if this is php compatible before applying this PR.
2022-01-30 14:40:36 +01:00
steve-lad 9519f0243a
Update sccpManagerUpdater.json 2022-01-28 11:24:50 +01:00
stevenA f5e51a52b7 Resolve issue of softkeysets lost across installs 2022-01-28 11:14:34 +01:00
stevenA 4cf414e995 Fix issue where values with spaces are truncate
Need to quote value in html
Fix installer overwriting valid sccpdevmodel
2022-01-28 10:00:13 +01:00
stevenA fb66f0e239 Fix issue where values with spaces are truncated
value needs to be quoted
2022-01-28 09:51:02 +01:00
steve-lad 60e973b4a6
Update sccpManagerUpdater.json 2022-01-27 19:29:51 +01:00
steve-lad 2ea478c117
Update sccpManagerUpdater.json 2022-01-27 19:29:27 +01:00
steve-lad fbbbefb25e
Update module.xml 2022-01-27 19:26:14 +01:00
steve-lad e7bc2492ef
Update module.xml 2022-01-27 19:18:23 +01:00
steve-lad f7e13505e9
Update sccpManagerUpdater.json 2022-01-27 19:05:29 +01:00
stevenA b752640f81 Update ajaxHelper.php 2022-01-27 18:50:18 +01:00
steve-lad da62493384
Update sccpManagerUpdater.json 2022-01-27 12:20:04 +01:00
stevenA 722285bc3d Update version
Revert 1 line from backport from 16
2022-01-27 12:15:51 +01:00
stevenA 09acfd097d Fix Issue #32
Standardise handling of IED fields (net and ip addresses)
Correct writing to db (seq was assigned a new value which caused duplication in sccpsettings and apparent unsaved data)
Remove inherit button in device and standardise to inherit server settings. Show users what will be set.
2022-01-27 12:03:50 +01:00
stevenA bd84870c6b Close Issue #29
Added warning and additional info for Hotline.
2022-01-19 14:41:43 +01:00
stevenA 60777bf3e3 Fix saving of custom soft keysets
Red border if invalid set name
Clean up modal indenting
Define valid chars
Only initialise general section at each save (previously initialised all clearing soft key sets)
2022-01-19 13:46:47 +01:00
steve-lad 1c5fa400ae
Update sccpManagerUpdater.json 2022-01-19 12:22:08 +01:00
steve-lad a8e3dbdd30
Update module.xml 2022-01-19 12:17:05 +01:00
stevenA 381fe184bd Fix Issue #59
Correct error in update mode selection
Save all buttons, rather than to last empty - buttons do not need to be allocated sequentially
Remove on duplicate case - add should always be new as either device is new, or have deleted device data before.
2022-01-19 12:07:41 +01:00
stevenA e08ad858f5 Update module.xml 2022-01-19 10:06:24 +01:00
stevenA ddd10f3ca9 Update rewrite.rules
Add case for dialplan.xml
2022-01-19 09:55:14 +01:00
stevenA d7ad8397da Update ajaxHelper.php 2022-01-19 08:36:57 +01:00
stevenA 4e17791fa1 Change wincharset selection method
Use utf-8 for java based phones
2022-01-17 10:43:50 +01:00
steve-lad 5796297bae
Update sccpManagerUpdater.json 2022-01-16 16:34:52 +01:00
stevenA 546de5add1 Modify installer db calls to remove IF EXISTS
IF EXISTS is not correct in MariaDb v5, used in all FreePbx Packages.
2022-01-16 16:04:41 +01:00
steve-lad b1769e6378
Update sccpManagerUpdater.json 2022-01-15 10:55:44 +01:00
stevenA 360ceea6cd Upgrade Installer
Installer was dropping new 14.3 columns data as these columns did not exist in module.xml schema.
Modify schema to include all columns, including legacy columns, and then move data prior to modifying schema.
2022-01-15 10:48:36 +01:00
stevenA 0dec44161f Update module.xml 2022-01-13 13:09:05 +01:00
stevenA 6808154c3a Update xmlinterface.class.php
Return binary vendor config values when necessary
2022-01-13 13:08:34 +01:00
stevenA e25fab14ff Update module.xml 2022-01-13 11:42:29 +01:00
stevenA e088deee12 Update xmlinterface.class.php
Fix langcode selection
2022-01-13 11:34:12 +01:00
stevenA 8051c30987 Update module.xml 2022-01-13 10:28:40 +01:00
stevenA 5c4848442a Update rewrite.rules
Optional rules were not commented out causing phones to look in tftproot/firmware/firmware
2022-01-13 10:24:26 +01:00
steve-lad 24cc8be3a7
Update module.xml 2022-01-11 15:40:47 +01:00
steve-lad 4f468517e7
Add PHP dependancy 2022-01-11 15:25:06 +01:00
steve-lad c3089d6d7f
Update sccpManagerUpdater.json 2022-01-11 11:59:19 +01:00
steve-lad 12cb1307ba
Update sccpManagerUpdater.json 2022-01-10 14:08:03 +01:00
stevenA 3ce99c94d8 Fix reversion - not returning to correct page after save
Settings and device save require different r=treatment on reload after save
2022-01-10 14:00:07 +01:00
steve-lad 70b318019e
Update sccpManagerUpdater.json 2022-01-10 11:37:59 +01:00
stevenA 82bd9cbaef Update module.xml
Update version
2022-01-10 11:33:42 +01:00
stevenA 34d6e976f2 Fix minor issues when saving settings
Page was not reloading correctly
Devices were not restarting (returning too soon)
2022-01-10 11:31:26 +01:00
steve-lad 6681a07c96
Update sccpManagerUpdater.json 2022-01-09 13:11:05 +01:00
stevenA 8013474e75 Fix issue where selecting new device in rnav caused exception
Correct window.location redirect syntax
2022-01-09 13:05:35 +01:00
steve-lad 88f4fba2c0
Update README.md 2022-01-06 15:26:13 +01:00
steve-lad a8dfaac9bb
Update sccpManagerUpdater.json 2022-01-06 15:09:06 +01:00
stevenA 745ef87fea Merge branch 'develop' of https://github.com/chan-sccp/sccp_manager into develop 2022-01-06 15:00:35 +01:00
stevenA 048077fce8 Update SIP device Handling & Fix Issue#53
Fix Issue #53
Consolidate forms to facilitate maintenance, reduce code, and apply changes to SIP handling introduce for sccp
Delete form.addsdevice.php
Delete form.sbuttons.php
Delete sipconfigs class and move db functions to dbinterface class, and other function to helperfunctions
create new field type for SIP line
update 9951 buttons count in installer
simplify segregation of sip and sccp requests
2022-01-06 15:00:24 +01:00
steve-lad fa9f28aac3
Update sccpManagerUpdater.json 2022-01-04 14:48:16 +01:00
stevenA 1f73ade196 Fix Issue #54
Do not try to write SEP file if no line defined. Save settings and warn user via toast
Fix feedback to ajax by separately submitting data before return
Fix freepbx overwriting data and causing fail, by separating json into two blocks and only parsing the first
Fix return to tab on save (set location hash) when tabs changed in settings
Fix return to calling page on save when device updated
2022-01-04 14:41:43 +01:00
steve-lad 8c725874d7
Update sccpManagerUpdater.json 2022-01-02 15:02:04 +01:00
steve-lad b39983c690
Update module.xml 2022-01-02 14:58:38 +01:00
stevenA 8f91e2c6e6 Update sipconfigs.class.php 2022-01-02 14:24:47 +01:00
steve-lad 463ab79add
Update sccpManagerUpdater.json 2022-01-02 13:12:21 +01:00
stevenA 198b3fffa8 Update save SIP device
Fail if no valid FreePbx sip bindings available

Fix SIP display issue

Correct line protocol selection
2022-01-02 13:06:41 +01:00
stevenA 21f9123ece Update formcreate.class.php
Clean up form create
2022-01-01 16:37:17 +01:00
stevenA 3381ad189b Update formcreate.class.php
Clean up code
2022-01-01 16:28:36 +01:00
stevenA b9ca187d30 Update module.xml
Update develop version
2022-01-01 13:50:29 +01:00
stevenA 2d9a272589 Update xmlinterface.class.php
change phonePersonalization from camel
2022-01-01 13:47:03 +01:00
steve-lad a68ac219d3
Update sccpManagerUpdater.json 2022-01-01 12:53:26 +01:00
steve-lad 4833638c8e
Update module.xml 2022-01-01 12:48:15 +01:00
steve-lad ad698eb5c0
Update module.xml 2022-01-01 12:46:17 +01:00
steve-lad 6cf10cc13b
Merge pull request #52 from chan-sccp/Fix-Issue-#49
Fix Issue #49 and improve handling of edit defaults
2022-01-01 12:45:46 +01:00
stevenA 378d3b2ff7 Fix Issue #49 and improve handling of edit defaults
keepalive was on 2 pages, so the value was being written then overwritten

Improved handling of customise and restore javascript to ensure that if the option was subsequently unselected, the original value was retained
2022-01-01 12:44:02 +01:00
steve-lad 354e3a2f47
Update sccpManagerUpdater.json 2021-12-31 15:38:18 +01:00
steve-lad ce365acdf2
Merge pull request #51 from chan-sccp/Fix-Issue-#50
Fix issue #50
2021-12-31 15:34:45 +01:00
stevenA 84b65309a3 Update Version 2021-12-31 15:32:44 +01:00
stevenA 89b1a1cd3f Fix defaults for string settings
Hack to fix bindaddr / externip
2021-12-31 15:31:56 +01:00
stevenA 8953484e1f Fix reset of defaults for text fields
Still need to address bindaddress:port and externalIP: Name
2021-12-31 15:01:02 +01:00
stevenA 8268bbf81a Fix restore defaults for radio buttons
Fix restore defaults for radio buttons
2021-12-31 12:45:12 +01:00
steve-lad 10a0ddb123
Update sccpManagerUpdater.json 2021-12-30 15:40:57 +01:00
steve-lad 8d412ce4ae
Merge pull request #48 from chan-sccp/Fix-issue-#47
Fix issue #47 - Defaults toggling with repeated saves
2021-12-30 15:27:25 +01:00
steve-lad 61beae544e
Merge branch 'develop' into Fix-issue-#47 2021-12-30 15:27:15 +01:00
stevenA c473c62ada Fix issue #47 - Defaults toggling with repeated saves
Remove unused group from server.settings.php
Correct testing for use of system defaults
Correct application of system defaults
ToDo:Numeric values are not being saved, or do not revert to defaults when button clicked
2021-12-30 15:22:20 +01:00
steve-lad fe780283a8
Update sccpManagerUpdater.json 2021-12-30 11:01:29 +01:00
steve-lad 7d4c7c5e50
Merge pull request #46 from chan-sccp/Fix-Issue-#44-part-2
Fix writing settings to sccp.conf
2021-12-30 10:55:55 +01:00
stevenA f4aa2eda1c Fix writing settings to sccp.conf
Only write chan-sccp allowed settings to sccp.conf
Clean sccp.conf on install
Move createDefaultSccpConfig to traits so that can access from installer
tighten calls to createDefaultSccpConfig
2021-12-30 09:39:28 +01:00
steve-lad 03206f8384
Update sccpManagerUpdater.json 2021-12-29 12:50:53 +01:00
steve-lad c0e7a3bc0a
Update sccpManagerUpdater.json 2021-12-29 12:50:33 +01:00
steve-lad 9a6bff2d27
Merge pull request #45 from chan-sccp/Fix-Issue-#44
Fix dndFeature setting not saved
2021-12-29 12:45:03 +01:00
stevenA 0bc2eed76b Fix dndFeature setting not saved
dndFeature setting was not saved
check for existence of chan-sccp flags
add helper to list chan-sccp flags
fix version compatibility check
update version to 14.3.0.19
2021-12-29 12:42:57 +01:00
stevenA 1489968b9e Merge branch 'develop' of https://github.com/chan-sccp/sccp_manager into develop 2021-12-29 08:55:17 +01:00
stevenA 3737462fa7 replace vtmp_key 2021-12-29 08:55:09 +01:00
steve-lad 380a9a52f2
Update README.md 2021-12-28 16:27:34 +01:00
steve-lad eb73d61684
Update README.md 2021-12-28 16:26:35 +01:00
steve-lad bca54bddff
Update README.md 2021-12-28 16:25:52 +01:00
steve-lad 01a703f5cf
Update sccpManagerUpdater.json 2021-12-28 16:14:55 +01:00
steve-lad 90ebbd20f8
Update sccpManagerUpdater.json 2021-12-28 16:14:39 +01:00
stevenA 5586a896cb Update module.xml 2021-12-28 16:11:54 +01:00
steve-lad f8f447b89c
Merge pull request #43 from chan-sccp/Fix-issue-#42
Remove vendor config prefix when matching data in create SEP Xml
2021-12-28 16:07:02 +01:00
stevenA 64ab034443 Remove vendor config prefix when matching data in create SEP Xml
Vendor config data is no longer prefixed. Create xml was looking for a prefix and so no vendor config data was updated
2021-12-28 16:06:09 +01:00
stevenA 88409eb6c8 Change label on sccp connector
Change from default to legacy
2021-12-28 11:30:40 +01:00
steve-lad 9470072e7c
Update sccpManagerUpdater.json 2021-12-28 11:13:08 +01:00
steve-lad 00a83d65ca
Update sccpManagerUpdater.json 2021-12-28 11:12:44 +01:00
steve-lad 00781216d9
Update module.xml 2021-12-28 11:08:33 +01:00
stevenA a395120fac Change version number in Sccp Info
Use module.xml to get version
2021-12-28 10:56:49 +01:00
steve-lad c2fb5f4492 modify details for automatic updates 2021-12-27 12:18:59 +01:00
steve-lad ef944e37c3 test for automatic updating 2021-12-27 11:55:03 +01:00
steve-lad 2830dfeeb1
Merge pull request #41 from chan-sccp/Fix-issue-39
Fix issue 39
2021-12-27 11:11:53 +01:00
steve-lad a2217e6e37 Fix issue #39
Get masterFilesList at install direct from Provisioner. If not available, install a copy from the module
2021-12-27 11:09:42 +01:00
steve-lad 1b979222fa Create masterFilesStructure.xml
Add file to distro so that download from internet is not required
2021-12-26 16:01:58 +01:00
steve-lad 04738f0657 Version update
WIP - fix various vendor config settings.
2021-12-03 11:17:35 +01:00
steve-lad ec9d1cc720 Fix Vendor Config Labels
Labels were incorrect and non descriptive
2021-12-03 11:03:06 +01:00
steve-lad 2b90440df7
Update README.md 2021-11-27 14:22:47 +01:00
steve-lad aca38997c7
Update README.md 2021-11-27 14:21:17 +01:00
steve-lad 2e990783bb
Update README.md 2021-11-27 14:18:08 +01:00
steve-lad e69db63dd2
Update README.md 2021-11-27 14:16:37 +01:00
steve-lad c674fdea96
Merge pull request #37 from chan-sccp/v14.2
V14.2 Merge into develop
2021-11-27 14:13:35 +01:00
steve-lad 0d2bfdbecd
Merge branch 'develop' into v14.2 2021-11-27 14:12:55 +01:00
steve-lad 48ace0574a Force installer to update sccpdevmodel
Ensure changes in sccpdevmodel are implimented. Update number of burttons on 894X
2021-10-16 15:32:53 +02:00
steve-lad 5bd1455e91 Update version 2021-10-14 09:13:43 +02:00
steve-lad 67f2a8b2a3 Quote device name in xpath request
Xpath requires quotes if non numeric device name (eg 894x)
2021-10-14 09:12:57 +02:00
steve-lad 2dc613f063 Fix variable name
arr_data was mistyped
2021-09-21 10:35:10 +02:00
steve-lad 6e97ce5fde
Update README.md 2021-09-07 12:17:22 +02:00
steve-lad 2d39f838b6
Update README.md 2021-09-07 12:16:41 +02:00
steve-lad 3a9d422252
Update README.md 2021-09-07 12:13:31 +02:00
steve-lad a0d7c81738
Update README.md 2021-09-07 12:12:54 +02:00
Phantom 1a09d4df1e
Update README.ru.md
Russian page.
2021-09-02 13:22:55 +03:00
Phantom 63679cd49c
Create README.ru.md 2021-09-02 13:20:54 +03:00
steve-lad 8f6c7be74e Optimise handle submit
Change order of treatment of returned data
Handle db calls outside of loops
Optimise parsing
2021-08-15 13:07:36 +02:00
steve-lad 570171bce0 Remove chan-sccp (null) defaults 2021-08-13 08:05:41 +02:00
steve-lad 1bea598588 Increase length of netlang and devlang fields
Increased to 50 - 25 caused truncation of certain locales
2021-08-13 07:01:16 +02:00
steve-lad 43677651df Refinements to installer handling of sccpvalues 2021-08-10 11:52:17 +02:00
steve-lad c209932eb5 Get all chan-sccp settings
Prior only included general section - now get from all sections

Get all settings fields even if empty or SccpClass will raise an exception
2021-08-10 09:48:53 +02:00
steve-lad 3a1a89fdb8 Update Sccp.class.php.v433 2021-08-10 08:11:08 +02:00
steve-lad fbb61be0f1 Update Sccp.class.php.v433 2021-08-10 08:10:30 +02:00
steve-lad b7d5851643 Update helperFunctions.php 2021-08-10 08:06:36 +02:00
steve-lad 90729f74aa Update for compatibility with PHP 7.4
PHP 7.4 gives warnings that are handled as exceptions
2021-08-10 07:08:10 +02:00
steve-lad 031ef0087e Compatibility update 2021-08-09 13:56:18 +02:00
steve-lad 91d6ad2f48 Fix incompatibility with new Describe table 2021-08-09 09:23:00 +02:00
steve-lad 662e2a4aa3 Update file extensions list to include .SBN and .LOADS
Some firmware has upper case extensions
2021-08-09 06:56:38 +02:00
steve-lad a40c110efe Update Defaults and correct site defaults to comply with new enum values
Legacy values for site defaults in sccpsettings are now converted to be compliant with current enums, or reset to system defaults (cleared)
2021-08-08 14:30:48 +02:00
steve-lad 0b03d58c09 Remove debug code and update version 2021-08-08 09:57:36 +02:00
steve-lad 481c8929a9 Correct handling of device vendor settings
Prefix was incorrect following removal of _column names
2021-08-08 09:56:04 +02:00
steve-lad 8dc1175b37 Update installer to add parent extensions to sccpline if they exist
Previously ignored sccp extensions in freepbx devices and so created 'orphans'. Now create rows for sccpline for devices that already exist as sccp extensions in devices.

Remove dbug code
2021-08-08 09:03:05 +02:00
steve-lad b30340eab5 Update ajaxHelper.php 2021-08-07 16:07:18 +02:00
steve-lad 31e8a48e12 Add videomode select - dropped in earlier commit 2021-08-07 16:01:19 +02:00
steve-lad 0f352eeb59 Fix addition of new device when not in db
Partial fix for issue#29

Populate available fields
Optimise code
2021-08-07 11:03:33 +02:00
steve-lad 14215b64ca Finalise chan-sccp build info 2021-08-06 08:42:39 +02:00
steve-lad 6567923ff1 Add chan-sccp build info to Sccp Info 2021-08-06 08:24:53 +02:00
steve-lad b3fc62caa7 Update dbinterface.class.php 2021-08-04 13:22:42 +02:00
steve-lad f1cc0f1bf6 Remove IF EXISTS condition on rename
Know that the column exists so this is unnecessary and fails in MariaDb 5.5
2021-08-04 12:36:18 +02:00
steve-lad b133b2bc3a Change sccpdeviceconfig view create statement
Should not use ALGORITHM=MERGE when using GROUP BY
2021-08-04 10:55:26 +02:00
steve-lad 2c8842d21a Correct initialisation
res_conf is an array
2021-08-04 07:24:28 +02:00
steve-lad 6775b6686b Simplify getPhoneGrid 2021-08-01 14:54:17 +02:00
steve-lad 4ffcfaf6b7 Correct getExtensionGrid method and optimise
Was dropping last line
Logic was overly complicated; optimise as called frequently
2021-08-01 13:58:11 +02:00
steve-lad 74ddfcd413 Update Sccp_manager.class.php 2021-08-01 12:14:13 +02:00
steve-lad 7ab6eba556 Finalise optimisation of getSccpModelInformation
Use foreach with reference instead of iterator.
2021-08-01 12:13:49 +02:00
steve-lad 28bb5a63da Optimise validate part of getSccpModelInformation
Remove needless iterations and use array functions.
Use basename to remove file extension to facilitate this
2021-08-01 11:57:03 +02:00
steve-lad ab7b295b87 switch basedir path source
Use $amp_conf['AMPWEBROOT'] instead of $_SERVER['DOCUMENT_ROOT'] as at least in one case the latter appears to be empty
2021-07-31 17:07:37 +02:00
steve-lad d8d2f946ce Minor optimisations 2021-07-31 15:41:32 +02:00
steve-lad 43a656cebc Correct XML Path in installer and optimise findAllFiles
XML Path in installer was in single quotes - corrected
Remove unnecessary tests in findallfiles
2021-07-31 12:30:24 +02:00
steve-lad e313b9da3f Change pathname style from {} to .
Instability seen when pathnames with globals enclosed in {} - revert to . style pathnames
2021-07-30 22:43:35 +02:00
steve-lad 3ea36f5459 add keepalive 2021-07-30 14:39:15 +02:00
steve-lad b7a64e854f Update ajaxHelper.php 2021-07-30 14:05:59 +02:00
steve-lad e8cabfbd1a Improve parsing of firewall rules 2021-07-30 14:05:00 +02:00
steve-lad 1338336dd9 Add phonecodepage column to sccpdeviceconfig 2021-07-30 12:04:32 +02:00
steve-lad 49fd6a5c91
Merge pull request #30 from chan-sccp/issue/28
Device SEP ID
2021-07-30 11:54:02 +02:00
steve-lad d8287157bd Remove videomode field from sccplineconfig
Not recognised by chan-sccp
2021-07-30 11:23:13 +02:00
steve-lad 85e77ab34c Insert missing field in sccplineconfig view 2021-07-30 11:04:01 +02:00
steve-lad 40cace04e4 Increase granularity of backup name 2021-07-30 10:36:38 +02:00
steve-lad 97c1f6d5d4 Minor settings changes 2021-07-30 10:18:27 +02:00
steve-lad 60f7d74cf4 Update Sccp Info 2021-07-30 09:12:51 +02:00
steve-lad a267f075c8 include silent lines in extension view 2021-07-30 08:39:53 +02:00
steve-lad d432ff7a05 Ensure that addons cannot be added in edit on devices that do not have addons 2021-07-30 07:27:31 +02:00
steve-lad 472d73489e Update ajaxHelper.php 2021-07-29 17:21:18 +02:00
steve-lad fb25407611 Improve presentation of shared lines 2021-07-29 17:20:43 +02:00
steve-lad f2d15ebd5e Correct del extension to remove all associated buttons 2021-07-29 16:28:05 +02:00
steve-lad 1f910c7e97 Force entry of correct mac address before save is enabled
Move focus to Mac field and stay until a correct Mac address is entered, disabling Save buttons until correct

Motive: a device record with an empty Mac address requires manual removal.
2021-07-29 15:40:23 +02:00
steve-lad d43570b471 Enable addition of sidecars to an existing device 2021-07-29 13:50:31 +02:00
steve-lad b753482898 Correct defaults after db schema change 2021-07-29 08:43:40 +02:00
steve-lad 646a975a5f Update xmlinterface.class.php
Update locale cases for SIP phones
2021-07-29 08:26:11 +02:00
steve-lad 48a2793886 Add directed_pickup field
Previously shown but not updated
2021-07-29 08:05:33 +02:00
steve-lad b659f55170 Remove _ prefixes in db column names
Mariadb does not accept _prefixed fields by spec, and these columns may give future issues. Migrate all fields in installer to remove this prefix (without data loss) and:
Create new view sccplineconfig for chan-sccp where only accepted fields are shown
Update sccpdeviceconfig to only show accepted fields
Update extconfigs.conf to use sccplineconfig
Remove references to _ prefixed fields
2021-07-28 15:48:57 +02:00
steve-lad 4e9dcb09f3 Fix return link if default button changed 2021-07-25 16:03:02 +02:00
Diederik de Groot a1e52d01a4 Rename Device SEP ID to Device ID
Use "XX:XX:XX:XX:XX:XX" as the default display format for device MAC Address
References #28
2021-07-25 12:27:05 +00:00
steve-lad 26f750296a Fix various issues with buttons
Add choice of default line on add device
Partially fix buttoncount (will not work if default device is selected)
Correct database save logic for buttons - triggers should be OK but more verification needed
Fix various save issues where defaults not correctly set
Delete default buttons when deleting line to avoid orphans
2021-07-25 13:42:42 +02:00
steve-lad 80cf629c0f Update ajaxHelper.php 2021-07-24 09:39:57 +02:00
steve-lad 75858d7cc1 Optimise and add error handling to getFilesFromProvisioner 2021-07-24 09:31:30 +02:00
steve-lad 97cfa12fea Update rewrite.rules 2021-07-23 13:05:09 +02:00
steve-lad 312229d4cf Update rewrite.rules 2021-07-23 12:54:21 +02:00
steve-lad 83d54c0fad Update rewrite.rules 2021-07-23 12:40:30 +02:00
steve-lad 4a6caf1eac Remove update link
Currently FreePbx uses a post to get the dta which fails with GitHub. Disable link until fixed by freepbx
2021-07-23 12:22:29 +02:00
steve-lad 4151b4fdae Restructure languages and locales management
Base off of provision file structure
Store netlang and devlang
Stop usage of extconfig ->sccplang
2021-07-23 12:14:46 +02:00
steve-lad 215cacae41 Get Country tones with locales
Get country files with locales
WIP incompatibility between provision, its rewrite rules and the file structure
WIP - need to clean up get files from provisioner
2021-07-21 16:44:23 +02:00
steve-lad 3a53e9ac8b Optimise database calls
Remove unnecessary post processing on returned object
2021-07-21 12:54:05 +02:00
steve-lad 3475efc2c6 Database request modifications and page improvements
Add device to extensions page - permits to see unassigned  lines and shared lines easily
Reformat status to centred
change 'replace' in sccp class to only 'insert on duplicate key' (UPSET equivalent)
Change request in phoneGrid to left join to show all lines, even unassigned to a device
2021-07-21 11:30:50 +02:00
steve-lad a4aa4eb03b Simplify db queries and change alignment 2021-07-21 08:57:43 +02:00
steve-lad 97c1395eb1 Fix Fill Phone status column
Add db query to include mac to allow join with ami active device data
Change output fields
2021-07-20 18:03:44 +02:00
steve-lad 65f3a6cd37 Fix saving empty num value to db
Replace with NULL
2021-07-20 15:56:44 +02:00
steve-lad 4b40811d60 Fix issue with uninitialised adv.ini
Change logic to ensure adv.ini is initialised - necessary as used __Construct before sccp_manager installer can initialise.
2021-07-20 15:40:35 +02:00
steve-lad be5890e61f Update extconfigs.class.php 2021-07-20 12:55:23 +02:00
steve-lad 477eb69146 Fix phonepersonalisation
Set expected numeric value for phonepersonalization
WIP fix - adv.ini
2021-07-20 12:53:29 +02:00
steve-lad 2898f5e3c9 Fix bug codecs storage
codecs were stored as a ',' separated list while chan-sccp expects a ';' separated list
Correct all existing db values when running installer
make sure that disallow is not unset in installer (set to all)
make sure that disallow is not empty
correct help text
2021-07-20 09:32:01 +02:00
steve-lad b3b3858965 standardise get ext file modal and add via include
Create standard modal for insertion via include in firmcreate class and adserver view
2021-07-19 08:04:12 +02:00
steve-lad d9fa0ad8bf Update module.xml 2021-07-18 12:51:16 +02:00
steve-lad 3d69090767 Fix finding master file 2021-07-18 12:50:53 +02:00
steve-lad 5c4bbaabba Ignore $adv_ini if not set
Installer and sccp_manager construct - empty variable. Do not use if not set (will be set later)
2021-07-18 12:33:08 +02:00
steve-lad 913cbd14c4 Set default for LangDir
When Sccp_manager construct is called by the installer, this variable is not set. The installer sets it later
2021-07-18 12:23:17 +02:00
steve-lad d7fd77dfe8 Get locales from provisioner
Add progress bar and xhr handler
2021-07-18 11:30:19 +02:00
steve-lad 1b32e0977e Optimise locale (language) management
Optimise function calls
Use array functions instead of loops
findInstalledlangs is currently called by the construct - as this is called frequently, maximise its efficiency
2021-07-15 12:12:07 +02:00
steve-lad a4f8fa4600 Impliment retrieving firmware from Provision_sccp
WIP - need to handle exceptions etc
2021-07-14 17:16:27 +02:00
steve-lad ef77bce159 Add retrieve device files 2021-07-14 13:10:15 +02:00
steve-lad 2ffe4028e6 Add download function
WIP - debug with ringtones
2021-07-12 16:32:57 +02:00
steve-lad 6e26428b1d Update rewrite rules
Add header with credits
Add specific rule for sccp_manager
Add correct fields to parse xml for sccpvalues
Add new option to update files from @dkgroot/provision
2021-07-12 13:50:09 +02:00
steve-lad 2b709c9037 remove index.cnf
Is created by extconfigs with actual server values
2021-07-12 12:36:29 +02:00
steve-lad 651f3adb44 Finalise TFTP Mapping treatment
User no longer can select on or pro: If remapping is enabled and rules are set, then must use pro or phones will not find files
Otherwise is Off (flat directory)
2021-07-12 12:26:56 +02:00
steve-lad 5a184ededb Integrate Provision functionality into Sccp_Manager
Create required directory structure
Check if mapping support is enabled
Check if mapping rules are defined
Change options available based on above
Create index.cnf and sccpManagerRewrite.rules
2021-07-11 16:52:24 +02:00
steve-lad 248abe6cb7 Clean up and correct missing save settings
Remove unnecessary method from formcreate
Correct indentation in formcreate
Remove debug code in Sccp.class
correct logic for updating TFTP mode
2021-07-10 17:51:55 +02:00
steve-lad bf7556ed81
Merge pull request #27 from chan-sccp/Fix-Issue-#23
Correct rewrite rules
2021-07-10 13:09:23 +02:00
steve-lad ffaab80ee2 Correct rewrite rules
Supplied by and thanks to @vaDrn
2021-07-10 13:08:27 +02:00
steve-lad 30cbe1ba95 Correct output regex
Supplied by and thanks to @vaDrn
2021-07-10 13:05:28 +02:00
steve-lad 2a98d8cfdb Override chan-sccp default context 2021-07-10 12:17:46 +02:00
steve-lad 71fef35ebd Finalise FormShowSysDefs
Remove debug conditionals in Sccp_manager
Pass missing arguments for tftpLang
Remove unused items from sccpgeneral.xml
2021-07-10 10:45:42 +02:00
steve-lad ce115dab8b Create formCreate class
Move anonymous class frpm formShowSysDefs to own class
2021-07-10 09:03:06 +02:00
steve-lad d966bfa303 Minor typo corrections and add defaults button to device add/edit 2021-07-09 14:06:25 +02:00
steve-lad ba4dfb2f0d Reset line codec choices to site defaults
If all codecs are unchecked, restores values to site codecs
Remove options that have no input (do not offer user empty lists)
Respect site dndFeature by hiding option if off
2021-07-09 11:18:53 +02:00
steve-lad acb0141d99 Refine Sccp.class
Move help and other defs to sccpgeneral so that have one interface across system
Correct defaults in line with chan-sccp
Standardise db object, and move sql to dbinterface to remove second dependancy
2021-07-08 17:22:50 +02:00
steve-lad 6429b6add9 Finalise Codec Management
Add video codec treatment
Correct missing defaults
Simplify defaults in Sccp.class
2021-07-08 08:56:42 +02:00
steve-lad 11da8356a5 Update Sccp_manager.class.php 2021-07-06 17:20:42 +02:00
steve-lad 945e77f9bc Simplify getCodecs by using array functions 2021-07-06 17:18:17 +02:00
steve-lad f929267910 Provide mechanism to reset codecs to system defaults
Unchecking all codecs will return to chan-sccp defaults
Document this behaviour
Remove various debug code
2021-07-06 16:12:25 +02:00
steve-lad 2e5028f438 Finalise Codecs tab for site defaults
Partially revert changes to sccpvalues keys
Remove obsolete code
Improve help and set as open by default
Move getMyConfig to AjaxHelper as only used there
2021-07-06 15:22:12 +02:00
steve-lad acdf777bcc Clean up xml in cnf files
Indentation was not satisfactory. Improves readability and presentation of cnf files created

Thanks to @dkgroot for proposing this improvement
2021-07-06 12:24:34 +02:00
steve-lad 8b06495938 Update installer to handle chan-sccp parsable fields
chan-sccp has parsable fields where two values are separated by a |.
Parse these fields and their associated values and create two fields.
Remove the unparsed field if it exists.
2021-07-06 11:54:46 +02:00
steve-lad fea6d88aa5 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

Remove Inherit processing

Remove functionality added to hide inherit in default configs - Inherit has been removed from sccpgeneral.xml
2021-07-06 09:31:44 +02:00
steve-lad 5af3c7d2eb
Merge pull request #26 from chan-sccp/Fix-Issue-#25
Fix issue #25
2021-07-06 09:08:14 +02:00
steve-lad 47522b4a25 Update SIP cnf as well 2021-07-06 09:06:10 +02:00
steve-lad 4ad33852fd Revert "Revert "Fix Issue #25""
This reverts commit 6fa4c8626e.
2021-07-06 09:01:26 +02:00
steve-lad 6fa4c8626e Revert "Fix Issue #25"
This reverts commit c1aab666b3.
2021-07-06 08:58:47 +02:00
steve-lad c1aab666b3 Fix Issue #25
Fix incorrect separator and key reference.
2021-07-06 08:58:03 +02:00
steve-lad 44e0846761 Update server.codec.php
Add Recommendation for disallow
2021-07-06 08:30:38 +02:00
steve-lad a6a9850a3c rewrite codec methods to be more compliant with chan-sccp
Update db Fields for defaults
Update save logic
WIP update save defaults Field  in sccpline
2021-07-05 17:08:01 +02:00
steve-lad b15729a340 Change earlyrtp enum
chan-sccp enum is now yes / no and all older values equate to one of these. Help updated in chan-sccp revision: 566c8695
2021-07-05 11:17:03 +02:00
steve-lad a493165153 Insert missing </div> at end of SL type
</div> was commented out
Change sccpdevice type to IE ( using a list suggests changes are legitimate. While true, they are not recommended, so now user must know exactly what to enter.
2021-07-05 11:02:52 +02:00
steve-lad 2809b0796e Simplify List Button Presentation
Standardise method for all SL Types
WIP - unused method needs to be removed after full testing
2021-07-05 10:27:26 +02:00
steve-lad 503f227b98 Convert formShowSysDefs to anonymous class
Allows use of methods per type, which allows clearer compartmentalisation of variables and code.
Improves loading as FreePBX instantiates only once
WIP - create a full class loaded with Sccp_Manager
2021-07-04 16:46:18 +02:00
steve-lad b6dfb51993 Conditional include of Use chan-sccp defaults/Customise button
If there is no chan-sccp default, do not add the button to use chan-sccp default/customise

This adds a large block of html + php enclosed within {}. Add documentation so that this is clear
2021-07-04 09:02:33 +02:00
steve-lad 6ecc981a02 Align more defaults 2021-07-03 16:44:52 +02:00
steve-lad dd9888e55e (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
2021-07-03 16:29:31 +02:00
steve-lad 7dc4438ad8 Enable/Disable buttons when setting chan-sccp defaults
First version - Needs simplifying!
2021-07-03 12:10:44 +02:00
steve-lad 93fe6d45e1 Extend defaults to all pages
Change enum in installer to correspond to chan-sccp
2021-07-02 12:27:06 +02:00
steve-lad 927186151e Update checkbox defaults logic 2021-07-02 08:29:15 +02:00
steve-lad dcd9c75886 WIP Partial fix for setting default radio buttons 2021-07-01 10:11:02 +02:00
steve-lad 02f0b401d0 Impliment defaults for class IS
WIP
2021-06-30 16:31:29 +02:00
steve-lad e50c32a1ac Correct Indents for IS data type 2021-06-30 15:04:09 +02:00
steve-lad 3b91ad2188 Update JS
Default settings for customise are chan-sccp settings
Include QOS page group
Change help text
2021-06-30 14:27:39 +02:00
steve-lad 01b5e9e868 Use Dynamic Checkbox 2021-06-30 13:43:52 +02:00
steve-lad 64624fa597 Simplify chan-sccp help usage
Convert array to string when loaded, and rename arrays that hold the data for clarity
2021-06-30 08:14:15 +02:00
steve-lad 3ec730b71b Standardise between different formShow pages 2021-06-30 07:05:17 +02:00
steve-lad ace4945eb0 Load help from chan-sccp
Load metainfo descriptions which provide help if not in XML
2021-06-30 07:02:22 +02:00
steve-lad b7766fcf64 First test of new interface to manage defaults hierarchy
WIP
Need to better manage display of system defaults when customising
Need to override XML defaults
2021-06-29 16:41:53 +02:00
steve-lad 063556f898 Prepare siteDefaults Page
First pass with input array structure
2021-06-28 16:39:32 +02:00
steve-lad d1e72714af add systemdefault field to sccpvalues for savesccpsettings 2021-06-28 13:02:24 +02:00
steve-lad 22d845ced3 Initialise all chan_sccp defaults in sccp_settings
Get default system settings from chan_sccp and add to sccpsettings
Remove legacy settings from sccpsettings
Change tftpReadTestFile to accept host as argument
Change sccpsettings structure to include systemdefaults
2021-06-28 11:51:05 +02:00
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
Diederik de Groot a6a7b517d1
Added file explaining config parsing and inheritance by chan-sccp. 2021-06-26 11:03:42 +02: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 0692b3cd6a Update module version 2021-06-20 13:15:49 +02:00
steve-lad def22582e3 Correct SQL in INSTALLER 2021-06-20 13:14:54 +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 aad6fa31c6
Merge pull request #21 from chan-sccp/Fix-Issue-#20
Fix Issue #20
2021-06-19 15:24:56 +02:00
steve-lad fd21a94821 Fix Issue #20
During initial migration of Sccp_Manager to chan-sccp, the incorrect version of sccp class driver was imported.

This corrects that and modifies the original driver
2021-06-19 15:23:42 +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 82772eed71 Bugfix Incorrect object for execute
Change object for execute in SaveButtons
2021-06-17 15:12:50 +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
steve-lad 218e1c66ee Clean Installer
Remove unused functions
Remove unused cases
Remove duplicate code
2021-06-16 09:28:47 +02:00
steve-lad 4c40809071 Update installer for new db version
Define new sccpdevice fields
Remove obsolete code
Remove duplicate code
2021-06-16 09:22:43 +02:00
steve-lad 5e5cf3ffda Remove unused cases in Save Device
These Fields do not exist in sccpdevice
2021-06-16 07:52:58 +02:00
steve-lad 5e7bdbe40b Revert Settings Changes
Move changes to new version 14.2
2021-06-16 07:05:40 +02:00
steve-lad 8c4b0ce240 Disable Inherit in default system button settings
Disable Inherit buttons in system defaults (should only be used for specific devices)

Add Device Vendor settings to Add Device (WIP - may need db change)

Change various names to be more readable
2021-06-15 17:56:37 +02:00
steve-lad 92ef25bc62 Change Version 2021-06-15 09:41:39 +02:00
steve-lad 2b49bbc373
Change Stable Branch Link 2021-06-15 09:27:07 +02:00
steve-lad fb8f4ec00e Bug Fix - Default line not added on Device Create
Default line was only set after Device edit and save, not after Device creation.
2021-06-15 08:56:19 +02:00
steve-lad 61818026ff Update module.xml
Update version after bug fix
2021-06-14 16:24:04 +02:00
steve-lad d2e9ac3184 Bug Fix
Wrong response class in MessageClass
2021-06-14 16:17:18 +02:00
steve-lad 5ea2c83115 Correct Device Reset page reload
Stay on page with page reset
Correct output
Switch from modal to Toast
2021-06-14 16:00:03 +02:00
steve-lad 707371cb92 Fix update button labels
Convert modal responses to Toast
Correct reload parameters to stay on page and redraw table
Correct output text
2021-06-14 15:19:45 +02:00
steve-lad d7bc3e500b Replace more modals with Toast 2021-06-14 14:24:11 +02:00
steve-lad 79f59de92e Update module.xml
Update change log
Increment version
2021-06-14 12:27:57 +02:00
steve-lad 1751e9dd9c Remove old comments
Remove old commented text and update comments
2021-06-14 12:21:18 +02:00
steve-lad 9ac0d59c66 Leave table deletion to FreePBX
FreePBX and Director remove all tables that it has installed. If they do not exist, uninstaller gives errors
2021-06-14 12:18:40 +02:00
steve-lad 09db30fe9f Update Uninstaller
Create Backup of SCCP tables
Remove all tables
Remove views and keys
2021-06-14 11:47:09 +02:00
steve-lad 808e676972 Clean up model display
Improve message and add newline
2021-06-14 10:43:21 +02:00
steve-lad e6c5dd63a0 Replace Save and Continue modal
Use Toast
2021-06-14 10:31:23 +02:00
steve-lad 89fe90d2ca Replace modal on save config
Remove modal with close waiting on user input and replace with Toast
2021-06-14 10:23:23 +02:00
steve-lad be2b21f8cf Update extconfigs.class.php
Fix missing .
2021-06-14 07:45:09 +02:00
steve-lad f159ab72f6 Clean up defaults
Set new base defaults to 433
Remove obsolete conf files to enhance maintainability
2021-06-13 16:55:26 +02:00
steve-lad 0e82da2492 Merge branch 'develop' of https://github.com/chan-sccp/sccp_manager into develop 2021-06-13 16:43:38 +02:00
steve-lad 7107dbe86b Fix issue with not saving all settings
An erroneous break instead of continue was truncating sccpsettings

Simplify logic by avoiding create then delete for settings where data was empty
2021-06-13 16:43:31 +02:00
steve-lad 6260f79b86
Update Version 2021-06-13 15:46:06 +02:00
steve-lad 3d1b8015c5
Merge pull request #18 from chan-sccp/Fix-Issue-#14
Fix issue #14
2021-06-13 15:43:48 +02:00
steve-lad 007330159e Disable TZ selection
TZ is a FreePBX property and should be only changed there.

Now only display for info with help

Ensure that at each initiation, we load the system value
2021-06-13 15:39:43 +02:00
steve-lad 3fee812cc6 Get TZ Offset from timezone
Remove unnecessary methods
2021-06-13 13:12:37 +02:00
steve-lad bbd811e578 New TZ and Cisco Code Algorithm
Simplify getting cisco_code and DST settings
2021-06-13 11:06:26 +02:00
steve-lad 3b5fb64589
Merge pull request #17 from chan-sccp/Fix-Issue-#15
Partial Revert of 212c437
2021-06-13 09:10:55 +02:00
steve-lad f20146b7ef Partial Revert of 212c437
If outbound caller id is not set by user, do not set here (no default value).

$label is not declared in this class and so causes exception when called from Quick Create Extension

Only redirect when called from SCCP Phone add extension or from Extensions add extension
2021-06-13 09:09:55 +02:00
steve-lad 67c43fea6c
Merge pull request #16 from chan-sccp/Fix-Issue-#12
Change DB Spec for compatibility with older MariaDB
2021-06-13 08:28:33 +02:00
steve-lad 7aaee83d4a Change DB Spec for compatibility with older MariaDB
Older versions of MariaDB, which are included in some distros, reject a VARCHAR that is a key and can be NULL longer than 190 (Director default is 255)

Change for backward compatibility
2021-06-13 08:27:14 +02:00
steve-lad 30933c6bfb Update module.xml
Update length of buttontype
2021-06-12 17:04:34 +02:00
steve-lad 8303ec28a4 Find correct Cisco TZ Code 2021-06-12 11:29:26 +02:00
steve-lad 878dd7c29a Update install.php
Remove extra .
2021-06-12 10:07:14 +02:00
steve-lad 1182d65971 Correct file names
cnf_read and cnf_wr can only write to a filename (not a path) inside /etc/asterisk
2021-06-12 09:56:59 +02:00
steve-lad f51f839e9c Update module.xml
Set Default on non null field
2021-06-12 08:37:59 +02:00
steve-lad 84925a334e Update TZ selection method
Change Cisco code determination
2021-06-12 07:30:18 +02:00
steve-lad 50d2f25326
Merge pull request #13 from chan-sccp/Fix-Issue-#12
Fix issue 12
2021-06-11 11:09:30 +02:00
steve-lad 5b67c8d6f9 Fix issue 12
Remove empty defaults from database definitions - Doctrine parses incorrectly
Add case in installer to create extconfig.conf if does not exist
2021-06-11 11:08:32 +02:00
steve-lad 7adaaeea09
Update README.md 2021-06-11 09:20:03 +02:00
steve-lad 5b3111e047
Update README.md 2021-06-11 09:18:59 +02:00
steve-lad 78feebc894
Merge pull request #11 from chan-sccp/Fix-Issue-#8
Fix issue #8
2021-06-11 08:58:22 +02:00
steve-lad 9547cfe927 Clean up and document redirect changes
Add comments
Standardise URL's
Remove surplus cases
2021-06-11 08:54:24 +02:00
Diederik de Groot d0873cdd16
Update sccpManagerUpdater.json 2021-06-10 21:38:42 +02:00
Diederik de Groot 5c656e409b
Update sccpManagerUpdater.json 2021-06-10 21:32:34 +02:00
steve-lad 1a96c523b7
Update README.md 2021-06-10 19:25:24 +02:00
steve-lad 7427fcabb8 Standardise URL
Standardise URL based on PHP Defaults
2021-06-10 17:41:18 +02:00
steve-lad cf546961fe Add redirect after saving to sccp_line
Add redirect after saving to sccpline
Revert changes in page script formatting
2021-06-10 16:57:19 +02:00
steve-lad 214509e2c7 Use BMO Hooks
Use BMO Hooks
Correct HTML
2021-06-10 12:15:18 +02:00
steve-lad 7f96c121fa Update module category in updater.json
Update module category in updater.json - this is used in Module Admin
Remove unused JS
2021-06-08 15:23:43 +02:00
steve-lad dface29681
Delete .nfs.2005102d.05d5
Delete extraneous file
2021-06-08 14:43:13 +02:00
steve-lad 03057edd6c Fix Broken Rnav in add device
Replace _DIR_ with absolute path; _DIR_ references sccpTraits
Fix error in toolbar id
2021-06-08 14:39:23 +02:00
steve-lad 5ad6f5bae0 Update button labels
Update button labels in Server Config
Atom whitespace removal in hardware.phone
2021-06-08 12:50:48 +02:00
steve-lad 0fa539bd6a Remove unused delete button
Remove disabled delete button
2021-06-07 16:23:21 +02:00
steve-lad 4ec741e1fa Revert "Update module to point to other updateurl branch"
This reverts commit 0c2df2d529.
2021-06-07 12:44:18 +02:00
dkgroot 0c2df2d529 Update module to point to other updateurl branch 2021-06-06 18:12:50 +00:00
dkgroot 792cf34522 Update json file 2021-06-06 18:10:08 +00:00
dkgroot 668bc3355c Update version number to 14.2.0.2 2021-06-06 14:07:07 +00:00
dkgroot 9e360240d9 Fix module.xml database definition 2021-06-06 13:51:44 +00:00
steve-lad e97dc89a49 Update install.php
Check realtime configuration
Impose correct version
2021-06-06 11:00:00 +02:00
steve-lad d7ebf7d0ec Simplify logic and correct SQL
Correct SQL for modify defaults
Remove unnecessary tests
Simplify remaining tests
2021-06-06 08:16:41 +02:00
steve-lad 6250f1b186
Update README.md 2021-06-05 08:42:36 +02:00
steve-lad 17293287fa Correct Default values
Correct default values
Fix SQL syntax error
2021-06-04 17:02:27 +02:00
steve-lad e8dae84512 Update install.php 2021-06-04 16:20:52 +02:00
steve-lad 98a0f4e8b7 Update installer
Change default values in Sccp.class
Change SQL statements
Change DB schema
2021-06-04 16:20:18 +02:00
steve-lad f7d88e68bb Correct defaults for call transfer
This field is an enum in db and so must be on/off
2021-06-04 08:12:09 +02:00
steve-lad fc9c060b26 Merge branch 'develop' of https://github.com/chan-sccp/sccp_manager into develop 2021-06-04 07:57:47 +02:00
steve-lad 355b0b0ca3 Fix issue - sccpline row not created
Remove unnecessary escaping of quotation marks that caused SQL to reject command
2021-06-04 07:56:20 +02:00
steve-lad 8244ce5366
Update sccpManagerUpdater.json 2021-06-03 15:25:50 +02:00
steve-lad 883f8ae674
Update sccpManagerUpdater.json 2021-06-03 14:57:26 +02:00
steve-lad ec54af5b9d
Update sccpManagerUpdater.json 2021-06-03 14:57:00 +02:00
steve-lad 337da918d4
Update sccpManagerUpdater.json 2021-06-03 14:54:16 +02:00
steve-lad 868ebbecc8
Update sccpManagerUpdater.json 2021-06-03 14:52:06 +02:00
steve-lad d683f686e5 Update module.xml 2021-06-03 14:39:35 +02:00
steve-lad c8ccef50c9 Impliment FreePBX Updater
Add json file to repo
2021-06-03 14:24:46 +02:00
steve-lad 3f7d59ee34 Update dbinterface.class.php
Standardise SQL quoting and style
2021-06-03 14:14:02 +02:00
steve-lad a8d12501de Update page.html.php 2021-06-03 13:58:50 +02:00
steve-lad d72a19f9e8 Minor Formatting 2021-06-03 13:51:38 +02:00
steve-lad f4927793ee Modify installer
Change load sequence
Delegate table creation to module.xml
Correct module.xml tables
Correct timezone typo
2021-06-03 13:07:26 +02:00
steve-lad 1c78d23df8 Update xmlinterface.class.php
Clean up
2021-06-03 09:14:19 +02:00
steve-lad 495ede0df2 Update Sccp_manager.class.php
Update version
2021-06-03 09:05:24 +02:00
steve-lad 8341cba1ca Update Sccp_manager.class.php
Remove unnecessary tests
2021-06-03 08:56:04 +02:00
steve-lad c1f35ace41 Update Sccp_manager.class.php
Remove unnecessary page code - this version only works with chan-sccp >433
2021-06-03 08:37:43 +02:00
steve-lad cd0da5b6a3 Update Sccp_manager.class.php
Reset settings page tab order
2021-06-03 08:25:57 +02:00
steve-lad 8c7c7d6fef Update module.xml
Remove duplicate tag
2021-06-03 08:08:32 +02:00
steve-lad 41033edc44 Remove duplicate Technical note folder 2021-06-02 16:54:24 +02:00
steve-lad 13778ce657 Update Sccp_manager.class.php
Move SccpInfo to first tab leaving General as default
2021-06-02 16:39:02 +02:00
steve-lad 7d641e3b2d Update Sccp_manager.class.php
Remove unused methods
Substitute single line methods
Clean up page presentation (this changes the previous tab order)
2021-06-02 16:31:38 +02:00
steve-lad 4620df53c4 Change Function names 2021-06-02 15:30:21 +02:00
steve-lad 6df032c137 Remove unused methods 2021-06-02 15:21:53 +02:00
steve-lad 2f487d1a32 Create BMO Trait
Move BMO code to separate trait
2021-06-02 15:10:12 +02:00
steve-lad 4ee26a9871 Name Changes 2021-06-02 15:03:38 +02:00
steve-lad f6bdd27335 Use Traits to simplify Sccp_Manager.class
Move helper functions to trait
Move Ajax to trait (WIP - next step to create subclass to simplify initialisation)
Rename Directories to eliminate punctuation
Add new directory for traits
2021-06-02 14:55:39 +02:00
steve-lad 91986cb674 Merge branch 'develop' into RetireOldInterface 2021-06-02 10:35:42 +02:00
steve-lad c9e52cc0c5 Update README.md 2021-06-02 10:32:46 +02:00
steve-lad bd80580933 Update README.md 2021-06-02 10:29:35 +02:00
steve-lad 975dd84853
Update README.md 2021-06-02 10:22:18 +02:00
steve-lad 32e465d635
Update README.md 2021-06-02 10:19:09 +02:00
steve-lad 538e4eeb0c
Update README.md 2021-06-02 10:17:08 +02:00
steve-lad 42b41d8bd0 Update README
Add required PHP classes
Delete Russian version as not maintained
2021-06-02 08:26:46 +02:00
steve-lad 80cc601da4 Update Installer - WIP
Add database definitions in module.xml
Catch exception if PHP Zip not installed
2021-06-02 08:17:35 +02:00
Diederik de Groot 9ef59f0df4
Add updateurl to module.xml 2021-06-01 18:51:29 +02:00
steve-lad 09a5daa593 Clean up install.php
Remove obsolete/non-applicable code
2021-05-31 18:45:48 +02:00
steve-lad 67c02aabf1 Return RevisionNum
Return RevisionNum - omitted in previous commit
2021-05-31 16:16:52 +02:00
steve-lad d0fd1f2cdb Remove incompatible files
Simplify compatibility checking. This version is only compatible with chan-sccp 433 or greater.
2021-05-31 16:11:07 +02:00
steve-lad 2eab67a117 Bug fix
Missing closing bracket
2021-05-31 12:57:16 +02:00
steve-lad 97c02f125f Add error message for chan-sccp compatibility
Ad error message in install if chan-sccp version is too low
Minor formatting
2021-05-31 12:52:56 +02:00
steve-lad ee0fda775e Retire Old Interface
Use exclusively AMI interface
Delete oldinterface
Delete srvinterface and move aminterface to Sccp_manager.inc
All calls now pass directly to aminterface
2021-05-31 12:33:35 +02:00
steve-lad a065884a8b Merge branch 'develop' of https://github.com/chan-sccp/sccp_manager into develop 2021-05-31 10:00:14 +02:00
steve-lad ac71164055 Update install.php
Clean up formatting and remove unnecessary quotations
2021-05-31 10:00:06 +02:00
dkgroot 524e15b2c4 Update version number 2021-05-30 14:37:49 +00:00
steve-lad d846af6913
Merge pull request #6 from chan-sccp/UpdateDeviceEdit
Update device edit as per 9e95071
2021-05-30 16:02:11 +02:00
steve-lad b138c3ac81 Enable edit of phones as per 9e95071
Reintegrate edit of phones as per original patch by @dkgroot
Corrections in HTML
Simplify Installer mods
2021-05-30 16:01:02 +02:00
Diederik de Groot 51dad690ef Fix: Default models should have at least 1 button if number is currently no known
Enh: allow all model information to be edited.
Fix: edit/load loadinformationid
Fix: Modal Title -> Model

With help from @steve-lad

References: #91

Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2021-05-30 15:03:38 +02:00
steve-lad 85e4bce407 Simplify tests
Use Isset instaed of empty twice
2021-05-30 14:27:45 +02:00
steve-lad 7cf12356c1 Update Sccp.class.php.v433
Correct indentation
Rewrite SQL Replace statement to simplify
2021-05-30 13:22:46 +02:00
steve-lad 9c4c94cba7 ReIndent Sccp.class.v433 2021-05-30 12:50:48 +02:00
steve-lad a77aa65f74
Merge pull request #5 from chan-sccp/ParseOutboundCID
parse outboundcid content into cid_num and cid_name sccpline fields
2021-05-30 11:49:17 +02:00
Diederik de Groot 212c43782b parse outboundcid content into cid_num and cid_name sccpline fields
If outboundcid contains '"name" <num>' the content needs to be split to cid_name and cid_num.
If not the content should be a number and should be copied to cid_num only, in that case we fill cid_name with the value of $label

Fixes: #72

Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2021-05-30 11:47:47 +02:00
steve-lad 16104a0589
Merge pull request #4 from chan-sccp/MoveDisallowBox
Move disallow box
2021-05-30 11:35:41 +02:00
steve-lad f8a3c8c81d Reapply patch wriiten by DKGroot
Move the disallow box to the top of the codec page
Correct english
2021-05-30 11:34:35 +02:00
Diederik de Groot fa7fa4772f Move the disallow box to the top of the form, the order is important.
Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2021-05-30 11:29:49 +02:00
steve-lad 4ce789cd3e Fix reversion errors
When rebasing, errors were introduced. This commit reverses those errors. It may also revert some commits
2021-05-29 15:50:04 +02:00
steve-lad ad1184af43 Merge branch 'develop' of https://github.com/chan-sccp/sccp_manager into develop 2021-05-24 16:24:25 +02:00
steve-lad 3859be72be
Merge pull request #3 from chan-sccp/issueswiki
Update README.md
2021-05-24 16:20:20 +02:00
Diederik de Groot 2bd2e814d7
Fix image link 2021-05-24 16:17:00 +02:00
Diederik de Groot d3e44c955b
Update module.xml and PhantomVl references 2021-05-24 16:15:28 +02:00
steve-lad b4301ebd14 Update README.md
Remove reference to extension_mobility
2021-05-24 16:02:50 +02:00
Diederik de Groot 8bdd6beee8
Couple of small changes 2021-05-24 15:55:24 +02:00
steve-lad cd30a20cf6 Update README.md
Reflect move of sccp_manager to chan-sccp, updating links and readme.
2021-05-24 15:14:55 +02:00
steve-lad 12c8f30464
Fix Issue with SQL syntax reported by kc2vrj
Correct quotation and simplify logic to avoid complex SQL statements.

Bind strings

Confirmed fix of issue reported by kc2vrj.
2021-05-24 13:55:36 +02:00
Diederik de Groot 0011581fc0
Merge branch 'PR108' into extension_mobility_rebased_on_develop 2021-05-24 13:46:19 +02:00
steve-lad d451b36363 Fix Issue with SQL syntax reported by kc2vrj
Correct quotation and simplify logic to avoid complex SQL statements.

Bind strings

Confirmed fix of issue reported by kc2vrj.
2021-04-29 16:44:33 +02:00
Diederik de Groot 9e95071bad
Fix: Default models should have at least 1 button if number is currently no known
Enh: allow all model information to be edited.
Fix: edit/load loadinformationid
Fix: Modal Title -> Model

With help from @steve-lad

References: #91

Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2021-04-02 15:30:03 +02:00
Diederik de Groot 07be691c16
parse outboundcid content into cid_num and cid_name sccpline fields
If outboundcid contains '"name" <num>' the content needs to be split to cid_name and cid_num.
If not the content should be a number and should be copied to cid_num only, in that case we fill cid_name with the value of $label

Fixes: #72

Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2021-04-02 15:30:03 +02:00
Diederik de Groot 1ef1fe1e31
Move the disallow box to the top of the form, the order is important.
Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2021-04-02 15:30:02 +02:00
steve-lad 7f93f0179b
Remove PHP % incompatible code 2021-04-02 15:29:36 +02:00
steve-lad 8fb29b93fd
Update dbinterface.class.php
Correct syntax
2021-04-02 15:29:36 +02:00
steve-lad ef4fc4fe12
Fix Sccp Button Save
Correct PDO statements and implimentation concept
2021-04-02 15:29:36 +02:00
steve-lad 9f5459f7c5
Update dbinterface.class.php
Check that labels exist before binding or an exception will occur
2021-04-02 15:29:36 +02:00
steve-lad bd257cec9b
Correct string quoting
String quoting was incompatible with PHP 7
2021-04-02 15:29:36 +02:00
steve-lad 594367cbd4
Update dbinterface.class.php
Bug fix
2021-04-02 15:29:36 +02:00
steve-lad 31ac0746ba
Bug fixes
Correct SQL statement
Correct Message Handler
Correct Message interpreter
2021-04-02 15:29:36 +02:00
steve-lad e1c6a1d39b
Remove tmp nfs files 2021-04-02 15:29:36 +02:00
steve-lad c4cd6cbdbf
Update install.php
Populate sccpdevmodel if empty
2021-04-02 15:29:36 +02:00
steve-lad 3ed43600d4
Merge Fix-dbinterface-class 2021-04-02 15:29:36 +02:00
steve-lad 36192599f1
Migrate from global db object
As per FreePBX BMO, no longer use global db object
2021-04-02 15:29:34 +02:00
steve-lad f4f11157e1
Fix exception if sccpsettings table does not exist
Before the installer can create sccpsettings, FreePBX instantiates an SCCP_Manager object which requires sccpsettings.
Catch the exception and create the table
2021-04-02 15:29:17 +02:00
steve-lad d3ae6536d1
Update dbinterface.class.php 2021-04-02 15:29:17 +02:00
steve-lad 19e1bb9b3e
Remove dbugs 2021-04-02 15:29:17 +02:00
steve-lad dac622c745
Final version
Standardise some calls and add notes
2021-04-02 15:29:15 +02:00
steve-lad 09beeb449e
Use bindParam on db executes
Use bind param to have stricter typing

Fix bug in Sccp-Manager where key and keyword were not the same
2021-04-02 15:28:55 +02:00
steve-lad 5892afc653
Update Transactions and fix errors
Reduce quoting level, and fix errors introduced by prior commits
2021-04-02 15:28:54 +02:00
steve-lad 4a3f21dc5d
Further clean ups and annotations
Document changes
2021-04-02 15:28:35 +02:00
steve-lad cfcbe23816
Switch to PDO model
Switch to PDO model and correct transactions
2021-04-02 15:28:06 +02:00
steve-lad fd8c5f9f96
Cleaning up
Simplify structure and fix errors
2021-04-02 15:27:28 +02:00
steve-lad a1c020c772
Switch to PDO model
Switch to PDO model and correct transactions
2021-04-02 15:27:27 +02:00
steve-lad c77c8b76cc
Test for chan_sccp_b version compatibility
SoftKeySets fails with chan_sccp-b prior to revision number 11048.

Check the version with the installer, and subsequently to ensure do not get exception.
2021-04-02 15:25:56 +02:00
steve-lad 91c2d233d4
Use bindParam on db executes
Use bind param to have stricter typing

Fix bug in Sccp-Manager where key and keyword were not the same
2021-04-02 15:25:32 +02:00
steve-lad 3fbccb982f
Update Transactions and fix errors
Reduce quoting level, and fix errors introduced by prior commits
2021-04-02 15:25:32 +02:00
steve-lad 7f047f7c10
Further clean ups and annotations
Document changes
2021-04-02 15:25:31 +02:00
steve-lad bda7518932
Cleaning up
Simplify structure and fix errors
2021-04-02 15:25:31 +02:00
steve-lad 95405190cc
Switch to PDO model
Switch to PDO model and correct transactions
2021-04-02 15:25:31 +02:00
steve-lad 92ca19ed41
Test for chan_sccp_b version compatibility
SoftKeySets fails with chan_sccp-b prior to revision number 11048.

Check the version with the installer, and subsequently to ensure do not get exception.
2021-04-02 15:25:30 +02:00
steve-lad 9d29d11a08
Apply PR 101 2021-04-02 15:23:55 +02:00
steve-lad 40e9b01510
Correct type declarations
type declarations must be lowercase or will be treated as local instance names
2021-04-02 15:23:55 +02:00
steve-lad e94fa4e8d1
Tidy up
Remove unused variables
Close socket if not using
2021-04-02 15:23:55 +02:00
steve-lad 673f6d45e0
Tighten Ami controls
Check that have compatible version of chan-sccp for AMI and disable AMI  if not found
Check returned values
Add new classes for response to reduce testing
2021-04-02 15:23:54 +02:00
steve-lad 315a693894
Correct Field and add new event classes
add 2 new event classes for SCCPShowDevice

correct translator in ShowSCCPDevice_Response
2021-04-02 15:23:54 +02:00
steve-lad 5beee7f9a2
Tidy up exception handling
Simplify handling of AMI lists and trap exceptions
2021-04-02 15:23:54 +02:00
steve-lad a89866e81e
Bug Fixes and optimisations as a result of issue 106
Fix bugs in Response Class causing exceptions
Update extconfigs class to correctly check database connectors and improve feedback
Move some constructors to start of class for lisibility
Tidy up Response class with Typing to eliminate unnecessary tests
2021-04-02 15:23:54 +02:00
Andrea Diotallevi 9b730a998a
Fixed recognition of chan-sccp release version 4.3.3 2021-04-02 15:23:54 +02:00
steve-lad ca5cf9571b
Updated GenericResponse
Updated generic response handler for table case
2021-04-02 15:23:54 +02:00
steve-lad 929f8036b1
Update AMI Response
Bring branch up to level of previous Pull which can now be deleted
2021-04-02 15:23:54 +02:00
steve-lad 6ccc9bbccb
Cleaned up messages
Improved message readability. Atom removed extraneous white spaces and lines
2021-04-02 15:23:54 +02:00
steve-lad 2f69bdb3fa
Match to previous commit
Add missing comments
2021-04-02 15:23:54 +02:00
steve-lad 11af87ca38
Remove extraneous calls
Duplicate calls from page.settings removed
2021-04-02 15:23:53 +02:00
steve-lad e4a4630ad2
Installer failed to update db version
Error in sytax at 745, and in exception handler at 747

Tidied up messages

Standardised Exception handler trap

Atom deleted whitespaces
2021-04-02 15:23:53 +02:00
PhantomVl e08e9b49b9
-- Bug Fix NTP Config 2021-04-02 15:23:53 +02:00
PhantomVl 30db2da52d
Fixes: #88
-- Bug Fix SRST Config
-- A template was added for 7975
2021-04-02 15:23:53 +02:00
PhantomVl 7268007ebd
-- Bug Fix SRST Config 2021-04-02 15:23:53 +02:00
PhantomVl 3bf8857759
-- Bug Fix Delete Empty Key 2021-04-02 15:23:53 +02:00
PhantomVl 7b48b289af
Fixes: #77
Fixes: #82
Fixes: #85
Fixes: #87
--- Bugfix sip protocol
Special thanks for help Diederik de Groot
2021-04-02 15:23:53 +02:00
PhantomVl f93b846dc1
--- Add support for setting "setvar=xxx=xxx" entries
--- Writing sccp.conf also check/create sccp_custom.conf #87
--- Fix the getCodec function. #85
--- Switching around the general deny/permit order. #82
--- Thank Josh2893 for the templet #77
Special thanks for help Diederik de Groot
2021-04-02 15:23:53 +02:00
PhantomVl 19e50dd4d9
-- Bug fix @BossLX 2021-04-02 15:23:53 +02:00
PhantomVl 8fc5fca817
-- Bug fix @BossLX 2021-04-02 15:23:53 +02:00
PhantomVl 8dc4f6b07c
-- Bug fix @BossLX 2021-04-02 15:23:52 +02:00
PhantomVl a3c240b63f
-- Bug fix issues/74 2021-04-02 15:23:52 +02:00
PhantomVl 1637731d99
-- Bug fix Thanks for the help @BossLX
-- Bug fix issues/73
2021-04-02 15:23:52 +02:00
PhantomVl 1e0e19cf26
-- Bug fix Thanks for the help @BossLX 2021-04-02 15:23:52 +02:00
PhantomVl 2f1cf6ca74
-- Bug fix 2021-04-02 15:23:52 +02:00
PhantomVl 6c0d37e25a
-- Bug fix
-- DB add field 'videomode'
2021-04-02 15:23:52 +02:00
PhantomVl 6740aab4f2
-- Bug fix
-- DB add field 'videomode'
2021-04-02 15:23:52 +02:00
PhantomVl 347f6f6702
-- Bug fix 2021-04-02 15:23:52 +02:00
PhantomVl 5cebb936c9
-- Bug fix 2021-04-02 15:23:52 +02:00
PhantomVl 14cb629f61
-- Added new features for the future (now disabled)
-- Changed time zone settings
-- Changed the list of supported codecs
-- Added the ability to specify the DNS name as the server interface
-- Bug Fix
-- Add Vendor Config Options
2021-04-02 15:23:51 +02:00
Diederik de Groot 6feed566d5
Fix get_server_sccp_bind when a bindaddr is specified in the frontend it should return an array of array indexed by the 'bindaddr'
Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2021-04-02 15:23:51 +02:00
Diederik de Groot 1afe5c5438
Fix Spelling Sccp_manager.class.php
Switch to using camelCase for functions in Sccp_manager.class.php
Remove old TODO comments
Remove comments that don't add information

Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2021-04-02 15:23:51 +02:00
Diederik de Groot de0a07562f
Ran: .......................................... 42 / 42 (100%)
No fixable errors were found

Time: 10.05 secs; Memory: 41.75MB
Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2021-04-02 15:23:44 +02:00
Diederik de Groot ca16773fa5
First round of spelling corrections
Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2021-04-02 15:23:27 +02:00
PhantomVl 413bcf1b38
-- Added new features for the future (now disabled)
-- Changed time zone settings
-- Changed the list of supported codecs
-- Added the ability to specify the DNS name as the server interface
2021-04-02 15:23:05 +02:00
Phantom 809c11fc0c
Update extconfigs.class.php 2021-04-02 15:23:05 +02:00
Phantom 5586e006c0
Update Sccp.class.php.v433 2021-04-02 15:23:05 +02:00
Phantom 3c7bd16342
Update Sccp.class.php.v431 2021-04-02 15:23:05 +02:00
PhantomVl f855b99bb7
- Fix not Bug 2021-04-02 15:23:05 +02:00
PhantomVl 3b33d83739
- Add Support "Callforward NOANSWER"
- Add Support "park"
2021-04-02 15:23:05 +02:00
PhantomVl c0990954e5
- Bug Fix Sip 2021-04-02 15:23:05 +02:00
PhantomVl 320da7b86f
- Bug Fix. Create addons information 2021-04-02 15:23:05 +02:00
PhantomVl bbe4b72fe7
- Button assignment form adjustment 2021-04-02 15:23:05 +02:00
PhantomVl 8121a69607
- New style of information message 2021-04-02 15:23:04 +02:00
PhantomVl 49aa1f0ecc
- Fix SCCP
- Fix SIP
2021-04-02 15:23:04 +02:00
PhantomVl b6bc649758
- Fix SCCP
- Fix SIP
2021-04-02 15:23:04 +02:00
PhantomVl 1905431be4
- ADD SIP TFTP
- Activate Dial Template
2021-04-02 15:23:04 +02:00
PhantomVl de7633ace7
- ADD SIP TFTP
- Activate Dial Template
2021-04-02 15:23:04 +02:00
PhantomVl f5c5d1f79e
- Change Sccp class driver 2021-04-02 15:23:04 +02:00
PhantomVl 4cd6d7958a
- Change Sccp class driver 2021-04-02 15:23:04 +02:00
PhantomVl 3f7c56a553
- Add Video codecs supported in Global config 2021-04-02 15:23:04 +02:00
PhantomVl 743d61d7eb
- Add Video codecs supported in Global config 2021-04-02 15:23:04 +02:00
PhantomVl 2e88b605bc
- Add Video codecs supported in Global config 2021-04-02 15:23:03 +02:00
PhantomVl 7f0ddf8f69
- Remove sccp_extensions.conf
- Remove sccp_hardware.conf
2021-04-02 15:23:03 +02:00
PhantomVl 180d832042
- Remove sccp_extensions.conf
- Remove sccp_hardware.conf
2021-04-02 15:23:03 +02:00
PhantomVl 8d92da8426
- Remove spaces and special characters from the name Softkey 2021-04-02 15:22:54 +02:00
PhantomVl 81d42b0b25
- Bug Fix 2021-04-02 15:22:30 +02:00
PhantomVl 2146a78e11
- Bug Fix 2021-04-02 15:22:30 +02:00
PhantomVl eac9efb5ee
- Add Buton "Update Buton Labels". If you replace User nams, this functon Regenerate device labels 2021-04-02 15:22:30 +02:00
PhantomVl 2031587f29
- Add Buton "Update Buton Labels". If you replace User nams, this functon Regenerate device labels 2021-04-02 15:22:29 +02:00
PhantomVl 06031ad89c
- Installation procedure, detect chan_sccp 2021-04-02 15:21:44 +02:00
PhantomVl 83ec52ea56
- Bug fix, provision sccp 2021-04-02 15:21:24 +02:00
PhantomVl 597bed3bce
- Create Cisco phone service for user mobility. 2021-04-02 15:20:55 +02:00
PhantomVl 23aad30d89
- Change Db Code page 2021-04-02 15:18:57 +02:00
PhantomVl e40adbaf00
- Change Version 2021-04-02 15:18:57 +02:00
PhantomVl 573a2c9811
Initial add of feature mobility user table:
- Add extra user fields and sccp_config entries
 - Create new buttonconfig table
 - Add PhoneCodepages like cp1251
 - Add BackUp Config before Install
2021-04-02 15:18:55 +02:00
PhantomVl 7582061645
Initial add of feature mobility user table:
- Add extra user fields and sccp_config entries
 - Create new buttonconfig table
 - Add PhoneCodepages like cp1251
 - Add BackUp Config before Install
2021-04-02 15:17:17 +02:00
PhantomVl f4d2396a3c
Initial add of feature mobility user table:
- Add extra user fields and sccp_config entries
 - Create new buttonconfig table
 - Add PhoneCodepages like cp1251
2021-04-02 15:16:33 +02:00
PhantomVl 713d588d98
Initial add of feature mobility user table:
- Add extra user fields and sccp_config entries
 - Create new buttonconfig table
2021-04-02 15:15:58 +02:00
steve-lad 45db467e5d Remove PHP % incompatible code 2021-04-02 13:17:33 +02:00
steve-lad 42717424a2 Update dbinterface.class.php
Correct syntax
2021-03-31 13:38:03 +02:00
steve-lad b79498dcb5 Fix Sccp Button Save
Correct PDO statements and implimentation concept
2021-03-29 16:22:15 +02:00
steve-lad e3116d39cb Update dbinterface.class.php
Check that labels exist before binding or an exception will occur
2021-03-24 08:59:13 +01:00
steve-lad 03dd9bed5a Correct string quoting
String quoting was incompatible with PHP 7
2021-03-23 07:08:36 +01:00
steve-lad 118ff43ec4 Update dbinterface.class.php
Bug fix
2021-03-18 07:12:59 +01:00
steve-lad fe6ff74608 Bug fixes
Correct SQL statement
Correct Message Handler
Correct Message interpreter
2021-03-17 09:48:20 +01:00
steve-lad f560a1e1be Remove tmp nfs files 2021-03-14 14:04:46 +01:00
steve-lad 815e56994b Update install.php
Populate sccpdevmodel if empty
2021-03-13 16:48:41 +01:00
steve-lad c24f6ad8d9 Merge Fix-dbinterface-class 2021-03-13 15:50:45 +01:00
steve-lad fdf6c2ae83 Merge branch 'Fix-dbinterface-class' into Issue-106 2021-03-13 15:50:17 +01:00
steve-lad da9517a335 Apply PR 101 2021-03-13 15:10:24 +01:00
steve-lad 7030ec2bb5 Migrate from global db object
As per FreePBX BMO, no longer use global db object
2021-03-13 14:58:30 +01:00
steve-lad 9ae3638d04 Correct type declarations
type declarations must be lowercase or will be treated as local instance names
2021-03-13 11:35:35 +01:00
steve-lad cc8eb549d0 Fix exception if sccpsettings table does not exist
Before the installer can create sccpsettings, FreePBX instantiates an SCCP_Manager object which requires sccpsettings.
Catch the exception and create the table
2021-03-13 11:21:12 +01:00
steve-lad 0f9ebb8cd1 Tidy up
Remove unused variables
Close socket if not using
2021-03-12 14:40:31 +01:00
steve-lad d5290f18cf Tighten Ami controls
Check that have compatible version of chan-sccp for AMI and disable AMI  if not found
Check returned values
Add new classes for response to reduce testing
2021-03-12 14:03:50 +01:00
steve-lad 2b07718c30 Correct Field and add new event classes
add 2 new event classes for SCCPShowDevice

correct translator in ShowSCCPDevice_Response
2021-02-28 13:33:41 +01:00
steve-lad 6e2101d4fd Tidy up exception handling
Simplify handling of AMI lists and trap exceptions
2021-02-27 10:00:26 +01:00
steve-lad c6c2134e03 Bug Fixes and optimisations as a result of issue 106
Fix bugs in Response Class causing exceptions
Update extconfigs class to correctly check database connectors and improve feedback
Move some constructors to start of class for lisibility
Tidy up Response class with Typing to eliminate unnecessary tests
2021-02-24 15:22:04 +01:00
steve-lad 3362f5a7cf Update dbinterface.class.php 2021-02-11 15:01:57 +01:00
steve-lad 80923f5ce1 Remove dbugs 2021-02-11 12:52:08 +01:00
steve-lad 6bfa311281 Final version
Standardise some calls and add notes
2021-02-11 12:46:37 +01:00
steve-lad 63e5be2cce Merge branch 'Fix-dbinterface-class' of https://github.com/steve-lad/sccp_manager into Fix-dbinterface-class 2021-02-11 12:41:05 +01:00
steve-lad 73ea3023eb Use bindParam on db executes
Use bind param to have stricter typing

Fix bug in Sccp-Manager where key and keyword were not the same
2021-02-09 12:48:22 +01:00
steve-lad 7d7b8cdd05 Update Transactions and fix errors
Reduce quoting level, and fix errors introduced by prior commits
2021-02-09 12:48:22 +01:00
steve-lad 124f7052eb Further clean ups and annotations
Document changes
2021-02-09 12:48:22 +01:00
steve-lad 22a4eb6e9e Cleaning up
Simplify structure and fix errors
2021-02-09 12:45:37 +01:00
steve-lad 5e5633ed7b Switch to PDO model
Switch to PDO model and correct transactions
2021-02-09 12:45:37 +01:00
steve-lad 7993eec487 Test for chan_sccp_b version compatibility
SoftKeySets fails with chan_sccp-b prior to revision number 11048.

Check the version with the installer, and subsequently to ensure do not get exception.
2021-02-09 12:45:36 +01:00
steve-lad b3d31b669a Fix assignment sccp_compatible
Sccpvalues key and keyword must be same or causes hidden DB warnings because of duplicate primary keys after write / read / write
2021-02-09 12:43:26 +01:00
steve-lad 175346c2c1 Use bindParam on db executes
Use bind param to have stricter typing

Fix bug in Sccp-Manager where key and keyword were not the same
2021-02-09 12:31:06 +01:00
steve-lad 89d4e45f5e Update Transactions and fix errors
Reduce quoting level, and fix errors introduced by prior commits
2021-02-08 17:41:19 +01:00
steve-lad 6664ab97af Further clean ups and annotations
Document changes
2021-02-08 15:27:35 +01:00
steve-lad 1972e53eef Merge branch 'Fix-dbinterface-class' of https://github.com/steve-lad/sccp_manager into Fix-dbinterface-class 2021-02-08 10:24:02 +01:00
steve-lad 22e1939ace Cleaning up
Simplify structure and fix errors
2021-02-07 16:09:35 +01:00
steve-lad c104b0e8fe Switch to PDO model
Switch to PDO model and correct transactions
2021-02-07 15:02:45 +01:00
steve-lad c1fb9370bd Test for chan_sccp_b version compatibility
SoftKeySets fails with chan_sccp-b prior to revision number 11048.

Check the version with the installer, and subsequently to ensure do not get exception.
2021-02-07 14:48:49 +01:00
steve-lad 14199fca2e Switch to PDO model
Switch to PDO model and correct transactions
2021-02-06 17:26:37 +01:00
Phantom 2f854e7273
Merge pull request #93 from andreadiotta/fix_chan-sccp_version_detect
Fixed recognition of chan-sccp release version 4.3.3
2021-02-05 12:15:14 +03:00
Phantom 2c28342286
Merge pull request #98 from steve-lad/Fix-SoftKeys
Fix soft keys
2021-02-05 12:14:07 +03:00
Phantom c0cf0b15d7
Merge pull request #97 from steve-lad/Update-AMI-getRealTimeStatus
Update ami get real time status
2021-02-05 12:10:59 +03:00
Phantom e31b4bf993
Merge pull request #95 from steve-lad/Improve-Page-Performance
Improve page performance
2021-02-05 12:09:55 +03:00
Phantom 30ba68d03e
Merge pull request #99 from steve-lad/Fix-Installer
Installer failed to update db version
2021-02-04 14:29:59 +03:00
steve-lad d26fbd719d Installer failed to update db version
Error in sytax at 745, and in exception handler at 747

Tidied up messages

Standardised Exception handler trap

Atom deleted whitespaces
2021-02-02 10:15:18 +01:00
steve-lad 26d9554c05 Updated GenericResponse
Updated generic response handler for table case
2021-01-28 11:54:27 +01:00
steve-lad c929649909 Update AMI Response
Bring branch up to level of previous Pull which can now be deleted
2021-01-28 11:18:48 +01:00
steve-lad 48041fc62c Cleaned up messages
Improved message readability. Atom removed extraneous white spaces and lines
2021-01-28 10:25:02 +01:00
steve-lad d5c8cc9ab2 Match to previous commit
Add missing comments
2021-01-28 10:00:10 +01:00
steve-lad 80fbf7b1b4 Remove extraneous calls
Duplicate calls from page.settings removed
2021-01-28 08:11:21 +01:00
Andrea Diotallevi 64e4c3d86b Fixed recognition of chan-sccp release version 4.3.3 2021-01-17 15:33:00 +01:00
PhantomVl 4eb816985e -- Bug Fix NTP Config 2020-11-17 09:34:11 +03:00
PhantomVl 5cf3f7f324 Fixes: #88
-- Bug Fix SRST Config
-- A template was added for 7975
2020-11-16 22:58:44 +03:00
PhantomVl adc46b84c2 -- Bug Fix SRST Config 2020-11-16 22:43:21 +03:00
PhantomVl 4c49a036f8 -- Bug Fix Delete Empty Key 2020-11-16 10:33:18 +03:00
PhantomVl 21a5472f4a Fixes: #77
Fixes: #82
Fixes: #85
Fixes: #87
--- Bugfix sip protocol
Special thanks for help Diederik de Groot
2020-11-15 18:37:51 +03:00
PhantomVl ab6b45350e --- Add support for setting "setvar=xxx=xxx" entries
--- Writing sccp.conf also check/create sccp_custom.conf #87
--- Fix the getCodec function. #85
--- Switching around the general deny/permit order. #82
--- Thank Josh2893 for the templet #77
Special thanks for help Diederik de Groot
2020-11-11 15:16:41 +03:00
PhantomVl 932aae5cfd -- Bug fix @BossLX 2020-05-05 16:08:49 +03:00
PhantomVl 52a3c91f7a -- Bug fix @BossLX 2020-05-05 15:16:23 +03:00
PhantomVl 9bb381c13a -- Bug fix @BossLX 2020-05-05 12:50:01 +03:00
PhantomVl dc94cf6d33 -- Bug fix issues/74 2020-05-04 16:29:45 +03:00
PhantomVl a1686b86e6 -- Bug fix Thanks for the help @BossLX
-- Bug fix issues/73
2020-05-04 12:39:13 +03:00
PhantomVl f23f8a511c -- Bug fix Thanks for the help @BossLX 2020-05-04 12:13:01 +03:00
PhantomVl c12cfad751 -- Bug fix 2020-04-30 14:15:24 +03:00
PhantomVl e8e49a357d -- Bug fix
-- DB add field 'videomode'
2020-04-22 14:01:26 +03:00
PhantomVl 5be35cc0ae -- Bug fix
-- DB add field 'videomode'
2020-04-21 22:51:43 +03:00
PhantomVl 86891c3751 -- Bug fix 2020-04-21 14:44:56 +03:00
PhantomVl 7bce73092f -- Bug fix 2020-04-21 13:51:10 +03:00
PhantomVl 2d57895fc1 -- Added new features for the future (now disabled)
-- Changed time zone settings
-- Changed the list of supported codecs
-- Added the ability to specify the DNS name as the server interface
-- Bug Fix
-- Add Vendor Config Options
2020-04-16 20:35:50 +03:00
Phantom 363bfbc658
Merge pull request #69 from dkgroot/refactor_spelling
(WIP) Refactor: Spelling / PSR2 / Rename / camelCase Functions (WIP)
2020-04-09 17:54:46 +03:00
Diederik de Groot 95d0c80b8e Fix get_server_sccp_bind when a bindaddr is specified in the frontend it should return an array of array indexed by the 'bindaddr'
Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2020-04-09 11:10:42 +00:00
Diederik de Groot 99aa4971c4 Fix Spelling Sccp_manager.class.php
Switch to using camelCase for functions in Sccp_manager.class.php
Remove old TODO comments
Remove comments that don't add information

Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2020-04-09 10:16:15 +00:00
Diederik de Groot 2db4cd3dc2 Ran: .......................................... 42 / 42 (100%)
No fixable errors were found

Time: 10.05 secs; Memory: 41.75MB
Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2020-04-09 09:25:43 +00:00
Diederik de Groot ccd514dbd9 First round of spelling corrections
Signed-off-by: Diederik de Groot <dkgroot@talon.nl>
2020-04-09 09:24:02 +00:00
PhantomVl 5e0b2605e3 -- Added new features for the future (now disabled)
-- Changed time zone settings
-- Changed the list of supported codecs
-- Added the ability to specify the DNS name as the server interface
2020-04-07 17:53:47 +03:00
Phantom 3201b4152c
Update extconfigs.class.php 2020-03-05 17:32:05 +03:00
Phantom 668ed964b8
Update Sccp.class.php.v433 2020-03-03 13:58:40 +03:00
Phantom 66e162a13e
Update Sccp.class.php.v431 2020-03-03 13:57:40 +03:00
PhantomVl 772de6bf66 - Fix not Bug 2019-11-15 10:39:57 +03:00
PhantomVl 57b73781dc - Add Support "Callforward NOANSWER"
- Add Support "park"
2019-11-14 17:10:14 +03:00
PhantomVl 6e00f1fba5 - Bug Fix Sip 2019-11-14 14:30:03 +03:00
PhantomVl e2761e5bdd - Bug Fix. Create addons information 2019-10-14 18:01:16 +03:00
PhantomVl 2faf6e1200 - Button assignment form adjustment 2019-09-27 14:44:56 +03:00
PhantomVl 91d3fe1558 - New style of information message 2019-09-25 13:27:43 +03:00
PhantomVl e4e720a182 - Fix SCCP
- Fix SIP
2019-09-25 11:10:51 +03:00
PhantomVl 859d15e140 - Fix SCCP
- Fix SIP
2019-09-20 19:43:18 +03:00
PhantomVl ca45965534 - ADD SIP TFTP
- Activate Dial Template
2019-09-09 17:26:09 +03:00
PhantomVl f75a486701 - ADD SIP TFTP
- Activate Dial Template
2019-08-21 18:00:57 +03:00
PhantomVl f98e7fb774 - Change Sccp class driver 2019-08-06 11:18:27 +03:00
PhantomVl 197eb8f1fa - Change Sccp class driver 2019-07-19 11:11:00 +03:00
PhantomVl e7270846af - Add Video codecs supported in Global config 2019-07-11 10:59:53 +03:00
PhantomVl 633e67285f - Add Video codecs supported in Global config 2019-07-10 20:53:00 +03:00
PhantomVl 2bca6e4d8d - Add Video codecs supported in Global config 2019-07-10 20:52:50 +03:00
PhantomVl c09cbc3aae - Remove sccp_extensions.conf
- Remove sccp_hardware.conf
2019-07-08 15:50:44 +03:00
PhantomVl 96c9a82819 - Remove sccp_extensions.conf
- Remove sccp_hardware.conf
2019-07-08 15:47:08 +03:00
PhantomVl a8af9a32fc - Remove sccp_extensions.conf
- Remove sccp_hardware.conf
2019-07-08 15:43:18 +03:00
PhantomVl 898240e1d4 - Remove spaces and special characters from the name Softkey 2019-05-29 20:49:50 +03:00
PhantomVl aadd1deb5b - Remove spaces and special characters from the name Softkey 2019-05-29 20:47:15 +03:00
PhantomVl cf54bb400a - Bug Fix 2019-05-22 08:47:28 +03:00
PhantomVl 8bfc08beaa - Bug Fix 2019-05-18 11:34:32 +03:00
PhantomVl 14ff3d74c2 - Add Buton "Update Buton Labels". If you replace User nams, this functon Regenerate device labels 2019-05-07 11:12:39 +03:00
PhantomVl fd57b885e6 - Add Buton "Update Buton Labels". If you replace User nams, this functon Regenerate device labels 2019-05-06 18:22:19 +03:00
PhantomVl d3aa9b7388 - Installation procedure, detect chan_sccp 2019-04-26 10:17:09 +03:00
Phantom f9bd447869
Merge pull request #36 from dkgroot/develop
Fix links in README.md / READMe.ru.md
2019-04-26 10:10:36 +03:00
PhantomVl 6e81e98dbb - Installation procedure, detect chan_sccp 2019-04-26 09:46:55 +03:00
Diederik de Groot 8b8778f746 Fix links in README.md / READMe.ru.md 2019-04-25 16:42:46 +02:00
PhantomVl c23a697234 - Installation procedure, detect chan_sccp 2019-04-24 20:31:38 +03:00
PhantomVl 47f92a0c53 - Bug fix, provision sccp 2019-04-24 13:38:51 +03:00
PhantomVl 83169b5160 - Bug fix, provision sccp 2019-04-23 14:11:20 +03:00
PhantomVl 8d8d45d2d9 - Create Cisco phone service for user mobility. 2019-04-23 13:32:52 +03:00
PhantomVl ce3bee1341 - Change Db Code page 2019-04-08 16:46:18 +03:00
PhantomVl c8182b6f8e - Change Db Code page 2019-04-02 15:00:38 +03:00
PhantomVl 510935134b - Change Version 2019-04-02 14:57:57 +03:00
PhantomVl 3daa41135f - Bugfix
- Add Code Page
 - update install
2019-04-02 14:52:23 +03:00
PhantomVl a943aa4b96 - Bugfix
- Add Code Page
2019-04-01 14:11:42 +03:00
PhantomVl c38d42db98 Bugfix 2019-04-01 13:20:15 +03:00
PhantomVl c5004e780d Initial add of feature mobility user table:
- Add extra user fields and sccp_config entries
 - Create new buttonconfig table
 - Add PhoneCodepages like cp1251
 - Add BackUp Config before Install
2019-04-01 09:33:13 +03:00
PhantomVl d6dc2a2071 Initial add of feature mobility user table:
- Add extra user fields and sccp_config entries
 - Create new buttonconfig table
 - Add PhoneCodepages like cp1251
 - Add BackUp Config before Install
2019-03-25 18:16:17 +03:00
PhantomVl f686274189 Initial add of feature mobility user table:
- Add extra user fields and sccp_config entries
 - Create new buttonconfig table
 - Add PhoneCodepages like cp1251
2019-03-25 16:55:44 +03:00
PhantomVl c2b97fe3ee Initial add of feature mobility user table:
- Add extra user fields and sccp_config entries
 - Create new buttonconfig table
2019-03-25 15:25:51 +03:00
95 changed files with 17540 additions and 13556 deletions

BIN
.dok/image/sip_model.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

126
README.md
View file

@ -1,59 +1,56 @@
## Welcome to Develop Chan_SCCP GUI Manager for FreePBX
| [English](README.md) | [Russian](README.ru.md) | [OLD Stable Release](https://github.com/PhantomVl/sccp_manager/tree/master)
| [English :gb:/:us:](README.md) | [Russian :ru:](README.ru.md) | [Previous Stable Releases](https://github.com/PhantomVl/sccp_manager/tree/master)
![Gif](https://github.com/PhantomVl/sccp_manager/raw/develop/.dok/image/Demo_1s5.gif)
![Gif](https://github.com/chan-sccp/sccp_manager/raw/develop/.dok/image/Demo_1s5.gif)
* [Installation](https://github.com/chan-sccp/sccp_manager#installation)
* [Prerequisites](https://github.com/chan-sccp/sccp_manager#prerequisites)
* [Links](https://github.com/chan-sccp/sccp_manager#link)
* [Wiki](https://github.com/chan-sccp/sccp_manager/wiki)
* [Installation](https://github.com/PhantomVl/sccp_manager#installation)
* [Prerequisites](https://github.com/PhantomVl/sccp_manager#prerequisites)
* [Links](https://github.com/PhantomVl/sccp_manager#link)
* [Wiki](https://github.com/PhantomVl/sccp_manager/wiki)
## Link
[![Download Sccp-Mamager](https://img.shields.io/badge/SccpGUI-build-ff69b4.svg)](https://github.com/PhantomVl/sccp_manager/archive/master.zip)
[![Download Sccp-Mamager](https://img.shields.io/badge/SccpGUI-build-ff69b4.svg)](https://github.com/chan-sccp/sccp_manager/archive/tarball/develop)
[![Download Chan-SCCP channel driver for Asterisk](https://img.shields.io/sourceforge/dt/chan-sccp-b.svg)](https://github.com/chan-sccp/chan-sccp/releases/latest)
[![Chan-SCCP Documentation] (https://img.shields.io/badge/docs-wiki-blue.svg)](https://github.com/chan-sccp/chan-sccp/wiki)
[![Chan-SCCP Documentation](https://img.shields.io/badge/docs-wiki-blue.svg)](https://github.com/chan-sccp/chan-sccp/wiki)
This FreePBX module has been developed to help IT Staff with their Asterisk-Cisco infrastructure deployment,
providing easy provisioning and management of Cisco IP phones and extensions in a similar way to Cisco CallManager.
The idea of creating a module is borrowed from (https://github.com/Cynjut/SCCP_Manager), and was further developed and managed
by PhantomVl (https://github.com/PhantomVl/sccp_manager) who has been unavailable for some time. sccp_manager relies heavily
on chan-sccp, so having the same repository will help improve integration.
This module has been developed to help IT Staff with their Asterisk-Cisco infrastructure deployment,
providing easily provisioning and managing Cisco IP phones and extensions in a similar way as it does with Cisco CallManager.
The idea of creating a module is borrowed from (https://github.com/Cynjut/SCCP_Manager)
SCCP Manager is free software. Please see the file COPYING for details.
This module has been developed to help IT Staff with their Asterisk-Cisco infrastructure deployment,
providing easily provisioning and managing Cisco IP phones and extensions in a similar way as it does with Cisco CallManager.
This module will suit you if you are planing the to migrate from CallManager to Asterisk (or did it), SCCP-Manager allows you to administer SCCP extensions and a wide range of Cisco phone types (including IP Communicator).
This module will suit you if you are planing the to migrate from CallManager to Asterisk (or have already done it). SCCP-Manager allows you to administer
SCCP extensions and a wide range of Cisco phone types (including IP Communicator).
You can control phone buttons (depending on the phone model) assigning multiple lines, speeddials and BLFs.
And you can use the driver functions "sccp_chain" from the GUI module.
### Wiki
You can find more information and documentation on our [![SCCP Manager Wiki](https://img.shields.io/badge/Wiki-new-blue.svg)](https://github.com/PhantomVl/sccp_manager/wiki)
You can find more information and documentation on our [![SCCP Manager Wiki](https://img.shields.io/badge/Wiki-new-blue.svg)](https://github.com/chan-sccp/wiki)
## Prerequisites
Make sure you have the following installed on your system:
- c-compiler:
- gcc >= 4.4 (note: older not supported, higher advised)
- clang >= 3.6 (note: older not supported, higher advised)
- gnu make
- pbx:
- asterisk >= 1.8 (absolute minimum & not recomended)
- asterisk >= 13.7 or asterisk >= 14.0 recommended
- gui:
- freepbx >= 13.0.192
- standard posix compatible applications like sed, awk, tr
- a working version of [chan-sccp](https://github.com/chan-sccp/chan-sccp)
- PHPx.x-zip has to be installed (where x.x is the installed version of PHP).
For example, on Debian, using PHP7.3
```
apt-get install PHP7.3-zip
```
### Requirements
- Chan_SCCP module 4.3.1 (or later) channel driver for Asterisk: [See our WIKI] (https://github.com/chan-sccp/chan-sccp/wiki/Building-and-Installation-Guide)
- expected configure flags:
```./configure --enable-conference --enable-advanced-functions --enable-distributed-devicestate```
- Creating mysql DB from sorce
```mysql -u root asterisk < mysql-v5_enum.sql```
- chan-sccp module 4.3.4 (or later) channel driver for Asterisk: [See our WIKI](https://github.com/chan-sccp/chan-sccp/wiki/Building-and-Installation-Guide)
- sccp_manager expects these configure flags to be set during compilation:
```./configure --enable-conference --enable-advanced-functions --enable-distributed-devicestate --enable-video```
- TFTP Server running under (recomended) /tftpboot/ [See our WIKI] (https://github.com/chan-sccp/chan-sccp/wiki/setup-tftp-service)
- You will need the phone settings templates. You can use the templates taken from the distribution "chan-sccp"
- TFTP Server running under (recommended) /tftpboot/ [See our WIKI] (https://github.com/chan-sccp/chan-sccp/wiki/setup-tftp-service)
- You will need the phone settings templates. You can use the templates taken from the distribution "chan-sccp"
```cp /usr/src/chan-sccp/conf/tftp/\*.xml\* /tftpboot/templates/```
- configure DHCP server [See our WIKI] (https://github.com/chan-sccp/chan-sccp/wiki/setup-dhcp-service)
- configure DHCP server [See our WIKI](https://github.com/chan-sccp/chan-sccp/wiki/setup-dhcp-service)
Important!
@ -65,33 +62,60 @@ Make sure you have the following installed on your system:
## Installation
1. Download module into your local system. (/var/www/html/admin/modules/)
2. Goto FreePBX Admin -> Module Admin.
How to install sccp_manager
-----
1. Log in to FreePBX
2. Go to Admin -> Module Admin
3. Click Upload Modules.
4. Browse to the location of the module on your computer and select Upload.
5. Click Manage Local Modules.
6. Find and click SCCP Manager. Check Install. Click Process button.
7. Confirm installation.
8. Close Status window.
9. Apply Config to FreePBX.
4. Enter one of the following urls:
Stable - Version 14.3.
This is the latest version of sccp_manager and has many bug fixes. It is targetted for FreePbx 16 and as such requires PHP > 7.3. It works fine with FreePbx 15 as long as you can upgrade PHP (this cannot be done if you use commercial modules). There are changes to the database structure, and so this cannot be easily reverted to prior versions without using a backup, which the installer will create. If you are using a VM, it is recommended to take a snapshot before upgrading.
Upgrades via FreePbx module admin are enabled in this release, but do not work because of a FreePbx issue (a patch has been posted). To workaround this, if you see that an upgrade is available, you can download it via the command line console which is unaffected by this issue
```
fwconsole ma upgrade sccp_manager
```
```
https://github.com/chan-sccp/sccp_manager/archive/refs/tags/14.3.0.13.zip
```
Stable (For PHP < 7 only)
```
https://github.com/chan-sccp/sccp_manager/archive/refs/tags/v14.2.0.11.zip
```
Develop.
This version can be updated through module admin as modifications are made (pending fix by FreePbx)
_This is development software and so may have issues_
```
https://github.com/chan-sccp/sccp_manager/archive/refs/heads/develop.zip
```
5. Click Download From Web.
6. Click Manage Local Modules.
7. Find and click SCCP Manager. Check Install. Click Process button.
8. Confirm installation.
9. Close Status window.
10. Apply Config to FreePBX.
11. Continue to [Using-SCCP_Manager-to-Manage-chan-sccp](https://github.com/chan-sccp/chan-sccp/wiki/Using-SCCP_Manager-to-Manage-chan-sccp)
### Module update to latest state
1. Goto to module into your local system. (/var/www/html/admin/modules/sccp_manager/)
> cd /var/www/html/admin/modules/sccp_manager/
> git fetch
> git pull
> git checkout develop
If you installed any version >14.3.0.13, the module can be updated to the latest version via FreePBX. The GUI version FreePBX -> Admin -> Module Admin currently has a reported bug, but the upgrade can be made via the command line using
```
fwconsole ma upgrade sccp_manager
```
### IMPORTANT NOTES:
- !!! If something stops working, use the master branch [master](https://github.com/PhantomVl/sccp_manager/tree/master)
!!! master branch does not support changes into chan-sccp made after October 2018.
- This system assumes/requires that you are using the Asterisk realtime database. If you are not yet using the realtime database,
### IMPORTANT NOTES:
- If something stops working, use the Stable branch as described in [Installation](https://github.com/chan-sccp/sccp_manager#installation)
- This system assumes/requires that you are using the Asterisk realtime database. If you are not yet using the realtime database,
you will have to set it up for this module to work ([See](https://github.com/chan-sccp/chan-sccp/wiki/Realtime-Configuration)).
- For the cisco phones to work correctly, they should be provisioned with the latest firmware (v8.1 or higher)
- You can use cisco language profiles (localization) to switch the phones to your locale.
### Chat
[![Gitter](https://badges.gitter.im/chan-sccp/chan-sccp.svg)](https://gitter.im/sccp_manager/community)

View file

@ -1,96 +1,118 @@
## Welcome to Develop Chan_SCCP GUI Manager for FreePBX
| [English](README.md) | [Russian](README.ru.md) | [OLD Stable Release](https://github.com/PhantomVl/sccp_manager/tree/master)
## Добро пожаловать странник на SCCP страницу веб интерфейса для FreePBX (SCCP Manager)
| [English :gb:/:us:](README.md) | [Russian :ru:](README.ru.md) | [Старая страница проекта](https://github.com/PhantomVl/sccp_manager/tree/master)
![Gif](https://github.com/PhantomVl/sccp_manager/raw/develop/.dok/image/Demo_1s5.gif)
![Gif](https://github.com/chan-sccp/sccp_manager/raw/develop/.dok/image/Demo_1s5.gif)
* [Installation](https://github.com/chan-sccp/sccp_manager#installation)
* [Prerequisites](https://github.com/chan-sccp/sccp_manager#prerequisites)
* [Links](https://github.com/chan-sccp/sccp_manager#link)
* [Wiki](https://github.com/chan-sccp/sccp_manager/wiki)
* [Installation](https://github.com/PhantomVl/sccp_manager#installation)
* [Prerequisites](https://github.com/PhantomVl/sccp_manager#prerequisites)
* [Links](https://github.com/PhantomVl/sccp_manager#link)
* [Wiki](https://github.com/PhantomVl/sccp_manager/wiki)
## Link
[![Download Sccp-Mamager](https://img.shields.io/badge/SccpGUI-build-ff69b4.svg)](https://github.com/PhantomVl/sccp_manager/archive/master.zip)и традиционно добалены новые баги
[![Download Sccp-Mamager](https://img.shields.io/badge/SccpGUI-build-ff69b4.svg)](https://github.com/chan-sccp/sccp_manager/archive/tarball/develop)
[![Download Chan-SCCP channel driver for Asterisk](https://img.shields.io/sourceforge/dt/chan-sccp-b.svg)](https://github.com/chan-sccp/chan-sccp/releases/latest)
[![Chan-SCCP Documentation] (https://img.shields.io/badge/docs-wiki-blue.svg)](https://github.com/chan-sccp/chan-sccp/wiki)
[![Chan-SCCP Documentation](https://img.shields.io/badge/docs-wiki-blue.svg)](https://github.com/chan-sccp/chan-sccp/wiki)
### История
Корни идея создания этого проекта лежат в несовершенстве уже существующего и заброшенного проекта.
Для желающих попробовать себя на просторах программирования ссылка на проект (https://github.com/Cynjut/SCCP_Manager).
.... давнем давно в далеком прошлом ....
Группа программистов пыталось быстро бороться с несовершенством продуктов CISCO, но повседневные дела угробили проект.
Но на помощь им пришел молодой программист и возродил идею уже заброшенного проекта.
Для желающих попробовать себя в этой борьбе на просторах программирования ссылка на проект (https://github.com/Cynjut/SCCP_Manager).
### Кому это надо...
Ну в первую очередь для себя, а заодно и для тех у кого есть куча телефонного хлама от компании Cisco.
Ну в первую очередь для Себя любимого ну и для тех, у кого есть куча телефонного хлама от компании Cisco.
Если вы планируете использовать Aserisk + FreePBX, то я надеюсь, что данный модуль существенно упростит управление и настройки телефонами от Cisco.
В интернете, существует замечательный проект (IMHO) который интегрирует проприетарный протокол Cisco в Asterisk, конечно он пока далек от идеала,
В интернете существует замечательный проект (IMHO), который интегрирует проприетарный протокол Cisco в Asterisk, конечно, он пока далек от идеала,
но все же это замечательная замена серверам CCME, СCM, СUСM !
Ну я совершенно не представляю себе, сколько времени данный проект будет поддерживаться.
### Если ты еще с нами ...
### Ну если ты еще с нами ...
Как я говорил выше, это дополнение к (Aserisk + FreePBX), но нам еще потребуется :
Как я говорил выше, это дополнение к (Aserisk + FreePBX), но нам еще потребуется:
1. У меня не получилось поставить добиться работы с дисками Aserisk и FreePBX - собираем из исходников
1.1. Замечательная копания freepbx. Теперь с SNG7-PBX-64bit-1805 все работает !
1.1. Замечательная копания freepbx. Теперь с SNG7-PBX-64bit-... все работает!
2. Mysql (Maria)
3. Драйвер протокола SCCP страница (https://github.com/chan-sccp/chan-sccp/)
4. Ну и этот модуль.
4. Этот модуль.
5. Руки
6. Возможно еще несколько проектов
### Вжно! В этой ветке лежат самые последне нововведения и обновления, и самые последние БАГИ !
Пользуйся и наслождайся. Так же не забывай писать нам об ошибках, которые ты нашел !
Это очень нам поможет, Я с радостью исправлю то что ты нашел и добалю новых.
### Вжно! В этой ветке лежат самые последне нововведения и обновления, и самые последние БАГИ!
Пользуйся и наслождайся. Так же не забывай писать нам об ошибках, которые ты нашел!
Это очень нам поможет, Я с радостью исправлю то, что ты нашел и добалю новых.
### Wiki - Основные Инструкции по настройке
Вся документация лежит на Вики [![SCCP Manager Wiki](https://img.shields.io/badge/Wiki-new-blue.svg)](https://github.com/PhantomVl/sccp_manager/wiki)
Вся документация по проекту пока лежит на старой Вики [![SCCP Manager Wiki](https://img.shields.io/badge/Wiki-new-blue.svg)](https://github.com/PhantomVl/sccp_manager/wiki)
Вся документация по драйверу Chan-SCCP [![SCCP Manager Wiki](https://img.shields.io/badge/Wiki-new-blue.svg)](https://github.com/chan-sccp/wiki)
Ну и как водится у на SCCP Manager это бесплатное дополнение. И помни "(C)" означает "Копия верна". Please see the file COPYING for details.
### Prerequisites - как говориться все, что хуже этого возможно работать тоже будет .... но только вопрос как ?
Make sure you have the following installed on your system:
- c-compiler: (мне то он не нужен, но как собирать все остальное ?)
- gcc >= 4.4 (note: older not supported, higher advised)
- clang >= 3.6 (note: older not supported, higher advised)
- gnu make
- PHPx.x-zip has to be installed (where x.x is the installed version of PHP).
For example, on Debian, using PHP7.3
- pbx:
- asterisk >= 1.8 (absolute minimum & not recomended)
- asterisk >= 1.8 (absolute minimum & not recommended)
- asterisk >= 13.7 or asterisk >= 14.0 or asterisk >= 15.0 (Тестировалось на стендах)
- gui:
- freepbx >= 13.0.192 (http://wiki.freepbx.org/display/FOP/Install+FreePBX)
- standard posix compatible applications like sed, awk, tr
- a working version of [chan-sccp](https://github.com/chan-sccp/chan-sccp)
- PHPx.x Ну тут уж как повезет, 5.6 от freepbx, но мы уже пишем под PHP7.3
```
apt-get install PHP7.3-zip
```
### Installation Очень короткая инструкция
###### [Полная версия инструкции] (https://github.com/PhantomVl/sccp_manager/wiki/step-by-step-instlation)
- Chan_SCCP module 4.3.1 (or later) [See our WIKI] (https://github.com/chan-sccp/chan-sccp/wiki/Building-and-Installation-Guide)
> git clone https://github.com/chan-sccp/chan-sccp.git
> git checkout develop
- открой полную инструкцию [Полная версия инструкции] (https://github.com/PhantomVl/sccp_manager/wiki/step-by-step-instlation)
- Собираем с флагами и создаем БД для работы:
> ./configure --enable-conference --enable-advanced-functions --enable-distributed-devicestate
> mysql -u root asterisk < mysql-v5_enum.sql
### Installation Другие инструкции по установке :-)
- [Setting up a FreePBX system](http://wiki.freepbx.org/display/FOP/Install+FreePBX)
- [Setting up Chan-Sccp](https://github.com/chan-sccp/chan-sccp/wiki/How-to-setup-the-chan_sccp-Module)
- [See chan-sccp wiki](https://github.com/chan-sccp/chan-sccp/wiki/Realtime-Configuration).
- Настраиваем TFTP Server, он нужен для телефонов /tftpboot/ [See our WIKI] (https://github.com/chan-sccp/chan-sccp/wiki/setup-tftp-service)
- Настраиваем DHCP serve, как ни странно он тоже нужен [See our WIKI] (https://github.com/chan-sccp/chan-sccp/wiki/setup-dhcp-service)
- Установка модуля
> cd /var/www/html/admin/modules/
> git clone https://github.com/PhantomVl/sccp_manager.git
> cd /var/www/html/admin/modules/sccp_manager/
> git checkout develop
> amportal chown
> amportal a ma install sccp_manager
- Настройка модуля
1. Открываем "SCCP Connectivity" -> "Server Config" и делаем все, что вам нужно.
2. Жмем "Сохранить" ..... И Все ! Дальше настройки в рамках концепции Freepbx.
## Установка в Веб морде
- Обновление модуля
> cd /var/www/html/admin/modules/sccp_manager/
> git fetch
> git pull
> git checkout develop
-----
1. Log in to FreePBX
2. Go to Admin -> Module Admin
3. Click Upload Modules.
4. Enter one of the following urls:
Мы решили, что это стабильная версия:
```
https://github.com/chan-sccp/sccp_manager/archive/refs/heads/Legacy.zip
```
Для тех, кто ищет нового и интересного:
_This is development software and so may have issues_
```
https://github.com/chan-sccp/sccp_manager/archive/refs/heads/develop.zip
```
5. Жми Download From Web.
6. Открывай Manage Local Modules.
7. Практически в конце списка "SCCP Manager". Тут и так понятно, выбрать "Install", и нажать "Process".
8. "Confirm installation".
9. "Close" Status window.
10. Красная кнопка "Apply" в правом верхнем углу.
11. Далее вопрос ни одного научного труда [Using-SCCP_Manager-to-Manage-chan-sccp](https://github.com/chan-sccp/chan-sccp/wiki/Using-SCCP_Manager-to-Manage-chan-sccp)
### Важно:
- !!! Если это это проект не заработал на твоей системе - переключись на ветку мастер [master](https://github.com/PhantomVl/sccp_manager/tree/master)
- !!! Если это это проект не заработал на твоей системе - переключись на ветку мастер [master](https://github.com/PhantomVl/sccp_manager)
!!! Но есть ограничение - ветка master не поддерживает изменения в chan-sccp сделаные после октября 2018 г.
- И чуть не забыл настраиваем Realtime-Configuration ([See](https://github.com/chan-sccp/chan-sccp/wiki/Realtime-Configuration)).
- Желательно иметь Firmware телефонов Cisco, языковые пакеты ну всякое разное.
- Возможно, ты найдешь, то что ищешь, в проекте (https://github.com/dkgroot/provision_sccp)
- Возможно, ты найдешь, то, что ищешь, в проекте (https://github.com/dkgroot/provision_sccp)
- Если что-то не так [Wiki GUI] (https://github.com/PhantomVl/sccp_manager), [Wiki chan-sccp] (https://github.com/chan-sccp/chan-sccp/wiki),
[Wiki FreePbx] (https://wiki.freepbx.org/display/FOP/Install+FreePBX)
### Chat
[![Gitter](https://badges.gitter.im/chan-sccp/chan-sccp.svg)](https://gitter.im/sccp_manager/community)

File diff suppressed because it is too large Load diff

View file

@ -1,263 +0,0 @@
<?php
/**
*
* Core Comsnd Interface
*
*
*/
namespace FreePBX\modules\Sccp_manager;
class dbinterface {
private $val_null = 'NONE'; /// REPLACE to null Field
public function __construct($parent_class = null) {
$this->paren_class = $parent_class;
}
public function info() {
$Ver = '13.0.2';
return Array('Version' => $Ver,
'about' => 'Data access interface ver: ' . $Ver);
}
/*
* Core Access Function
*/
public function get_db_SccpTableData($dataid, $data = array()) {
if ($dataid == '') {
return False;
}
switch ($dataid) {
case "SccpExtension":
if (empty($data['name'])) {
$sql = "SELECT * FROM `sccpline` ORDER BY `name`";
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
} else {
$sql = "SELECT * FROM `sccpline` WHERE `name`=" . $data['name'];
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
}
break;
case "SccpDevice":
// $sql = "SELECT * FROM `sccpdeviceconfig` ORDER BY `name`";
$sql = "select `name`,`name` as `mac`, `type`, `button`, `addon` from `sccpdeviceconfig` ORDER BY `name`";
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
break;
case "HWDevice":
$raw_settings = $this->getDb_model_info($get = "phones", $format_list = "model");
break;
case "HWextension":
$raw_settings = $this->getDb_model_info($get = "extension", $format_list = "model");
break;
case "get_colums_sccpdevice":
$sql = "DESCRIBE sccpdevice";
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
break;
case "get_sccpdevice_byid":
$sql = 'SELECT t1.*, types.dns, types.buttons, types.loadimage, types.nametemplate as nametemplate, '
. 'addon.buttons as addon_buttons FROM sccpdevice AS t1 '
. 'LEFT JOIN sccpdevmodel as types ON t1.type=types.model '
. 'LEFT JOIN sccpdevmodel as addon ON t1.addon=addon.model WHERE name="' . $data['id'] . '";';
$raw_settings = sql($sql, "getRow", DB_FETCHMODE_ASSOC);
break;
case "get_sccpdevice_buttons":
$sql = 'SELECT * FROM buttonconfig WHERE device="' . $data['id'] . '";';
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
break;
}
return $raw_settings;
}
public function get_db_SccpSetting() {
$sql = "SELECT `keyword`, `data`, `type`, `seq` FROM `sccpsettings` ORDER BY `type`, `seq`";
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
return $raw_settings;
}
/*
* Get Sccp Device Model information
*/
function getDb_model_info($get = "all", $format_list = "all", $filter = array()) {
global $db;
switch ($format_list) {
case "model":
$sel_inf = "model, vendor, dns, buttons";
break;
case "all":
default:
$sel_inf = "*";
break;
}
$sel_inf .= ", '0' as 'validate'";
switch ($get) {
case "byciscoid":
if (!empty($filter)) {
if (!empty($filter['model'])) {
if (strpos($filter['model'], 'loadInformation')) {
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (`loadinformationid` ='" . $filter['model'] . "') ORDER BY model ";
} else {
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (`loadinformationid` ='loadInformation" . $filter['model'] . "') ORDER BY model ";
}
} else {
// $sql = "SELECT ".$filter['model'];
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel ORDER BY model ";
}
break;
}
break;
case "byid":
if (!empty($filter)) {
if (!empty($filter['model'])) {
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (`model` ='" . $filter['model'] . "') ORDER BY model ";
} else {
// $sql = "SELECT ".$filter['model'];
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel ORDER BY model ";
}
break;
}
break;
case "extension":
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (dns = 0)ORDER BY model ";
break;
case "enabled":
case "phones":
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (dns > 0) and (enabled > 0) ORDER BY model ";
// $sql = "SELECT " . $sel_inf . " FROM sccpdevmodel WHERE (enabled > 0) ORDER BY model ";
break;
case "all":
default:
$sql = "SELECT " . $sel_inf . " FROM sccpdevmodel ORDER BY model ";
break;
}
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
return $raw_settings;
}
function sccp_save_db($db_name = "", $save_value = array(), $mode = 'update', $key_fld = "", $hwid = "") {
// mode clear - Empty tabele before update
// mode update - update / replace record
global $db;
// global $amp_conf;
$result = "Error";
switch ($db_name) {
case 'sccpsettings':
if ($mode == 'clear') {
$sql = 'truncate `sccpsettings`';
$stmt = $db->prepare($sql);
$stmt->execute();
$stmt = $db->prepare('INSERT INTO `sccpsettings` (`keyword`, `data`, `seq`, `type`) VALUES (?,?,?,?)');
$result = $db->executeMultiple($stmt, $save_value);
} else {
$stmt = $db->prepare('REPLACE INTO `sccpsettings` (`keyword`, `data`, `seq`, `type`) VALUES (?,?,?,?)');
$result = $db->executeMultiple($stmt, $save_value);
}
break;
case 'sccpdevmodel':
case 'sccpdevice':
$sql_db = $db_name;
$sql_key = "";
$sql_var = "";
foreach ($save_value as $key_v => $data) {
if (!empty($sql_var)) {
$sql_var .= ', ';
}
if ($data === $this->val_null) {
$sql_var .= '`' . $key_v . '`=NULL';
} else {
$sql_var .= '`' . $key_v . '`="' . $data . '"';
}
if ($key_fld == $key_v) {
$sql_key = '`' . $key_v . '`="' . $data . '"';
}
}
if (!empty($sql_var)) {
if ($mode == 'delete') {
$req = 'DELETE FROM `' . $sql_db . '` WHERE ' . $sql_key . ';';
} else {
if ($mode == 'update') {
$req = 'UPDATE `' . $sql_db . '` SET ' . $sql_var . ' WHERE ' . $sql_key . ';';
} else {
$req = 'REPLACE INTO `' . $sql_db . '` SET ' . $sql_var . ';';
}
}
}
$stmt = $db->prepare($req);
$result = $stmt->execute();
break;
case 'sccpbuttons':
if (($mode == 'clear') || ($mode == 'delete')) {
$sql = 'DELETE FROM `buttonconfig` WHERE device="' . $hwid . '";';
$stmt = $db->prepare($sql);
$stmt->execute();
}
if ($mode == 'delete') {
break;
}
if (!empty($save_value)) {
$sql = 'INSERT INTO `buttonconfig` (`device`, `instance`, `type`, `name`, `options`) VALUES (?,?,?,?,?);';
$stmt = $db->prepare($sql);
$res = $db->executeMultiple($stmt, $save_value);
}
break;
}
return $result;
}
/*
* My be Replace by SccpTables ??!
*
*/
public function dump_sccp_tables($data_path, $database, $user, $pass ) {
$filename = $data_path.'/sccp_backup_'.date('G_a_m_d_y').'.sql';
$result = exec('mysqldump '.$database.' --password='.$pass.' --user='.$user.' --single-transaction >'.$filename ,$output);
return $filename;
}
/*
* Check Table structure
*/
public function validate() {
global $db;
$check_fields = array('430' => array('_hwlang' => "varchar(12)"), '431' => array('private'=> "enum('on','off')"), '433' => array('directed_pickup'=>'') );
$sql = "DESCRIBE `sccpdevice`;";
$raw_result = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
$result = 0;
foreach ($raw_result as $value) {
$id_result[$value['Field']] = $value['Type'];
}
foreach ($check_fields as $key => $value) {
$sub_result = true;
foreach($value as $skey => $svalue) {
if (!empty($svalue) ) {
if (empty($id_result[$skey])) {
$sub_result = false;
} else {
if (strtolower($id_result[$skey]) != strtolower($svalue)) {
$sub_result = false;
}
}
} else {
if (!empty($id_result[$skey])) {
$sub_result = false;
}
}
}
if ($sub_result) {
$result = $key;
} else {
break;
}
}
return $result;
}
}

View file

@ -1,446 +0,0 @@
<?php
/**
*
*/
namespace FreePBX\modules\Sccp_manager;
class extconfigs {
public function __construct($parent_class = null) {
$this->paren_class = $parent_class;
}
public function info() {
$Ver = '13.0.3';
return Array('Version' => $Ver,
'about' => 'Default Setings and Enums ver: ' . $Ver);
}
public function getextConfig($id = '', $index = '') {
switch ($id) {
case 'keyset':
$result = $this->keysetdefault;
break;
case 'sccp_lang':
$result = $this->cisco_language;
break;
case 'sccpDefaults':
$result = $this->sccpDefaults;
break;
case 'sccp_timezone':
$result = array();
foreach ($this->cisco_timezone as $key => $value) {
$cisco_code = $key . ' Standard' . ((empty($value['daylight'])) ? '' : '/' . $value['daylight']) . ' Time';
if (isset($value['cisco_code'])) {
$cisco_code = (empty($value['cisco_code'])) ? $cisco_code : $value['cisco_code'];
}
$result[$key] = array('offset' => $value['offset'], 'daylight' => $value['daylight'], 'cisco_code' => $cisco_code);
}
break;
/* case 'cisco_time':
$result = array();
foreach ($this->cisco_timezone as $key => $value) {
$result[] = array('id'=> ($value['offset']/60) ,'val'=>$key.((empty($value['daylight']))? '': '/'.$value['daylight']));
}
break;
*/
case 'cisco_timezone':
$result = array();
foreach ($this->cisco_timezone as $key => $value) {
$result[] = array('id' => $key, 'val' => $key . ((empty($value['daylight'])) ? '' : '/' . $value['daylight']));
// $result[$key] =$key.((empty($value['daylight']))? '': '/'.$value['daylight']);
}
break;
default:
return array('noId');
break;
}
if (empty($index)) {
return $result;
} else {
if (isset($result[$index])) {
return $result[$index];
} else {
return array();
}
}
}
private $sccpDefaults = array(
"servername" => 'VPBXSCCP',
"bindaddr" => '0.0.0.0', "port" => '2000', # chan_sccp also supports ipv6
# bindaddr = "::" will support ipv6 and ipv4 at the same time
"deny" => '0.0.0.0/0.0.0.0',
"permit" => '0.0.0.0/0.0.0.0', # !TODO!: please change this to 'internal' which would mean:
# permit:127.0.0.0/255.0.0.0,permit:10.0.0.0/255.0.0.0,permit:172.0.0.0/255.224.0.0,permit:192.168.0.0/255.255.0.0"
"dateformat" => 'D.M.Y', # This is the german default format. Should be "D/M/Y" or "D/M/YA" instead
"disallow" => 'all', "allow" => 'alaw;ulaw',
"hotline_enabled" => 'off',
"hotline_context" => 'default', # !TODO!: Should this not be from-internal on FreePBX ?
"hotline_extension" => '*60', # !TODO!: Is this a good default extension to dial for hotline ?
"hotline_label" => 'hotline',
"devicetable" => 'sccpdevice',
"linetable" => 'sccpline',
"tftp_path" => '/tftpboot'
);
private $keysetdefault = array('onhook' => 'redial,newcall,cfwdall,dnd,pickup,gpickup,private',
'connected' => 'hold,endcall,park,vidmode,select,cfwdall,cfwdbusy,idivert',
'onhold' => 'resume,newcall,endcall,transfer,conflist,select,dirtrfr,idivert,meetme',
'ringin' => 'answer,endcall,transvm,idivert',
'offhook' => 'redial,endcall,private,cfwdall,cfwdbusy,pickup,gpickup,meetme,barge',
'conntrans' => 'hold,endcall,transfer,conf,park,select,dirtrfr,vidmode,meetme,cfwdall,cfwdbusy',
'digitsfoll' => 'back,endcall,dial',
'connconf' => 'conflist,newcall,endcall,hold,vidmode',
'ringout' => 'empty,endcall,transfer,cfwdall,idivert',
'offhookfeat' => 'redial,endcall',
'onhint' => 'redial,newcall,pickup,gpickup,barge',
'onstealable' => 'redial,newcall,cfwdall,pickup,gpickup,dnd,intrcpt',
'holdconf' => 'resume,newcall,endcall,join',
'uriaction' => 'default');
// Cisco Language Code / Directory
private $cisco_language = array('ar_SA' => array('code' => 'ar', 'language' => 'Arabic', 'locale' => 'Arabic_Saudi_Arabia'),
'bg_BG' => array('code' => 'bg', 'language' => 'Bulgarian', 'locale' => 'Bulgarian_Bulgaria'),
'cz_CZ' => array('code' => 'cz', 'language' => 'Czech', 'locale' => 'Czech_Czech_Republic'),
'da_DK' => array('code' => 'da', 'language' => 'Danish', 'locale' => 'Danish_Denmark'),
'de_DE' => array('code' => 'de', 'language' => 'German', 'locale' => 'German_Germany'),
'el_GR' => array('code' => 'el', 'language' => 'Greek', 'locale' => 'Greek_Greece'),
'en_AU' => array('code' => 'en', 'language' => 'English', 'locale' => 'AU_English_United_States'),
'en_GB' => array('code' => 'en', 'language' => 'English', 'locale' => 'English_United_Kingdom'),
'en_US' => array('code' => 'en', 'language' => 'English', 'locale' => 'English_United_States'),
'es_ES' => array('code' => 'es', 'language' => 'Spanish', 'locale' => 'Spanish_Spain'),
'et_EE' => array('code' => 'et', 'language' => 'Estonian', 'locale' => 'Estonian_Estonia'),
'fi_FI' => array('code' => 'fi', 'language' => 'Finnish', 'locale' => 'Finnish_Finland'),
'fr_CA' => array('code' => 'fr', 'language' => 'French', 'locale' => 'French_Canada'),
'fr_FR' => array('code' => 'fr', 'language' => 'French', 'locale' => 'French_France'),
'he_IL' => array('code' => 'he', 'language' => 'Hebrew', 'locale' => 'Hebrew_Israel'),
'hr_HR' => array('code' => 'hr', 'language' => 'Croatian', 'locale' => 'Croatian_Croatia'),
'hu_HU' => array('code' => 'hu', 'language' => 'Hungarian', 'locale' => 'Hungarian_Hungary'),
'it_IT' => array('code' => 'it', 'language' => 'Italian', 'locale' => 'Italian_Italy'),
'ja_JP' => array('code' => 'ja', 'language' => 'Japanese', 'locale' => 'Japanese_Japan'),
'ko_KO' => array('code' => 'ko', 'language' => 'Korean', 'locale' => 'Korean_Korea_Republic'),
'lt_LT' => array('code' => 'lt', 'language' => 'Lithuanian', 'locale' => 'Lithuanian_Lithuania'),
'lv_LV' => array('code' => 'lv', 'language' => 'Latvian', 'locale' => 'Latvian_Latvia'),
'nl_NL' => array('code' => 'nl', 'language' => 'Dutch', 'locale' => 'Dutch_Netherlands'),
'no_NO' => array('code' => 'no', 'language' => 'Norwegian', 'locale' => 'Norwegian_Norway'),
'pl_PL' => array('code' => 'pl', 'language' => 'Polish', 'locale' => 'Polish_Poland'),
'pt_BR' => array('code' => 'pt', 'language' => 'Portuguese', 'locale' => 'Portuguese_Brazil'),
'pt_PT' => array('code' => 'pt', 'language' => 'Portuguese', 'locale' => 'Portuguese_Portugal'),
'ro_RO' => array('code' => 'ro', 'language' => 'Romanian', 'locale' => 'Romanian_Romania'),
'ru_RU' => array('code' => 'ru', 'language' => 'Russian', 'locale' => 'Russian_Russian_Federation'),
'sk_SK' => array('code' => 'sk', 'language' => 'Slovakian', 'locale' => 'Slovak_Slovakia'),
'sl_SL' => array('code' => 'sl', 'language' => 'Slovenian', 'locale' => 'Slovenian_Slovenia'),
'sr_ME' => array('code' => 'sr', 'language' => 'Serbian', 'locale' => 'Serbian_Republic_of_Montenegro'),
'sr_RS' => array('code' => 'rs', 'language' => 'Serbian', 'locale' => 'Serbian_Republic_of_Serbia'),
'sv_SE' => array('code' => 'sv', 'language' => 'Swedish', 'locale' => 'Swedish_Sweden'),
'th_TH' => array('code' => 'th', 'language' => 'Thailand', 'locale' => 'Thai_Thailand'),
'tr_TR' => array('code' => 'tr', 'language' => 'Turkish', 'locale' => 'Turkish_Turkey'),
'zh_CN' => array('code' => 'cn', 'language' => 'Chinese', 'locale' => 'Chinese_China'),
'zh_TW' => array('code' => 'zh', 'language' => 'Chinese', 'locale' => 'Chinese_Taiwan')
);
private $cisco_timezone = array(
'Dateline' => array('offset' => '-720', 'daylight' => ''),
'Samoa' => array('offset' => '-660', 'daylight' => ''),
'Hawaiian' => array('offset' => '-600', 'daylight' => ''),
'Alaskan' => array('offset' => '-540', 'daylight' => 'Daylight'),
'Pacific' => array('offset' => '-480', 'daylight' => 'Daylight'),
'Mountain' => array('offset' => '-420', 'daylight' => 'Daylight'),
'US Mountain' => array('offset' => '-420', 'daylight' => ''),
'Central' => array('offset' => '-360', 'daylight' => 'Daylight'),
'Mexico' => array('offset' => '-360', 'daylight' => 'Daylight'),
'Canada Central' => array('offset' => '-360', 'daylight' => ''),
'SA Pacific' => array('offset' => '-300', 'daylight' => ''),
'Eastern' => array('offset' => '-300', 'daylight' => 'Daylight'),
'US Eastern' => array('offset' => '-300', 'daylight' => ''),
'Atlantic' => array('offset' => '-240', 'daylight' => 'Daylight'),
'SA Western' => array('offset' => '-240', 'daylight' => ''),
'Pacific SA' => array('offset' => '-240', 'daylight' => ''),
'Newfoundland' => array('offset' => '-210', 'daylight' => 'Daylight'),
'E. South America' => array('offset' => '-180', 'daylight' => 'Daylight'),
'SA Eastern' => array('offset' => '-180', 'daylight' => ''),
'Pacific SA' => array('offset' => '-180', 'daylight' => 'Daylight'),
'Mid-Atlantic' => array('offset' => '-120', 'daylight' => 'Daylight'),
'Azores' => array('offset' => '-060', 'daylight' => 'Daylight'),
'GMT' => array('offset' => '00', 'daylight' => 'Daylight'),
'Greenwich' => array('offset' => '00', 'daylight' => ''),
'W. Europe' => array('offset' => '60', 'daylight' => 'Daylight'),
'GTB' => array('offset' => '60', 'daylight' => 'Daylight'),
'Egypt' => array('offset' => '60', 'daylight' => 'Daylight'),
'E. Europe' => array('offset' => '60', 'daylight' => 'Daylight'),
'Romance' => array('offset' => '120', 'daylight' => 'Daylight'),
'Central Europe' => array('offset' => '120', 'daylight' => 'Daylight'),
'South Africa' => array('offset' => '120', 'daylight' => ''),
'Jerusalem' => array('offset' => '120', 'daylight' => 'Daylight'),
'Saudi Arabia' => array('offset' => '180', 'daylight' => ''),
/* Russion Regions */
'Russian/Kaliningrad' => array('offset' => '120', 'daylight' => '', 'cisco_code' => 'South Africa Standard Time'),
'Russian/Moscow' => array('offset' => '180', 'daylight' => '', 'cisco_code' => 'Russian Standard Time'),
'Russian/St.Peterburg' => array('offset' => '180', 'daylight' => '', 'cisco_code' => 'Russian Standard Time'),
'Russian/Samara' => array('offset' => '240', 'daylight' => '', 'cisco_code' => 'Arabian Standard Time'),
'Russian/Novosibirsk' => array('offset' => '300', 'daylight' => '', 'cisco_code' => 'Ekaterinburg Standard Time'),
'Russian/Ekaterinburg' => array('offset' => '300', 'daylight' => '', 'cisco_code' => 'Ekaterinburg Standard Time'),
'Russian/Irkutsk' => array('offset' => '480', 'daylight' => '', 'cisco_code' => 'China Standard Time'),
'Russian/Yakutsk' => array('offset' => '540', 'daylight' => '', 'cisco_code' => 'Tokyo Standard Time'),
'Russian/Khabarovsk' => array('offset' => '600', 'daylight' => '', 'cisco_code' => 'West Pacific Standard Time'),
'Russian/Vladivostok' => array('offset' => '600', 'daylight' => '', 'cisco_code' => 'West Pacific Standard Time'),
'Russian/Sakhalin' => array('offset' => '660', 'daylight' => '', 'cisco_code' => 'Central Pacific Standard Time'),
'Russian/Magadan' => array('offset' => '660', 'daylight' => '', 'cisco_code' => 'Central Pacific Standard Time'),
'Russian/Kamchatka' => array('offset' => '720', 'daylight' => '', 'cisco_code' => 'Fiji Standard Time'),
/* EnD - Russion Regions */
'Iran' => array('offset' => '210', 'daylight' => 'Daylight'),
'Caucasus' => array('offset' => '240', 'daylight' => 'Daylight'),
'Arabian' => array('offset' => '240', 'daylight' => ''),
'Afghanistan' => array('offset' => '270', 'daylight' => ''),
'West Asia' => array('offset' => '300', 'daylight' => ''),
'India' => array('offset' => '330', 'daylight' => ''),
'Central Asia' => array('offset' => '360', 'daylight' => ''),
'SE Asia' => array('offset' => '420', 'daylight' => ''),
'China' => array('offset' => '480', 'daylight' => ''),
'Taipei' => array('offset' => '480', 'daylight' => ''),
'Tokyo' => array('offset' => '540', 'daylight' => ''),
'Cen. Australia' => array('offset' => '570', 'daylight' => 'Daylight'),
'AUS Central' => array('offset' => '570', 'daylight' => ''),
'E. Australia' => array('offset' => '600', 'daylight' => ''),
'AUS Eastern' => array('offset' => '600', 'daylight' => 'Daylight'),
'West Pacific' => array('offset' => '600', 'daylight' => ''),
'Tasmania' => array('offset' => '600', 'daylight' => 'Daylight'),
'Central Pacific' => array('offset' => '660', 'daylight' => ''),
'Fiji' => array('offset' => '720', 'daylight' => ''),
'New Zealand' => array('offset' => '720', 'daylight' => 'Daylight')
);
public function validate_init_path($confDir = '', $db_vars, $sccp_driver_replace = '') {
// global $db;
// global $amp_conf;
// *** Setings for Provision Sccp
$adv_config = Array('tftproot' => '', 'firmware' => 'firmware', 'settings' => 'settings',
'locales' => 'locales', 'languages' => 'languages', 'templates' => 'templates');
$adv_tree['pro'] = Array('templates' => 'tftproot', 'settings' => 'tftproot', 'locales' => 'tftproot', 'firmware' => 'tftproot', 'languages' => 'locales');
// $adv_tree['def'] = Array('templates' => 'tftproot', 'settings' => '', 'locales' => 'tftproot', 'firmware' => 'tftproot', 'languages' => '');
$adv_tree['def'] = Array('templates' => 'tftproot', 'settings' => '', 'locales' => 'tftproot', 'firmware' => 'tftproot', 'languages' => 'tftproot');
//* **************------ ****
$base_tree = Array('tftp_templates' => 'templates', 'tftp_path_store' => 'settings', 'tftp_lang_path' => 'languages', 'tftp_firmware_path' => 'firmware');
if (empty($confDir)) {
return array('error' => 'empty СonfDir');
}
$base_config = Array('asterisk' => $confDir, 'sccp_conf' => $confDir . '/sccp.conf', 'tftp_path' => '');
// Test Base dir (/tftproot)
if (!empty($db_vars["tftp_path"])) {
if (file_exists($db_vars["tftp_path"]["data"])) {
$base_config["tftp_path"] = $db_vars["tftp_path"]["data"];
}
}
if (empty($base_config["tftp_path"])) {
if (file_exists($this->getextConfig('sccpDefaults', "tftp_path"))) {
$base_config["tftp_path"] = $this->getextConfig('sccpDefaults', "tftp_path");
}
}
if (empty($base_config["tftp_path"])) {
if (!empty($this->paren_class)) {
$this->paren_class->class_error['tftp_path'] = 'Tftp path not defined';
}
return array('error' => 'empty tftp_path');
}
if (!is_writeable($base_config["tftp_path"])) {
if (!empty($this->paren_class)) {
$this->paren_class->class_error['tftp_path'] = 'No write permision on tftp DIR';
}
return array('error' => 'No write permision on tftp DIR');
}
// END Test Base dir (/tftproot)
if (!empty($db_vars['tftp_rewrite_path'])) {
$adv_ini = $db_vars['tftp_rewrite_path']["data"];
}
$adv_tree_mode = 'def';
if (empty($db_vars["tftp_rewrite"])) {
$db_vars["tftp_rewrite"]["data"] = "off";
}
$adv_config['tftproot'] = $base_config["tftp_path"];
if ($db_vars["tftp_rewrite"]["data"] == 'pro') {
$adv_tree_mode = 'pro';
if (!empty($adv_ini)) { // something found in external conflicts
$adv_ini .= 'index.cnf';
if (file_exists($adv_ini)) {
$adv_ini_array = parse_ini_file($adv_ini);
$adv_config = array_merge($adv_config, $adv_ini_array);
}
}
}
if ($db_vars["tftp_rewrite"]["data"] == 'on') {
$adv_tree_mode = 'def';
}
foreach ($adv_tree[$adv_tree_mode] as $key => $value) {
if (!empty($adv_config[$key])) {
if (!empty($value)) {
if (substr($adv_config[$key], 0, 1) != "/") {
$adv_config[$key] = $adv_config[$value] . '/' . $adv_config[$key];
}
} else {
$adv_config[$key] = $adv_config['tftproot'];
}
}
}
foreach ($base_tree as $key => $value) {
$base_config[$key] = $adv_config[$value];
if (!file_exists($base_config[$key])) {
if (!mkdir($base_config[$key], 0777, true)) {
die('Error creating dir : ' . $base_config[$key]);
}
}
}
// $base_config['External_ini'] = $adv_config;
// $base_config['External_mode'] = $adv_tree_mode;
/*
if (!empty($this->sccppath["tftp_path"])) {
$this->sccppath["tftp_DP"] = $this->sccppath["tftp_path"] . '/Dialplan';
if (!file_exists($this->sccppath["tftp_DP"])) {
if (!mkdir($this->sccppath["tftp_DP"], 0777, true)) {
die('Error creating DialPlan template dir');
}
}
}
*/
// TFTP -REWrite double model
if (empty($_SERVER['DOCUMENT_ROOT'])) {
if (!empty($this->paren_class)) {
$this->paren_class->class_error['DOCUMENT_ROOT'] = 'Empty DOCUMENT_ROOT';
}
$base_config['error'] = 'Empty DOCUMENT_ROOT';
return $base_config;
}
if (!file_exists($base_config["tftp_templates"] . '/XMLDefault.cnf.xml_template')) {
$src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/';
$dst_path = $base_config["tftp_templates"] . '/';
foreach (glob($src_path . '*.*_template') as $filename) {
copy($filename, $dst_path . basename($filename));
}
}
$dst = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/core/functions.inc/drivers/Sccp.class.php';
if (!file_exists($dst) || $sccp_driver_replace == 'yes') {
$src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst) . '.v' . $db_vars['sccp_compatible']['data'];
if (file_exists($src_path)) {
copy($src_path, $dst);
} else {
$src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst);
copy($src_path, $dst);
}
}
if (!file_exists($base_config["sccp_conf"])) { // System re Config
$sccpfile = file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/sccp.conf');
file_put_contents($base_config["sccp_conf"], $sccpfile);
}
return $base_config;
}
public function validate_RealTime($realm = '') {
global $amp_conf;
$res = Array();
if (empty($realm) ) {
$realm = 'sccp';
}
$cnf_int = \FreePBX::Config();
$cnf_wr = \FreePBX::WriteConfig();
$cnf_read = \FreePBX::LoadConfig();
$def_config = array('sccpdevice' => 'mysql,'.$realm.',sccpdeviceconfig', 'sccpline' => 'mysql,'.$realm.',sccpline');
$backup_ext = array('_custom.conf', '.conf', '_additional.conf');
$def_bd_config = array('dbhost' => $amp_conf['AMPDBHOST'], 'dbname' => $amp_conf['AMPDBNAME'],
'dbuser' => $amp_conf['AMPDBUSER'], 'dbpass' => $amp_conf['AMPDBPASS'],
'dbport' => '3306', 'dbsock' => '/var/lib/mysql/mysql.sock');
$def_bd_sec = 'sccp';
$dir = $cnf_int->get('ASTETCDIR');
$res_conf_sql = ini_get('pdo_mysql.default_socket');
$res_conf_old = '';
$res_conf = '';
$ext_conf = '';
foreach ($backup_ext as $fext) {
if (file_exists($dir . '/extconfig' . $fext)) {
$ext_conf = $cnf_read->getConfig('extconfig' . $fext);
if (!empty($ext_conf['settings']['sccpdevice'])) {
// Add chek line
if (strtolower($ext_conf['settings']['sccpdevice']) == strtolower($def_config['sccpdevice'])){
$res['sccpdevice'] = 'OK';
$res['extconfigfile'] = 'extconfig'. $fext;
} else {
$res['sccpdevice'] = 'Error in line sccpdevice '. $res['sccpdevice'];
}
}
if (!empty($ext_conf['settings']['sccpline'])) {
if (strtolower($ext_conf['settings']['sccpline']) == strtolower($def_config['sccpline'])){
$res['sccpline'] = 'OK';
} else {$res['sccpline'] = 'Error in line sccpline';}
}
}
}
$res['extconfig'] = 'OK';
if (empty($res['sccpdevice'])) {
$res['extconfig'] = ' Options "Sccpdevice" not config ';
}
if (empty($res['sccpline'])) {
$res['extconfig'] = ' Options "Sccpline" not config ';
}
if (empty($res['extconfigfile'])) {
$res['extconfig'] = 'File extconfig.conf not exist';
}
if (!empty($res_conf_sql)) {
if (file_exists($res_conf_sql)) {
$def_bd_config['dbsock'] = $res_conf_sql;
}
}
if (file_exists($dir . '/res_mysql.conf')) {
$res_conf = $cnf_read->getConfig('res_mysql.conf');
if (empty($res_conf[$realm])) {
$res['mysqlconfig'] = 'Not Config in file: res_mysql.conf';
} else {
if ($res_conf[$realm]['dbsock'] != $def_bd_config['dbsock']) {
$res['mysqlconfig'] = 'Mysql Soket Error in file: res_mysql.conf';
}
}
if (empty($res['mysqlconfig'])) {
$res['mysqlconfig'] = 'OK';
}
}
if (file_exists($dir . '/res_config_mysql.conf')) {
$res_conf = $cnf_read->getConfig('res_config_mysql.conf');
if (empty($res_conf[$realm])) {
$res['mysqlconfig'] = 'Not Config in file: res_config_mysql.conf';
} else {
if ($res_conf[$realm]['dbsock'] != $def_bd_config['dbsock']) {
$res['mysqlconfig'] = 'Mysql Soket Error in file: res_config_mysql.conf';
}
}
if (empty($res['mysqlconfig'])) {
$res['mysqlconfig'] = 'OK';
}
}
if (empty($res['mysqlconfig'])) {
$res['mysqlconfig'] = 'Realtime Error: not found res_config_mysql.conf or res_mysql.conf configutation on the path :' . $dir;
}
return $res;
}
}

View file

@ -1,696 +0,0 @@
<?php
/**
*
* Core Comsnd Interface
*
* https://www.voip-info.org/asterisk-manager-example-php/
*/
/* !TODO!: Re-Indent this file. -TODO-: What do you mean? coreaccessinterface ?? */
namespace FreePBX\modules\Sccp_manager;
class srvinterface {
var $socket;
var $error;
public function __construct($parent_class = null) {
global $amp_conf;
$this->paren_class = $parent_class;
$this->socket = FALSE;
$this->error = "";
/*
if (isset($amp_conf[AMPMGRUSER])) {
$this->astLogin('localhost', $amp_conf[AMPMGRUSER],$amp_conf[AMPMGRPASS]);
}
*/
}
public function info() {
$Ver = '13.0.3';
return Array('Version' => $Ver,
'about' => 'Server interface data ver: ' . $Ver);
}
/*
Core Access Function
*/
/*
* Replace or dublicate to AMI interface
*/
public function sccp_core_commands($params = array()) {
global $astman;
$cmd_list = array('get_softkey' => array('cmd' => "sccp show softkeyssets", 'param' => ''),
'get_version' => array('cmd' => "sccp show version", 'param' => ''),
'get_device' => array('cmd' => "sccp show devices", 'param' => ''),
'get_dev_info' => array('cmd' => "sccp show device", 'param' => 'name'),
'get_hints' => array('cmd' => "core show hints", 'param' => ''),
'sccp_reload' => array('cmd' => "sccp reload force", 'param' => ''),
'reset_phone' => array('cmd' => "sccp reset ", 'param' => 'name'), // Жесткая перезагрузка
'reload_phone' => array('cmd' => "sccp reload device ", 'param' => 'name'),
'reset_token' => array('cmd' => "sccp tokenack ", 'param' => 'name'),
'get_realtime_status' => array('cmd' => "realtime mysql status", 'param' => ''),
);
$result = true;
if (!empty($params['cmd'])) {
$id_cmd = $params['cmd'];
if (!empty($cmd_list[$id_cmd])) {
$id_param = $cmd_list[$id_cmd]['param'];
if (!empty($id_param)) {
if (!empty($params[$id_param])) {
$result = $astman->Command($cmd_list[$id_cmd]['cmd'] . ' ' . $params[$id_param]);
}
} else {
$result = $astman->Command($cmd_list[$id_cmd]['cmd']);
}
} else {
switch ($params['cmd']) {
case 'phone_call':
if (!empty($params['name'])) {
$result = $astman->Command('sccp call ' . $params['name'] . ' ' . $params['call']);
}
break;
case 'phone_message':
if (!empty($params['msg'])) {
$msg = $params['msg'];
} else {
$msg = $this->sccpvalues['servername']['data'];
}
if (!empty($params['name'])) {
$astman->Command('sccp device ' . $params['name'] . ' ' . $msg);
} else {
}
break;
default:
$result = false;
break;
}
}
}
return $result;
}
public function sccp_getdevice_info($dev_id) {
if (empty($dev_id)) {
return array();
}
$res = $this->sccp_core_commands(array('cmd' => 'get_dev_info', 'name' => $dev_id));
$res1 = str_replace(array("\r\n", "\r", "\n"), ';', strip_tags((string) $res['data']));
if (strpos($res1, 'MAC-Address')) {
$res2 = substr($res1, 0, strpos($res1, '+--- Buttons '));
$res1 = explode(';', substr($res2, strpos($res2, 'MAC-Address')));
foreach ($res1 as $data) {
if (!empty($data)) {
$tmp = explode(':', $data);
$data_key = str_replace(array(" ", "-", "\t"), '_', trim($tmp[0]));
$res3[$data_key] = $tmp[1];
}
}
$res1 = $res3['Skinny_Phone_Type'];
$res4 = $res3['Config_Phone_Type'];
if (!empty($res3['Addons'])) {
$res2 = $res3['Addons'];
} else {
$res2 = '';
}
$res3['SCCP_Vendor'] = Array('vendor' => strtok($res1, ' '), 'model' => strtok('('), 'model_id' => strtok(')'), 'vendor_addon' => strtok($res2, ' '), 'model_addon' => strtok(' '));
if (empty($res3['SCCP_Vendor']['vendor']) || $res3['SCCP_Vendor']['vendor'] == 'Undefined') {
$res3['SCCP_Vendor'] = Array('vendor' => 'Undefined', 'model' => $res4, 'model_id' => '', 'vendor_addon' => $res3['SCCP_Vendor']['vendor_addon'], 'model_addon' => $res3['SCCP_Vendor']['model_addon']);
// return $res4;
// return array();
}
return $res3;
} else {
return array();
}
}
/* Current not use */
/*
* A function should be used in the form of buttons for getting all hint. Not working. I don't know how to use properly.
*/
public function sccp_list_hints() {
$hint_key = array();
$hint_all = $this->sccp_list_all_hints();
foreach ($hint_all as $value) {
$res = $this->loc_after('@', $value);
// array_search($res, $hint_key)) != NULL)
if (!isset($hint_key[$res])) {
$hint_key[$res] = '@'.$res;
}
}
return $hint_key;
}
public function sccp_list_all_hints() {
$ast_out = $this->sccp_core_commands(array('cmd' => 'get_hints'));
$ast_out = preg_split("/[\n]/", $ast_out['data']);
$ast_key = array();
for ($i = 0; $i < 3; $i++) {
$ast_out[$i] = "";
}
$i = count($ast_out) - 1;
$ast_out[--$i] = "";
$ast_out[--$i] = "";
foreach ($ast_out as $line) {
if (strlen($line) > 3) {
list ($line, $junk) = explode(' ', $line);
if (!is_bool(strpos($line,':'))) {
$line = trim(substr($line, 0, strpos($line, ':')));
}
if (isset($ast_key[$line])) {
if (strlen($ast_key[$line]) < 1) {
$ast_key[$line] = $line;
}
} else {
$ast_key[$line] = $line;
}
}
}
return $ast_key;
}
public function sccp_realtime_status() {
$ast_res = array();
$ast_out = $this->sccp_core_commands(array('cmd'=>'get_realtime_status'));
$ast_out = preg_split("/[\n]/", $ast_out['data']);
if (strpos($ast_out[0], 'Privilege') !== false){
$ast_out[0] = "";
}
foreach ($ast_out as $line) {
if (strlen($line) > 3) {
$ast_key = strstr(trim($line), ' ', true);
$ast_res[$ast_key] = array('message' => $line, 'status'=> strpos($line, 'connected') ? 'OK' : 'ERROR');
}
}
return $ast_res;
}
// !TODO!: -TODO-: install.php is still using the other version number. This is actually where I use another method ?
public function get_compatible_sccp() {
$res = $this->getSCCPVersion();
if (empty($res)) {
return 0;
}
switch ($res["vCode"]) {
case 433:
return 433;
case 432:
case 431:
return 431;
default:
return 430;
}
/* if ($res["vCode"] >= 433) {
}
if ($res["vCode"] >= 431) {
return 431;
} else {
return 430;
}
*
*/
// return $res["vCode"];
}
public function getSCCPVersion() {
$res = $this->getChanSCCPVersion();
if (empty($res)) {
$res = $this->getCoreSCCPVersion();
}
return $res;
}
private function getCoreSCCPVersion() {
$result = array();
$ast_out = $this->sccp_version();
$result["Version"] = $ast_out[0];
$version_parts = explode(".", $ast_out[0]);
$result["vCode"] = implode('', $version_parts);
if (!empty($ast_out[1]) && $ast_out[1] == 'develop') {
$result["develop"] = $ast_out[1];
$res = 10;
// !TODO!: This does not work as you might expect
if (base_convert($ast_out[3], 16, 10) == base_convert('702487a', 16, 10)) {
$result["vCode"] = 431;
}
if (base_convert($ast_out[3], 16, 10) >= "10403") { // new method, RevisionNum is incremental
$result["vCode"] = 432;
}
}
return $result;
}
private function sccp_version() {
$ast_out = $this->sccp_core_commands(array('cmd' => 'get_version'));
if (preg_match("/Release.*\(/", $ast_out['data'], $matches)) {
$ast_out = substr($matches[0], 9, -1);
return explode(' ', $ast_out);
} else {
return array('unknown');
}
}
private function getChanSCCPVersion() {
global $astman;
$result = array();
if (!$astman) {
return $result;
}
$metadata = $this->astman_retrieveJSFromMetaData("");
// return $metadata;
if ($metadata && array_key_exists("Version", $metadata)) {
$result["Version"] = $metadata["Version"];
$version_parts = explode(".", $metadata["Version"]);
$result["vCode"] = 0;
# not sure about this sccp_ver numbering. Might be better to just check "Version" and Revision
# $result["vCode"] = implode('', $version_parts);
$result["vCode"] = 0;
if ($version_parts[0] == "4") {
$result["vCode"] = 400;
if ($version_parts[1] == "1") {
$result["vCode"] = 410;
} else
if ($version_parts[1] == "2") {
$result["vCode"] = 420;
} else
if ($version_parts[1] >= "3") {
$result["vCode"] = 430;
}
}
/*
if (array_key_exists("Branch",$metadata)) {
if ($metadata["Branch"] == "master") {
} else
if ($metadata["Branch"] == "develop") {
}
}
*/
/* Revision got replaced by RevisionHash in 10404 (using the hash does not work) */
if (array_key_exists("Revision", $metadata)) {
if (base_convert($metadata["Revision"], 16, 10) == base_convert('702487a', 16, 10)) {
$result["vCode"] = 431;
}
if (base_convert($metadata["Revision"], 16, 10) >= "10403") {
$result["vCode"] = 431;
}
}
if (array_key_exists("RevisionHash", $metadata)) {
$result["RevisionHash"] = $metadata["RevisionHash"];
} else {
$result["RevisionHash"] = '';
}
if (array_key_exists("RevisionNum", $metadata)) {
$result["RevisionNum"] = $metadata["RevisionNum"];
if ($metadata["RevisionNum"] >= "10403") { // new method, RevisionNum is incremental
$result["vCode"] = 432;
}
if ($metadata["RevisionNum"] >= "10491") { // new method, RevisionNum is incremental
$result["vCode"] = 433;
}
}
if (array_key_exists("ConfigureEnabled", $metadata)) {
$result["futures"] = implode(';', $metadata["ConfigureEnabled"]);
}
} else {
return null;
die_freepbx("Version information could not be retrieved from chan-sccp, via astman::SCCPConfigMetaData");
}
return $result;
}
public function sccp_list_keysets() {
$ast_out = $this->sccp_core_commands(array('cmd' => 'get_softkey'));
$ast_out = preg_split("/[\n]/", $ast_out['data']);
$ast_key = array();
for ($i = 0; $i < 5; $i++) {
$ast_out[$i] = "";
}
$i = count($ast_out) - 1;
$ast_out[--$i] = "";
foreach ($ast_out as $line) {
if (strlen($line) > 3) {
$line = substr($line, 2);
list ($line, $junk) = explode(' ', $line);
if (isset($ast_key[$line])) {
if (strlen($ast_key[$line]) < 1) {
$ast_key[$line] = $line;
}
} else {
$ast_key[$line] = $line;
}
}
}
return $ast_key;
}
public function sccp_get_active_device() {
$ast_out = $this->sccp_core_commands(array('cmd' => 'get_device'));
$ast_out = preg_split("/[\n]/", $ast_out['data']);
$ast_key = array();
for ($i = 0; $i < 5; $i++) {
$ast_out[$i] = "";
}
$i = count($ast_out) - 1;
$ast_out[--$i] = "";
foreach ($ast_out as $line) {
if (strlen($line) > 3) {
$line = substr($line, 2);
$line = preg_replace("/\s{2,}/", " ", $line);
$line_arr = explode(' ', $line);
$it = 1;
do {
if ($this->strpos_array($line_arr[$it + 1], array('SEP', 'ATA', 'VG')) === false) {
// if (strpos($line_arr[$it + 1], 'SEP') === false) {
$line_arr[0] .= ' ' . $line_arr[$it];
unset($line_arr[$it]);
} else {
break;
}
$it++;
} while ((count($line_arr) > 3) and ( $it < count($line_arr)));
explode(";|", implode(";|", $line_arr));
list ($descr, $adress, $devname, $status, $token, $junk) = explode(";|", implode(";|", $line_arr));
// list ($descr, $adress, $devname, $status, $junk) = $line_arr;
// if (strlen($ast_key[$devname]) < 1) {
if (strlen($devname) > 1) {
$ast_key[$devname] = Array('name' => $devname, 'status' => $status, 'address' => $adress, 'descr' => $descr, 'token' => $token);
}
/*
if (isset($ast_key[$devname])) {
if (strlen($ast_key[$devname]) < 1) {
$ast_key[$devname] = Array('name' => $devname, 'status' => $status, 'address' => $adress, 'descr' => $descr, 'token' => $descr);
}
} else {
$ast_key[$devname] = Array('name' => $devname, 'status' => $status, 'address' => $adress, 'descr' => $descr, 'token' => $token);
}
*
*/
}
}
return $ast_key;
}
/*
* Replace sccp_core_commands($params = array()) {
*/
private function astman_retrieveJSFromMetaData($segment = "") {
global $astman;
$params = array();
if ($segment != "") {
$params["Segment"] = $segment;
}
$response = $astman->send_request('SCCPConfigMetaData', $params);
if ($response["Response"] == "Success") {
//outn(_("JSON-content:").$response["JSON"]);
$decode = json_decode($response["JSON"], true);
return $decode;
} else {
return false;
}
}
private function strpos_array($haystack, $needles) {
if (is_array($needles)) {
foreach ($needles as $str) {
if (is_array($str)) {
$pos = strpos_array($haystack, $str);
} else {
$pos = strpos($haystack, $str);
}
if ($pos !== FALSE) {
return $pos;
}
}
} else {
return strpos($haystack, $needles);
}
return FALSE;
}
private function loc_after($value, $inthat)
{
if (!is_bool(strpos($inthat, $value)))
return substr($inthat, strpos($inthat, $value) + strlen($value));
}
function getеtestChanSCC() {
global $astman;
// $action = Array('SCCPShowGlobals',);
$params = array();
$action = 'SCCPShowSoftkeySets';
// $params = array('Segment' => 'device', 'ResultFormat'=>'command' );
// $params = array('Segment' => 'device');
// $params = array();
$metadata = $astman->send_request($action, $params);
return $metadata;
}
/*
* [Segments] => ( [0] => general [1] => device [2] => line [3] => softkey )
*/
function getеtestChanSCCP_GlablsInfo($Segment='') {
global $astman;
$params = array();
$response = $astman->send_request('SCCPConfigMetaData', $params);
$action = 'SCCPConfigMetaData';
if (empty($Segment)) {
$Segment = 'general';
}
$params = array('Segment' => $Segment, 'ResultFormat'=>'command' );
$metadata = $astman->send_request($action, $params);
if (!empty($metadata['data'])) {
$tmp_data = $metadata['data'];
if (strpos($tmp_data, 'JSON:')!==false ) {
$decode = json_decode(substr ($tmp_data,strpos($tmp_data, 'JSON:') + 5), true);
$result = array();
if (!empty($decode['Options'])) {
foreach ($decode['Options'] as $value) {
$result[$value['Name']] = $value;
}
return $result;
}
return $decode;
}
}
return $metadata;
}
/*
private function astLogin($host="localhost", $username="admin", $password="amp111"){
$this->socket = @fsockopen("127.0.0.1","5038", $errno, $errstr, 1);
if (!$this->socket) {
$this->error = "Could not connect - $errstr ($errno)";
return FALSE;
}else{
stream_set_timeout($this->socket, 1);
$wrets = $this->astQuery("Action: Login\r\nUserName: $username\r\nSecret: $password\r\nEvents: off\r\n\r\n");
if (strpos($wrets['raw'], "Message: Authentication accepted") != FALSE) {
return TRUE;
}else{
$this->error = "Could not login - Authentication failed ";
fclose($this->socket);
$this->socket = FALSE;
return FALSE;
}
}
}
private function astLogout(){
if ($this->socket){
fputs($this->socket, "Action: Logoff\r\n\r\n");
while (!feof($this->socket)) {
$wrets .= fread($this->socket, 8192);
}
fclose($this->socket);
$this->socket = "FALSE";
}
return;
}
private function astQuery($query, $rawdata = false){
$wrets = "";
if ($this->socket === FALSE)
return FALSE;
$parameters = array();
$data_store = 'data';
fputs($this->socket, $query);
$parameters['raw_q'] = $query;
do
{
$line = fgets($this->socket, 4096);
$parameters['raw'] .= $line;
if (!$rawdata) {
$a = strpos($line, ':');
if($a) {
$key = substr($line, 0, $a);
switch ($key) {
case 'Response':
case 'Message':
case 'EventList':
$parameters[$key] = trim(substr($line, $a + 2));
break;
case 'JSON':
$parameters[$key] = substr($line, $a + 2);
$data_store = $key;
break;
default:
$parameters[$data_store] .= $line;
break;
}
// store parameter in $parameters
} else {
$parameters[$data_store] .= $line;
}
}
$info = stream_get_meta_data($this->socket);
}while ($line != "\r\n" && $info['timed_out'] == false );
return $parameters;
}
function GetError(){
return $this->error;
}
private function astman_retrieveMeta($action = "", $parameters=array(), $rawdata = false) {
// $parameters=array()
global $amp_conf;
$option = "";
$result = array();
if ($this->socket === FALSE) {
if (!$this->astLogin(localhost, $amp_conf[AMPMGRUSER],$amp_conf[AMPMGRPASS])) {
$result["Response"] = "Faild";
$result["Error"] = $this->error;
return $result;
}
}
if (empty($action)) {
$action = 'SCCPConfigMetaData';
}
$query = "Action: $action\r\n";
foreach($parameters as $var=>$val) {
if (is_array($val)) {
foreach($val as $k => $v) {
$query .= "$var: $k=$v\r\n";
}
} else {
$query .= "$var: $val\r\n";
}
}
$result = $this->astQuery($query."\r\n",$rawdata);
if ($result["Response"] == "Success") {
if ($rawdata) {
return $result;
} else {
if (!empty($result["JSON"])) {
$decode = json_decode($response["JSON"], true);
return $decode;
} else {
return $result;
}
}
} else {
return $result;
return array();
}
}
*/
function t_get_meta_data() {
global $amp_conf;
$fp = fsockopen("127.0.0.1", "5038", $errno, $errstr, 10);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
fputs ($fp,"Action: login\r\n");
fputs ($fp,"Username: ".$amp_conf[AMPMGRUSER]."\r\n");
// fputs ($fp,"Secret: secret\r\n");
fputs ($fp,"Secret: ".$amp_conf[AMPMGRPASS]."\r\n");
fputs ($fp,"Events: on\r\n\r\n");
// fputs ($fp,"Action: SCCPShowDevices\r\n");
fputs ($fp,"Action: SCCPConfigMetaData\r\n");
// fputs ($fp,"Segment: general\r\n");
// "Segments":["general","device","line","softkey"]}
fputs ($fp,"Segment: device\r\n");
fputs ($fp,"ResultFormat: command\r\n");
fputs ($fp,"\r\n");
/*
fputs ($fp,"Action: SCCPConfigMetaData\r\n");
fputs ($fp,"\r\n");
fputs ($fp,"Action: SCCPConfigMetaData\r\n");
fputs ($fp,"Segment: general\r\n");
fputs ($fp,"\r\n");
fputs ($fp,"Action: SCCPConfigMetaData\r\n");
fputs ($fp,"Segment: general\r\n");
fputs ($fp,"ListResult: yes\r\n");
fputs ($fp,"Option: fallback\r\n");
fputs ($fp,"\r\n");
fputs ($fp,"Action: SCCPConfigMetaData\r\n");
fputs ($fp,"Segment: device\r\n");
fputs ($fp,"ListResult: freepbx\r\n");
fputs ($fp,"\r\n");
fputs ($fp,"Action: SCCPConfigMetaData\r\n");
fputs ($fp,"Segment: device\r\n");
fputs ($fp,"Option: dtmfmode\r\n");
fputs ($fp,"ListResult: yes\r\n");
fputs ($fp,"\r\n");
*/
fputs ($fp,"Action: logoff\r\n\r\n");
// print_r(fgets($fp));
$resp = '';
while (!feof($fp)) {
$resp .= fgets($fp);
}
// print_r(fgets($fp));
// print_r('<br>');
// echo fgets($fp, 128);
}
fclose($fp);
return $resp;
}
}

View file

@ -1,391 +0,0 @@
<?php
/**
*
* Core Comsnd Interface
*
*
*/
/* !TODO!: -TODO-: Would you like to use my XSD file to check if the provided template file is a correct cisco cnf.xml file ?
* !TODO!: -TODO-: I just don't understand how to use it here.. To check the incoming pattern ? To check the result of my script ?
* !TODO!: -TODO-: The most correct variant is to generate xml based on XSD template.
*/
namespace FreePBX\modules\Sccp_manager;
class xmlinterface {
private $val_null = 'NONE'; /// REPLACE to null Field
public function __construct($parent_class = null) {
$this->paren_class = $parent_class;
}
public function info() {
$Ver = '13.0.3';
return Array('Version' => $Ver,
'about' => 'Create XML data interface ver: ' . $Ver);
}
function create_default_XML($store_path = '', $data_values = array(), $model_information = array(), $lang_info = array()) {
$data_path = $data_values['tftp_path'];
if (empty($store_path) || empty($data_path) || empty($data_values)) {
return;
}
$def_xml_fields = array('authenticationURL', 'informationURL', 'messagesURL', 'servicesURL', 'directoryURL', 'proxyServerURL', 'idleTimeout', 'idleURL');
$def_xml_locale = array('userLocale', 'networkLocaleInfo', 'networkLocale');
$xml_name = $store_path . '/XMLDefault.cnf.xml';
$xml_template = $data_values['tftp_path'] . '/templates/XMLDefault.cnf.xml_template';
if (file_exists($xml_template)) {
$xml_work = simplexml_load_file($xml_template);
$xnode = &$xml_work->callManagerGroup->members;
if ($data_values['bindaddr'] == '0.0.0.0') {
$ifc = 0;
// $xnode->member['priority'] = print_r($data_values['server_if_list'], true);
foreach ($data_values['server_if_list'] as $value) {
if (!empty($value['ip'])) {
$ip_valid = true;
if (!empty($data_values['ccm_address'])) {
if (strpos($data_values['ccm_address'], 'internal') !== false || strpos($data_values['ccm_address'], '0.0.0.0') !== false ) {
// Skip
} else {
if (strpos($data_values['ccm_address'], $value['ip']) === false) {
$ip_valid = false;
}
}
}
if (!in_array($value['ip'], array('0.0.0.0', '127.0.0.1'), true) && ($ip_valid)) {
$xnode_obj = clone $xnode->member;
$xnode_obj['priority'] = $ifc;
//$xnode_obj = &$xnode -> member -> callManager;
$xnode_obj->callManager->name = $data_values['servername'];
$xnode_obj->callManager->ports->ethernetPhonePort = $data_values['port'];
$xnode_obj->callManager->processNodeName = $value['ip'];
if ($ifc === 0) {
$this->replaceSimpleXmlNode($xnode->member, $xnode_obj);
} else {
$this->appendSimpleXmlNode($xnode->member, $xnode_obj);
}
$ifc ++;
}
}
}
} else {
$xnode->member['priority'] = '0';
$xnode_obj = &$xnode->member->callManager;
$xnode_obj->name = $data_values['servername'];
$xnode_obj->ports->ethernetPhonePort = $data_values['port'];
$xnode_obj->processNodeName = $data_values['bindaddr'];
}
$this->replaceSimpleXmlNode($xml_work->callManagerGroup->members, $xnode);
foreach ($def_xml_fields as $value) {
if (!empty($data_values['dev_' . $value])) {
$xml_work->$value = trim($data_values['dev_' . $value]);
} else {
// $xml_work->$value = '';
$node = $xml_work->$value;
unset($node[0][0]);
}
}
foreach ($def_xml_locale as $key) {
if (!empty($xml_work->$key)) {
$xnode = &$xml_work->$key;
switch ($key) {
case 'userLocale':
case 'networkLocaleInfo':
if ($key == 'networkLocaleInfo') {
$lang = $data_values['netlang'];
} else {
$lang = $data_values['devlang'];
}
// configs->getConfig('sccp_lang')
if (isset($lang_info[$lang])) {
$xnode->name = $lang_info[$lang]['locale'];
$xnode->langCode = $lang_info[$lang]['code'];
} else {
$xnode->name = '';
$xnode->langCode = '';
}
// $this -> replaceSimpleXmlNode($xml_work->$key,$xnode);
break;
case 'networkLocale':
$lang = $data_values['netlang'];
if (isset($lang_info[$lang])) {
$xnode = $lang_info[$lang]['language'];
} else {
$xnode = '';
}
break;
}
//$this-> replaceSimpleXmlNode($xml_work->$value, $xnode );
}
}
foreach ($model_information as $var) {
if (!empty($var['loadinformationid'])) {
$node = $xml_work->addChild($var['loadinformationid'], $var['loadimage']);
$node->addAttribute('model', $var['vendor'] . ' ' . $var['model']);
}
}
$xml_work->asXml($xml_name); // Save XMLDefault1.cnf.xml
}
}
function create_SEP_XML($store_path = '', $data_values = array(), $dev_config = array(), $dev_id = '', $lang_info = array()) {
$var_xml_general_fields = array('authenticationURL' => 'dev_authenticationURL', 'informationURL' => 'dev_informationURL', 'messagesURL' => 'dev_messagesURL',
'servicesURL' => 'dev_servicesURL', 'directoryURL' => 'dev_directoryURL', 'proxyServerURL' => 'dev_proxyServerURL', 'idleTimeout' => 'dev_idleTimeout',
'idleURL' => 'dev_idleURL', 'sshUserId' => 'dev_sshUserId', 'sshPassword' => 'dev_sshPassword', 'deviceProtocol' => 'dev_deviceProtocol',
'phonePersonalization' => 'phonePersonalization'
);
$var_xml_general_vars = array('capfAuthMode' => 'null', 'capfList' => 'null', 'mobility' => 'null',
'phoneServices' => 'null', 'certHash' => 'null',
'deviceSecurityMode' => '1');
// $var_hw_config = $this->dbinterface->get_db_SccpTableData("get_sccpdevice_byid", array('id' => $dev_id));
if (empty($dev_config)) {
return false;
}
$data_path = $dev_config['tftp_path'];
if (empty($store_path) || empty($data_path) || empty($data_values) || empty($dev_id)) {
return;
}
if (!empty($dev_config['nametemplate'])) {
$xml_template = $data_path . '/templates/' . $dev_config['nametemplate'];
} else {
$xml_template = $data_path . '/templates/SEP0000000000.cnf.xml_79df_template';
}
$xml_name = $store_path . '/' . $dev_id . '.cnf.xml';
if (file_exists($xml_template)) {
$xml_work = simplexml_load_file($xml_template);
foreach ($var_xml_general_vars as $key => $data) {
if (isset($xml_work->$key)) {
if ($data != 'null') {
$xml_work->$key = $data;
} else {
$node = $xml_work->$key;
unset($node[0][0]);
}
}
}
foreach ($xml_work as $key => $data) {
// Set System global Values
if (!empty($var_xml_general_fields[$key])) {
$xml_work->$key = $data_values[$var_xml_general_fields[$key]];
}
// Set section Values
$xml_node = $xml_work->$key;
switch ($key) {
case 'devicePool':
$xml_node = $xml_work->$key;
foreach ($xml_work->$key->children() as $dkey => $ddata) {
switch ($dkey) {
case 'dateTimeSetting':
$xnode = &$xml_node->$dkey;
$tz_id = $data_values['ntp_timezone'];
$TZdata = $data_values['ntp_timezone_id'];
if (empty($TZdata)) {
$TZdata = array('offset' => '0', 'daylight' => '', 'cisco_code' => 'Greenwich Standard Time');
}
$xnode->name = $tz_id;
$xnode->dateTemplate = $data_values['dateformat'];
$xnode->timeZone = $TZdata['cisco_code'];
// $xnode->timeZone = $tz_id.' Standard'.((empty($TZdata['daylight']))? '': '/'.$TZdata['daylight']).' Time';
if ($data_values['ntp_config_enabled'] == 'yes') {
$xnode->ntps->ntp->name = $data_values['ntp_server'];
$xnode->ntps->ntp->ntpMode = $data_values['ntp_server_mode'];
} else {
$xnode->ntps = '';
}
// Ntp Config
break;
case 'srstInfo':
if ($data_values['srst_Option'] == 'user') {
break;
}
$xnode = &$xml_node->$dkey;
$xnode->name = $data_values['srst_Name'];
$xnode->srstOption = $data_values['srst_Option'];
$xnode->userModifiable = $data_values['srst_userModifiable'];
$xnode->isSecure = $data_values['srst_isSecure'];
$srst_fld = array('srst_ip' => array('ipAddr', 'port'));
// $srst_fld = array('srst_ip' => array('ipAddr','port') , 'srst_sip' => array('sipIpAddr','sipPort') );
foreach ($srst_fld as $srst_pro => $srs_put) {
$srst_data = explode(';', $data_values[$srst_pro]);
$si = 1;
// $xnode['test'] = $srst_data[0];
foreach ($srst_data as $value) {
$srs_val = explode('/', $value);
$nod = $srs_put[0] . $si;
$xnode->$nod = $srs_val[0];
$nod = $srs_put[1] . $si;
$xnode->$nod = $srs_val[1];
$si ++;
}
while ($si < 4) {
$nod = $srs_put[0] . $si;
$xnode->$nod = '';
$nod = $srs_put[1] . $si;
$xnode->$nod = '';
$si ++;
}
}
break;
case 'connectionMonitorDuration':
$xml_node->$dkey = strval(intval(intval($data_values['keepalive']) * 0.75));
break;
case 'callManagerGroup':
$xnode = &$xml_node->$dkey->members;
if ($data_values['bindaddr'] == '0.0.0.0') {
$ifc = 0;
foreach ($data_values['server_if_list'] as $value) {
if (!empty($value['ip'])) {
$ip_valid = true;
if (!empty($data_values['ccm_address'])) {
if (strpos($data_values['ccm_address'], 'internal') !== false || strpos($data_values['ccm_address'], '0.0.0.0') !== false ) {
// Skip
} else {
if (strpos($data_values['ccm_address'], $value['ip']) === false) {
$ip_valid = false;
}
}
}
if (!in_array($value['ip'], array('0.0.0.0', '127.0.0.1'), true) && ($ip_valid)) {
$xnode_obj = clone $xnode->member;
// $xnode_obj = $xnode -> member;
// $xnode_obj = $xnode -> addChild($xnode->member);
$xnode_obj['priority'] = $ifc;
//$xnode_obj = &$xnode -> member -> callManager;
$xnode_obj->callManager->name = $data_values['servername'];
$xnode_obj->callManager->ports->ethernetPhonePort = $data_values['port'];
$xnode_obj->callManager->processNodeName = $value['ip'];
if ($ifc === 0) {
$this->replaceSimpleXmlNode($xnode->member, $xnode_obj);
} else {
$this->appendSimpleXmlNode($xnode->member, $xnode_obj);
}
$ifc ++;
}
}
}
} else {
$xnode->member['priority'] = '0';
$xnode_obj = &$xnode->member->callManager;
$xnode_obj->name = $data_values['servername'];
$xnode_obj->ports->ethernetPhonePort = $data_values['port'];
$xnode_obj->processNodeName = $data_values['bindaddr'];
}
break;
}
}
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
break;
case 'versionStamp':
$xml_work->$key = time();
break;
case 'loadInformation':
// Set Path Image ????
if (isset($dev_config["tftp_firmware"])) {
$xml_work->$key = (isset($dev_config["loadimage"])) ? $dev_config["tftp_firmware"].$dev_config["loadimage"] : '';
} else {
$xml_work->$key = (isset($dev_config["loadimage"])) ? $dev_config["loadimage"] : '';
}
// $xml_work->$key = $dev_config["loadimage"];
if (!empty($dev_config['addon'])) {
$xnode = $xml_work->addChild('addOnModules');
$ti = 1;
foreach ($dev_config['addon_info'] as $add_key => $add_val) {
$xnode_obj = $xnode->addChild('addOnModule');
$xnode_obj->addAttribute('idx', $ti);
$xnode_obj->addChild('loadInformation', $add_val);
$ti ++;
}
// $this->appendSimpleXmlNode($xml_work , $xnode_obj);
}
break;
case 'commonProfile':
$xml_node->phonePassword = $data_values['dev_sshPassword'];
$xml_node->backgroundImageAccess = (($data_values['backgroundImageAccess'] =='on') || ($data_values['backgroundImageAccess'] =='true') ) ? 'true':'false';
$xml_node->callLogBlfEnabled = $data_values['callLogBlfEnabled'];
break;
case 'userLocale':
case 'networkLocaleInfo':
case 'networkLocale':
$hwlang = '';
$lang = '';
if (!empty($dev_config["_hwlang"])) {
$hwlang = explode(':', $dev_config["_hwlang"]);
}
if (($key == 'networkLocaleInfo') || ($key == 'networkLocale')) {
$lang = (empty($hwlang[0])) ? $data_values['netlang'] : $hwlang[0];
} else {
$lang = (empty($hwlang[1])) ? $data_values['devlang'] : $hwlang[1];
}
if (($lang != 'null') && (!empty($lang))) {
if ($key == 'networkLocale') {
$xml_work->$key = $lang;
} else {
if (isset($lang_info[$lang])) {
$xml_node->name = $lang_info[$lang]['locale'];
$xml_node->langCode = $lang_info[$lang]['code'];
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
}
}
} else {
$xml_work->$key = '';
}
break;
// Move all set to $var_xml_general_vars
// case 'mobility':
// case 'capfList':
// break;
// case 'phoneServices':
// break;
// $xml_work->$key = '';
default:
break;
}
}
// print_r($xml_work);
$xml_work->asXml($xml_name); // Save
} else {
die('Error Hardware template :' . $xml_template . ' not found');
}
return time();
}
private function replaceSimpleXmlNode($xml, $element = SimpleXMLElement) {
$dom = dom_import_simplexml($xml);
$import = $dom->ownerDocument->importNode(
dom_import_simplexml($element), TRUE
);
$dom->parentNode->replaceChild($import, $dom);
}
private function appendSimpleXmlNode($xml, $element = SimpleXMLElement) {
$dom = dom_import_simplexml($xml);
$import = $dom->ownerDocument->importNode(
dom_import_simplexml($element), TRUE
);
// $dom->parentNode->appendChild($import, $dom);
$dom->parentNode->appendChild($import->cloneNode(true));
}
}

View file

@ -12,7 +12,7 @@ param default description
conf_allow yes Allow the use of conference
conf_play_general_announce yes Playback General Announcements (like: 'You are Entering/Leaving the conference')
conf_play_part_announce yes Playback Personal/Participant Announcements, (like: 'You have been muted / You have been kicked')
conf_mute_on_entry no Mute new participants from the start, when they enter the conference (Preventing them to talk amongst one another). The Moderator will have to UnMute a participant manually to allow them to speak. Usefull in a classroom setting.
conf_mute_on_entry no Mute new participants from the start, when they enter the conference (Preventing them to talk amongst one another). The Moderator will have to UnMute a participant manually to allow them to speak. Useful in a classroom setting.
conf_music_on_hold_class 'default' 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.
conf_show_conflist yes Automatically show conference list to the moderator
Creating a New Conference (Conf Softkey)

View file

@ -95,98 +95,98 @@
<phonePassword></phonePassword>
<backgroundImageAccess>true</backgroundImageAccess>
<callLogBlfEnabled>2</callLogBlfEnabled>
</commonProfile>
</commonProfile>
<vendorConfig>
<ehookEnable>1</ehookEnable>
<!--
Headset Hookswitch Control
<ehookEnable>1</ehookEnable>
<!--
Headset Hookswitch Control
This allows the headset to take the phone off-hook (with appropriate
cables/connections etc)
-->
<disableSpeaker>false</disableSpeaker>
<!--
Disable only the speakerphone functionality.
Disable only the speakerphone functionality.
Disabling speakerphone functionality will not affect the handset.
true = Disabled.
false = Enabled (default).
false = Enabled (default).
-->
<disableSpeakerAndHeadset>false</disableSpeakerAndHeadset>
<!--
Enables and disables the speakerphone and headset.
true = Disabled.
false = Enabled (default).
false = Enabled (default).
-->
<pcPort>0</pcPort>
<!--
Enables and disables the Ethernet switch port on the phone so the IP phone can
Enables and disables the Ethernet switch port on the phone so the IP phone can
have access to an Ethernet connection for a PC connection through the phone.
0 = Enabled (default).
1 = Disabled.
1 = Disabled.
-->
<settingsAccess>1</settingsAccess>
<!--
Enables and disables the Settings button on an IP phone.
Indicates whether the Settings button on the phone is functional. When Settings Access is enabled, you can change the phone network configuration, ring type, and volume on the phone. When Settings Access is disabled, the Settings button is completely disabled; no options appear when you press the button. Also, you cannot adjust the ringer volume or save any volume settings. By default, Settings Access is enabled.
0 = Disabled.
1 = Enabled (default). The phone user can modify features by using the Settings menu.
2 = Restricted. The phone user is allowed to access User Preferences and volume settings only.
2 = Restricted. The phone user is allowed to access User Preferences and volume settings only.
-->
<garp>0</garp>
<!--
Enables and disables IP phone response to gratuitous Address Resolution
Enables and disables IP phone response to gratuitous Address Resolution
Protocol (ARP) messages from the IP phone's Ethernet interface.
Indicates whether the phone will learn MAC addresses from Gratuitous ARP responses. Disabling the phones ability to accept Gratuitous ARP will prevent applications which use this mechanism for monitoring and recording of voice streams from working. If monitoring capability is not desired, change this setting to Disabled.
0 = Disabled.
1 = Enabled (default).
-->
-->
<voiceVlanAccess>0</voiceVlanAccess>
<!--
Enables and disables spanning, which is the IP phone's access to the voice
Enables and disables spanning, which is the IP phone's access to the voice
VLAN of the PC to which the IP phone's Ethernet port is connected.
0 = Enabled (default).
1 = Disabled.
1 = Disabled.
-->
<videoCapability>1</videoCapability>
<!--
a 7975G doesn't have any "real" video capability, it requires software
<videoCapability>1</videoCapability>
<!--
a 7975G doesn't have any "real" video capability, it requires software
called video advantage to stream webcam/video from a pc connected to
the pc-port on the back of the phone. Enabled here just as a
the pc-port on the back of the phone. Enabled here just as a
curiosity for now.
Make sure this is only set when video is available. Seems to cause sporadic issues if not.
-->
<autoSelectLineEnable>0</autoSelectLineEnable>
<!--
Enables and disables auto line selection.
0 = Disabled.
1 = Enabled (default).
1 = Enabled (default).
-->
<webAccess>0</webAccess>
<webAccess>0</webAccess>
<!--
Enables and disables web access that allows phone users to configure settings and features on User Option web pages.
This parameter indicates whether the phone will accept connections from a web browser or other HTTP client.
Disabling the web server functionality of the phone will block access to the phones internal web pages.
These pages provide statistics and configuration information.
Features, such as QRT ( Quality Report Tool ), will not function properly without access to the phones web pages.
This setting will also affect any serviceability application such as CiscoWorks 2000 that relies on web access.
This parameter indicates whether the phone will accept connections from a web browser or other HTTP client.
Disabling the web server functionality of the phone will block access to the phones internal web pages.
These pages provide statistics and configuration information.
Features, such as QRT ( Quality Report Tool ), will not function properly without access to the phones web pages.
This setting will also affect any serviceability application such as CiscoWorks 2000 that relies on web access.
The following options are available.
Disabled: Phone does not accept any HTTP connection. HTTP server is disabled on the phone.
Read Only: Phone displays web pages but does not allow any configuration.
Full: Phone displays web pages and allows configuration.
0 = Enabled (default).
1 = Disabled.
2 = Read Only.
2 = Read Only.
-->
<daysDisplayNotActive>1,7</daysDisplayNotActive> <!-- sunday = 1, sat = 7 -->
<displayOnTime>08:00</displayOnTime>
<displayOnDuration>12:00</displayOnDuration>
@ -200,52 +200,52 @@
<!-- <headsetWidebandUIControl>1</headsetWidebandUIControl> -->
<!--
Enables or disables wideband headset option on supported IP phones.
If the headsetWidebandUIControl parameter is set to Enable (0), the option set
in the phone UI, by the phone user, has priority over the value set for this
If the headsetWidebandUIControl parameter is set to Enable (0), the option set
in the phone UI, by the phone user, has priority over the value set for this
parameter.
0 = Enabled (default). Enables wideband headset on phone.
1 = Disabled. Disables wideband headset on phone.
1 = Disabled. Disables wideband headset on phone.
-->
<!-- <handsetWidebandUIControl>1</handsetWidebandUIControl> -->
<!--
Enables or disables control of handset options by phone user.
0 = Enabled (default). Allows phone user to select either narrowband or wideband handset in the phone UI.
1 = Disabled.
1 = Disabled.
-->
<!-- <headsetWidebandEnable>1</headsetWidebandEnable> -->
<!--
Enables or disables control of headset option by phone user.
0 = Enabled (default). Allows phone user to select either narrowband or wideband headset
1 = Disabled.
1 = Disabled.
-->
<!-- <handsetWidebandEnable>1</handsetWidebandEnable> -->
<!--
Enables or disables wideband handset option on supported IP phones.
If the handsetWidebandUIControl parameter is set to Enable (1), the option
set in the phone UI, by the phone user, has priority over the value set for
If the handsetWidebandUIControl parameter is set to Enable (1), the option
set in the phone UI, by the phone user, has priority over the value set for
this parameter.
0 = Phone default (default), equal to disabled or enabled and set by manufacturer.
1 = Enabled. Enables wideband handset on phone.
2 = Disabled. Disables wideband headset on phone.
2 = Disabled. Disables wideband headset on phone.
-->
<spanToPCPort>1</spanToPCPort>
<!--
Enables and disables the path between the Ethernet switch port of an IP phone
Enables and disables the path between the Ethernet switch port of an IP phone
and a connection to a PC.
0 = Enabled (default).
1 = Disabled.
1 = Disabled.
-->
<g722CodecSupport>2</g722CodecSupport>
<!--
Enables and disables the registration of the G.722 codec on the IP phone.
0 = Phone default (default), equal to disabled or enabled and set by manufacturer.
1 = Disabled. Disables G.722-64K2 codec on phone.
2 = Enabled. Enables G.722-64K codec on phone.
2 = Enabled. Enables G.722-64K codec on phone.
See also advertiseG722Codec
-->
@ -256,10 +256,10 @@
<enableLldpPcPort>1</enableLldpPcPort>
<lldpAssetId></lldpAssetId>
<powerPriority>1</powerPriority>
<!--
<!--
I have the above turned on just for curiosity.
-->
<sshAccess>0</sshAccess> <!-- 0 = enabled -->
<sshPort>22</sshPort>
<!--
@ -275,8 +275,8 @@
-->
<loadServer></loadServer>
<!--
Indicates that the phone will use an alternative server to obtain firmware loads and upgrades, rather than the defined TFTP server.
This option enables you to indicate a local server to be used for firmware upgrades, which can assist in reducing install times, particularly for upgrades over a WAN. Enter the hostname or the IP address (using standard IP addressing format) of the server. The indicated server must be running TFTP services and have the load file in the TFTP path. If the load file is not found, the load will not install. The phone will not be redirected to the TFTP server.
Indicates that the phone will use an alternative server to obtain firmware loads and upgrades, rather than the defined TFTP server.
This option enables you to indicate a local server to be used for firmware upgrades, which can assist in reducing install times, particularly for upgrades over a WAN. Enter the hostname or the IP address (using standard IP addressing format) of the server. The indicated server must be running TFTP services and have the load file in the TFTP path. If the load file is not found, the load will not install. The phone will not be redirected to the TFTP server.
If this field is left blank, the phone will use the designated TFTP server to obtain its load files and upgrades
string
length = 256
@ -286,13 +286,13 @@
<!--
Only on 7921/7925/7926
Indicates whether WLAN Profile 1 can be modified by the user.
If the profile is locked, the user can not modify it.
Indicates whether WLAN Profile 1 can be modified by the user.
If the profile is locked, the user can not modify it.
To allow the user to edit only the username and password in the profile, set it to restricted.
0 = Unlocked
1 = Locked
2 = Restricted
-->
<WlanProfile2>0</WlanProfile1>
<WlanProfile3>0</WlanProfile1>
@ -300,20 +300,20 @@
<specialNumbers></specialNumbers>
<!--
Only on 7921/7925/7926
Special numbers are telephone numbers that do not require unlocking the phone to call.
Special numbers are telephone numbers that do not require unlocking the phone to call.
For example, in the United States, the 911 emergency number is a good special number candidate so that it can be dialed without unlocking the phone.
You may enter one or more special numbers in this field.
To enter more than one special number, use a comma as separator.
You may enter one or more special numbers in this field.
To enter more than one special number, use a comma as separator.
For example, if you want to enter 411, 511, and 911 as special numbers, enter 411,511,911 in the field without spaces.
string
length = 16
comma seperated
comma separated
-->
<PushToTalkURL></PushToTalkURL>
<!--
Only on 7921/7925/7926
This parameter specifies the URL which the phone contacts for application services.
-->
<sendKeyAction></sendKeyAction>
@ -331,7 +331,7 @@
-->
<appButtonTimer></appButtonTimer>
<!--
Amount of time you must hold down the Application Button to activate the application. The timer values are in seconds. A value of 0 indicates that a simple push of the Application Button will active the application. For non-zero values, the application is activated after the specified timer value expires.
Amount of time you must hold down the Application Button to activate the application. The timer values are in seconds. A value of 0 indicates that a simple push of the Application Button will active the application. For non-zero values, the application is activated after the specified timer value expires.
-->
<appButtonPriority></appButtonPriority>
<!--
@ -349,7 +349,7 @@
<!--
Only on 7921/7925/7926
This parameter controls when the phone performs scanning. The parameter values are as follow.
Auto: Phone scans when it is in a call or when the received strength signal indicator (RSSI) is low.
Auto: Phone scans when it is in a call or when the received strength signal indicator (RSSI) is low.
Single AP: Phone never scans except when the basic service set (BSS) is lost.
Continuous: Phone scans continuously even when it is not in a call.
-->
@ -420,10 +420,10 @@
</vendorConfig>
<versionStamp>{Jan 01 2003 00:00:00}</versionStamp>
<loadInformation>P00308010100</loadInformation>
<!--
<!--
The firmware version that the phone looks for at boot.
Can be either the actual firmware version like P00308010100 or SCCP70.8-5-4S or a reference to the termXX.default file.
The later is actually much easier to maintain, just unpack the new firmware, which replaces the termXX.default.loads file.
Can be either the actual firmware version like P00308010100 or SCCP70.8-5-4S or a reference to the termXX.default file.
The later is actually much easier to maintain, just unpack the new firmware, which replaces the termXX.default.loads file.
You don't have to update all your SEP... files because it just refers them to the loads file, from which they get the
new firmware version number.
@ -457,26 +457,32 @@
<proxyServerURL></proxyServerURL>
<servicesURL>http://x.x.x.x/cisco_menu/menu.php</servicesURL>
<directoryURL>http://x.x.x.x/cisco_menu/directory/menu.php</directoryURL>
<!--
<!--
This is the URL for a CiscoIPPhoneMenu which gets appended to the end of the
Missed/Received/Placed calls. I don't use it (I find it makes more sense to
Missed/Received/Placed calls. I don't use it (I find it makes more sense to
put my phone book under services)
-->
<idleURL>http://x.x.x.x/cisco_menu/idle.php</idleURL>
<!--
URL of CiscoIPPhoneImage.
URL of CiscoIPPhoneImage.
Requires a non-zero setting in idleTimeout.
-->
<idleTimeout>3600</idleTimeout>
<deviceSecurityMode>1</deviceSecurityMode>
<phonePersonalization>1</phonePersonalization>
<!--
ToDo Three options. Must be numeric. actual numerics need to be confirmed
0 Disabled-The user cannot customize the Cisco Unified IP Phone by using Phone Designer.
1 Enabled-The user can use Phone Designer to customize the phone.
2 Default-The phone uses the configuration from the Phone Personalization enterprise parameter if you choose Default in both the Phone Configuration and Common Phone Profile Configuration windows. If you choose Default in the Common Phone Profile Configuration window but not in the Phone Configuration window, the phone uses the configuration that you specify in the Phone Configuration window.
-->
<singleButtonBarge>1</singleButtonBarge>
<joinAcrossLines>1</joinAcrossLines>
<autoCallPickupEnable>false</autoCallPickupEnable>
<blfAudibleAlertSettingOfIdleStation>1</blfAudibleAlertSettingOfIdleStation>
<blfAudibleAlertSettingOfBusyStation>1</blfAudibleAlertSettingOfBusyStation>
<advertiseG722Codec>1</advertiseG722Codec>
<advertiseG722Codec>1</advertiseG722Codec>
<mobility>
<handoffdn></handoffdn>
@ -488,7 +494,7 @@
<dtmfTxfCode>*84</dtmfTxfCode>
<dtmfCnfCode>*85</dtmfCnfCode>
</mobility>
<dscpForSCCPPhoneConfig>104</dscpForSCCPPhoneConfig>
<dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices>
<dscpForCm2Dvce>184</dscpForCm2Dvce>
@ -508,7 +514,7 @@
1 = Use ServicerURL / DirectoryURL and MessagesURL (Above)
2 = Use Both (Merge Both)
-->
<!-- Below
type = 0 -> applicaton menu
type = 1 -> contacts menu

View file

@ -0,0 +1,91 @@
Config Structure & Handling explained
-------------------------------------
Asterisk has a config parsing system that provides a generic interface to
config sections and paramater, this system has multiple backends like
ini, ldap, database that all present their data in a unified structure.
From chan-sccp's view all the config sections and parameters looks exactly
the same. In principal we don't have to know where the settings are coming
from, we just need to be able to handle three cases:
- requested section+paramater does not exist -> error
- requested section+parameter exists and returns a value
- requested section+parameter exists and returns NULL (ie: no field present in
ini/table or is set to NULL)
Based on this simple view of the world we built sccp_config.c and it's
primary source of information sccp_config_entries.hh. The latter contains:
- all valid config sections and parameters
- their links to the in memory entity structures (POD's)
- flags:
- their deprecated/obsolete status
- their value inheritance structure, device or lines can inherit values from
the [general] section if they are not provided (See more about inheritance
below)
- what to do when a value changes (either directly or through inheritance)
- ultimate fallback value for parameter that cannot be/work `unspecified`
- dedicated parser required to process the value, if a generic parser would
not work (for example handling codecs, deny/permit)
- help descriptions for each parameter
Config value inheritance
------------------------
sccp_config_entries.hh contains universal fallback values for parameters
that cannot work without one. Without this ultimate fallback
value, chan-sccp would crash/not work. For example chan-sccp would not know
what tcp-port to use for it's listerning connection, if not provided.
They are built-in fallback values fixed at compile time.
sccpdevices or sccplines can inherit values from the general section
in sccp.conf. The parameters in the general section are further backed by
the sccp_config_entries.hh with it's fallback value, in case they
are not provided.
So for example:
If sccpdevice:keepalive is not set, it will get it's value from
general:keepalive, which if not set, will fallback to the value provided
in sccp_config_entries.hh. The actual sccpdevice:keepalive is on evaluated
at the moment the device is connecting and registering to chan-sccp, at
which moment the value trickles down. So let's assume this situation:
sccp.conf:
```
[general]
;keepalive=120
[SEPxxxxx]
;keepalive=140
```
In this case the universal default will be provided by
sccp_config_entries.hh. When we now set general:keepalive to 120 and issue
`sccp reload`, all devices will have to be restart (RESTART_REQUIRED flag
is set for keepalive in sccp_config_entries.hh). They will start to connect
again, and the keepalive parameter is reevalueated, they will now see that
they do not have a personal keepalive parameter provided and will use the
general one, instead.
Note: inheritance is specifically specified in the sccp_config_entries.hh
file and just not automatically happen just based on the parameter name for
example.
You can think of the sccp_config_entries.hh and a universal section in the
sccp.conf that has a slew of fallback values that are there to have your
back. It will allow you to get by with a minimal config file without having
to worry about chan-sccp not working, becasue you forgot to set the port
number for example.
So mentally you can think of it like this:
```
[universal]
keepalive=60
[general]
;keepalive=120
[SEPxxxxx]
;keepalive=140
```
Note: changing sccp_config_entries.hh after the binary has been build, will
not do anything, the fallback values are backed into the final binary at
compile time.

View file

@ -0,0 +1 @@
https://github.com/chan-sccp/chan-sccp/wiki/Monitor-and-Pickup-Incoming-Calls-via-Speeddial-Using-Custom-Devstate

View file

@ -30,7 +30,7 @@ permit = internal
; This General rule is valid for all incoming connections. It's the 1st filter.
; using 'internal' will allow the 10.0.0.0, 172.16.0.0 and 192.168.0.0 networks
;localnet = internal ; (MULTI-ENTRY) All RFC 1918 addresses are local networks, example '192.168.1.0/255.255.255.0'
;externip = 0.0.0.0 ; External IP Address of the firewall, required in case the PBX is running on a seperate host behind it. IP Address that we're going to notify in RTP media stream as the pbx source address.
;externip = 0.0.0.0 ; External IP Address of the firewall, required in case the PBX is running on a separate host behind it. IP Address that we're going to notify in RTP media stream as the pbx source address.
;firstdigittimeout = 16 ; Dialing timeout for the 1st digit
;digittimeout = 8 ; More digits
;digittimeoutchar = # ; You can force the channel to dial with this char in the dialing state
@ -44,7 +44,7 @@ permit = internal
;transfer_tone = 0 ; Confirmation tone on transfer. Works only between SCCP devices
;transfer_on_hangup = no ; Complete transfer on hangup, without pressing transfer a second time.
; Will complete transfer, when the transferer puts the receiver on hook, after the destination has been reached.
; To cancel the transfer, either press resume on the transfered channel, press the 'endcall' softkey, or have the receiving party hangup first.
; To cancel the transfer, either press resume on the transferred channel, press the 'endcall' softkey, or have the receiving party hangup first.
;dnd_tone = 0x0 ; Use 0x2D, 0x31, 0x32, 0x33 to activate dnd incoming call indication when dnd silent is active
;callwaiting_tone = 0x2d ; Sets to 0 to disable the callwaiting tone
;callwaiting_interval = 0 ; Callwaiting ring interval in seconds. Set to 0 to disable the callwaiting ringing interval.
@ -79,7 +79,7 @@ permit = internal
;nat = auto ; Global NAT support.
; (POSSIBLE VALUES: ["Auto","Off","(Auto)Off","On","(Auto)On"])
;directrtp = no ; This option allow devices to do direct RTP sessions.
;allowoverlap = no ; Enable overlap dialing support. If enabled, starts dialing immediately and sends remaing digits as DTMF/inband.
;allowoverlap = no ; Enable overlap dialing support. If enabled, starts dialing immediately and sends remaining digits as DTMF/inband.
; Use with extreme caution as it is very dialplan and provider dependent.
callgroup = "" ; We are in caller groups 1,3,4. Valid for all lines
pickupgroup = "" ; We can do call pick-p for call group 1,3,4,5. Valid for all lines

View file

@ -3,17 +3,16 @@ To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
/*
Created on : 03.05.2017, 16:13:49
Author : Alex
*/
.sccpmultiselect {
min-height: 100px;
padding: 1px 1px;
}
.sccpbtn {
min-height: 10px;
padding: 1px 1px;
}

View file

@ -1,11 +1,4 @@
/**
* jQuery.SelectListActions
* https://github.com/esausilva/jquery.selectlistactions.js
*
* (c) http://esausilva.com
*/
(function ($) {
(function ($) {
//Moves selected item(s) from sourceList to destinationList
$.fn.moveToList = function (sourceList, destinationList) {
var opts = $(sourceList + ' option:selected');

File diff suppressed because it is too large Load diff

803
conf/CiscoIPPhone.xsd Normal file
View file

@ -0,0 +1,803 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by Cisco Systems, Inc. (Cisco Systems, Inc.) -->
<!-- Last updated 31 Dec 20 -->
<!-- The following Cisco IP Phones implement this XML parser: 6921, 6941, 6945, 6961, 7906G, 7911G, 7921G, 7925G, 7925G-EX, 7926G, 7931G, 7941G, 7941G-GE 7942G, 7945G, 7961G, 7961G-GE, 7962G, 7965G, 7970G, 7971G-GE, 7975G, 8800 Series, 8821, 8961, 9951, and 9971.-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
attributeFormDefault="unqualified" version="3.3.4">
<xsd:complexType name="CiscoIPPhoneExecuteItemType">
<xsd:attribute name="Priority" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedByte">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="URL" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="256"/>
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneResponseItemType">
<xsd:sequence>
<xsd:element name="Status" type="xsd:short"/>
<xsd:element name="Data">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="32"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URL">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneTouchAreaMenuItemType">
<xsd:sequence>
<xsd:element name="Name" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="32"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URL" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="TouchArea" type="CiscoIPPhoneTouchAreaType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneTouchAreaType">
<xsd:attribute name="X1" type="xsd:unsignedShort" use="required"/>
<xsd:attribute name="Y1" type="xsd:unsignedShort" use="required"/>
<xsd:attribute name="X2" type="xsd:unsignedShort" use="required"/>
<xsd:attribute name="Y2" type="xsd:unsignedShort" use="required"/>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneDirectoryEntryType">
<xsd:sequence>
<xsd:element name="Name" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="32"/>
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Telephone" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="32"/>
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneInputItemType">
<xsd:sequence>
<xsd:element name="DisplayName" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="32"/>
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="QueryStringParam">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="32"/>
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="InputFlags">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="A"/>
<xsd:enumeration value="T"/>
<xsd:enumeration value="N"/>
<xsd:enumeration value="E"/>
<xsd:enumeration value="U"/>
<xsd:enumeration value="L"/>
<xsd:enumeration value="AP"/>
<xsd:enumeration value="TP"/>
<xsd:enumeration value="NP"/>
<xsd:enumeration value="EP"/>
<xsd:enumeration value="UP"/>
<xsd:enumeration value="LP"/>
<xsd:enumeration value="PA"/>
<xsd:enumeration value="PT"/>
<xsd:enumeration value="PN"/>
<xsd:enumeration value="PE"/>
<xsd:enumeration value="PU"/>
<xsd:enumeration value="PL"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="DefaultValue" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="32"/>
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneMenuItemType">
<xsd:sequence>
<xsd:element name="Name" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="64"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URL" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="256"/>
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneIconItemType">
<xsd:sequence>
<xsd:element name="Index" type="xsd:unsignedShort"/>
<xsd:element name="Width">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="16"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Height">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Depth">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Data" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:hexBinary">
<xsd:maxLength value="40"/>
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneIconMenuItemType">
<xsd:sequence>
<xsd:element name="Name" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="64"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URL" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="256"/>
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="IconIndex" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="9"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneIconFileItemType">
<xsd:sequence>
<xsd:element name="Index">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="9"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URL">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneKeyType">
<xsd:sequence>
<xsd:element name="Key">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="KeyPad0"/>
<xsd:enumeration value="KeyPad1"/>
<xsd:enumeration value="KeyPad2"/>
<xsd:enumeration value="KeyPad3"/>
<xsd:enumeration value="KeyPad4"/>
<xsd:enumeration value="KeyPad5"/>
<xsd:enumeration value="KeyPad6"/>
<xsd:enumeration value="KeyPad7"/>
<xsd:enumeration value="KeyPad8"/>
<xsd:enumeration value="KeyPad9"/>
<xsd:enumeration value="KeyPadStar"/>
<xsd:enumeration value="KeyPadPound"/>
<xsd:enumeration value="NavUp"/>
<xsd:enumeration value="NavDown"/>
<xsd:enumeration value="NavLeft"/>
<xsd:enumeration value="NavRight"/>
<xsd:enumeration value="NavSelect"/>
<xsd:enumeration value="NavBack"/>
<xsd:enumeration value="PushToTalk"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URL" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URLDown" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneSoftKeyType">
<xsd:sequence>
<xsd:element name="Name" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="32"/>
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Position">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="8"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URL" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="256"/>
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URLDown" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CiscoIPPhoneDisplayableType">
<xsd:sequence>
<xsd:element name="Title" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="32"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Prompt" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="32"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="SoftKeyItem" type="CiscoIPPhoneSoftKeyType" minOccurs="0" maxOccurs="8"/>
<xsd:element name="KeyItem" type="CiscoIPPhoneKeyType" minOccurs="0" maxOccurs="32"/>
</xsd:sequence>
<xsd:attribute name="keypadTarget" use="optional" default="application">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="application"/>
<xsd:enumeration value="applicationCall"/>
<xsd:enumeration value="activeCall"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="appId" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="64"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="onAppFocusLost" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="onAppFocusGained" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="onAppMinimized" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="onAppClosed" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
<xsd:element name="CiscoIPPhoneExecute">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ExecuteItem" type="CiscoIPPhoneExecuteItemType" maxOccurs="3"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPhoneResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ResponseItem" type="CiscoIPPhoneResponseItemType" maxOccurs="3"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneError">
<xsd:complexType>
<xsd:attribute name="Number" type="xsd:unsignedShort" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneText">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="CiscoIPPhoneDisplayableType">
<xsd:sequence>
<xsd:element name="Text" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="4000"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneInput">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="CiscoIPPhoneDisplayableType">
<xsd:sequence>
<xsd:element name="URL">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="InputItem" type="CiscoIPPhoneInputItemType" minOccurs="0" maxOccurs="5"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneDirectory">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="CiscoIPPhoneDisplayableType">
<xsd:sequence>
<xsd:element name="DirectoryEntry" type="CiscoIPPhoneDirectoryEntryType" minOccurs="0" maxOccurs="32"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneImage">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="CiscoIPPhoneDisplayableType">
<xsd:sequence>
<xsd:element name="LocationX" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="132"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationY" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="64"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Width">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="133"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Height">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="65"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Depth">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Data" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:hexBinary">
<xsd:maxLength value="2162"/>
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneImageFile">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="CiscoIPPhoneDisplayableType">
<xsd:sequence>
<xsd:element name="LocationX" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="297"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationY" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="167"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URL">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="256"/>
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneMenu">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="CiscoIPPhoneDisplayableType">
<xsd:sequence>
<xsd:element name="MenuItem" type="CiscoIPPhoneMenuItemType" minOccurs="0" maxOccurs="100"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneIconMenu">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="CiscoIPPhoneDisplayableType">
<xsd:sequence>
<xsd:element name="MenuItem" type="CiscoIPPhoneIconMenuItemType" minOccurs="0" maxOccurs="32"/>
<xsd:element name="IconItem" type="CiscoIPPhoneIconItemType" minOccurs="0" maxOccurs="10"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneIconFileMenu">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="CiscoIPPhoneDisplayableType">
<xsd:sequence>
<xsd:element name="MenuItem" type="CiscoIPPhoneIconMenuItemType" minOccurs="0" maxOccurs="32"/>
<xsd:element name="IconItem" type="CiscoIPPhoneIconFileItemType" minOccurs="0" maxOccurs="10"/>
</xsd:sequence>
<xsd:attribute name="IconIndex" type="xsd:unsignedShort" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneGraphicMenu">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="CiscoIPPhoneDisplayableType">
<xsd:sequence>
<xsd:element name="LocationX" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="132"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationY" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="64"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Width">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="133"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Height">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="65"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Depth">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Data" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:hexBinary">
<xsd:maxLength value="2162"/>
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MenuItem" type="CiscoIPPhoneMenuItemType" minOccurs="0" maxOccurs="12"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneGraphicFileMenu">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="CiscoIPPhoneDisplayableType">
<xsd:sequence>
<xsd:element name="LocationX" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="297"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationY" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="167"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URL">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="256"/>
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MenuItem" type="CiscoIPPhoneTouchAreaMenuItemType" minOccurs="0" maxOccurs="32"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneStatus">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Text" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="32"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Timer" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationX" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="105"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationY" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="20"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Width">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="106"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Height">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="21"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Depth">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Data" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:hexBinary">
<xsd:minLength value="0"/>
<xsd:maxLength value="557"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="CiscoIPPhoneStatusFile">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Text" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="32"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Timer" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort">
<xsd:minInclusive value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationX" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="261"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationY" default="0" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="-1"/>
<xsd:maxInclusive value="49"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="URL">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

View file

@ -0,0 +1,300 @@
<device>
<fullConfig>true</fullConfig>
<deviceProtocol>SIP</deviceProtocol>
<devicePool>
<dateTimeSetting>
<dateTemplate>D/M/Y</dateTemplate>
<timeZone></timeZone>
<ntps>
<ntp>
<name></name>
<ntpMode>unicast</ntpMode>
</ntp>
</ntps>
</dateTimeSetting>
<callManagerGroup>
<members>
<member priority="0">
<callManager>
<ports>
<sipPort>5060</sipPort>
<securedSipPort>5061</securedSipPort>
</ports>
<processNodeName></processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
</devicePool>
<sipProfile>
<sipProxies>
<registerWithProxy>true</registerWithProxy>
</sipProxies>
<sipCallFeatures>
<cnfJoinEnabled>true</cnfJoinEnabled>
<callForwardURI>x-cisco-serviceuri-cfwdall</callForwardURI>
<callPickupURI>x-cisco-serviceuri-pickup</callPickupURI>
<callPickupListURI>x-cisco-serviceuri-opickup</callPickupListURI>
<callPickupGroupURI>x-cisco-serviceuri-gpickup</callPickupGroupURI>
<meetMeServiceURI>x-cisco-serviceuri-meetme</meetMeServiceURI>
<abbreviatedDialURI>x-cisco-serviceuri-abbrdial</abbreviatedDialURI>
<rfc2543Hold>false</rfc2543Hold>
<callHoldRingback>1</callHoldRingback>
<localCfwdEnable>true</localCfwdEnable>
<semiAttendedTransfer>true</semiAttendedTransfer>
<anonymousCallBlock>3</anonymousCallBlock>
<callerIdBlocking>3</callerIdBlocking>
<dndControl>0</dndControl>
<remoteCcEnable>true</remoteCcEnable>
<retainForwardInformation>false</retainForwardInformation>
<uriDialingDisplayPreference>1</uriDialingDisplayPreference>
</sipCallFeatures>
<sipStack>
<sipInviteRetx>6</sipInviteRetx>
<sipRetx>10</sipRetx>
<timerInviteExpires>180</timerInviteExpires>
<timerRegisterExpires>3600</timerRegisterExpires>
<timerRegisterDelta>5</timerRegisterDelta>
<timerKeepAliveExpires>120</timerKeepAliveExpires>
<timerSubscribeExpires>120</timerSubscribeExpires>
<timerSubscribeDelta>5</timerSubscribeDelta>
<timerT1>500</timerT1>
<timerT2>4000</timerT2>
<maxRedirects>70</maxRedirects>
<remotePartyID>true</remotePartyID>
<userInfo>Phone</userInfo>
</sipStack>
<autoAnswerTimer>1</autoAnswerTimer>
<autoAnswerAltBehavior>false</autoAnswerAltBehavior>
<autoAnswerOverride>true</autoAnswerOverride>
<transferOnhookEnabled>true</transferOnhookEnabled>
<enableVad>false</enableVad>
<preferredCodec>none</preferredCodec>
<dtmfAvtPayload>101</dtmfAvtPayload>
<dtmfDbLevel>3</dtmfDbLevel>
<dtmfOutofBand>avt</dtmfOutofBand>
<alwaysUsePrimeLine>false</alwaysUsePrimeLine>
<alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail>
<kpml>0</kpml>
<phoneLabel></phoneLabel>
<stutterMsgWaiting>0</stutterMsgWaiting>
<callStats>true</callStats>
<offhookToFirstDigitTimer>15000</offhookToFirstDigitTimer>
<silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts>
<disableLocalSpeedDialConfig>false</disableLocalSpeedDialConfig>
<startMediaPort>16384</startMediaPort>
<stopMediaPort>32766</stopMediaPort>
<natEnabled>false</natEnabled>
<natReceivedProcessing>false</natReceivedProcessing>
<natAddress></natAddress>
<sipLines>
<line button="1" lineIndex="1">
<featureID>9</featureID>
<featureLabel></featureLabel>
<proxy>USECALLMANAGER</proxy>
<port>5060</port>
<name></name>
<displayName></displayName>
<autoAnswer>
<autoAnswerEnabled>0</autoAnswerEnabled>
</autoAnswer>
<callWaiting>3</callWaiting>
<authName></authName>
<authPassword></authPassword>
<contact></contact>
<sharedLine>false</sharedLine>
<messageWaitingLampPolicy>3</messageWaitingLampPolicy>
<messageWaitingAMWI>0</messageWaitingAMWI>
<messagesNumber></messagesNumber>
<ringSettingIdle>4</ringSettingIdle>
<ringSettingActive>5</ringSettingActive>
<forwardCallInfoDisplay>
<callerName>true</callerName>
<callerNumber>true</callerNumber>
<redirectedNumber>false</redirectedNumber>
<dialedNumber>true</dialedNumber>
</forwardCallInfoDisplay>
<maxNumCalls>5</maxNumCalls>
<busyTrigger>4</busyTrigger>
</line>
</sipLines>
<externalNumberMask></externalNumberMask>
<voipControlPort>5060</voipControlPort>
<dscpForAudio>184</dscpForAudio>
<ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy>
<dialTemplate></dialTemplate>
<softKeyFile></softKeyFile>
</sipProfile>
<MissedCallLoggingOption>1</MissedCallLoggingOption>
<featurePolicyFile></featurePolicyFile>
<commonProfile>
<phonePassword></phonePassword>
<backgroundImageAccess>true</backgroundImageAccess>
<callLogBlfEnabled>2</callLogBlfEnabled>
</commonProfile>
<vendorConfig>
<defaultWallpaperFile></defaultWallpaperFile>
<disableSpeaker>false</disableSpeaker>
<disableSpeakerAndHeadset>false</disableSpeakerAndHeadset>
<enableMuteFeature>false</enableMuteFeature>
<enableGroupListen>true</enableGroupListen>
<holdResumeKey>1</holdResumeKey>
<recentsSoftKey>1</recentsSoftKey>
<dfBit>1</dfBit>
<pcPort>0</pcPort>
<spanToPCPort>1</spanToPCPort>
<garp>0</garp>
<rtcp>1</rtcp>
<videoRtcp>1</videoRtcp>
<voiceVlanAccess>0</voiceVlanAccess>
<videoCapability>1</videoCapability>
<hideVideoByDefault>0</hideVideoByDefault>
<separateMute>0</separateMute>
<ciscoCamera>1</ciscoCamera>
<usb1>1</usb1>
<usb2>1</usb2>
<usbClasses>0,1,2</usbClasses>
<sdio>1</sdio>
<wifi>1</wifi>
<bluetooth>1</bluetooth>
<bluetoothProfile>0,1</bluetoothProfile>
<btpbap>0</btpbap>
<bthfu>0</bthfu>
<ehookEnable>0</ehookEnable>
<autoSelectLineEnable>1</autoSelectLineEnable>
<autoCallSelect>1</autoCallSelect>
<incomingCallToastTimer>10</incomingCallToastTimer>
<dialToneFromReleaseKey>0</dialToneFromReleaseKey>
<joinAndDirectTransferPolicy>0</joinAndDirectTransferPolicy>
<minimumRingVolume></minimumRingVolume>
<simplifiedNewCall>0</simplifiedNewCall>
<actionableAlert>0</actionableAlert>
<showCallHistoryForSelectedLine>0</showCallHistoryForSelectedLine>
<kemOneColumn>0</kemOneColumn>
<lineMode>0</lineMode>
<allCallsOnPrimary>0</allCallsOnPrimary>
<softKeyControl>0</softKeyControl>
<settingsAccess>1</settingsAccess>
<webProtocol>0</webProtocol>
<webAccess>0</webAccess>
<webAdmin>1</webAdmin>
<adminPassword></adminPassword>
<sshAccess>0</sshAccess>
<detectCMConnectionFailure>0</detectCMConnectionFailure>
<g722CodecSupport>1</g722CodecSupport>
<handsetWidebandEnable>2</handsetWidebandEnable>
<headsetWidebandEnable>2</headsetWidebandEnable>
<headsetWidebandUIControl>1</headsetWidebandUIControl>
<handsetWidebandUIControl>1</handsetWidebandUIControl>
<daysDisplayNotActive>1,7</daysDisplayNotActive>
<displayOnTime>08:00</displayOnTime>
<displayOnDuration>10:00</displayOnDuration>
<displayIdleTimeout>00:10</displayIdleTimeout>
<displayOnWhenIncomingCall>1</displayOnWhenIncomingCall>
<displayRefreshRate>0</displayRefreshRate>
<daysBacklightNotActive>1,7</daysBacklightNotActive>
<backlightOnTime>08:00</backlightOnTime>
<backlightOnDuration>10:00</backlightOnDuration>
<backlightIdleTimeout>00:10</backlightIdleTimeout>
<backlightOnWhenIncomingCall>1</backlightOnWhenIncomingCall>
<recordingTone>0</recordingTone>
<recordingToneLocalVolume>100</recordingToneLocalVolume>
<recordingToneRemoteVolume>50</recordingToneRemoteVolume>
<recordingToneDuration></recordingToneDuration>
<moreKeyReversionTimer>5</moreKeyReversionTimer>
<peerFirmwareSharing>0</peerFirmwareSharing>
<loadServer></loadServer>
<problemReportUploadURL></problemReportUploadURL>
<enableCdpSwPort>1</enableCdpSwPort>
<enableCdpPcPort>0</enableCdpPcPort>
<enableLldpSwPort>1</enableLldpSwPort>
<enableLldpPcPort>0</enableLldpPcPort>
<cdpEnable>true</cdpEnable>
<outOfRangeAlert>0</outOfRangeAlert>
<scanningMode>2</scanningMode>
<applicationURL></applicationURL>
<appButtonTimer>0</appButtonTimer>
<appButtonPriority>0</appButtonPriority>
<specialNumbers></specialNumbers>
<sendKeyAction>0</sendKeyAction>
<powerOffWhenCharging>0</powerOffWhenCharging>
<homeScreen>0</homeScreen>
<accessContacts>1</accessContacts>
<accessFavorites>1</accessFavorites>
<accessVoicemail>1</accessVoicemail>
<accessApps>1</accessApps>
</vendorConfig>
<versionStamp>d902ed5a-c1e5-4233-b1d6-a960d53d1c3a</versionStamp>
<loadInformation></loadInformation>
<phoneServices useHTTPS="false">
<provisioning>2</provisioning>
<phoneService type="1" category="0">
<name>Missed Calls</name>
<url>Application:Cisco/MissedCalls</url>
<vendor></vendor>
<version></version>
</phoneService>
<phoneService type="1" category="0">
<name>Received Calls</name>
<url>Application:Cisco/ReceivedCalls</url>
<vendor></vendor>
<version></version>
</phoneService>
<phoneService type="1" category="0">
<name>Placed Calls</name>
<url>Application:Cisco/PlacedCalls</url>
<vendor></vendor>
<version></version>
</phoneService>
<phoneService type="2" category="0">
<name>Voicemail</name>
<url>Application:Cisco/Voicemail</url>
<vendor></vendor>
<version></version>
</phoneService>
</phoneServices>
<userLocale>
<name></name>
<uid>1</uid>
<langCode></langCode>
<version></version>
<winCharSet>utf-8</winCharSet>
</userLocale>
<networkLocale></networkLocale>
<networkLocaleInfo>
<name></name>
<version></version>
</networkLocaleInfo>
<deviceSecurityMode>1</deviceSecurityMode>
<idleTimeout>0</idleTimeout>
<authenticationURL></authenticationURL>
<messagesURL></messagesURL>
<servicesURL></servicesURL>
<directoryURL></directoryURL>
<idleURL></idleURL>
<informationURL></informationURL>
<proxyServerURL></proxyServerURL>
<secureAuthenticationURL></secureAuthenticationURL>
<secureMessagesURL></secureMessagesURL>
<secureServicesURL></secureServicesURL>
<secureDirectoryURL></secureDirectoryURL>
<secureInformationURL></secureInformationURL>
<secureIdleURL></secureIdleURL>
<transportLayerProtocol>1</transportLayerProtocol>
<TLSResumptionTimer>3600</TLSResumptionTimer>
<phonePersonalization>1</phonePersonalization>
<autoCallPickupEnable>true</autoCallPickupEnable>
<blfAudibleAlertSettingOfIdleStation>0</blfAudibleAlertSettingOfIdleStation>
<blfAudibleAlertSettingOfBusyStation>0</blfAudibleAlertSettingOfBusyStation>
<dndCallAlert>1</dndCallAlert>
<dndReminderTimer>5</dndReminderTimer>
<advertiseG722Codec>1</advertiseG722Codec>
<rollover>0</rollover>
<joinAcrossLines>0</joinAcrossLines>
<capfAuthMode>0</capfAuthMode>
<capfList></capfList>
<certHash></certHash>
<encrConfig>false</encrConfig>
<sshUserId></sshUserId>
<sshPassword></sshPassword>
</device>

View file

@ -0,0 +1,237 @@
<?xml version="1.0"?>
<device xsi:type="axl:XIPPhone" ctiid="406" uuid="{aed907f9-9e22-72d8-c218-b7165fff6d37}">
<fullConfig>true</fullConfig>
<portalDefaultServer>x.x.x.x</portalDefaultServer>
<deviceProtocol>SCCP</deviceProtocol>
<sshUserId/>
<sshPassword/>
<ipAddressMode>0</ipAddressMode>
<allowAutoConfig>true</allowAutoConfig>
<dadEnable>true</dadEnable>
<redirectEnable>false</redirectEnable>
<echoMultiEnable>false</echoMultiEnable>
<ipPreferenceModeControl>0</ipPreferenceModeControl>
<ipMediaAddressFamilyPreference>0</ipMediaAddressFamilyPreference>
<tzdata>
<tzolsonversion>2016g</tzolsonversion>
<tzupdater>tzupdater.jar</tzupdater>
</tzdata>
<mlppDomainId>000000</mlppDomainId>
<mlppIndicationStatus>Off</mlppIndicationStatus>
<preemption>Disabled</preemption>
<executiveOverridePreemptable>false</executiveOverridePreemptable>
<devicePool uuid="{f8d7c5cb-5d3b-e6c0-0200-8608c8138e66}">
<revertPriority>0</revertPriority>
<name>MyDeviceName</name>
<dateTimeSetting uuid="{ce543907-40b1-efe8-21e1-bdd1853c9594}">
<name>timezone name</name>
<dateTemplate>M-D-Y</dateTemplate>
<timeZone/>
<olsonTimeZone>Europe/Amsterdam</olsonTimeZone>
<ntps>
<ntp>
<name>x.x.x.x</name>
<ntpMode>Directed Broadcast</ntpMode>
</ntp>
</ntps>
</dateTimeSetting>
<callManagerGroup>
<name>MyGroupName</name>
<tftpDefault>false</tftpDefault>
<members>
<member priority="0">
<callManager>
<name>My CM1 name</name>
<description>My CM Description</description>
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
<sipPort>5060</sipPort>
<securedSipPort>5061</securedSipPort>
<mgcpPorts>
<listen>2427</listen>
<keepAlive>2428</keepAlive>
</mgcpPorts>
</ports>
<processNodeName>y.y.y.y</processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
<srstInfo uuid="{cd241e11-4a58-4d3d-9661-f06c912a18a3}">
<name>Disable</name>
<srstOption>Disable</srstOption>
<userModifiable>false</userModifiable>
<ipAddr1/>
<port1>2000</port1>
<ipAddr2/>
<port2>2000</port2>
<ipAddr3/>
<port3>2000</port3>
<sipIpAddr1/>
<sipPort1>5060</sipPort1>
<sipIpAddr2/>
<sipPort2>5060</sipPort2>
<sipIpAddr3/>
<sipPort3>5060</sipPort3>
<isSecure>false</isSecure>
</srstInfo>
<connectionMonitorDuration>120</connectionMonitorDuration>
</devicePool>
<commonProfile>
<phonePassword/>
<backgroundImageAccess>true</backgroundImageAccess>
<callLogBlfEnabled>3</callLogBlfEnabled>
</commonProfile>
<loadInformation>CP7925G-1.4.8.4</loadInformation>
<vendorConfig>
<disableSpeaker>false</disableSpeaker>
<garp>0</garp>
<webAccess>2</webAccess>
<WlanProfile1>0</WlanProfile1>
<WlanProfile2>0</WlanProfile2>
<WlanProfile3>0</WlanProfile3>
<WlanProfile4>0</WlanProfile4>
<loadServer>MyAdminUsername</loadServer>
<adminPassword>MyPassword#$%^!</adminPassword>
<specialNumbers/>
<PushToTalkURL/>
<sendKeyAction>0</sendKeyAction>
<phoneBookWebAccess>0</phoneBookWebAccess>
<unlockSettingsSequence>1</unlockSettingsSequence>
<appButtonTimer>0</appButtonTimer>
<appButtonPriority>0</appButtonPriority>
<outOfRangeAlert>0</outOfRangeAlert>
<scanningMode>0</scanningMode>
<restrictDataRates>0</restrictDataRates>
<powerOffWhenCharging>0</powerOffWhenCharging>
<cdpEnable>1</cdpEnable>
<g722CodecSupport>0</g722CodecSupport>
<homeScreen>0</homeScreen>
<fipsMode>0</fipsMode>
<autoSelectLineEnable>0</autoSelectLineEnable>
<fileSystemVerificationEnable>0</fileSystemVerificationEnable>
<minimumRingVolume>0</minimumRingVolume>
<java>1</java>
</vendorConfig>
<commonConfig>
<sshAccess>1</sshAccess>
<RingLocale>0</RingLocale>
<companyPhotoDir>http://z.z.z.z/pictures/%%sAMAccountName%%.jpg</companyPhotoDir>
<ice/>
<instantMessaging/>
<desktopClient/>
</commonConfig>
<enterpriseConfig>
<ciscoCamera>1</ciscoCamera>
<energyWiseDomain>MyaAdminUsername</energyWiseDomain>
<energyWiseSecret>MyPassword#$%^!</energyWiseSecret>
<webProtocol>0</webProtocol>
<companyPhotoDir>http://z.z.z.z/pictures/%%sAMAccountName%%.jpg</companyPhotoDir>
<ice/>
<instantMessaging/>
<desktopClient/>
</enterpriseConfig>
<versionStamp>1234562241-013d4ba4-5b51-4be6-9792-b7165fff6d37</versionStamp>
<userLocale>
<name>English_United_States</name>
<uid>1</uid>
<langCode>en_US</langCode>
<version>10.0.0.0(1)</version>
<winCharSet>iso-8859-1</winCharSet>
</userLocale>
<networkLocale>United_States</networkLocale>
<networkLocaleInfo>
<name>United_States</name>
<uid>64</uid>
<version>10.0.0.0(1)</version>
</networkLocaleInfo>
<deviceSecurityMode>1</deviceSecurityMode>
<idleTimeout>0</idleTimeout>
<authenticationURL>http://z.z.z.z:8080/sccp/authenticate.php</authenticationURL>
<directoryURL>http://z.z.z.z:8080/sccp/xmldirectory.php</directoryURL>
<idleURL/>
<informationURL>http://z.z.z.z:8080/sccp/helptext.php</informationURL>
<messagesURL/>
<proxyServerURL/>
<servicesURL>http://z.z.z.z:8080/sccp/servicesmenu.php</servicesURL>
<secureAuthenticationURL>https://z.z.z.z:8443/sccp/authenticate.php</secureAuthenticationURL>
<secureDirectoryURL>https://z.z.z.z:8443/sccp/xmldirectory.php</secureDirectoryURL>
<secureIdleURL/>
<secureInformationURL>https://z.z.z.z:8443/sccp/helptext.php</secureInformationURL>
<secureMessagesURL/>
<secureServicesURL>https://z.z.z.z:8443/sccp/servicesmenu.php</secureServicesURL>
<dscpForSCCPPhoneConfig>96</dscpForSCCPPhoneConfig>
<dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices>
<dscpForCm2Dvce>96</dscpForCm2Dvce>
<transportLayerProtocol>1</transportLayerProtocol>
<dndCallAlert>5</dndCallAlert>
<phonePersonalization>0</phonePersonalization>
<rollover>0</rollover>
<singleButtonBarge>0</singleButtonBarge>
<joinAcrossLines>0</joinAcrossLines>
<autoCallPickupEnable>false</autoCallPickupEnable>
<blfAudibleAlertSettingOfIdleStation>0</blfAudibleAlertSettingOfIdleStation>
<blfAudibleAlertSettingOfBusyStation>0</blfAudibleAlertSettingOfBusyStation>
<capfAuthMode>0</capfAuthMode>
<capfList>
<capf>
<phonePort>3804</phonePort>
<processNodeName>y.y.y.y</processNodeName>
</capf>
</capfList>
<certHash/>
<encrConfig>false</encrConfig>
<advertiseG722Codec>0</advertiseG722Codec>
<mobility>
<handoffdn/>
<dtmfdn/>
<ivrdn/>
<dtmfHoldCode>*81</dtmfHoldCode>
<dtmfExclusiveHoldCode>*82</dtmfExclusiveHoldCode>
<dtmfResumeCode>*83</dtmfResumeCode>
<dtmfTxfCode>*84</dtmfTxfCode>
<dtmfCnfCode>*85</dtmfCnfCode>
</mobility>
<TLSResumptionTimer>3600</TLSResumptionTimer>
<userId/>
<ownerId/>
<phoneServices useHTTPS="true">
<provisioning>2</provisioning>
<phoneService type="1" category="0">
<name>Missed Calls</name>
<url>Application:Cisco/MissedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="2" category="0">
<name>Voicemail</name>
<url>Application:Cisco/Voicemail</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Received Calls</name>
<url>Application:Cisco/ReceivedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Placed Calls</name>
<url>Application:Cisco/PlacedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Personal Directory</name>
<url>Application:Cisco/PersonalDirectory</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Corporate Directory</name>
<url>Application:Cisco/CorporateDirectory</url>
<vendor/>
<version/>
</phoneService>
</phoneServices>
</device>

View file

@ -0,0 +1,237 @@
<?xml version="1.0"?>
<device ctiid="406" uuid="{aed907f9-9e22-72d8-c218-b7165fff6d37}">
<fullConfig>true</fullConfig>
<portalDefaultServer>x.x.x.x</portalDefaultServer>
<deviceProtocol>SCCP</deviceProtocol>
<sshUserId/>
<sshPassword/>
<ipAddressMode>0</ipAddressMode>
<allowAutoConfig>true</allowAutoConfig>
<dadEnable>true</dadEnable>
<redirectEnable>false</redirectEnable>
<echoMultiEnable>false</echoMultiEnable>
<ipPreferenceModeControl>0</ipPreferenceModeControl>
<ipMediaAddressFamilyPreference>0</ipMediaAddressFamilyPreference>
<tzdata>
<tzolsonversion>2016g</tzolsonversion>
<tzupdater>tzupdater.jar</tzupdater>
</tzdata>
<mlppDomainId>000000</mlppDomainId>
<mlppIndicationStatus>Off</mlppIndicationStatus>
<preemption>Disabled</preemption>
<executiveOverridePreemptable>false</executiveOverridePreemptable>
<devicePool uuid="{f8d7c5cb-5d3b-e6c0-0200-8608c8138e66}">
<revertPriority>0</revertPriority>
<name>MyDeviceName</name>
<dateTimeSetting uuid="{ce543907-40b1-efe8-21e1-bdd1853c9594}">
<name>timezone name</name>
<dateTemplate>M-D-Y</dateTemplate>
<timeZone/>
<olsonTimeZone>Europe/Amsterdam</olsonTimeZone>
<ntps>
<ntp>
<name>x.x.x.x</name>
<ntpMode>Directed Broadcast</ntpMode>
</ntp>
</ntps>
</dateTimeSetting>
<callManagerGroup>
<name>MyGroupName</name>
<tftpDefault>false</tftpDefault>
<members>
<member priority="0">
<callManager>
<name>My CM1 name</name>
<description>My CM Description</description>
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
<sipPort>5060</sipPort>
<securedSipPort>5061</securedSipPort>
<mgcpPorts>
<listen>2427</listen>
<keepAlive>2428</keepAlive>
</mgcpPorts>
</ports>
<processNodeName>y.y.y.y</processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
<srstInfo uuid="{cd241e11-4a58-4d3d-9661-f06c912a18a3}">
<name>Disable</name>
<srstOption>Disable</srstOption>
<userModifiable>false</userModifiable>
<ipAddr1/>
<port1>2000</port1>
<ipAddr2/>
<port2>2000</port2>
<ipAddr3/>
<port3>2000</port3>
<sipIpAddr1/>
<sipPort1>5060</sipPort1>
<sipIpAddr2/>
<sipPort2>5060</sipPort2>
<sipIpAddr3/>
<sipPort3>5060</sipPort3>
<isSecure>false</isSecure>
</srstInfo>
<connectionMonitorDuration>120</connectionMonitorDuration>
</devicePool>
<commonProfile>
<phonePassword/>
<backgroundImageAccess>true</backgroundImageAccess>
<callLogBlfEnabled>3</callLogBlfEnabled>
</commonProfile>
<loadInformation>CP7925G-1.4.8.4</loadInformation>
<vendorConfig>
<disableSpeaker>false</disableSpeaker>
<garp>0</garp>
<webAccess>2</webAccess>
<WlanProfile1>0</WlanProfile1>
<WlanProfile2>0</WlanProfile2>
<WlanProfile3>0</WlanProfile3>
<WlanProfile4>0</WlanProfile4>
<loadServer>MyAdminUsername</loadServer>
<adminPassword>MyPassword#$%^!</adminPassword>
<specialNumbers/>
<PushToTalkURL/>
<sendKeyAction>0</sendKeyAction>
<phoneBookWebAccess>0</phoneBookWebAccess>
<unlockSettingsSequence>1</unlockSettingsSequence>
<appButtonTimer>0</appButtonTimer>
<appButtonPriority>0</appButtonPriority>
<outOfRangeAlert>0</outOfRangeAlert>
<scanningMode>0</scanningMode>
<restrictDataRates>0</restrictDataRates>
<powerOffWhenCharging>0</powerOffWhenCharging>
<cdpEnable>1</cdpEnable>
<g722CodecSupport>0</g722CodecSupport>
<homeScreen>0</homeScreen>
<fipsMode>0</fipsMode>
<autoSelectLineEnable>0</autoSelectLineEnable>
<fileSystemVerificationEnable>0</fileSystemVerificationEnable>
<minimumRingVolume>0</minimumRingVolume>
<java>1</java>
</vendorConfig>
<commonConfig>
<sshAccess>1</sshAccess>
<RingLocale>0</RingLocale>
<companyPhotoDir>http://z.z.z.z/pictures/%%sAMAccountName%%.jpg</companyPhotoDir>
<ice/>
<instantMessaging/>
<desktopClient/>
</commonConfig>
<enterpriseConfig>
<ciscoCamera>1</ciscoCamera>
<energyWiseDomain>MyaAdminUsername</energyWiseDomain>
<energyWiseSecret>MyPassword#$%^!</energyWiseSecret>
<webProtocol>0</webProtocol>
<companyPhotoDir>http://z.z.z.z/pictures/%%sAMAccountName%%.jpg</companyPhotoDir>
<ice/>
<instantMessaging/>
<desktopClient/>
</enterpriseConfig>
<versionStamp>1234562241-013d4ba4-5b51-4be6-9792-b7165fff6d37</versionStamp>
<userLocale>
<name>English_United_States</name>
<uid>1</uid>
<langCode>en_US</langCode>
<version>10.0.0.0(1)</version>
<winCharSet>iso-8859-1</winCharSet>
</userLocale>
<networkLocale>United_States</networkLocale>
<networkLocaleInfo>
<name>United_States</name>
<uid>64</uid>
<version>10.0.0.0(1)</version>
</networkLocaleInfo>
<deviceSecurityMode>1</deviceSecurityMode>
<idleTimeout>0</idleTimeout>
<authenticationURL>http://z.z.z.z:8080/sccp/authenticate.php</authenticationURL>
<directoryURL>http://z.z.z.z:8080/sccp/xmldirectory.php</directoryURL>
<idleURL/>
<informationURL>http://z.z.z.z:8080/sccp/helptext.php</informationURL>
<messagesURL/>
<proxyServerURL/>
<servicesURL>http://z.z.z.z:8080/sccp/servicesmenu.php</servicesURL>
<secureAuthenticationURL>https://z.z.z.z:8443/sccp/authenticate.php</secureAuthenticationURL>
<secureDirectoryURL>https://z.z.z.z:8443/sccp/xmldirectory.php</secureDirectoryURL>
<secureIdleURL/>
<secureInformationURL>https://z.z.z.z:8443/sccp/helptext.php</secureInformationURL>
<secureMessagesURL/>
<secureServicesURL>https://z.z.z.z:8443/sccp/servicesmenu.php</secureServicesURL>
<dscpForSCCPPhoneConfig>96</dscpForSCCPPhoneConfig>
<dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices>
<dscpForCm2Dvce>96</dscpForCm2Dvce>
<transportLayerProtocol>1</transportLayerProtocol>
<dndCallAlert>5</dndCallAlert>
<phonePersonalization>0</phonePersonalization>
<rollover>0</rollover>
<singleButtonBarge>0</singleButtonBarge>
<joinAcrossLines>0</joinAcrossLines>
<autoCallPickupEnable>false</autoCallPickupEnable>
<blfAudibleAlertSettingOfIdleStation>0</blfAudibleAlertSettingOfIdleStation>
<blfAudibleAlertSettingOfBusyStation>0</blfAudibleAlertSettingOfBusyStation>
<capfAuthMode>0</capfAuthMode>
<capfList>
<capf>
<phonePort>3804</phonePort>
<processNodeName>y.y.y.y</processNodeName>
</capf>
</capfList>
<certHash/>
<encrConfig>false</encrConfig>
<advertiseG722Codec>0</advertiseG722Codec>
<mobility>
<handoffdn/>
<dtmfdn/>
<ivrdn/>
<dtmfHoldCode>*81</dtmfHoldCode>
<dtmfExclusiveHoldCode>*82</dtmfExclusiveHoldCode>
<dtmfResumeCode>*83</dtmfResumeCode>
<dtmfTxfCode>*84</dtmfTxfCode>
<dtmfCnfCode>*85</dtmfCnfCode>
</mobility>
<TLSResumptionTimer>3600</TLSResumptionTimer>
<userId/>
<ownerId/>
<phoneServices useHTTPS="true">
<provisioning>2</provisioning>
<phoneService type="1" category="0">
<name>Missed Calls</name>
<url>Application:Cisco/MissedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="2" category="0">
<name>Voicemail</name>
<url>Application:Cisco/Voicemail</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Received Calls</name>
<url>Application:Cisco/ReceivedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Placed Calls</name>
<url>Application:Cisco/PlacedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Personal Directory</name>
<url>Application:Cisco/PersonalDirectory</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Corporate Directory</name>
<url>Application:Cisco/CorporateDirectory</url>
<vendor/>
<version/>
</phoneService>
</phoneServices>
</device>

View file

@ -39,7 +39,7 @@
</srstInfo>
<connectionMonitorDuration>120</connectionMonitorDuration>
</devicePool>
<versionStamp>{Jan 01 2003 00:00:00}</versionStamp>
<versionStamp>{Jan 01 2003 00:00:00}</versionStamp>
<loadInformation>P00308010100</loadInformation>
<vendorConfig>
<disableSpeaker>false</disableSpeaker>

View file

@ -0,0 +1,163 @@
<?xml version="1.0" encoding="UTF-8"?>
<device>
<fullConfig>true</fullConfig>
<sshUserId>cisco</sshUserId>
<sshPassword>cisco</sshPassword>
<ipAddressMode>2</ipAddressMode>
<ipPreferenceModeControl>1</ipPreferenceModeControl>
<allowAutoConfig>true</allowAutoConfig>
<devicePool uuid="{1b1b9eb6-7803-11d3-bdf0-00108302ead1}">
<revertPriority>1</revertPriority>
<dateTimeSetting>
<dateTemplate>M/D/YA</dateTemplate>
<timeZone>Eastern Standard/Daylight Time</timeZone>
<ntps>
<ntp>
<name>213.109.127.195</name>
<ntpMode>Unicast</ntpMode>
</ntp>
</ntps>
</dateTimeSetting>
<callManagerGroup>
<members>
<member priority="0">
<callManager>
<name>pbxserver1</name>
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
</ports>
<processNodeName>x.x.x.x</processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
<srstInfo>
<srstOption>Disable</srstOption>
<ipAddr1>x.x.x.x</ipAddr1>
<port1>2443</port1>
<ipAddr2/>
<port2/>
<isSecure>false</isSecure>
</srstInfo>
<connectionMonitorDuration>60</connectionMonitorDuration>
</devicePool>
<versionStamp>1b1b9eb6-7803-11d3-bdf0-00108302ead1</versionStamp>
<commonProfile>
<phonePassword>1234</phonePassword>
<defaultBackground>http://x.x.x.x/Chan-SCCP-b.png</defaultBackground>
<backgroundImageAccess>true</backgroundImageAccess>
<callLogBlfEnabled>3</callLogBlfEnabled>
</commonProfile>
<vendorConfig>
<disableSpeaker>false</disableSpeaker>
<disableSpeakerAndHeadset>false</disableSpeakerAndHeadset>
<forwardingDelay>1</forwardingDelay>
<settingsAccess>1</settingsAccess>
<videoCapability>1</videoCapability>
<autoSelectLineEnable>0</autoSelectLineEnable>
<webAccess>0</webAccess>
<daysDisplayNotActive>1,7</daysDisplayNotActive>
<displayOnTime>08:30</displayOnTime>
<displayOnDuration>11:30</displayOnDuration>
<displayIdleTimeout>01:00</displayIdleTimeout>
<displayOnWhenIncomingCall>1</displayOnWhenIncomingCall>
<loggingDisplay>1</loggingDisplay>
<autoCallSelect>0</autoCallSelect>
<logServer>x.x.x.x:9001</logServer>
<enableCdpSwPort>1</enableCdpSwPort>
<enableCdpPcPort>1</enableCdpPcPort>
<enableLldpSwPort>1</enableLldpSwPort>
<enableLldpPcPort>1</enableLldpPcPort>
<lldpAssetId>Cisco Phone</lldpAssetId>
<powerPriority>1</powerPriority>
<detectCMConnectionFailure>0</detectCMConnectionFailure>
<g722CodecSupport>2</g722CodecSupport>
<sshAccess>0</sshAccess>
<pcPort>0</pcPort>
<spanToPCPort>0</spanToPCPort>
<callHoldRingback>1</callHoldRingback>
<rtcp>1</rtcp>
<rtpcontrolprotocol>1</rtpcontrolprotocol>
<videoRtcp>1</videoRtcp>
</vendorConfig>
<userLocale>
<name>English_United_States</name>
<uid>39</uid>
<langCode>en_US</langCode>
<version>9.3(2.9902)US</version>
<winCharSet>utf-8</winCharSet>
</userLocale>
<networkLocale>United_States</networkLocale>
<networkLocaleInfo>
<name>United_States</name>
<uid>64</uid>
<version>4.0(1)</version>
</networkLocaleInfo>
<informationURL>http://x.x.x.x/shiftkey/handle_shift.php</informationURL>
<authenticationURL>http://x.x.x.x/authenticate.php</authenticationURL>
<servicesURL>http://x.x.x.x/cisco/service.php?emcc=#EMCC#</servicesURL>
<directoryURL>http://x.x.x.x/CiscoDirectory/phonebook.php</directoryURL>
<messagesURL/>
<proxyServerURL/>
<dndCallAlert>5</dndCallAlert>
<dndReminderTimer>60</dndReminderTimer>
<phonePersonalization>0</phonePersonalization>
<rollover>0</rollover>
<singleButtonBarge>1</singleButtonBarge>
<joinAcrossLines>1</joinAcrossLines>
<autoCallPickupEnable>true</autoCallPickupEnable>
<blfAudibleAlertSettingOfIdleStation>1</blfAudibleAlertSettingOfIdleStation>
<blfAudibleAlertSettingOfBusyStation>1</blfAudibleAlertSettingOfBusyStation>
<advertiseG722Codec>1</advertiseG722Codec>
<userId>dkgroot</userId>
<transportLayerProtocol>2</transportLayerProtocol>
<deviceSecurityMode>1</deviceSecurityMode>
<dscpForSCCPPhoneConfig>96</dscpForSCCPPhoneConfig>
<dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices>
<dscpForCm2Dvce>184</dscpForCm2Dvce>
<phoneServices>
<provisioning>0</provisioning>
<phoneService type="1" category="0">
<name>Missed Calls</name>
<url>Application:Cisco/MissedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Received Calls</name>
<url>Application:Cisco/ReceivedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Placed Calls</name>
<url>Application:Cisco/PlacedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Personal Directory</name>
<url>Application:Cisco/PersonalDirectory</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="2" category="0">
<name>Voicemail</name>
<url>Application:Cisco/Voicemail</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="0" category="0">
<name>Services</name>
<url>http://x.x.x.x/cisco/service.php?emmcmode=#EMCC#</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="0" category="0">
<name>Login</name>
<url>http://x.x.x.x/cisco/service.php?name=#DEVICENAME#&amp;emmcmode=#EMCC#&amp;action=loginform</url>
<vendor/>
<version/>
</phoneService>
</phoneServices>
</device>

View file

@ -0,0 +1,163 @@
<?xml version="1.0" encoding="UTF-8"?>
<device>
<fullConfig>true</fullConfig>
<sshUserId>cisco</sshUserId>
<sshPassword>cisco</sshPassword>
<ipAddressMode>2</ipAddressMode>
<ipPreferenceModeControl>1</ipPreferenceModeControl>
<allowAutoConfig>true</allowAutoConfig>
<devicePool uuid="{1b1b9eb6-7803-11d3-bdf0-00108302ead1}">
<revertPriority>1</revertPriority>
<dateTimeSetting>
<dateTemplate>M/D/YA</dateTemplate>
<timeZone>Eastern Standard/Daylight Time</timeZone>
<ntps>
<ntp>
<name>213.109.127.195</name>
<ntpMode>Unicast</ntpMode>
</ntp>
</ntps>
</dateTimeSetting>
<callManagerGroup>
<members>
<member priority="0">
<callManager>
<name>pbxserver1</name>
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
</ports>
<processNodeName>x.x.x.x</processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
<srstInfo>
<srstOption>Disable</srstOption>
<ipAddr1>x.x.x.x</ipAddr1>
<port1>2443</port1>
<ipAddr2/>
<port2/>
<isSecure>false</isSecure>
</srstInfo>
<connectionMonitorDuration>60</connectionMonitorDuration>
</devicePool>
<versionStamp>1b1b9eb6-7803-11d3-bdf0-00108302ead1</versionStamp>
<commonProfile>
<phonePassword>1234</phonePassword>
<defaultBackground>http://x.x.x.x/Chan-SCCP-b.png</defaultBackground>
<backgroundImageAccess>true</backgroundImageAccess>
<callLogBlfEnabled>3</callLogBlfEnabled>
</commonProfile>
<vendorConfig>
<disableSpeaker>false</disableSpeaker>
<disableSpeakerAndHeadset>false</disableSpeakerAndHeadset>
<forwardingDelay>1</forwardingDelay>
<settingsAccess>1</settingsAccess>
<videoCapability>1</videoCapability>
<autoSelectLineEnable>0</autoSelectLineEnable>
<webAccess>0</webAccess>
<daysDisplayNotActive>1,7</daysDisplayNotActive>
<displayOnTime>08:30</displayOnTime>
<displayOnDuration>11:30</displayOnDuration>
<displayIdleTimeout>01:00</displayIdleTimeout>
<displayOnWhenIncomingCall>1</displayOnWhenIncomingCall>
<loggingDisplay>1</loggingDisplay>
<autoCallSelect>0</autoCallSelect>
<logServer>x.x.x.x:9001</logServer>
<enableCdpSwPort>1</enableCdpSwPort>
<enableCdpPcPort>1</enableCdpPcPort>
<enableLldpSwPort>1</enableLldpSwPort>
<enableLldpPcPort>1</enableLldpPcPort>
<lldpAssetId>Cisco Phone</lldpAssetId>
<powerPriority>1</powerPriority>
<detectCMConnectionFailure>0</detectCMConnectionFailure>
<g722CodecSupport>2</g722CodecSupport>
<sshAccess>0</sshAccess>
<pcPort>0</pcPort>
<spanToPCPort>0</spanToPCPort>
<callHoldRingback>1</callHoldRingback>
<rtcp>1</rtcp>
<rtpcontrolprotocol>1</rtpcontrolprotocol>
<videoRtcp>1</videoRtcp>
</vendorConfig>
<userLocale>
<name>English_United_States</name>
<uid>39</uid>
<langCode>en_US</langCode>
<version>9.3(2.9902)US</version>
<winCharSet>utf-8</winCharSet>
</userLocale>
<networkLocale>United_States</networkLocale>
<networkLocaleInfo>
<name>United_States</name>
<uid>64</uid>
<version>4.0(1)</version>
</networkLocaleInfo>
<informationURL>http://x.x.x.x/shiftkey/handle_shift.php</informationURL>
<authenticationURL>http://x.x.x.x/authenticate.php</authenticationURL>
<!--<servicesURL>http://x.x.x.x/cisco/service.php?emcc=#EMCC#</servicesURL>-->
<directoryURL>http://x.x.x.x/CiscoDirectory/phonebook.php</directoryURL>
<messagesURL/>
<proxyServerURL/>
<dndCallAlert>5</dndCallAlert>
<dndReminderTimer>60</dndReminderTimer>
<phonePersonalization>0</phonePersonalization>
<rollover>0</rollover>
<singleButtonBarge>1</singleButtonBarge>
<joinAcrossLines>1</joinAcrossLines>
<autoCallPickupEnable>true</autoCallPickupEnable>
<blfAudibleAlertSettingOfIdleStation>1</blfAudibleAlertSettingOfIdleStation>
<blfAudibleAlertSettingOfBusyStation>1</blfAudibleAlertSettingOfBusyStation>
<advertiseG722Codec>1</advertiseG722Codec>
<userId>dkgroot</userId>
<transportLayerProtocol>2</transportLayerProtocol>
<deviceSecurityMode>1</deviceSecurityMode>
<dscpForSCCPPhoneConfig>96</dscpForSCCPPhoneConfig>
<dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices>
<dscpForCm2Dvce>184</dscpForCm2Dvce>
<phoneServices>
<provisioning>0</provisioning>
<phoneService type="1" category="0">
<name>Missed Calls</name>
<url>Application:Cisco/MissedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Received Calls</name>
<url>Application:Cisco/ReceivedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Placed Calls</name>
<url>Application:Cisco/PlacedCalls</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="1" category="0">
<name>Personal Directory</name>
<url>Application:Cisco/PersonalDirectory</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="2" category="0">
<name>Voicemail</name>
<url>Application:Cisco/Voicemail</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="0" category="0">
<name>Services</name>
<url>http://x.x.x.x/cisco/service.php?emmcmode=#EMCC#</url>
<vendor/>
<version/>
</phoneService>
<phoneService type="0" category="0">
<name>Login</name>
<url>http://x.x.x.x/cisco/service.php?name=#DEVICENAME#&amp;emmcmode=#EMCC#&amp;action=loginform</url>
<vendor/>
<version/>
</phoneService>
</phoneServices>
</device>

View file

@ -0,0 +1,255 @@
<device>
<fullConfig>true</fullConfig>
<deviceProtocol>SIP</deviceProtocol>
<devicePool>
<dateTimeSetting>
<dateTemplate>D/M/Y</dateTemplate>
<timeZone></timeZone>
<ntps>
<ntp>
<name></name>
<ntpMode>unicast</ntpMode>
</ntp>
</ntps>
</dateTimeSetting>
<callManagerGroup>
<members>
<member priority="0">
<callManager>
<ports>
<sipPort>5060</sipPort>
<securedSipPort>5061</securedSipPort>
</ports>
<processNodeName></processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
</devicePool>
<sipProfile>
<sipProxies>
<registerWithProxy>true</registerWithProxy>
<backupProxy>$ASTERISK</backupProxy>
<backupProxyPort>5060</backupProxyPort>
<emergencyProxy>$ASTERISK</emergencyProxy>
<emergencyProxyPort>5060</emergencyProxyPort>
<outboundProxy>$ASTERISK</outboundProxy>
<outboundProxyPort>5060</outboundProxyPort>
</sipProxies>
<sipCallFeatures>
<cnfJoinEnabled>true</cnfJoinEnabled>
<callForwardURI>x-cisco-serviceuri-cfwdall</callForwardURI>
<callPickupURI>x-cisco-serviceuri-pickup</callPickupURI>
<callPickupListURI>x-cisco-serviceuri-opickup</callPickupListURI>
<callPickupGroupURI>x-cisco-serviceuri-gpickup</callPickupGroupURI>
<meetMeServiceURI>x-cisco-serviceuri-meetme</meetMeServiceURI>
<abbreviatedDialURI>x-cisco-serviceuri-abbrdial</abbreviatedDialURI>
<rfc2543Hold>false</rfc2543Hold>
<callHoldRingback>1</callHoldRingback>
<localCfwdEnable>true</localCfwdEnable>
<semiAttendedTransfer>true</semiAttendedTransfer>
<anonymousCallBlock>3</anonymousCallBlock>
<callerIdBlocking>3</callerIdBlocking>
<dndControl>0</dndControl>
<remoteCcEnable>true</remoteCcEnable>
<retainForwardInformation>false</retainForwardInformation>
</sipCallFeatures>
<sipStack>
<sipInviteRetx>6</sipInviteRetx>
<sipRetx>10</sipRetx>
<timerInviteExpires>180</timerInviteExpires>
<timerRegisterExpires>3600</timerRegisterExpires>
<timerRegisterDelta>5</timerRegisterDelta>
<timerKeepAliveExpires>120</timerKeepAliveExpires>
<timerSubscribeExpires>120</timerSubscribeExpires>
<timerSubscribeDelta>5</timerSubscribeDelta>
<timerT1>500</timerT1>
<timerT2>4000</timerT2>
<maxRedirects>70</maxRedirects>
<remotePartyID>true</remotePartyID>
<userInfo>Phone</userInfo>
</sipStack>
<autoAnswerTimer>1</autoAnswerTimer>
<autoAnswerAltBehavior>false</autoAnswerAltBehavior>
<autoAnswerOverride>true</autoAnswerOverride>
<transferOnhookEnabled>true</transferOnhookEnabled>
<enableVad>false</enableVad>
<preferredCodec>g711alaw</preferredCodec>
<dtmfAvtPayload>101</dtmfAvtPayload>
<dtmfDbLevel>3</dtmfDbLevel>
<dtmfOutofBand>avt</dtmfOutofBand>
<alwaysUsePrimeLine>false</alwaysUsePrimeLine>
<alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail>
<kpml>0</kpml>
<phoneLabel></phoneLabel>
<stutterMsgWaiting>0</stutterMsgWaiting>
<callStats>true</callStats>
<offhookToFirstDigitTimer>15000</offhookToFirstDigitTimer>
<silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts>
<disableLocalSpeedDialConfig>false</disableLocalSpeedDialConfig>
<startMediaPort>16384</startMediaPort>
<stopMediaPort>32766</stopMediaPort>
<natEnabled>false</natEnabled>
<natReceivedProcessing>false</natReceivedProcessing>
<natAddress></natAddress>
<sipLines>
<line button="1" lineIndex="1">
<featureID>9</featureID>
<featureLabel></featureLabel>
<proxy>USECALLMANAGER</proxy>
<port>5060</port>
<name></name>
<displayName></displayName>
<autoAnswer>
<autoAnswerEnabled>0</autoAnswerEnabled>
</autoAnswer>
<callWaiting>3</callWaiting>
<authName></authName>
<authPassword></authPassword>
<contact></contact>
<sharedLine>false</sharedLine>
<messageWaitingLampPolicy>3</messageWaitingLampPolicy>
<messageWaitingAMWI>0</messageWaitingAMWI>
<messagesNumber></messagesNumber>
<ringSettingIdle>4</ringSettingIdle>
<ringSettingActive>5</ringSettingActive>
<forwardCallInfoDisplay>
<callerName>true</callerName>
<callerNumber>true</callerNumber>
<redirectedNumber>false</redirectedNumber>
<dialedNumber>true</dialedNumber>
</forwardCallInfoDisplay>
<maxNumCalls>5</maxNumCalls>
<busyTrigger>4</busyTrigger>
</line>
</sipLines>
<externalNumberMask></externalNumberMask>
<voipControlPort>5060</voipControlPort>
<dscpForAudio>184</dscpForAudio>
<ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy>
<dialTemplate></dialTemplate>
<softKeyFile></softKeyFile>
</sipProfile>
<MissedCallLoggingOption>1</MissedCallLoggingOption>
<commonProfile>
<phonePassword></phonePassword>
<backgroundImageAccess>true</backgroundImageAccess>
<callLogBlfEnabled>2</callLogBlfEnabled>
</commonProfile>
<vendorConfig>
<disableSpeaker>false</disableSpeaker>
<disableSpeakerAndHeadset>false</disableSpeakerAndHeadset>
<enableMuteFeature>false</enableMuteFeature>
<enableGroupListen>true</enableGroupListen>
<pcPort>0</pcPort>
<spanToPCPort>1</spanToPCPort>
<garp>0</garp>
<rtcp>1</rtcp>
<voiceVlanAccess>0</voiceVlanAccess>
<videoCapability>1</videoCapability>
<ehookEnable>0</ehookEnable>
<autoSelectLineEnable>1</autoSelectLineEnable>
<autoCallSelect>1</autoCallSelect>
<minimumRingVolume></minimumRingVolume>
<settingsAccess>1</settingsAccess>
<webProtocol>0</webProtocol>
<webAccess>0</webAccess>
<sshAccess>0</sshAccess>
<detectCMConnectionFailure>0</detectCMConnectionFailure>
<g722CodecSupport>1</g722CodecSupport>
<handsetWidebandEnable>2</handsetWidebandEnable>
<headsetWidebandEnable>2</headsetWidebandEnable>
<headsetWidebandUIControl>1</headsetWidebandUIControl>
<handsetWidebandUIControl>1</handsetWidebandUIControl>
<daysDisplayNotActive>1,7</daysDisplayNotActive>
<displayOnTime>08:00</displayOnTime>
<displayOnDuration>10:00</displayOnDuration>
<displayIdleTimeout>00:10</displayIdleTimeout>
<displayOnWhenIncomingCall>1</displayOnWhenIncomingCall>
<displayRefreshRate>0</displayRefreshRate>
<recordingTone>0</recordingTone>
<recordingToneLocalVolume>100</recordingToneLocalVolume>
<recordingToneRemoteVolume>50</recordingToneRemoteVolume>
<recordingToneDuration></recordingToneDuration>
<moreKeyReversionTimer>5</moreKeyReversionTimer>
<peerFirmwareSharing>0</peerFirmwareSharing>
<loadServer></loadServer>
<enableCdpSwPort>1</enableCdpSwPort>
<enableCdpPcPort>0</enableCdpPcPort>
<enableLldpSwPort>1</enableLldpSwPort>
<enableLldpPcPort>0</enableLldpPcPort>
</vendorConfig>
<versionStamp>d902ed5a-c1e5-4233-b1d6-a960d53d1c3a</versionStamp>
<loadInformation></loadInformation>
<phoneServices useHTTPS="false">
<provisioning>2</provisioning>
<phoneService type="1" category="0">
<name>Missed Calls</name>
<url>Application:Cisco/MissedCalls</url>
<vendor></vendor>
<version></version>
</phoneService>
<phoneService type="1" category="0">
<name>Received Calls</name>
<url>Application:Cisco/ReceivedCalls</url>
<vendor></vendor>
<version></version>
</phoneService>
<phoneService type="1" category="0">
<name>Placed Calls</name>
<url>Application:Cisco/PlacedCalls</url>
<vendor></vendor>
<version></version>
</phoneService>
<phoneService type="2" category="0">
<name>Voicemail</name>
<url>Application:Cisco/Voicemail</url>
<vendor></vendor>
<version></version>
</phoneService>
</phoneServices>
<userLocale>
<name></name>
<uid>1</uid>
<langCode></langCode>
<version>10</version>
<winCharSet>utf-8</winCharSet>
</userLocale>
<networkLocale></networkLocale>
<networkLocaleInfo>
<name></name>
<version>10</version>
</networkLocaleInfo>
<deviceSecurityMode>1</deviceSecurityMode>
<idleTimeout>0</idleTimeout>
<authenticationURL></authenticationURL>
<messagesURL></messagesURL>
<servicesURL></servicesURL>
<directoryURL></directoryURL>
<idleURL></idleURL>
<informationURL></informationURL>
<proxyServerURL></proxyServerURL>
<secureAuthenticationURL></secureAuthenticationURL>
<secureMessagesURL></secureMessagesURL>
<secureServicesURL></secureServicesURL>
<secureDirectoryURL></secureDirectoryURL>
<secureInformationURL></secureInformationURL>
<secureIdleURL></secureIdleURL>
<transportLayerProtocol>1</transportLayerProtocol>
<TLSResumptionTimer>3600</TLSResumptionTimer>
<phonePersonalization>1</phonePersonalization>
<autoCallPickupEnable>true</autoCallPickupEnable>
<blfAudibleAlertSettingOfIdleStation>0</blfAudibleAlertSettingOfIdleStation>
<blfAudibleAlertSettingOfBusyStation>0</blfAudibleAlertSettingOfBusyStation>
<dndCallAlert>1</dndCallAlert>
<dndReminderTimer>5</dndReminderTimer>
<advertiseG722Codec>1</advertiseG722Codec>
<rollover>0</rollover>
<joinAcrossLines>0</joinAcrossLines>
<capfAuthMode>0</capfAuthMode>
<capfList></capfList>
<certHash></certHash>
<encrConfig>false</encrConfig>
<sshUserId></sshUserId>
<sshPassword></sshPassword>
</device>

View file

@ -0,0 +1,300 @@
<device>
<fullConfig>true</fullConfig>
<deviceProtocol>SIP</deviceProtocol>
<devicePool>
<dateTimeSetting>
<dateTemplate>D/M/Y</dateTemplate>
<timeZone></timeZone>
<ntps>
<ntp>
<name></name>
<ntpMode>unicast</ntpMode>
</ntp>
</ntps>
</dateTimeSetting>
<callManagerGroup>
<members>
<member priority="0">
<callManager>
<ports>
<sipPort>5060</sipPort>
<securedSipPort>5061</securedSipPort>
</ports>
<processNodeName></processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
</devicePool>
<sipProfile>
<sipProxies>
<registerWithProxy>true</registerWithProxy>
</sipProxies>
<sipCallFeatures>
<cnfJoinEnabled>true</cnfJoinEnabled>
<callForwardURI>x-cisco-serviceuri-cfwdall</callForwardURI>
<callPickupURI>x-cisco-serviceuri-pickup</callPickupURI>
<callPickupListURI>x-cisco-serviceuri-opickup</callPickupListURI>
<callPickupGroupURI>x-cisco-serviceuri-gpickup</callPickupGroupURI>
<meetMeServiceURI>x-cisco-serviceuri-meetme</meetMeServiceURI>
<abbreviatedDialURI>x-cisco-serviceuri-abbrdial</abbreviatedDialURI>
<rfc2543Hold>false</rfc2543Hold>
<callHoldRingback>1</callHoldRingback>
<localCfwdEnable>true</localCfwdEnable>
<semiAttendedTransfer>true</semiAttendedTransfer>
<anonymousCallBlock>3</anonymousCallBlock>
<callerIdBlocking>3</callerIdBlocking>
<dndControl>0</dndControl>
<remoteCcEnable>true</remoteCcEnable>
<retainForwardInformation>false</retainForwardInformation>
<uriDialingDisplayPreference>1</uriDialingDisplayPreference>
</sipCallFeatures>
<sipStack>
<sipInviteRetx>6</sipInviteRetx>
<sipRetx>10</sipRetx>
<timerInviteExpires>180</timerInviteExpires>
<timerRegisterExpires>3600</timerRegisterExpires>
<timerRegisterDelta>5</timerRegisterDelta>
<timerKeepAliveExpires>120</timerKeepAliveExpires>
<timerSubscribeExpires>120</timerSubscribeExpires>
<timerSubscribeDelta>5</timerSubscribeDelta>
<timerT1>500</timerT1>
<timerT2>4000</timerT2>
<maxRedirects>70</maxRedirects>
<remotePartyID>true</remotePartyID>
<userInfo>Phone</userInfo>
</sipStack>
<autoAnswerTimer>1</autoAnswerTimer>
<autoAnswerAltBehavior>false</autoAnswerAltBehavior>
<autoAnswerOverride>true</autoAnswerOverride>
<transferOnhookEnabled>true</transferOnhookEnabled>
<enableVad>false</enableVad>
<preferredCodec>none</preferredCodec>
<dtmfAvtPayload>101</dtmfAvtPayload>
<dtmfDbLevel>3</dtmfDbLevel>
<dtmfOutofBand>avt</dtmfOutofBand>
<alwaysUsePrimeLine>false</alwaysUsePrimeLine>
<alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail>
<kpml>0</kpml>
<phoneLabel></phoneLabel>
<stutterMsgWaiting>0</stutterMsgWaiting>
<callStats>true</callStats>
<offhookToFirstDigitTimer>15000</offhookToFirstDigitTimer>
<silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts>
<disableLocalSpeedDialConfig>false</disableLocalSpeedDialConfig>
<startMediaPort>16384</startMediaPort>
<stopMediaPort>32766</stopMediaPort>
<natEnabled>false</natEnabled>
<natReceivedProcessing>false</natReceivedProcessing>
<natAddress></natAddress>
<sipLines>
<line button="1" lineIndex="1">
<featureID>9</featureID>
<featureLabel></featureLabel>
<proxy>USECALLMANAGER</proxy>
<port>5060</port>
<name></name>
<displayName></displayName>
<autoAnswer>
<autoAnswerEnabled>0</autoAnswerEnabled>
</autoAnswer>
<callWaiting>3</callWaiting>
<authName></authName>
<authPassword></authPassword>
<contact></contact>
<sharedLine>false</sharedLine>
<messageWaitingLampPolicy>3</messageWaitingLampPolicy>
<messageWaitingAMWI>0</messageWaitingAMWI>
<messagesNumber></messagesNumber>
<ringSettingIdle>4</ringSettingIdle>
<ringSettingActive>5</ringSettingActive>
<forwardCallInfoDisplay>
<callerName>true</callerName>
<callerNumber>true</callerNumber>
<redirectedNumber>false</redirectedNumber>
<dialedNumber>true</dialedNumber>
</forwardCallInfoDisplay>
<maxNumCalls>5</maxNumCalls>
<busyTrigger>4</busyTrigger>
</line>
</sipLines>
<externalNumberMask></externalNumberMask>
<voipControlPort>5060</voipControlPort>
<dscpForAudio>184</dscpForAudio>
<ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy>
<dialTemplate></dialTemplate>
<softKeyFile></softKeyFile>
</sipProfile>
<MissedCallLoggingOption>1</MissedCallLoggingOption>
<featurePolicyFile></featurePolicyFile>
<commonProfile>
<phonePassword></phonePassword>
<backgroundImageAccess>true</backgroundImageAccess>
<callLogBlfEnabled>2</callLogBlfEnabled>
</commonProfile>
<vendorConfig>
<defaultWallpaperFile></defaultWallpaperFile>
<disableSpeaker>false</disableSpeaker>
<disableSpeakerAndHeadset>false</disableSpeakerAndHeadset>
<enableMuteFeature>false</enableMuteFeature>
<enableGroupListen>true</enableGroupListen>
<holdResumeKey>1</holdResumeKey>
<recentsSoftKey>1</recentsSoftKey>
<dfBit>1</dfBit>
<pcPort>0</pcPort>
<spanToPCPort>1</spanToPCPort>
<garp>0</garp>
<rtcp>1</rtcp>
<videoRtcp>1</videoRtcp>
<voiceVlanAccess>0</voiceVlanAccess>
<videoCapability>1</videoCapability>
<hideVideoByDefault>0</hideVideoByDefault>
<separateMute>0</separateMute>
<ciscoCamera>1</ciscoCamera>
<usb1>1</usb1>
<usb2>1</usb2>
<usbClasses>0,1,2</usbClasses>
<sdio>1</sdio>
<wifi>1</wifi>
<bluetooth>1</bluetooth>
<bluetoothProfile>0,1</bluetoothProfile>
<btpbap>0</btpbap>
<bthfu>0</bthfu>
<ehookEnable>0</ehookEnable>
<autoSelectLineEnable>1</autoSelectLineEnable>
<autoCallSelect>1</autoCallSelect>
<incomingCallToastTimer>10</incomingCallToastTimer>
<dialToneFromReleaseKey>0</dialToneFromReleaseKey>
<joinAndDirectTransferPolicy>0</joinAndDirectTransferPolicy>
<minimumRingVolume></minimumRingVolume>
<simplifiedNewCall>0</simplifiedNewCall>
<actionableAlert>0</actionableAlert>
<showCallHistoryForSelectedLine>0</showCallHistoryForSelectedLine>
<kemOneColumn>0</kemOneColumn>
<lineMode>0</lineMode>
<allCallsOnPrimary>0</allCallsOnPrimary>
<softKeyControl>0</softKeyControl>
<settingsAccess>1</settingsAccess>
<webProtocol>0</webProtocol>
<webAccess>0</webAccess>
<webAdmin>1</webAdmin>
<adminPassword></adminPassword>
<sshAccess>0</sshAccess>
<detectCMConnectionFailure>0</detectCMConnectionFailure>
<g722CodecSupport>1</g722CodecSupport>
<handsetWidebandEnable>2</handsetWidebandEnable>
<headsetWidebandEnable>2</headsetWidebandEnable>
<headsetWidebandUIControl>1</headsetWidebandUIControl>
<handsetWidebandUIControl>1</handsetWidebandUIControl>
<daysDisplayNotActive>1,7</daysDisplayNotActive>
<displayOnTime>08:00</displayOnTime>
<displayOnDuration>10:00</displayOnDuration>
<displayIdleTimeout>00:10</displayIdleTimeout>
<displayOnWhenIncomingCall>1</displayOnWhenIncomingCall>
<displayRefreshRate>0</displayRefreshRate>
<daysBacklightNotActive>1,7</daysBacklightNotActive>
<backlightOnTime>08:00</backlightOnTime>
<backlightOnDuration>10:00</backlightOnDuration>
<backlightIdleTimeout>00:10</backlightIdleTimeout>
<backlightOnWhenIncomingCall>1</backlightOnWhenIncomingCall>
<recordingTone>0</recordingTone>
<recordingToneLocalVolume>100</recordingToneLocalVolume>
<recordingToneRemoteVolume>50</recordingToneRemoteVolume>
<recordingToneDuration></recordingToneDuration>
<moreKeyReversionTimer>5</moreKeyReversionTimer>
<peerFirmwareSharing>0</peerFirmwareSharing>
<loadServer></loadServer>
<problemReportUploadURL></problemReportUploadURL>
<enableCdpSwPort>1</enableCdpSwPort>
<enableCdpPcPort>0</enableCdpPcPort>
<enableLldpSwPort>1</enableLldpSwPort>
<enableLldpPcPort>0</enableLldpPcPort>
<cdpEnable>true</cdpEnable>
<outOfRangeAlert>0</outOfRangeAlert>
<scanningMode>2</scanningMode>
<applicationURL></applicationURL>
<appButtonTimer>0</appButtonTimer>
<appButtonPriority>0</appButtonPriority>
<specialNumbers></specialNumbers>
<sendKeyAction>0</sendKeyAction>
<powerOffWhenCharging>0</powerOffWhenCharging>
<homeScreen>0</homeScreen>
<accessContacts>1</accessContacts>
<accessFavorites>1</accessFavorites>
<accessVoicemail>1</accessVoicemail>
<accessApps>1</accessApps>
</vendorConfig>
<versionStamp>d902ed5a-c1e5-4233-b1d6-a960d53d1c3a</versionStamp>
<loadInformation></loadInformation>
<phoneServices useHTTPS="false">
<provisioning>2</provisioning>
<phoneService type="1" category="0">
<name>Missed Calls</name>
<url>Application:Cisco/MissedCalls</url>
<vendor></vendor>
<version></version>
</phoneService>
<phoneService type="1" category="0">
<name>Received Calls</name>
<url>Application:Cisco/ReceivedCalls</url>
<vendor></vendor>
<version></version>
</phoneService>
<phoneService type="1" category="0">
<name>Placed Calls</name>
<url>Application:Cisco/PlacedCalls</url>
<vendor></vendor>
<version></version>
</phoneService>
<phoneService type="2" category="0">
<name>Voicemail</name>
<url>Application:Cisco/Voicemail</url>
<vendor></vendor>
<version></version>
</phoneService>
</phoneServices>
<userLocale>
<name></name>
<uid>1</uid>
<langCode></langCode>
<version></version>
<winCharSet>utf-8</winCharSet>
</userLocale>
<networkLocale></networkLocale>
<networkLocaleInfo>
<name></name>
<version></version>
</networkLocaleInfo>
<deviceSecurityMode>1</deviceSecurityMode>
<idleTimeout>0</idleTimeout>
<authenticationURL></authenticationURL>
<messagesURL></messagesURL>
<servicesURL></servicesURL>
<directoryURL></directoryURL>
<idleURL></idleURL>
<informationURL></informationURL>
<proxyServerURL></proxyServerURL>
<secureAuthenticationURL></secureAuthenticationURL>
<secureMessagesURL></secureMessagesURL>
<secureServicesURL></secureServicesURL>
<secureDirectoryURL></secureDirectoryURL>
<secureInformationURL></secureInformationURL>
<secureIdleURL></secureIdleURL>
<transportLayerProtocol>1</transportLayerProtocol>
<TLSResumptionTimer>3600</TLSResumptionTimer>
<phonePersonalization>1</phonePersonalization>
<autoCallPickupEnable>true</autoCallPickupEnable>
<blfAudibleAlertSettingOfIdleStation>0</blfAudibleAlertSettingOfIdleStation>
<blfAudibleAlertSettingOfBusyStation>0</blfAudibleAlertSettingOfBusyStation>
<dndCallAlert>1</dndCallAlert>
<dndReminderTimer>5</dndReminderTimer>
<advertiseG722Codec>1</advertiseG722Codec>
<rollover>0</rollover>
<joinAcrossLines>0</joinAcrossLines>
<capfAuthMode>0</capfAuthMode>
<capfList></capfList>
<certHash></certHash>
<encrConfig>false</encrConfig>
<sshUserId></sshUserId>
<sshPassword></sshPassword>
</device>

View file

@ -0,0 +1,201 @@
<softKeyCfg>
<versionStamp>0200d4f8-e302-4315-b91e-9490e0b37fc5</versionStamp>
<typeSoftKey>
<softKeyDef keyID="Undefined">
<tag>0</tag>
<eventID>0</eventID>
<helpID>0</helpID>
</softKeyDef>
<softKeyDef keyID="Redial">
<tag>1</tag>
<eventID>1</eventID>
<helpID>301</helpID>
</softKeyDef>
<softKeyDef keyID="NewCall">
<tag>2</tag>
<eventID>2</eventID>
<helpID>302</helpID>
</softKeyDef>
<softKeyDef keyID="Hold">
<tag>3</tag>
<eventID>3</eventID>
<helpID>303</helpID>
</softKeyDef>
<softKeyDef keyID="Transfer">
<tag>4</tag>
<eventID>4</eventID>
<helpID>304</helpID>
</softKeyDef>
<softKeyDef keyID="CFwdAll">
<tag>5</tag>
<eventID>5</eventID>
<helpID>305</helpID>
</softKeyDef>
<softKeyDef keyID="&lt;&lt;">
<tag>8</tag>
<eventID>8</eventID>
<helpID>308</helpID>
</softKeyDef>
<softKeyDef keyID="EndCall">
<tag>9</tag>
<eventID>9</eventID>
<helpID>309</helpID>
</softKeyDef>
<softKeyDef keyID="Resume">
<tag>10</tag>
<eventID>10</eventID>
<helpID>310</helpID>
</softKeyDef>
<softKeyDef keyID="Answer">
<tag>11</tag>
<eventID>11</eventID>
<helpID>311</helpID>
</softKeyDef>
<softKeyDef keyID="Confrn">
<tag>13</tag>
<eventID>13</eventID>
<helpID>313</helpID>
</softKeyDef>
<softKeyDef keyID="Park">
<tag>14</tag>
<eventID>14</eventID>
<helpID>314</helpID>
</softKeyDef>
<softKeyDef keyID="Join">
<tag>15</tag>
<eventID>15</eventID>
<helpID>315</helpID>
</softKeyDef>
<softKeyDef keyID="MeetMe">
<tag>16</tag>
<eventID>16</eventID>
<helpID>316</helpID>
</softKeyDef>
<softKeyDef keyID="PickUp">
<tag>17</tag>
<eventID>17</eventID>
<helpID>317</helpID>
</softKeyDef>
<softKeyDef keyID="GPickUp">
<tag>18</tag>
<eventID>18</eventID>
<helpID>318</helpID>
</softKeyDef>
<softKeyDef keyID="RmLstC">
<tag>57</tag>
<eventID>19</eventID>
<helpID>319</helpID>
</softKeyDef>
<softKeyDef keyID="DND">
<tag>63</tag>
<eventID>69</eventID>
<helpID>369</helpID>
</softKeyDef>
<softKeyDef keyID="CallBack">
<tag>65</tag>
<eventID>20</eventID>
<helpID>320</helpID>
</softKeyDef>
<softKeyDef keyID="QRT">
<tag>75</tag>
<eventID>22</eventID>
<helpID>322</helpID>
</softKeyDef>
<softKeyDef keyID="MCID">
<tag>76</tag>
<eventID>27</eventID>
<helpID>327</helpID>
</softKeyDef>
<softKeyDef keyID="Select">
<tag>78</tag>
<eventID>29</eventID>
<helpID>329</helpID>
</softKeyDef>
<softKeyDef keyID="ConfList">
<tag>79</tag>
<eventID>30</eventID>
<helpID>330</helpID>
</softKeyDef>
<softKeyDef keyID="iDivert">
<tag>80</tag>
<eventID>31</eventID>
<helpID>331</helpID>
</softKeyDef>
<softKeyDef keyID="OPickUp">
<tag>91</tag>
<eventID>34</eventID>
<helpID>334</helpID>
</softKeyDef>
<softKeyDef keyID="HLog">
<tag>92</tag>
<eventID>35</eventID>
<helpID>335</helpID>
</softKeyDef>
<softKeyDef keyID="AbbrDial">
<tag>7740</tag>
<eventID>71</eventID>
<helpID>371</helpID>
</softKeyDef>
<softKeyDef keyID="Record">
<tag>7747</tag>
<eventID>74</eventID>
<helpID>374</helpID>
</softKeyDef>
</typeSoftKey>
<softKeySets>
<softKeySet id="On Hook">
<softKey keyID="Redial" />
<softKey keyID="NewCall" />
<softKey keyID="DND" />
<softKey keyID="CFwdAll" />
</softKeySet>
<softKeySet id="Off Hook">
<softKey keyID="Redial" />
<softKey keyID="EndCall" />
<softKey keyID="PickUp" />
</softKeySet>
<softKeySet id="Off Hook With Feature">
<softKey keyID="Redial" />
<softKey keyID="EndCall" />
</softKeySet>
<softKeySet id="Digits After First">
<softKey keyID="&lt;&lt;" />
<softKey keyID="EndCall" />
</softKeySet>
<softKeySet id="Ring Out">
<softKey keyID="Undefined" />
<softKey keyID="EndCall" />
</softKeySet>
<softKeySet id="Connected">
<softKey keyID="Hold" />
<softKey keyID="EndCall" />
<softKey keyID="Transfer" />
<softKey keyID="Confrn" />
<softKey keyID="ConfList" />
<softKey keyID="Park" />
</softKeySet>
<softKeySet id="Connected No Feature">
<softKey keyID="Undefined" />
<softKey keyID="EndCall" />
</softKeySet>
<softKeySet id="Connected Transfer">
<softKey keyID="Undefined" />
<softKey keyID="EndCall" />
<softKey keyID="Transfer" />
</softKeySet>
<softKeySet id="Connected Conference">
<softKey keyID="Undefined" />
<softKey keyID="EndCall" />
<softKey keyID="Confrn" />
<softKey keyID="ConfList" />
</softKeySet>
<softKeySet id="On Hold">
<softKey keyID="Resume" />
<softKey keyID="NewCall" />
</softKeySet>
<softKeySet id="Ring In">
<softKey keyID="Answer" />
<softKey keyID="iDivert" />
</softKeySet>
</softKeySets>
</softKeyCfg>

View file

@ -0,0 +1,142 @@
<typeSoftKey>
<softKeyDef keyID="Undefined">
<tag>0</tag>
<eventID>0</eventID>
<helpID>0</helpID>
</softKeyDef>
<softKeyDef keyID="Redial">
<tag>1</tag>
<eventID>1</eventID>
<helpID>301</helpID>
</softKeyDef>
<softKeyDef keyID="NewCall">
<tag>2</tag>
<eventID>2</eventID>
<helpID>302</helpID>
</softKeyDef>
<softKeyDef keyID="Hold">
<tag>3</tag>
<eventID>3</eventID>
<helpID>303</helpID>
</softKeyDef>
<softKeyDef keyID="Transfer">
<tag>4</tag>
<eventID>4</eventID>
<helpID>304</helpID>
</softKeyDef>
<softKeyDef keyID="CFwdAll">
<tag>5</tag>
<eventID>5</eventID>
<helpID>305</helpID>
</softKeyDef>
<softKeyDef keyID="&lt;&lt;">
<tag>8</tag>
<eventID>8</eventID>
<helpID>308</helpID>
</softKeyDef>
<softKeyDef keyID="EndCall">
<tag>9</tag>
<eventID>9</eventID>
<helpID>309</helpID>
</softKeyDef>
<softKeyDef keyID="Resume">
<tag>10</tag>
<eventID>10</eventID>
<helpID>310</helpID>
</softKeyDef>
<softKeyDef keyID="Answer">
<tag>11</tag>
<eventID>11</eventID>
<helpID>311</helpID>
</softKeyDef>
<softKeyDef keyID="Confrn">
<tag>13</tag>
<eventID>13</eventID>
<helpID>313</helpID>
</softKeyDef>
<softKeyDef keyID="Park">
<tag>14</tag>
<eventID>14</eventID>
<helpID>314</helpID>
</softKeyDef>
<softKeyDef keyID="Join">
<tag>15</tag>
<eventID>15</eventID>
<helpID>315</helpID>
</softKeyDef>
<softKeyDef keyID="MeetMe">
<tag>16</tag>
<eventID>16</eventID>
<helpID>316</helpID>
</softKeyDef>
<softKeyDef keyID="PickUp">
<tag>17</tag>
<eventID>17</eventID>
<helpID>317</helpID>
</softKeyDef>
<softKeyDef keyID="GPickUp">
<tag>18</tag>
<eventID>18</eventID>
<helpID>318</helpID>
</softKeyDef>
<softKeyDef keyID="RmLstC">
<tag>57</tag>
<eventID>19</eventID>
<helpID>319</helpID>
</softKeyDef>
<softKeyDef keyID="DND">
<tag>63</tag>
<eventID>69</eventID>
<helpID>369</helpID>
</softKeyDef>
<softKeyDef keyID="CallBack">
<tag>65</tag>
<eventID>20</eventID>
<helpID>320</helpID>
</softKeyDef>
<softKeyDef keyID="QRT">
<tag>75</tag>
<eventID>22</eventID>
<helpID>322</helpID>
</softKeyDef>
<softKeyDef keyID="MCID">
<tag>76</tag>
<eventID>27</eventID>
<helpID>327</helpID>
</softKeyDef>
<softKeyDef keyID="Select">
<tag>78</tag>
<eventID>29</eventID>
<helpID>329</helpID>
</softKeyDef>
<softKeyDef keyID="ConfList">
<tag>79</tag>
<eventID>30</eventID>
<helpID>330</helpID>
</softKeyDef>
<softKeyDef keyID="iDivert">
<tag>80</tag>
<eventID>31</eventID>
<helpID>331</helpID>
</softKeyDef>
<softKeyDef keyID="OPickUp">
<tag>91</tag>
<eventID>34</eventID>
<helpID>334</helpID>
</softKeyDef>
<softKeyDef keyID="HLog">
<tag>92</tag>
<eventID>35</eventID>
<helpID>335</helpID>
</softKeyDef>
<softKeyDef keyID="AbbrDial">
<tag>7740</tag>
<eventID>71</eventID>
<helpID>371</helpID>
</softKeyDef>
<softKeyDef keyID="Record">
<tag>7747</tag>
<eventID>74</eventID>
<helpID>374</helpID>
</softKeyDef>
</typeSoftKey>

View file

@ -1,319 +0,0 @@
<?php
// vim: set ai ts=4 sw=4 ft=php:
// Version for SCCP Manager 13.0.X
//
// Templete for Sccp Driver
//
namespace FreePBX\modules\Core\Drivers;
class Sccp extends \FreePBX\modules\Core\Driver {
private $data_fld = array("pin"=>'pin', "label" => 'label', "accountcode" => 'account',
"context" =>'lcontext',"incominglimit"=>'incominglimit',
"callgroup"=>'callgroup',"pickupgroup"=>'pickupgroup',
"transfer" => 'transfer', "echocancel" => 'echocancel',
"language" => 'language', "description" => 'callerid',
"cid_num" => 'cid_num', "cid_name" => 'label', "mailbox" => 'description',
"musicclass" => 'musicclass',
"dnd" => 'dnd', "silencesuppression" => 'silencesuppression',
"secondary_dialtone_digits" => 'secondary_dialtone_digits', "secondary_dialtone_tone" => 'secondary_dialtone_tone',
'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup'
);
public function getInfo() {
return array(
"rawName" => "sccp",
"hardware" => "sccp_custom",
"prettyName" => _("Sccp Custom Driver"),
"shortName" => "SCCP",
"description" => _("Sccp Device"),
"Version" => "11.3",
"about" => "Sccp mysql class Base ver: 11.3, Sccp ver: default"
);
}
/* public function addDevice1($id, $settings) {
$sql = 'INSERT INTO sccp (id, keyword, data, flags) values (?,?,?,?)';
$sth = $this->database->prepare($sql);
$settings = is_array($settings)?$settings:array();
foreach($settings as $key => $setting) {
$sth->execute(array($id,$key,$setting['value'],$setting['flag']));
}
return true;
}
*/
public function addDevice($id, $settings) {
$add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description');
// print_r($_REQUEST);
// echo '<br><br>';
// die(print_r($settings));
$settings['cid_num']['value']='';
if (isset($_REQUEST)){
foreach($add_fld as $key => $val) {
if (!empty($_REQUEST[$key])){
$settings[$val]['value'] = $_REQUEST[$key];
}
}
}
if (empty($settings['cid_num']['value'])) {
$settings['cid_num']['value']= $id;
}
$sql = 'INSERT INTO sccpline (name';
$sqlv = 'values ("'.$id.'"';
foreach($this->data_fld as $key => $val) {
if (!empty($settings[$val]) ) {
if (!empty($settings[$val]['value'])){
$sql .= ', '.$key;
$sqlv .= ", '".$settings[$val]['value']."' ";
}
}
}
$sql .= ") ".$sqlv.");";
$sth = $this->database->prepare($sql);
$sth->execute();
return true;
}
public function delDevice($id) {
$sql = "DELETE FROM sccpline WHERE name = ?";
$sth = $this->database->prepare($sql);
$sth->execute(array($id));
return true;
}
public function getDevice($id) {
$sccp_line = array();
// $sql = "SELECT name as id, name as name";
$sql = "SELECT name as id, name as name ";
foreach($this->data_fld as $key => $val) {
$sql .= ',`'. $key .'` as '.$val;
}
$sql .= " FROM sccpline WHERE name = ?";
$sth = $this->database->prepare($sql);
$result = array();
$tech = array();
try {
$sth->execute(array($id));
$result = $sth->fetch(\PDO::FETCH_ASSOC);
$tech = $result;
$tech['dial']='SCCP/'.$id;
} catch(\Exception $e) {}
return $tech;
}
public function getDefaultDeviceSettings($id, $displayname, &$flag) {
$dial = 'SCCP';
$settings = array(
"pin" => array(
"value" => "",
"flag" => $flag++
),
"incominglimit" => array(
"value" => "",
"flag" => $flag++
),
"lcontext" => array(
"value" => "from-internal",
"flag" => $flag++
),
"callgroup" => array(
"value" => "",
"flag" => $flag++
),
"namedcallgroup" => array(
"value" => "",
"flag" => $flag++
),
"pickupgroup" => array(
"value" => "",
"flag" => $flag++
),
"namedpickupgroup" => array(
"value" => "",
"flag" => $flag++
),
"transfer" => array(
"value" => "yes",
"flag" => $flag++
),
"adhocNumber" => array(
"value" => "",
"flag" => $flag++
),
"echocancel" => array(
"value" => "no",
"flag" => $flag++
),
"dnd" => array(
"value" => "UserDefined",
"flag" => $flag++
),
"silencesuppression" => array(
"value" => "no",
"flag" => $flag++
),
"secondary_dialtone_digits" => array(
"value" => "9",
"flag" => $flag++
),
"secondary_dialtone_tone" => array(
"value" => "0x22",
"flag" => $flag++
),
"musicclass" => array(
"value" => "default",
"flag" => $flag++
),
);
return array(
"dial" => $dial,
"settings" => $settings
);
}
# !TODO!: -TODO-: Would it not be better to put this part in the view directory (MVC) ? No, This is a template for Freepbx.
public function getDeviceDisplay($display, $deviceInfo, $currentcomponent, $primarySection) {
$section = _("Settings");
$category = "general";
$tmparr = array();
$tt = _("The maximum number of incoming calls on this line.");
// $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '2', 'tt' => $tt, 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidChannel);
// !TODO!: Please change the default value for incominglimit to '6' or higher
$tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '2', 'tt' => $tt, 'level' => 1);
$tt = _("Asterisk context which this line will use to send and receive calls (Note: Only change this is you know what you are doing).");
$tmparr['lcontext'] = array('prompttext' => _('Line context'), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1);
// !TODO!: -TODO-: Maybe completely remove support for old numberic callgroup/pickupgroup in favor of the named version ? See Sccp.class.php.v431
$tt = _("Phone call group (numeric only, example:1,3-4)");
$tmparr['callgroup'] = array('prompttext' => _('Call group id'),'value' => '', 'tt' => $tt, 'level' => 1);
// !TODO!: -TODO-: multiple allowed (not sure if that is implemented here). See Sccp.class.php.v431
$tt = _("Phone named call group (>asterisk-11)");
$tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1);
$tt = _("Sets the pickup group (numeric only, example:1,3-4) this line is a member of. Allows this line to pickup calls from remote phones which are in this callhroup.");
$tmparr['pickupgroup'] = array('prompttext' => _('Pickup group id'),'value' => '', 'tt' => $tt, 'level' => 1);
// !TODO!: -TODO-: multiple allowed (not sure if that is implemented here). See Sccp.class.php.v431
$tt = _("Sets the named pickup name group this line is a member of. Allows this line to pickup calls from remote phones which are in this name callgroup (>asterisk-11).");
$tmparr['namedpickupgroup'] = array('prompttext' => _('Named Pickup Group'),'value' => '', 'tt' => $tt, 'level' => 1);
$tt = _("Phone pincode (Note used)");
$tmparr['pin'] = array('value' => '', 'tt' => $tt, 'level' => 1);
$tt = _("Digits to indicate an external line to user (secondary dialtone) Sample 9 or 8 (max 9 digits)");
$tmparr['secondary_dialtone_digits'] = array('prompttext' => _('Secondary dialtone digits'), 'value' => '', 'tt' => $tt, 'level' => 1);
unset($select);
$select[] = array( 'value' => '0x21', 'text' => 'Inside Dial Tone');
$select[] = array( 'value' => '0x22', 'text' => 'Outside Dial Tone');
$select[] = array( 'value' => '0x23', 'text' => 'Line Busy Tone');
$select[] = array( 'value' => '0x24', 'text' => 'Alerting Tone');
$select[] = array( 'value' => '0x25', 'text' => 'Reorder Tone');
$select[] = array( 'value' => '0x26', 'text' => 'Recorder Warning Tone');
$select[] = array( 'value' => '0x27', 'text' => 'Recorder Detected Tone');
$select[] = array( 'value' => '0x28', 'text' => 'Reverting Tone');
$select[] = array( 'value' => '0x29', 'text' => 'Receiver OffHook Tone');
$select[] = array( 'value' => '0x2A', 'text' => 'Partial Dial Tone');
$select[] = array( 'value' => '0x2B', 'text' => 'No Such Number Tone');
$select[] = array( 'value' => '0x2C', 'text' => 'Busy Verification Tone');
$select[] = array( 'value' => '0x2D', 'text' => 'Call Waiting Tone');
$select[] = array( 'value' => '0x2E', 'text' => 'Confirmation Tone');
$select[] = array( 'value' => '0x2F', 'text' => 'Camp On Indication Tone');
$select[] = array( 'value' => '0x30', 'text' => 'Recall Dial Tone');
$select[] = array( 'value' => '0x31', 'text' => 'Zip Zip');
$select[] = array( 'value' => '0x32', 'text' => 'Zip');
$select[] = array( 'value' => '0x33', 'text' => 'Beep Bonk');
$select[] = array( 'value' => '0x34', 'text' => 'Music Tone');
$select[] = array( 'value' => '0x35', 'text' => 'Hold Tone');
$select[] = array( 'value' => '0x36', 'text' => 'Test Tone');
$select[] = array( 'value' => '0x37', 'text' => 'DT Monitor Warning Tone');
$select[] = array( 'value' => '0x40', 'text' => 'Add Call Waiting');
$select[] = array( 'value' => '0x41', 'text' => 'Priority Call Wait');
$select[] = array( 'value' => '0x42', 'text' => 'Recall Dial');
$select[] = array( 'value' => '0x43', 'text' => 'Barg In');
$select[] = array( 'value' => '0x44', 'text' => 'Distinct Alert');
$select[] = array( 'value' => '0x45', 'text' => 'Priority Alert');
$select[] = array( 'value' => '0x46', 'text' => 'Reminder Ring');
$select[] = array( 'value' => '0x47', 'text' => 'Precedence RingBank');
$select[] = array( 'value' => '0x48', 'text' => 'Pre-EmptionTone');
$select[] = array( 'value' => '0x67', 'text' => '2105 HZ');
$select[] = array( 'value' => '0x68', 'text' => '2600 HZ');
$select[] = array( 'value' => '0x69', 'text' => '440 HZ');
$select[] = array( 'value' => '0x6A', 'text' => '300 HZ');
$select[] = array( 'value' => '0x77', 'text' => 'MLPP Pala');
$select[] = array( 'value' => '0x78', 'text' => 'MLPP Ica');
$select[] = array( 'value' => '0x79', 'text' => 'MLPP Vca');
$select[] = array( 'value' => '0x7A', 'text' => 'MLPP Bpa');
$select[] = array( 'value' => '0x7B', 'text' => 'MLPP Bnea');
$select[] = array( 'value' => '0x7C', 'text' => 'MLPP Upa');
/* !TODO!: +TODO+: I would remove the values below this line, except for 'No Tone' */
// $select[] = array( 'value' => '0x7F', 'text' => 'No Tone');
$select[] = array( 'value' => '0x80', 'text' => 'Meetme Greeting Tone');
$select[] = array( 'value' => '0x81', 'text' => 'Meetme Number Invalid Tone');
$select[] = array( 'value' => '0x82', 'text' => 'Meetme Number Failed Tone');
$select[] = array( 'value' => '0x83', 'text' => 'Meetme Enter Pin Tone');
$select[] = array( 'value' => '0x84', 'text' => 'Meetme Invalid Pin Tone');
$select[] = array( 'value' => '0x85', 'text' => 'Meetme Failed Pin Tone');
$select[] = array( 'value' => '0x86', 'text' => 'Meetme CFB Failed Tone');
$select[] = array( 'value' => '0x87', 'text' => 'Meetme Enter Access Code Tone');
$select[] = array( 'value' => '0x88', 'text' => 'Meetme Access Code Invalid Tone');
$select[] = array( 'value' => '0x89', 'text' => 'Meetme Access Code Failed Tone');
$select[] = array('value' => 'yes', 'text' => 'Yes');
$select[] = array('value' => 'no', 'text' => 'No');
$tt = _("Outside dialtone frequency (defaul 0x22)");
$tmparr['secondary_dialtone_tone'] = array('prompttext' => _('Secondary dialtone'), 'value' => '0x22', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'select');
# !TODO!: -TODO-: is there no easier way to specify a boolean radio group ? No.
unset($select);
$select[] = array('value' => 'yes', 'text' => 'Yes');
$select[] = array('value' => 'no', 'text' => 'No');
$tt = _("Allow call transfer.");
$tmparr['transfer'] = array('prompttext' => _('Call Transfer'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
unset($select);
$select[] = array('value' => 'yes', 'text' => 'Yes');
$select[] = array('value' => 'no', 'text' => 'No');
$tt = _("Echo cancel");
$tmparr['echocancel'] = array('prompttext' => _('Echo cancel'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
unset($select);
$select[] = array('value' => 'off', 'text' => 'Off');
$select[] = array('value' => 'reject', 'text' => 'Reject');
$select[] = array('value' => 'silent', 'text' => 'Silent');
$select[] = array('value' => 'UserDefined', 'text' => 'UserDefined');
# !TODO!: -TODO-: The next entry should be "null/empty" (not UserDefined) -> to indicate the trie-state behaviour
# !TODO!: -TODO-: Userdefined is also a possible state, but it is not used or implemented (and it should not be implemented here, i think). See Sccp.class.php.v431, See Sccp.class.php - Old Style
$tt = _("DND: How will dnd react when it is set on the device level dnd can have three states: off / busy(reject) / silent / UserDefined").'<br>'.
_("UserDefined - dnd that cycles through all three states off -> reject -> silent -> off (this is the normal behaviour)").'<br>'.
_("Reject - Usesr can only switch off and on (in reject/busy mode)").'<br>'.
_("Silent - Usesr can only switch off and on (in silent mode)");
$tmparr['dnd'] = array('prompttext' => _('DND'), 'value' => 'UserDefined', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
unset($select);
$select[] = array('value' => 'yes', 'text' => 'Yes');
$select[] = array('value' => 'no', 'text' => 'No');
$tt = _("Silence Suppression. Asterisk Not suported");
$tmparr['silencesuppression'] = array('prompttext' => _('Silence Suppression'), 'value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
unset($select);
$select[] = array('value' => 'default', 'text' => _('default'));
if (function_exists('music_list')){
$moh_list = music_list();
} else {
$moh_list = array('default');
}
foreach ($moh_list as $value) {
$select[] = array('value' => $value, 'text' => _($value));
}
$tt = _("Music on hold");
$tmparr['musicclass'] = array('prompttext' => _('Music on hold'), 'value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1);
$devopts = $tmparr;
return $devopts;
}
}

View file

@ -1,421 +0,0 @@
<?php
// vim: set ai ts=4 sw=4 ft=php:
// Version for SCCP Manager 13.0.X
//
// Templete for Sccp Driver
//
namespace FreePBX\modules\Core\Drivers;
class Sccp extends \FreePBX\modules\Core\Driver {
public $version;
// Key (db) = > key Settings
private $data_fld = array("pin"=>'pin', "label" => 'label', "accountcode" => 'account',
"context" =>'lcontext',"incominglimit"=>'incominglimit',
// "callgroup"=>'callgroup',"pickupgroup"=>'pickupgroup',
'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup',
"transfer" => 'transfer', "echocancel" => 'echocancel',
"language" => 'language', "description" => 'callerid',
"cid_num" => 'cid_num', "cid_name" => 'label', "mailbox" => 'mailbox',
"musicclass" => 'musicclass',
"dnd" => 'dnd', "silencesuppression" => 'silencesuppression',
"secondary_dialtone_digits" => 'secondary_dialtone_digits', "secondary_dialtone_tone" => 'secondary_dialtone_tone'
);
public function __construct($freepbx) {
parent::__construct($freepbx);
// $this->version = $freepbx->Config->get('ASTVERSION');
}
public function getInfo() {
return array(
"rawName" => "sccp",
"hardware" => "sccp_custom",
"prettyName" => _("Sccp Custom Driver"),
"shortName" => "SCCP",
"description" => _("Sccp Device"),
"Version" => "11.3.v432",
"about" => "Sccp mysql class Base ver: 11.3, Sccp ver: 431"
);
}
/*
public function addDevice1($id, $settings) {
$sql = 'INSERT INTO sccp (id, keyword, data, flags) values (?,?,?,?)';
$sth = $this->database->prepare($sql);
$settings = is_array($settings)?$settings:array();
foreach($settings as $key => $setting) {
$sth->execute(array($id,$key,$setting['value'],$setting['flag']));
}
return true;
}
*/
public function addDevice($id, $settings) {
$add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description','devinfo_mailbox'=>'mailbox');
// print_r($_REQUEST);
// echo '<br><br>';
// die(print_r($settings));
$settings['cid_num']['value']='';
$settings['mailbox']['value']= '';
if (isset($_REQUEST)){
foreach($add_fld as $key => $val) {
if (!empty($_REQUEST[$key])){
$settings[$val]['value'] = $_REQUEST[$key];
}
}
}
if (empty($settings['cid_num']['value'])) {
$settings['cid_num']['value']= $id;
}
if (!empty($_REQUEST['vm']) && ($_REQUEST['vm'] =='enabled')){ // mailbox
if (empty($settings['mailbox']['value'])) {
$settings['mailbox']['value']= $id;
}
}
// die(print_r($settings));
$sql = 'REPLACE INTO sccpline (name';
$sqlv = 'values ("'.$id.'"';
foreach($this->data_fld as $key => $val) {
switch ($key) {
case 'incominglimit':
$sql .= ', '.$key;
if (!empty($settings[$val]['value'])){
$sqlv .= ", '".$settings[$val]['value']."' ";
} else {
$sqlv .= ", DEFAULT(`".$key."`)";
}
break;
case 'secondary_dialtone_digits':
case 'secondary_dialtone_tone':
case 'dnd':
$sql .= ', '.$key;
if (!$this->is_my_blank($settings[$val]['value'])){
$sqlv .= ", '".$settings[$val]['value']."' ";
} else {
$sqlv .= ", NULL ";
// $sqlv .= ", DEFAULT(`".$key."`)";
}
break;
default:
if (!empty($settings[$val]) ) {
if (!empty($settings[$val]['value'])){
$sql .= ', '.$key;
$sqlv .= ", '".$settings[$val]['value']."' ";
}
}
break;
}
}
$sql .= ") ".$sqlv.");";
// die(print_r($sql));
$sth = $this->database->prepare($sql);
$sth->execute();
return true;
}
public function delDevice($id) {
// $sql = "DELETE FROM sccpline WHERE id = ?";
$sql = "DELETE FROM sccpline WHERE name = ?";
$sth = $this->database->prepare($sql);
$sth->execute(array($id));
return true;
}
public function getDevice($id) {
$sccp_line = array();
$sql = "SELECT name as id, name as name ";
foreach($this->data_fld as $key => $val) {
$sql .= ',`'. $key .'` as '.$val;
}
// $sql .= " FROM sccpline WHERE id = ?";
$sql .= " FROM sccpline WHERE name = ?";
$sth = $this->database->prepare($sql);
$result = array();
$tech = array();
try {
$sth->execute(array($id));
$result = $sth->fetch(\PDO::FETCH_ASSOC);
$tech = $result;
$tech['dial']='SCCP/'.$id;
} catch(\Exception $e) {}
// print_r($tech);
// echo '<br><br>';
// print_r($sql);
// die(print_r($id));
// echo '<br><br>';
return $tech;
}
public function getNamedGroup() {
$sql = "select namedcallgroup from sccpline group by namedcallgroup";
$sth = $this->database->prepare($sql);
$result = array();
$tech = array();
// $tech['namedcallgroup'] = '';
// $tech['namedpickupgroup'] = '';
try {
$sth->execute();
$result = $sth->fetchAll();
foreach($result as $val) {
$tech['namedcallgroup'][] = $val[0];
}
} catch(\Exception $e) {}
$sql = "select namedpickupgroup from sccpline group by namedpickupgroup";
$sth = $this->database->prepare($sql);
try {
$sth->execute();
$result = $sth->fetchAll();
foreach($result as $val) {
$tech['namedpickupgroup'][] = $val[0];
}
} catch(\Exception $e) {}
return $tech;
}
public function getDefaultDeviceSettings($id, $displayname, &$flag) {
$dial = 'SCCP';
$settings = array(
"mailbox" => array(
"value" => "",
"flag" => $flag++
),
"incominglimit" => array(
"value" => "2",
"flag" => $flag++
),
"lcontext" => array(
"value" => "from-internal",
"flag" => $flag++
),
// "callgroup" => array(
// "value" => "from-internal",
// "flag" => $flag++
// ),
"namedcallgroup" => array(
"value" => "",
"flag" => $flag++
),
// "pickupgroup" => array(
// "value" => "",
// "flag" => $flag++
// ),
"namedpickupgroup" => array(
"value" => "",
"flag" => $flag++
),
"secondary_dialtone_digits" => array(
"value" => "9",
"flag" => $flag++
),
"secondary_dialtone_tone" => array(
"value" => "0x22",
"flag" => $flag++
),
"transfer" => array(
"value" => "on",
"flag" => $flag++
),
"echocancel" => array(
"value" => "on",
"flag" => $flag++
),
"dnd" => array(
"value" => "",
"flag" => $flag++
),
"silencesuppression" => array(
"value" => "off",
"flag" => $flag++
),
"musicclass" => array(
"value" => "default",
"flag" => $flag++
),
"pin" => array(
"value" => "",
"flag" => $flag++
),
"musicclass" => array(
"value" => "default",
"flag" => $flag++
),
);
return array(
"dial" => $dial,
"settings" => $settings
);
}
public function getDeviceDisplay($display, $deviceInfo, $currentcomponent, $primarySection) {
$section = _("SCCP Extension Details");
// $category = "general";
// Assigned DID/CID
$named_group = $this->getNamedGroup();
$tmparr = array();
$tt = _("Name or id of lincked maibox");
$tmparr['mailbox'] = array('prompttext' => _('Mailbox'), 'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
$tt = _("The SCCP channel number for this port. If you plaining to use this line as 'Shared' or use on several devices - leave this field blank or set limit to 10 calls.");
// $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '2', 'tt' => $tt, 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidChannel);
// $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section, 'category' => 'general');
$tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
$tt = _("Asterisk context this device will send calls to. Only change this is you know what you are doing.");
$tmparr['lcontext'] = array('prompttext' => _('Line context'), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1, 'section' => $section);
// $tt = _("Phone call group callgroup=1,3-4");
// $tmparr['callgroup'] = array('prompttext' => _('Call group id'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
$tt = _("Sets the named caller groups this line is a member of (ast111) : ");
if (!empty($named_group['namedcallgroup'])) {
foreach ($named_group['namedcallgroup'] as $val) {
$tt .= $val. ', ';
}
$tt .= '... ';
}
$tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
// $tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section, 'category' => 'general');
// $tt = _("Phone pickup group pickupgroup=1,3-4");
// $tmparr['pickupgroup'] = array('prompttext' => _('Pickup group id'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
$tt = _("Name picapuroup : ");
if (!empty($named_group['namedpickupgroup'])) {
foreach ($named_group['namedpickupgroup'] as $val) {
$tt .= $val. ', ';
}
$tt .= '... ';
}
$tmparr['namedpickupgroup'] = array('prompttext' => _('Named Pickup Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
// $tmparr['namedpickupgroup'] = array('prompttext' => _('Named Pickup Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section, 'category' => 'general');
$tt = _("Digits to indicate an external line to user (secondary dialtone) Sample 9 or 8 (max 9 digits)");
$tmparr['secondary_dialtone_digits'] = array('prompttext' => _('Secondary dialtone digits'), 'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
unset($select);
$select[] = array( 'value' => '0x21', 'text' => 'Inside Dial Tone');
$select[] = array( 'value' => '0x22', 'text' => 'Outside Dial Tone');
$select[] = array( 'value' => '0x23', 'text' => 'Line Busy Tone');
$select[] = array( 'value' => '0x24', 'text' => 'Alerting Tone');
$select[] = array( 'value' => '0x25', 'text' => 'Reorder Tone');
$select[] = array( 'value' => '0x26', 'text' => 'Recorder Warning Tone');
$select[] = array( 'value' => '0x27', 'text' => 'Recorder Detected Tone');
$select[] = array( 'value' => '0x28', 'text' => 'Reverting Tone');
$select[] = array( 'value' => '0x29', 'text' => 'Receiver OffHook Tone');
$select[] = array( 'value' => '0x2A', 'text' => 'Partial Dial Tone');
$select[] = array( 'value' => '0x2B', 'text' => 'No Such Number Tone');
$select[] = array( 'value' => '0x2C', 'text' => 'Busy Verification Tone');
$select[] = array( 'value' => '0x2D', 'text' => 'Call Waiting Tone');
$select[] = array( 'value' => '0x2E', 'text' => 'Confirmation Tone');
$select[] = array( 'value' => '0x2F', 'text' => 'Camp On Indication Tone');
$select[] = array( 'value' => '0x30', 'text' => 'Recall Dial Tone');
$select[] = array( 'value' => '0x31', 'text' => 'Zip Zip');
$select[] = array( 'value' => '0x32', 'text' => 'Zip');
$select[] = array( 'value' => '0x33', 'text' => 'Beep Bonk');
$select[] = array( 'value' => '0x34', 'text' => 'Music Tone');
$select[] = array( 'value' => '0x35', 'text' => 'Hold Tone');
$select[] = array( 'value' => '0x36', 'text' => 'Test Tone');
$select[] = array( 'value' => '0x37', 'text' => 'DT Monitor Warning Tone');
$select[] = array( 'value' => '0x40', 'text' => 'Add Call Waiting');
$select[] = array( 'value' => '0x41', 'text' => 'Priority Call Wait');
$select[] = array( 'value' => '0x42', 'text' => 'Recall Dial');
$select[] = array( 'value' => '0x43', 'text' => 'Barg In');
$select[] = array( 'value' => '0x44', 'text' => 'Distinct Alert');
$select[] = array( 'value' => '0x45', 'text' => 'Priority Alert');
$select[] = array( 'value' => '0x46', 'text' => 'Reminder Ring');
$select[] = array( 'value' => '0x47', 'text' => 'Precedence RingBank');
$select[] = array( 'value' => '0x48', 'text' => 'Pre-EmptionTone');
$select[] = array( 'value' => '0x67', 'text' => '2105 HZ');
$select[] = array( 'value' => '0x68', 'text' => '2600 HZ');
$select[] = array( 'value' => '0x69', 'text' => '440 HZ');
$select[] = array( 'value' => '0x6A', 'text' => '300 HZ');
$select[] = array( 'value' => '0x77', 'text' => 'MLPP Pala');
$select[] = array( 'value' => '0x78', 'text' => 'MLPP Ica');
$select[] = array( 'value' => '0x79', 'text' => 'MLPP Vca');
$select[] = array( 'value' => '0x7A', 'text' => 'MLPP Bpa');
$select[] = array( 'value' => '0x7B', 'text' => 'MLPP Bnea');
$select[] = array( 'value' => '0x7C', 'text' => 'MLPP Upa');
/* !TODO!: I would remove the values below this line, except for 'No Tone' */
// $select[] = array( 'value' => '0x7F', 'text' => 'No Tone');
$select[] = array( 'value' => '0x80', 'text' => 'Meetme Greeting Tone');
$select[] = array( 'value' => '0x81', 'text' => 'Meetme Number Invalid Tone');
$select[] = array( 'value' => '0x82', 'text' => 'Meetme Number Failed Tone');
$select[] = array( 'value' => '0x83', 'text' => 'Meetme Enter Pin Tone');
$select[] = array( 'value' => '0x84', 'text' => 'Meetme Invalid Pin Tone');
$select[] = array( 'value' => '0x85', 'text' => 'Meetme Failed Pin Tone');
$select[] = array( 'value' => '0x86', 'text' => 'Meetme CFB Failed Tone');
$select[] = array( 'value' => '0x87', 'text' => 'Meetme Enter Access Code Tone');
$select[] = array( 'value' => '0x88', 'text' => 'Meetme Access Code Invalid Tone');
$select[] = array( 'value' => '0x89', 'text' => 'Meetme Access Code Failed Tone');
$select[] = array('value' => 'yes', 'text' => 'Yes');
$select[] = array('value' => 'no', 'text' => 'No');
$tt = _("Outside dialtone frequency (defaul 0x22)");
$tmparr['secondary_dialtone_tone'] = array('prompttext' => _('Secondary dialtone'), 'value' => '0x22', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'select', 'section' => $section);
unset($select);
$select[] = array('value' => 'on', 'text' => 'Yes');
$select[] = array('value' => 'off', 'text' => 'No');
$tt = _("Allow call transfer.");
// $tmparr['transfer'] = array('prompttext' => _('Call Transfer'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section, 'category' => 'general');
$tmparr['transfer'] = array('prompttext' => _('Call Transfer'), 'value' => 'on', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => 'on', 'text' => 'Yes');
$select[] = array('value' => 'off', 'text' => 'No');
$tt = _("Echo cancel");
$tmparr['echocancel'] = array('prompttext' => _('Echo cancel'), 'value' => 'on', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => 'off', 'text' => 'Off');
$select[] = array('value' => 'reject', 'text' => 'Reject');
$select[] = array('value' => 'silent', 'text' => 'Silent');
$select[] = array('value' => 'user', 'text' => 'Cycle');
$tt = _("DND: Means how will dnd react when it is set on the device level dnd can have three states: off / busy(reject) / silent / Cycle").'<br>'.
_("Cycle - dnd that cycles through all three states off -> reject -> silent -> off (this is the normal behaviour)").'<br>'.
_("Reject - Usesr can only switch off and on (in reject/busy mode)").'<br>'.
_("Silent - Usesr can only switch off and on (in silent mode)");
$tmparr['dnd'] = array('prompttext' => _('DND'), 'value' => 'reject', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => 'on', 'text' => 'Yes');
$select[] = array('value' => 'off', 'text' => 'No');
$tt = _("Silence Suppression. Asterisk Not suported");
$tmparr['silencesuppression'] = array('prompttext' => _('Silence Suppression'), 'value' => 'off', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => 'default', 'text' => _('default'));
if (function_exists('music_list')){
$moh_list = music_list();
} else {
$moh_list = array('default');
}
foreach ($moh_list as $value) {
$select[] = array('value' => $value, 'text' => _($value));
}
$tt = _("Music on hold");
$tmparr['musicclass'] = array('prompttext' => _('Music on hold'), 'value' => '', 'tt' => $tt, 'select' => $select, 'level' => 1, 'section' => $section);
$tt = _("Sets the named pickup groups this line is a member of (this phone can pickup calls from remote phones which are in this caller group (ast111)");
$tmparr['pin'] = array('value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
$devopts = $tmparr;
return $devopts;
}
public function getDeviceHeaders() {
return array(
'secret' => array('identifier' => _('Secret'), 'description' => sprintf(_('Secret [Enter "%s" to regenerate]'),"REGEN")),
);
}
public function is_my_blank($value) {
return empty($value) && !is_numeric($value);
}
}

View file

@ -1,446 +0,0 @@
<?php
// vim: set ai ts=4 sw=4 ft=php:
// Version for SCCP Manager 13.0.X
//
// Templete for Sccp Driver
//
namespace FreePBX\modules\Core\Drivers;
class Sccp extends \FreePBX\modules\Core\Driver {
public $version;
// Key (db) = > key Settings
private $data_fld = array("pin"=>'pin', "label" => 'label', "accountcode" => 'account',
"context" =>'lcontext',"incominglimit"=>'incominglimit',
// "callgroup"=>'callgroup',"pickupgroup"=>'pickupgroup',
'directed_pickup_context' => 'directed_pickup_context',
'directed_pickup' => 'directed_pickup',
'pickup_modeanswer' => 'pickup_modeanswer',
'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup',
"transfer" => 'transfer', "echocancel" => 'echocancel',
"language" => 'language', "description" => 'callerid',
"cid_num" => 'cid_num', "cid_name" => 'label', "mailbox" => 'mailbox',
"musicclass" => 'musicclass',
"dnd" => 'dnd', "silencesuppression" => 'silencesuppression',
"secondary_dialtone_digits" => 'secondary_dialtone_digits', "secondary_dialtone_tone" => 'secondary_dialtone_tone'
);
public function __construct($freepbx) {
parent::__construct($freepbx);
// $this->version = $freepbx->Config->get('ASTVERSION');
}
public function getInfo() {
return array(
"rawName" => "sccp",
"hardware" => "sccp_custom",
"prettyName" => _("Sccp Custom Driver"),
"shortName" => "SCCP",
"description" => _("Sccp Device"),
"Version" => "11.3.v433",
"about" => "Sccp mysql class Base ver: 11.3, Sccp ver: 433"
);
}
/*
public function addDevice1($id, $settings) {
$sql = 'INSERT INTO sccp (id, keyword, data, flags) values (?,?,?,?)';
$sth = $this->database->prepare($sql);
$settings = is_array($settings)?$settings:array();
foreach($settings as $key => $setting) {
$sth->execute(array($id,$key,$setting['value'],$setting['flag']));
}
return true;
}
*/
public function addDevice($id, $settings) {
$add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description','devinfo_mailbox'=>'mailbox');
// print_r($_REQUEST);
// echo '<br><br>';
// die(print_r($settings));
$settings['cid_num']['value']='';
$settings['mailbox']['value']= '';
if (isset($_REQUEST)){
foreach($add_fld as $key => $val) {
if (!empty($_REQUEST[$key])){
$settings[$val]['value'] = $_REQUEST[$key];
}
}
}
if (empty($settings['cid_num']['value'])) {
$settings['cid_num']['value']= $id;
}
if (!empty($_REQUEST['vm']) && ($_REQUEST['vm'] =='enabled')){ // mailbox
if (empty($settings['mailbox']['value'])) {
$settings['mailbox']['value']= $id;
}
}
// die(print_r($settings));
$sql = 'REPLACE INTO sccpline (name';
$sqlv = 'values ("'.$id.'"';
foreach($this->data_fld as $key => $val) {
switch ($key) {
case 'incominglimit':
$sql .= ', '.$key;
if (!empty($settings[$val]['value'])){
$sqlv .= ", '".$settings[$val]['value']."' ";
} else {
$sqlv .= ", DEFAULT(`".$key."`)";
}
break;
case 'secondary_dialtone_digits':
case 'secondary_dialtone_tone':
case 'dnd':
$sql .= ', '.$key;
if (!$this->is_my_blank($settings[$val]['value'])){
$sqlv .= ", '".$settings[$val]['value']."' ";
} else {
$sqlv .= ", NULL ";
// $sqlv .= ", DEFAULT(`".$key."`)";
}
break;
default:
if (!empty($settings[$val]) ) {
if (!empty($settings[$val]['value'])){
$sql .= ', '.$key;
$sqlv .= ", '".$settings[$val]['value']."' ";
}
}
break;
}
}
$sql .= ") ".$sqlv.");";
// die(print_r($sql));
$sth = $this->database->prepare($sql);
$sth->execute();
return true;
}
public function delDevice($id) {
// $sql = "DELETE FROM sccpline WHERE id = ?";
$sql = "DELETE FROM sccpline WHERE name = ?";
$sth = $this->database->prepare($sql);
$sth->execute(array($id));
return true;
}
public function getDevice($id) {
$sccp_line = array();
$sql = "SELECT name as id, name as name ";
foreach($this->data_fld as $key => $val) {
$sql .= ',`'. $key .'` as '.$val;
}
// $sql .= " FROM sccpline WHERE id = ?";
$sql .= " FROM sccpline WHERE name = ?";
$sth = $this->database->prepare($sql);
$result = array();
$tech = array();
try {
$sth->execute(array($id));
$result = $sth->fetch(\PDO::FETCH_ASSOC);
$tech = $result;
$tech['dial']='SCCP/'.$id;
} catch(\Exception $e) {}
// print_r($tech);
// echo '<br><br>';
// print_r($sql);
// die(print_r($id));
// echo '<br><br>';
return $tech;
}
public function getNamedGroup() {
$sql = "select namedcallgroup from sccpline group by namedcallgroup";
$sth = $this->database->prepare($sql);
$result = array();
$tech = array();
// $tech['namedcallgroup'] = '';
// $tech['namedpickupgroup'] = '';
try {
$sth->execute();
$result = $sth->fetchAll();
foreach($result as $val) {
$tech['namedcallgroup'][] = $val[0];
}
} catch(\Exception $e) {}
$sql = "select namedpickupgroup from sccpline group by namedpickupgroup";
$sth = $this->database->prepare($sql);
try {
$sth->execute();
$result = $sth->fetchAll();
foreach($result as $val) {
$tech['namedpickupgroup'][] = $val[0];
}
} catch(\Exception $e) {}
return $tech;
}
public function getDefaultDeviceSettings($id, $displayname, &$flag) {
$dial = 'SCCP';
$settings = array(
"mailbox" => array(
"value" => "",
"flag" => $flag++
),
"incominglimit" => array(
"value" => "2",
"flag" => $flag++
),
"directed_pickup_context" => array(
"value" => "from-internal",
"flag" => $flag++
),
"lcontext" => array(
"value" => "from-internal",
"flag" => $flag++
),
// "callgroup" => array(
// "value" => "from-internal",
// "flag" => $flag++
// ),
"namedcallgroup" => array(
"value" => "",
"flag" => $flag++
),
// "pickupgroup" => array(
// "value" => "",
// "flag" => $flag++
// ),
"namedpickupgroup" => array(
"value" => "",
"flag" => $flag++
),
"secondary_dialtone_digits" => array(
"value" => "9",
"flag" => $flag++
),
"secondary_dialtone_tone" => array(
"value" => "0x22",
"flag" => $flag++
),
"transfer" => array(
"value" => "on",
"flag" => $flag++
),
"echocancel" => array(
"value" => "on",
"flag" => $flag++
),
"dnd" => array(
"value" => "",
"flag" => $flag++
),
"silencesuppression" => array(
"value" => "off",
"flag" => $flag++
),
"musicclass" => array(
"value" => "default",
"flag" => $flag++
),
"pin" => array(
"value" => "",
"flag" => $flag++
),
"musicclass" => array(
"value" => "default",
"flag" => $flag++
),
);
return array(
"dial" => $dial,
"settings" => $settings
);
}
public function getDeviceDisplay($display, $deviceInfo, $currentcomponent, $primarySection) {
$section = _("SCCP Extension Details");
// $category = "general";
// Assigned DID/CID
$named_group = $this->getNamedGroup();
$tmparr = array();
$tt = _("Name or id of lincked maibox");
$tmparr['mailbox'] = array('prompttext' => _('Mailbox'), 'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
$tt = _("The SCCP channel number for this port. If you plaining to use this line as 'Shared' or use on several devices - leave this field blank or set limit to 10 calls.");
// $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '2', 'tt' => $tt, 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidChannel);
// $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section, 'category' => 'general');
$tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
$tt = _("Asterisk context this device will send calls to. Only change this is you know what you are doing.");
$tmparr['lcontext'] = array('prompttext' => _('Line context'), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1, 'section' => $section);
$tt = _("Asterisk context this device will can pickup calls. Only change this is you know what you are doing.");
$tmparr['directed_pickup_context'] = array('prompttext' => _('Directed PickUp Сontext '), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1, 'section' => $section);
// $tt = _("Phone call group callgroup=1,3-4");
// $tmparr['callgroup'] = array('prompttext' => _('Call group id'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
$tt = _("Sets the named caller groups this line is a member of (ast111) : ");
if (!empty($named_group['namedcallgroup'])) {
foreach ($named_group['namedcallgroup'] as $val) {
$tt .= $val. ', ';
}
$tt .= '... ';
}
$tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
// $tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section, 'category' => 'general');
// $tt = _("Phone pickup group pickupgroup=1,3-4");
// $tmparr['pickupgroup'] = array('prompttext' => _('Pickup group id'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
$tt = _("Name picapuroup : ");
if (!empty($named_group['namedpickupgroup'])) {
foreach ($named_group['namedpickupgroup'] as $val) {
$tt .= $val. ', ';
}
$tt .= '... ';
}
$tmparr['namedpickupgroup'] = array('prompttext' => _('Named Pickup Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
// $tmparr['namedpickupgroup'] = array('prompttext' => _('Named Pickup Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section, 'category' => 'general');
$tt = _("Digits to indicate an external line to user (secondary dialtone) Sample 9 or 8 (max 9 digits)");
$tmparr['secondary_dialtone_digits'] = array('prompttext' => _('Secondary dialtone digits'), 'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
unset($select);
$select[] = array( 'value' => '0x21', 'text' => 'Inside Dial Tone');
$select[] = array( 'value' => '0x22', 'text' => 'Outside Dial Tone');
$select[] = array( 'value' => '0x23', 'text' => 'Line Busy Tone');
$select[] = array( 'value' => '0x24', 'text' => 'Alerting Tone');
$select[] = array( 'value' => '0x25', 'text' => 'Reorder Tone');
$select[] = array( 'value' => '0x26', 'text' => 'Recorder Warning Tone');
$select[] = array( 'value' => '0x27', 'text' => 'Recorder Detected Tone');
$select[] = array( 'value' => '0x28', 'text' => 'Reverting Tone');
$select[] = array( 'value' => '0x29', 'text' => 'Receiver OffHook Tone');
$select[] = array( 'value' => '0x2A', 'text' => 'Partial Dial Tone');
$select[] = array( 'value' => '0x2B', 'text' => 'No Such Number Tone');
$select[] = array( 'value' => '0x2C', 'text' => 'Busy Verification Tone');
$select[] = array( 'value' => '0x2D', 'text' => 'Call Waiting Tone');
$select[] = array( 'value' => '0x2E', 'text' => 'Confirmation Tone');
$select[] = array( 'value' => '0x2F', 'text' => 'Camp On Indication Tone');
$select[] = array( 'value' => '0x30', 'text' => 'Recall Dial Tone');
$select[] = array( 'value' => '0x31', 'text' => 'Zip Zip');
$select[] = array( 'value' => '0x32', 'text' => 'Zip');
$select[] = array( 'value' => '0x33', 'text' => 'Beep Bonk');
$select[] = array( 'value' => '0x34', 'text' => 'Music Tone');
$select[] = array( 'value' => '0x35', 'text' => 'Hold Tone');
$select[] = array( 'value' => '0x36', 'text' => 'Test Tone');
$select[] = array( 'value' => '0x37', 'text' => 'DT Monitor Warning Tone');
$select[] = array( 'value' => '0x40', 'text' => 'Add Call Waiting');
$select[] = array( 'value' => '0x41', 'text' => 'Priority Call Wait');
$select[] = array( 'value' => '0x42', 'text' => 'Recall Dial');
$select[] = array( 'value' => '0x43', 'text' => 'Barg In');
$select[] = array( 'value' => '0x44', 'text' => 'Distinct Alert');
$select[] = array( 'value' => '0x45', 'text' => 'Priority Alert');
$select[] = array( 'value' => '0x46', 'text' => 'Reminder Ring');
$select[] = array( 'value' => '0x47', 'text' => 'Precedence RingBank');
$select[] = array( 'value' => '0x48', 'text' => 'Pre-EmptionTone');
$select[] = array( 'value' => '0x67', 'text' => '2105 HZ');
$select[] = array( 'value' => '0x68', 'text' => '2600 HZ');
$select[] = array( 'value' => '0x69', 'text' => '440 HZ');
$select[] = array( 'value' => '0x6A', 'text' => '300 HZ');
$select[] = array( 'value' => '0x77', 'text' => 'MLPP Pala');
$select[] = array( 'value' => '0x78', 'text' => 'MLPP Ica');
$select[] = array( 'value' => '0x79', 'text' => 'MLPP Vca');
$select[] = array( 'value' => '0x7A', 'text' => 'MLPP Bpa');
$select[] = array( 'value' => '0x7B', 'text' => 'MLPP Bnea');
$select[] = array( 'value' => '0x7C', 'text' => 'MLPP Upa');
/* !TODO!: I would remove the values below this line, except for 'No Tone' */
// $select[] = array( 'value' => '0x7F', 'text' => 'No Tone');
$select[] = array( 'value' => '0x80', 'text' => 'Meetme Greeting Tone');
$select[] = array( 'value' => '0x81', 'text' => 'Meetme Number Invalid Tone');
$select[] = array( 'value' => '0x82', 'text' => 'Meetme Number Failed Tone');
$select[] = array( 'value' => '0x83', 'text' => 'Meetme Enter Pin Tone');
$select[] = array( 'value' => '0x84', 'text' => 'Meetme Invalid Pin Tone');
$select[] = array( 'value' => '0x85', 'text' => 'Meetme Failed Pin Tone');
$select[] = array( 'value' => '0x86', 'text' => 'Meetme CFB Failed Tone');
$select[] = array( 'value' => '0x87', 'text' => 'Meetme Enter Access Code Tone');
$select[] = array( 'value' => '0x88', 'text' => 'Meetme Access Code Invalid Tone');
$select[] = array( 'value' => '0x89', 'text' => 'Meetme Access Code Failed Tone');
$select[] = array('value' => 'yes', 'text' => 'Yes');
$select[] = array('value' => 'no', 'text' => 'No');
$tt = _("Outside dialtone frequency (defaul 0x22)");
$tmparr['secondary_dialtone_tone'] = array('prompttext' => _('Secondary dialtone'), 'value' => '0x22', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'select', 'section' => $section);
unset($select);
$select[] = array('value' => '', 'text' => 'Inherit');
$select[] = array('value' => 'on', 'text' => 'Yes');
$select[] = array('value' => 'off', 'text' => 'No');
$tt = _("Enable/Disable the `directed` pickup softkey");
$tmparr['directed_pickup'] = array('prompttext' => _('Directed pickup'), 'value' => '', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => '', 'text' => 'Inherit');
$select[] = array('value' => 'on', 'text' => 'Yes');
$select[] = array('value' => 'off', 'text' => 'No');
$tt = _("Should the picked/gpicked-up call be answered automatically");
$tmparr['pickup_modeanswer'] = array('prompttext' => _('Pickup Modeanswer'), 'value' => '', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => '', 'text' => 'Inherit');
$select[] = array('value' => 'on', 'text' => 'Yes');
$select[] = array('value' => 'off', 'text' => 'No');
$tt = _("Allow call transfer.");
// $tmparr['transfer'] = array('prompttext' => _('Call Transfer'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section, 'category' => 'general');
$tmparr['transfer'] = array('prompttext' => _('Call Transfer'), 'value' => '', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => 'on', 'text' => 'Yes');
$select[] = array('value' => 'off', 'text' => 'No');
$tt = _("Echo cancel");
$tmparr['echocancel'] = array('prompttext' => _('Echo cancel'), 'value' => 'on', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => 'off', 'text' => 'Off');
$select[] = array('value' => 'reject', 'text' => 'Reject');
$select[] = array('value' => 'silent', 'text' => 'Silent');
$select[] = array('value' => 'user', 'text' => 'Cycle');
$tt = _("DND: Means how will dnd react when it is set on the device level dnd can have three states: off / busy(reject) / silent / Cycle").'<br>'.
_("Cycle - dnd that cycles through all three states off -> reject -> silent -> off (this is the normal behaviour)").'<br>'.
_("Reject - Usesr can only switch off and on (in reject/busy mode)").'<br>'.
_("Silent - Usesr can only switch off and on (in silent mode)");
$tmparr['dnd'] = array('prompttext' => _('DND'), 'value' => 'reject', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => 'on', 'text' => 'Yes');
$select[] = array('value' => 'off', 'text' => 'No');
$tt = _("Silence Suppression. Asterisk Not suported");
$tmparr['silencesuppression'] = array('prompttext' => _('Silence Suppression'), 'value' => 'off', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => 'default', 'text' => _('default'));
if (function_exists('music_list')){
$moh_list = music_list();
} else {
$moh_list = array('default');
}
foreach ($moh_list as $value) {
$select[] = array('value' => $value, 'text' => _($value));
}
$tt = _("Music on hold");
$tmparr['musicclass'] = array('prompttext' => _('Music on hold'), 'value' => '', 'tt' => $tt, 'select' => $select, 'level' => 1, 'section' => $section);
$tt = _("Sets the named pickup groups this line is a member of (this phone can pickup calls from remote phones which are in this caller group (ast111)");
$tmparr['pin'] = array('value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
$devopts = $tmparr;
return $devopts;
}
public function getDeviceHeaders() {
return array(
'secret' => array('identifier' => _('Secret'), 'description' => sprintf(_('Secret [Enter "%s" to regenerate]'),"REGEN")),
);
}
public function is_my_blank($value) {
return empty($value) && !is_numeric($value);
}
}

View file

@ -0,0 +1,8 @@
<dialTemplate>
<versionStamp>e68d54c1-0354-4b1a-aca4-adffc4b7de2f</versionStamp>
<TEMPLATE match="3.." timeout="1" />
<TEMPLATE match="..." timeout="2" />
<TEMPLATE match="......." timeout="2" />
<TEMPLATE match="0........" timeout="2" />
<TEMPLATE match="*" timeout="3" />
</dialTemplate>

9
conf/mappingRulesHeader Normal file
View file

@ -0,0 +1,9 @@
#
# TFTPd Mapping Rules for SCCP_Manager Provision
#
# This file is maintained by Sccp_Manager, and will be overwritten by the installer
# a copy of the original can be found at sccpManagerRewrite.rules.bu
# For any changes to this file to be effective, the tftp server will have to be restarted.
#
# The rules below are provided by dkgroot/provision project https://github.com/dkgroot/provision_sccp
#

View file

@ -41,10 +41,3 @@ hotline_context=default
hotline_extension=111
devicetable=sccpdevice
linetable=sccpline
[KeySet1] ; Managed by sccp_manager
type=softkeyset
onhook=redial,newcall,cfwdall,dnd,pickup,gpickup,private
connected=hold,endcall,park,select,cfwdall,cfwdbusy
onhold=newcall

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -58,13 +58,13 @@ ri ^(P00405000700.sbn)$ firmware/7910/\1
ri ^(CP7912080004SCCP080108A.sbin)$ firmware/7912/\1
# 7915 firmware (ancient)
ri ^(B015-1-0-4.SBN)$ firmware/7915/\1
ri ^(B015-1-0-)(.+\.SBN)$ firmware/7915/\1\2
# 7916 firmware (ancient)
ri ^(B016-1-0-4.SBN)$ firmware/7916/\1
ri ^(B016-1-0-)(.+\.SBN)$ firmware/7916/\1\2
# 7920 firmware (ancient)
ri ^(cmterm_7920.4.0-03-02.bin)$ firmware/7920/\1
ri ^(cmterm_7920)(.+\.bin)$ firmware/7920/\1\2
# 7921_7925 firmware (ancient)
ri ^(APPS-1.4.3.4.SBN)$ firmware/7921/\1
@ -106,10 +106,10 @@ ri ^(cmterm_7936.3-3-21-0.bin)$ firmware/7936/\1
ri ^(apps37sccp.1-4-5-7.bin)$ firmware/7937/\1
# 7940_7960 firmware (ancient)
ri ^(P0030801SR01.bin)$ firmware/7940/\1
ri ^(P0030801SR01.loads)$ firmware/7940/\1
ri ^(P0030801SR01.sb2)$ firmware/7940/\1
ri ^(P0030801SR01.sbn)$ firmware/7940/\1
ri ^(P0030801SR)(.+\.bin)$ firmware/7940/\1\2
ri ^(P0030801SR)(.+\.loads)$ firmware/7940/\1\2
ri ^(P0030801SR)(.+\.sb2)$ firmware/7940/\1\2
ri ^(P0030801SR)(.+\.sbn)$ firmware/7940/\1\2
# 7941_7961 firmware (java-based)
ri ^(apps41)(.+\.sbn)$ firmware/7941/\1\2
@ -184,20 +184,31 @@ ri ^\/((SPA504G-cfg.xml)(\.enc)?(\.sgn)?)$ settings/\1
#ri ^(.+\.loads)$ firmware/\1
#ri ^(.+\.sbn)$ firmware/\1
# Keep locales in a separate directory (optional)
ri ^(.+)\/(.+-sccp.jar)$ locales/\1/\2
ri ^(.+)\/(.+-dictionary.xml)$ locales/\1/\2
#ri ^(.+)\/(.+-tones.xml)$ locales/countries/\1/\2
ri ^(.+)\/(.+-sccp.jar)$ locales/languages/\1/\2
ri ^(.+)\/(.+-sip.jar)$ locales/languages/\1/\2
ri ^(.+)\/(.+-dictionary.xml)$ locales/languages/\1/\2
ri ^(.+)\/(.+-dictionary-ext.xml)$ locales/languages/\1/\2
#ri ^(.+)\/(.+-tones.xml)$ locales/languages/\1/\2
ri ^(.+)\/(.+-font.xml)$ locales/languages/\1/\2
ri ^(.+)\/(.+-kate.xml)$ locales/languages/\1/\2
ri ^(.+)\/(gk.+)(\.cfg)$ locales/languages/\1/\2\3
ri ^(.+)\/(.+-tones.xml)$ locales/countries/\1/\2
# Keep ring-tones in a separate directory (optional)
ri ^([R|r]ing[L|l]ist)(\.xml|-wb\.xml)(\.sgn)?$ ringtones/ringlist.xml
ri ^(Distinctive[R|r]ing[L|l]ist)(\.xml|-wb\.xml)(\.sgn)?$ ringtones/ringlist.xml
ri ^(.+)(\.raw|\.rwb)(\.sgn)?$ ringtones/\1\2\3
ri ^(.+)(\.raw|\.rwb|\.pcm)(\.sgn)?$ ringtones/\1\2\3
# Rename Desktops to wallpapers (optional)
#ri ^Desktops/(.+)/(List\.xml)(\.sgn)?$ wallpapers/\1/\2\3
#ri ^Desktops/(.+)/(.+\.png)(\.sgn)?$ wallpapers/\1/\2\3
# Dialplan
ri ^(dialplan.xml)$ dialplan/\1
ri ^authorized_keys$ settings/authorized_keys
#

View file

@ -10,7 +10,7 @@ service tftp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -c -s -v /tftpboot -m /tftpboot/rewrite.rules
server_args = -c -s -v /tftpboot -m -m /etc/asterisk/sccpManagerRewrite.rules
disable = no
per_source = 11
cps = 100 2

View file

@ -1,77 +0,0 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
function removeSimpleXmlNode($node)
{
$dom = dom_import_simplexml($node);
$dom->parentNode->removeChild($dom);
}
function replaceSimpleXmlNode($xml, SimpleXMLElement $element) {
$dom = dom_import_simplexml($xml);
$import = $dom->ownerDocument->importNode(
dom_import_simplexml($element),TRUE
);
$dom->parentNode->replaceChild($import, $dom);
}
*/
function after($this, $inthat) {
if (!is_bool(strpos($inthat, $this)))
return substr($inthat, strpos($inthat, $this) + strlen($this));
}
function after_last($this, $inthat) {
if (!is_bool(strrevpos($inthat, $this)))
return substr($inthat, strrevpos($inthat, $this) + strlen($this));
}
function before($this, $inthat) {
return substr($inthat, 0, strpos($inthat, $this));
}
function before_last($this, $inthat) {
return substr($inthat, 0, strrevpos($inthat, $this));
}
function between($this, $that, $inthat) {
return before($that, after($this, $inthat));
}
function between_last($this, $that, $inthat) {
return after_last($this, before_last($that, $inthat));
}
function strrevpos($instr, $needle) {
$rev_pos = strpos(strrev($instr), strrev($needle));
if ($rev_pos === false)
return false;
else
return strlen($instr) - $rev_pos - strlen($needle);
}
function strpos_array($haystack, $needles) {
if (is_array($needles)) {
foreach ($needles as $str) {
if (is_array($str)) {
$pos = strpos_array($haystack, $str);
} else {
$pos = strpos($haystack, $str);
}
if ($pos !== FALSE) {
return $pos;
}
}
} else {
return strpos($haystack, $needles);
}
return FALSE;
}
?>

View file

@ -154,7 +154,7 @@ msgstr "Внешний адрес"
#: views/sccpgeneral.xml:
msgid ""
"External IP Address of the firewall, required in case the PBX is running on "
"a seperatehost behind it. IP Address that we're going to notify in RTP media "
"a separatehost behind it. IP Address that we're going to notify in RTP media "
"stream as the pbx source address."
msgstr ""
"Внешнее имя FQDN в системе DNS на внешнем интерфейсе (WAN) роутера, которое "
@ -504,7 +504,7 @@ msgid "NTP Server name or IP"
msgstr "Адрес Сервера NTP"
#: views/sccpgeneral.xml:
msgid "Configure NTP Server protocol time syncronization"
msgid "Configure NTP Server protocol time synchronization"
msgstr "Настойка протокола синхронизации времени"
#: views/sccpgeneral.xml:
@ -910,8 +910,8 @@ msgid "General Device configuration"
msgstr "Абонентского устройство"
#: views/sccpgeneral.xml:
msgid "Device SEP ID.[XXXXXXXXXXXX]=MAC"
msgstr "Устройство SEP ID : [XXXXXXXXXXXX]=MAC"
msgid "Device ID.[XXXXXXXXXXXX]=MAC"
msgstr "Устройство ID : [XXXXXXXXXXXX]=MAC"
#: views/sccpgeneral.xml:
msgid ""
@ -955,8 +955,8 @@ msgid "Device Label"
msgstr "Название Устройства"
#: views/sccpgeneral.xml:
msgid "Device SEP ID"
msgstr "Идентификатор устройства SEP ID"
msgid "Device ID"
msgstr "Идентификатор устройства ID"
#: views/sccpgeneral.xml:
msgid "The information in the upper right corner of the device screen"
@ -1005,7 +1005,7 @@ msgid "Buttons Configuration"
msgstr "Настройка Кнопок"
#: views/sccpgeneral.xml:
msgid "Device MAC SEP."
msgid "Device MAC."
msgstr "Прямое подключение."
#: views/sccpgeneral.xml:
@ -1306,7 +1306,7 @@ msgid "Close"
msgstr "Закрыть"
#: views/server.model:
msgid "Add New model whithout Enabled"
msgid "Add New model without Enabled"
msgstr "Добавить шаблон как неактивный"
#: views/server.model:

View file

@ -143,7 +143,7 @@ msgid "External Ip"
msgstr ""
#: views/sccpgeneral.xml:
msgid "External IP Address of the firewall, required in case the PBX is running on a seperatehost behind it. IP Address that we're going to notify in RTP media stream as the pbx source address."
msgid "External IP Address of the firewall, required in case the PBX is running on a separatehost behind it. IP Address that we're going to notify in RTP media stream as the pbx source address."
msgstr ""
#: views/sccpgeneral.xml:
@ -395,7 +395,7 @@ msgid "NTP Server name or IP"
msgstr ""
#: views/sccpgeneral.xml:
msgid "Configure NTP Server protocol time syncronization"
msgid "Configure NTP Server protocol time synchronization"
msgstr ""
#: views/sccpgeneral.xml:
@ -679,7 +679,7 @@ msgid "General Device configuration"
msgstr ""
#: views/sccpgeneral.xml:
msgid "Device SEP ID.[XXXXXXXXXXXX]=MAC"
msgid "Device ID.[XXXXXXXXXXXX]=MAC"
msgstr ""
#: views/sccpgeneral.xml:
@ -707,7 +707,7 @@ msgid "Device Label"
msgstr ""
#: views/sccpgeneral.xml:
msgid "Device SEP ID"
msgid "Device ID"
msgstr ""
#: views/sccpgeneral.xml:
@ -743,7 +743,7 @@ msgid "Buttons Configuration"
msgstr ""
#: views/sccpgeneral.xml:
msgid "Device MAC SEP."
msgid "Device MAC."
msgstr ""
#: views/sccpgeneral.xml:
@ -967,7 +967,7 @@ msgid "Close"
msgstr ""
#: views/server.model:
msgid "Add New model whithout Enabled"
msgid "Add New model without Enabled"
msgstr ""
#: views/server.model:

File diff suppressed because it is too large Load diff

View file

@ -1,26 +1,279 @@
<module>
<rawname>sccp_manager</rawname>
<name>SCCP Manager</name>
<version>13.0.0.4</version>
<version>14.5.0.4</version>
<type>setup</type>
<category>SCCP Connectivity</category>
<publisher>Alex GP</publisher>
<repo>extended</repo>
<publisher>Steve Lad, Alex GP</publisher>
<repo>extended</repo>
<description>SCCP Phone and Extension Manager</description>
<menuitems>
<sccpsettings sort="1">Server Config</sccpsettings>
<sccp_adv sort="2">System Parameters</sccp_adv>
<sccp_phone sort="3">Phones Manager</sccp_phone>
<sccpsettings sort="1">Server Config</sccpsettings>
<sccp_adv sort="2">System Parameters</sccp_adv>
<sccp_phone sort="3">Phones Manager</sccp_phone>
</menuitems>
<changelog>
* Version 13.0.0.1 * - Alfa Release tested on freepbx v.13.0.192.16, v.14.0.1.5
* Version 13.0.0.2 * - Release tested
* Version 13.0.0.1 * - Alfa Release tested on freepbx v.13.0.192.16, v.14.0.1.5
* Version 13.0.0.2 * - Release tested
* Version 14.0.0.1 * - Alfa Release new DB structure Add User mobility
* Version 14.1.0.1 * - Migrated to chan-sccp repo
* Version 14.2.0.1 * - Retired old interface - min chan-sccp v433
* Version 14.2.0.2 * - Fix module database definition
* Version 14.2.0.5 * - Replace Modals with fpbxToast
* Version 14.2.0.8 * - Fix uninstaller and create backup
* Version 14.2.0.9 * - Bug Fix - incorrect response class for Reset Token Device
* Version 14.2.0.10 * - Bug Fix - line not assigned on device creation
* Version 14.3.0.0 * - New Minor Version - Change DB and add new settings
* Version 14.3.0.15 * - Get masterFilesList from provisoner via installer Fix Issue 39
* Version 14.3.0.16 * - Test version for freepbx upgrader.
* Version 14.3.0.17 * - Test version for freepbx upgrader.
* Version 14.3.0.18 * - Fix Issue 42
* Version 14.3.0.22 * - Fix Issue 50
* Version 14.3.0.23 * - Fix Issue 49
* Version 14.3.0.25 * - Fix Issue 55
* Version 14.3.0.26 * - Fix Issue 54
* Version 14.3.0.27 * - Standardise treatment of SIP and SCCP hardware.
* Version 14.3.0.28 * - Fix issue with RNav which caused exception with new device
* Version 14.3.0.29 * - Fix issue reloading page after saving settings and not restarting devices.
* Version 14.3.0.30 * - Fix reversion in 29. Not returning to correct page when saving device.
* Version 14.3.0.31 * - Fix rewrite rules.
* Version 14.4.0.1 * - Modify installer to avoid data loss on existing 14.3 fields. Bump Minor version to reflect this.
* Version 14.4.0.2 * - Revert error in Installer db calls - IF EXISTS is not valid in MariaDb v5 (package DB)
* Version 14.4.0.3 * - Change method of selecting phonecodepage depending on if is java phone.
* Version 14.4.0.5 * - Fix issue #59.
* Version 14.5.0.2 * - Fix issue #32.
* Version 14.5.0.4 * - Fix issue where values with spaces are truncated. Preserve softkeys accross installs
</changelog>
<location></location>
<location>https://github.com/chan-sccp/sccp_manager</location>
<depends>
<version>15</version>
<phpversion>7.0</phpversion>
<phpcomponent>zip</phpcomponent>
</depends>
<supported>
<version>13.0.0.1</version>
<version>13.0.0.2M</version>
</supported>
<info>https://github.com/PhantomVl/sccp_manager</info>
<license>GPL</license>
<info>https://github.com/chan-sccp/sccp_manager</info>
<updateurl>https://raw.githubusercontent.com/chan-sccp/sccp_manager/develop/sccpManagerUpdater.json</updateurl>
<license>GPL</license>
<md5sum></md5sum>
<database>
<table name="sccpdevice">
<field name="name" type="string" length="15" primarykey="true"/>
<field name="type" type="string" length="15" notnull="false"/>
<field name="addon" type="string" length="45" notnull="false"/>
<field name="description" type="string" length="45" notnull="false"/>
<field name="_description" type="string" length="45" notnull="false"/>
<field name="tzoffset" type="string" length="5" notnull="false"/>
<field name="imageversion" type="string" length="31" notnull="false"/>
<field name="deny" type="string" length="100" default="0.0.0.0/0.0.0.0" notnull="false"/>
<field name="permit" type="string" length="100" default="internal" notnull="false"/>
<field name="earlyrtp" type="string" notnull="false"/>
<field name="mwilamp" type="string" default="on" notnull="false"/>
<field name="mwioncall" type="string" default="on" notnull="false"/>
<field name="dndFeature" type="string" notnull="false"/>
<field name="transfer" type="string" notnull="false"/>
<field name="cfwdall" type="string" default="on" notnull="false"/>
<field name="cfwdbusy" type="string" default="on" notnull="false"/>
<field name="private" type="string" default="off"/>
<field name="privacy" type="string" default="full"/>
<field name="nat" type="string" notnull="false"/>
<field name="directrtp" type="string" notnull="false"/>
<field name="softkeyset" type="string" length="100" default="softkeyset" notnull="false"/>
<field name="audio_tos" type="string" length="11" default="0xB8" notnull="false"/>
<field name="audio_cos" type="string" length="1" default="6" notnull="false"/>
<field name="video_tos" type="string" length="11" default="0x88" notnull="false"/>
<field name="video_cos" type="string" length="1" default="5" notnull="false"/>
<field name="conf_allow" type="string" default="on"/>
<field name="conf_play_general_announce" type="string" length="3" default="on" notnull="false"/>
<field name="conf_play_part_announce" type="string" default="on"/>
<field name="conf_mute_on_entry" type="string" default="off"/>
<field name="conf_music_on_hold_class" type="string" length="80" default="default" notnull="false"/>
<field name="conf_show_conflist" type="string" default="on"/>
<field name="force_dtmfmode" type="string" default="auto"/>
<field name="setvar" type="string" length="100" notnull="false"/>
<field name="backgroundImage" type="string" length="255" notnull="false"/>
<field name="backgroundThumbnail" type="string" length="255" notnull="false"/>
<field name="ringtone" type="string" length="255" notnull="false"/>
<field name="callhistory_answered_elsewhere" type="string" notnull="false"/>
<field name="loginname" type="string" length="20" default="NULL" notnull="false"/>
<field name="_loginname" type="string" length="20" notnull="false"/>
<field name="profileid" type="integer" default="0"/>
<field name="_profileid" type="integer" notnull="false"/>
<field name="dialrules" type="string" length="255" default="NULL" notnull="false"/>
<field name="_dialrules" type="string" length="255" notnull="false"/>
<field name="useRedialMenu" type="string" length="5" default="no" notnull="false"/>
<field name="cfwdnoanswer" type="string" default="on" notnull="false"/>
<field name="park" type="string" default="on" notnull="false"/>
<field name="monitor" type="string" notnull="false"/>
<field name="transfer_on_hangup" type="string" notnull="false"/>
<field name="phonecodepage" type="string" length="50" notnull="false"/>
<field name="logserver" type="string" length="100" default="NULL" notnull="false"/>
<field name="_logserver" type="string" length="100" notnull="false"/>
<field name="daysdisplaynotactive" type="string" length="20" default="NULL" notnull="false"/>
<field name="_daysdisplaynotactive" type="string" length="20" notnull="false"/>
<field name="displayontime" type="string" length="20" default="NULL" notnull="false"/>
<field name="_displayontime" type="string" length="20" notnull="false"/>
<field name="displayonduration" type="string" length="20" default="NULL" notnull="false"/>
<field name="_displayonduration" type="string" length="20" notnull="false"/>
<field name="displayidletimeout" type="string" length="20" default="NULL" notnull="false"/>
<field name="_displayidletimeout" type="string" length="20" notnull="false"/>
<field name="settingsaccess" type="string" default="off"/>
<field name="_settingsaccess" type="string" notnull="false"/>
<field name="videocapability" type="string" default="off"/>
<field name="_videocapability" type="string" notnull="false"/>
<field name="webaccess" type="string" default="off"/>
<field name="_webaccess" type="string" notnull="false"/>
<field name="webadmin" type="string" default="off"/>
<field name="_webadmin" type="string" notnull="false"/>
<field name="pcport" type="string" default="on"/>
<field name="_pcport" type="string" notnull="false"/>
<field name="spantopcport" type="string" default="on"/>
<field name="_spantopcport" type="string" notnull="false"/>
<field name="voicevlanaccess" type="string" default="off"/>
<field name="_voicevlanaccess" type="string" notnull="false"/>
<field name="enablecdpswport" type="string" default="off"/>
<field name="_enablecdpswport" type="string" notnull="false"/>
<field name="enablecdppcport" type="string" default="off"/>
<field name="_enablecdppcport" type="string" notnull="false"/>
<field name="enablelldpswport" type="string" default="off"/>
<field name="_enablelldpswport" type="string" notnull="false"/>
<field name="enablelldppcport" type="string" default="off"/>
<field name="_enablelldppcport" type="string" notnull="false"/>
<field name="firstdigittimeout" type="string" length="20" default="NULL" notnull="false"/>
<field name="_firstdigittimeout" type="string" length="20" notnull="false"/>
<field name="digittimeout" type="string" length="20" default="NULL" notnull="false"/>
<field name="_digittimeout" type="string" length="20" notnull="false"/>
<field name="cfwdnoanswer_timeout" type="string" length="20" default="NULL" notnull="false"/>
<field name="_cfwdnoanswer_timeout" type="string" length="20" notnull="false"/>
<field name="autoanswer_ring_time" type="string" length="20" default="NULL" notnull="false"/>
<field name="_autoanswer_ring_time" type="string" length="20" notnull="false"/>
<field name="autoanswer_tone" type="string" length="20" default="NULL" notnull="false"/>
<field name="_autoanswer_tone" type="string" length="20" notnull="false"/>
<field name="remotehangup_tone" type="string" length="20" default="NULL" notnull="false"/>
<field name="_remotehangup_tone" type="string" length="20" notnull="false"/>
<field name="transfer_tone" type="string" length="20" default="NULL" notnull="false"/>
<field name="_transfer_tone" type="string" length="20" notnull="false"/>
<field name="callwaiting_tone" type="string" length="20" default="NULL" notnull="false"/>
<field name="_callwaiting_tone" type="string" length="20" notnull="false"/>
<field name="callanswerorder" type="string" default="latestfirst"/>
<field name="_callanswerorder" type="string" notnull="false"/>
<field name="sccp_tos" type="string" length="11" default="0x68"/>
<field name="_sccp_tos" type="string" length="11" notnull="false"/>
<field name="sccp_cos" type="string" length="11" default="0x4"/>
<field name="_sccp_cos" type="string" length="11" notnull="false"/>
<field name="dev_sshPassword" type="string" length="25" default="cisco"/>
<field name="_dev_sshPassword" type="string" length="25" notnull="false"/>
<field name="dev_sshUserId" type="string" length="25" default="cisco"/>
<field name="_dev_sshUserId" type="string" length="25" notnull="false"/>
<field name="phonepersonalization" type="string" length="25" default="0"/>
<field name="_phonepersonalization" type="string" length="25" notnull="false"/>
<field name="devlang" type="string" length="50" default="NULL" notnull="false"/>
<field name="_devlang" type="string" length="50" notnull="false"/>
<field name="netlang" type="string" length="50" default="NULL" notnull="false"/>
<field name="_netlang" type="string" length="50" notnull="false"/>
<field name="keepalive" type="integer" default="60" notnull="false"/>
</table>
<table name="sccpline">
<field name="id" type="integer" autoincrement="true"/>
<field name="pin" type="string" length="7" notnull="false"/>
<field name="label" type="string" length="45" notnull="false"/>
<field name="description" type="string" length="45" notnull="false"/>
<field name="context" type="string" length="45" notnull="false"/>
<field name="incominglimit" type="integer" default="6" notnull="false"/>
<field name="transfer" type="string" notnull="false"/>
<field name="mailbox" type="string" length="45" notnull="false"/>
<field name="vmnum" type="string" length="45" default="*97" notnull="false"/>
<field name="cid_name" type="string" length="45" notnull="false"/>
<field name="cid_num" type="string" length="45" notnull="false"/>
<field name="disallow" type="string" length="255" notnull="false"/>
<field name="allow" type="string" length="255" notnull="false"/>
<field name="trnsfvm" type="string" length="45" notnull="false"/>
<field name="secondary_dialtone_digits" type="string" length="45" notnull="false"/>
<field name="secondary_dialtone_tone" type="string" length="45" notnull="false"/>
<field name="musicclass" type="string" length="45" default="default" notnull="false"/>
<field name="language" type="string" length="45" notnull="false"/>
<field name="accountcode" type="string" length="45" notnull="false"/>
<field name="echocancel" type="string" default="off"/>
<field name="silencesuppression" type="string" default="off"/>
<field name="callgroup" type="string" length="45" notnull="false"/>
<field name="pickupgroup" type="string" length="45" notnull="false"/>
<field name="namedcallgroup" type="string" length="100" notnull="false"/>
<field name="namedpickupgroup" type="string" length="100" notnull="false"/>
<field name="adhocNumber" type="string" length="45" notnull="false"/>
<field name="meetme" type="string" length="5" notnull="false"/>
<field name="meetmenum" type="string" length="45" notnull="false"/>
<field name="meetmeopts" type="string" length="45" notnull="false"/>
<field name="regexten" type="string" length="45" notnull="false"/>
<field name="directed_pickup" type="string" notnull="false"/>
<field name="directed_pickup_context" type="string" length="100" notnull="false"/>
<field name="pickup_modeanswer" type="string" notnull="false"/>
<field name="amaflags" type="string" length="45" notnull="false"/>
<field name="dnd" type="string" default="reject" notnull="false"/>
<field name="videomode" type="string" default="auto" notnull="false"/>
<field name="setvar" type="string" length="50" notnull="false"/>
<field name="name" type="string" length="40" primarykey="true"/>
<field name="phonecodepage" type="string" length="50" notnull="false"/>
<field name="regcontext" type="string" length="20" default="sccpregistration" notnull="false"/>
<field name="_regcontext" type="string" length="20" notnull="false"/>
<field name="transfer_on_hangup" type="string" default="off"/>
<field name="_transfer_on_hangup" type="string" notnull="false"/>
<field name="autoselectline_enabled" type="string" default="off"/>
<field name="_autoselectline_enabled" type="string" notnull="false"/>
<field name="autocall_select" type="string" default="off"/>
<field name="_autocall_select" type="string" notnull="false"/>
<field name="backgroundImageAccess" type="string" default="off"/>
<field name="_backgroundImageAccess" type="string" notnull="false"/>
<field name="callLogBlfEnabled" type="string" default="2"/>
<field name="_callLogBlfEnabled" type="string" notnull="false"/>
<key name="id" type="unique">
<column name="id"/>
</key>
</table>
<table name="sccpbuttonconfig">
<field name="ref" type="string" length="15" default="" primarykey="true"/>
<field name="reftype" type="string" length="15" default="sccpdevice" primarykey="true"/>
<field name="instance" type="boolean" default="0" primarykey="true"/>
<field name="buttontype" type="string" length="190" default="line" primarykey="true"/>
<field name="name" type="string" length="36" notnull="false"/>
<field name="options" type="string" length="100" notnull="false"/>
<key name="ref" type="index">
<column name="ref"/>
<column name="reftype"/>
</key>
</table>
<table name="sccpdevmodel">
<field name="model" type="string" length="20" primarykey="true"/>
<field name="vendor" type="string" length="40" notnull="false"/>
<field name="dns" type="integer" default="1" notnull="false"/>
<field name="buttons" type="integer" default="0" notnull="false"/>
<field name="loadimage" type="string" length="40" notnull="false"/>
<field name="loadinformationid" type="string" length="30" notnull="false"/>
<field name="enabled" type="integer" default="0" notnull="false"/>
<field name="nametemplate" type="string" length="50" notnull="false"/>
<key name="model" type="index">
<column name="model"/>
</key>
</table>
<table name="sccpuser">
<field name="name" type="string" length="20" primarykey="true"/>
<field name="pin" type="string" length="7" notnull="false"/>
<field name="password" type="string" length="7" notnull="false"/>
<field name="description" type="string" length="45" notnull="false"/>
<field name="roaminglogin" type="string" default="off" notnull="false"/>
<field name="devicegroup" type="string" length="7"/>
<field name="auto_logout" type="string" default="off" notnull="false"/>
<field name="homedevice" type="string" length="20" notnull="false"/>
<key name="name" type="unique">
<column name="name"/>
</key>
</table>
<table name="sccpsettings">
<field name="keyword" type="string" length="50" primarykey="true"/>
<field name="data" type="string" length="255" notnull="false"/>
<field name="seq" type="boolean" primarykey="true"/>
<field name="type" type="boolean" primarykey="true"/>
<field name="systemdefault" type="string" length="255" notnull="false"/>
</table>
</database>
</module>

46
page.html.php Normal file
View file

@ -0,0 +1,46 @@
<div class="container-fluid">
<h1><?php echo $display_info?></h1>
<div class="row">
<div class="col-sm-12">
<div class="fpbx-container">
<div class="display no-border">
<div class="nav-container">
<div class="scroller scroller-left"><i class="glyphicon glyphicon-chevron-left"></i></div>
<div class="scroller scroller-right"><i class="glyphicon glyphicon-chevron-right"></i></div>
<div class="wrapper">
<ul class="nav nav-tabs list" role="tablist">
<?php foreach ($display_page as $key => $page) { ?>
<li data-name="<?php echo $key?>" class="change-tab <?php echo $key == 'general' ? 'active' : ''?>"><a href="#<?php echo $key?>" aria-controls="<?php echo $key?>" role="tab" data-toggle="tab"><?php echo $page['name']?></a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="tab-content display">
<?php foreach ($display_page as $key => $page) { ?>
<div id="<?php echo $key?>" class="tab-pane <?php echo $key == 'general' ? 'active' : ''?>">
<?php echo $page['content']?>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal alerts-->
<div class="modal" id="hwalert" tabindex="-1" role="dialog" aria-labelledby="lhwalert">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>

View file

@ -1,5 +1,7 @@
<?php /* $Id:$ */
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
if (!defined('FREEPBX_IS_AUTH')) {
die('No direct script access allowed');
}
// License for all code of this FreePBX module can be found in the license file inside the module directory
// Copyright 2015 Sangoma Technologies.
//
@ -14,40 +16,12 @@ if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
//
$spage = FreePBX::create()->Sccp_manager;
if (empty($spage->class_error)) {
$display_page = $spage->AdvServerShowPage();
$display_info = _("SCCP Advance Server Configuration");
$display_page = $spage->advServerShowPage();
$display_info = _("SCCP Advance Server Configuration");
} else {
$display_page = $spage->InfoServerShowPage();
$display_info = _("SCCP Server Configuration");
$display_page = $spage->infoServerShowPage();
$display_info = _("SCCP Server Configuration");
}
// standardise code to reduce base
include('page.html.php');
?>
<div class="container-fluid">
<h1><?php echo $display_info?></h1>
<div class="row">
<div class="col-sm-12">
<div class="fpbx-container">
<div class="display no-border">
<div class="nav-container">
<div class="scroller scroller-left"><i class="glyphicon glyphicon-chevron-left"></i></div>
<div class="scroller scroller-right"><i class="glyphicon glyphicon-chevron-right"></i></div>
<div class="wrapper">
<ul class="nav nav-tabs list" role="tablist">
<?php foreach($display_page as $key => $page) { ?>
<li data-name="<?php echo $key?>" class="change-tab <?php echo $key == 'general' ? 'active' : ''?>"><a href="#<?php echo $key?>" aria-controls="<?php echo $key?>" role="tab" data-toggle="tab"><?php echo $page['name']?></a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="tab-content display">
<?php foreach($display_page as $key => $page) { ?>
<div id="<?php echo $key?>" class="tab-pane <?php echo $key == 'general' ? 'active' : ''?>">
<?php echo $page['content']?>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -1,5 +1,7 @@
<?php /* $Id:$ */
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
if (!defined('FREEPBX_IS_AUTH')) {
die('No direct script access allowed');
}
// License for all code of this FreePBX module can be found in the license file inside the module directory
// Copyright 2015 Sangoma Technologies.
//
@ -14,41 +16,12 @@ if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
//
$spage = FreePBX::create()->Sccp_manager;
if (empty($spage->class_error)) {
$display_page = $spage->PhoneShowPage();
$display_info = _("SCCP Phone Manager");
$display_page = $spage->phoneShowPage();
$display_info = _("SCCP Phone Manager");
} else {
$display_page = $spage->InfoServerShowPage();
$display_info = _("SCCP Server Configuration");
$display_page = $spage->infoServerShowPage();
$display_info = _("SCCP Server Configuration");
}
// standardise code to reduce base
include('page.html.php');
?>
<div class="container-fluid">
<h1><?php echo $display_info?></h1>
<div class="row">
<div class="col-sm-12">
<div class="fpbx-container">
<div class="display no-border">
<div class="nav-container">
<div class="scroller scroller-left"><i class="glyphicon glyphicon-chevron-left"></i></div>
<div class="scroller scroller-right"><i class="glyphicon glyphicon-chevron-right"></i></div>
<div class="wrapper">
<ul class="nav nav-tabs list" role="tablist">
<?php foreach($display_page as $key => $page) { ?>
<li data-name="<?php echo $key?>" class="change-tab <?php echo $key == 'general' ? 'active' : ''?>"><a href="#<?php echo $key?>" aria-controls="<?php echo $key?>" role="tab" data-toggle="tab"><?php echo $page['name']?></a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="tab-content display">
<?php foreach($display_page as $key => $page) { ?>
<div id="<?php echo $key?>" class="tab-pane <?php echo $key == 'general' ? 'active' : ''?>">
<?php echo $page['content']?>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -1,42 +1,18 @@
<?php /* $Id:$ */
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
if (!defined('FREEPBX_IS_AUTH')) {
die('No direct script access allowed');
}
// License for all code of this FreePBX module can be found in the license file inside the module directory
// Copyright 2015 Sangoma Technologies.
// vim: set ai ts=4 sw=4 ft=php:
// SccpSettings page. Re-written for usage with chan_sccp
// SccpSettings page. Re-written for usage with chan_sccp
// AGPL v3 Licened
//
$spage = FreePBX::create()->Sccp_manager;
// Initialise page before to avoid double calls and improve performance
$display_page = FreePBX::create()->Sccp_manager->settingsShowPage();
$display_info = _("SCCP Server Settings");
// standardise code to reduce base
include('page.html.php');
?>
<div class="container-fluid">
<h1><?php echo _("SCCP Server Settings")?></h1>
<div class="row">
<div class="col-sm-12">
<div class="fpbx-container">
<div class="display no-border">
<div class="nav-container">
<div class="scroller scroller-left"><i class="glyphicon glyphicon-chevron-left"></i></div>
<div class="scroller scroller-right"><i class="glyphicon glyphicon-chevron-right"></i></div>
<div class="wrapper">
<ul class="nav nav-tabs list" role="tablist">
<?php foreach($spage->myShowPage() as $key => $page) { ?>
<li data-name="<?php echo $key?>" class="change-tab <?php echo $key == 'general' ? 'active' : ''?>"><a href="#<?php echo $key?>" aria-controls="<?php echo $key?>" role="tab" data-toggle="tab"><?php echo $page['name']?></a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="tab-content display">
<?php foreach($spage->myShowPage() as $key => $page) { ?>
<div id="<?php echo $key?>" class="tab-pane <?php echo $key == 'general' ? 'active' : ''?>">
<?php echo $page['content']?>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,482 @@
<?php
// vim: set ai ts=4 sw=4 ft=php:
// Version for SCCP Manager 13.0.X
//
/* This is the driver for Sccp_manager in FreePBX.
It is loaded via an include, written by the installer, at
modules/core/functions.inc/drivers
and provides the following required methods. it provides the interface between
FreePBX extensions and sccp_manager lines
*
* getInfo
* addDevice
* delDevice
* getDevice - Called by core to read sccpline returning fields in data_fld
* getDefaultDeviceSettings -
* getDeviceDisplay - Called by functionsInc to load sccp tab using values from Device and getDevice.
*
*/
//
namespace FreePBX\modules\Core\Drivers;
class Sccp extends \FreePBX\modules\Core\Driver {
// This is a map between sccpline fields and FreePBX fields.
// TODO: List needs to be extended. Missing fields, not necessarily all required              
/* adhocNumber
              meetme
                meetmenum
               meetmeopts
                 regexten
          directed_pickup
  directed_pickup_context
        pickup_modeanswer
                 amaflags
setvar
            phonecodepage
                  trnsfvm
                    vmnum
*/
private $data_fld = array("pin"=>'pin', "label" => 'label', "accountcode" => 'account',
"context" =>'context',"incominglimit"=>'incominglimit',
"callgroup"=>'callgroup',"pickupgroup"=>'pickupgroup',
"transfer" => 'transfer', "echocancel" => 'echocancel',
"language" => 'language', "description" => 'callerid',
"cid_num" => 'cid_num', "cid_name" => 'label', "mailbox" => 'mailbox',
"musicclass" => 'musicclass', "allow" => 'allow',"disallow" => 'disallow',
"videomode" => 'videomode', 'pickup_modeanswer' => 'pickup_modeanswer',
"dnd" => 'dnd', "silencesuppression" => 'silencesuppression',
"secondary_dialtone_digits" => 'secondary_dialtone_digits',
"secondary_dialtone_tone" => 'secondary_dialtone_tone',
'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup',
'directed_pickup' => 'directed_pickup'
);
// These are gui defaults used by freePBX for the elements in the SCCP tab in add/edit phone.
private $guiDefaults =array(
'gui_checkset' => array( "elemname" => "",
"prompttext" => "", //ok
"helptext" => "",
"currentvalue" => "",
"valarray" => array(),
"jsonclick" => '',
"jsvalidation" => "", //ok
"failvalidationmsg" => "", //ok
"canbeempty" => true,
"maxchars" => 0,
"disable" => false, //ok
"inputgroup" => false,
"class" => "",
"cblabel" => 'Enable',
"disabled_value" => 'DEFAULT',
"check_enables" => 'true',
"cbdisable" => false,
"cbclass" => '')
);
private $line_defaults = array();
public function __construct($parent_class = null) {
$this->freepbx = $parent_class;
$this->database = $parent_class->Database();
// Get system defaults [systemdefault] and sitedefaults [data] from sccpsettings.
$stmt = $this->database->prepare("SELECT * FROM sccpsettings");
$stmt->execute();
$raw_settings = $stmt->fetchAll(\PDO::FETCH_ASSOC);
foreach ($raw_settings as $key => $valueArray) {
$sccpDefaults[$valueArray['keyword']] = $valueArray['systemdefault'];
$siteDefaults[$valueArray['keyword']] = $valueArray['data'];
}
// This will produce an array where site defaults take precedence over system defaults
$this->line_defaults = array_intersect_key($siteDefaults,$sccpDefaults);
// If have no site codecs, use system defaults - must have a codec!
if (empty($this->line_defaults['allow'])) {
$this->line_defaults['allow'] = $sccpDefaults['allow'];
}
if (empty($this->line_defaults['disallow'])) {
$this->line_defaults['disallow'] = $sccpDefaults['disallow'];
}
unset($raw_settings, $siteDefaults, $sccpDefaults);
}
public function getInfo() {
return array(
"rawName" => "sccp",
"hardware" => "sccp_custom",
"prettyName" => _("Sccp Custom Driver"),
"shortName" => "SCCP",
"description" => _("Sccp Device"),
"Version" => "11.5",
"about" => "Sccp class Base ver: 11.5, Sccp ver: default"
);
}
public function addDevice($id, $settings) {
// This is actually save line and is used by add and edit.
$add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description','devinfo_mailbox'=>'mailbox');
$settings['cid_num']['value'] = '';
$settings['cid_name']['value'] = '';
$settings['mailbox']['value']= '';
// Add $_REQUEST values to settings
if (isset($_REQUEST)){
foreach($add_fld as $key => $val) {
if (!empty($_REQUEST[$key])){
$settings[$val]['value'] = $_REQUEST[$key];
}
}
}
$allow_codec = array();
foreach($settings as $key => $val) {
if (strncmp($key,'codec_',6) === 0 ) {
$allow_codec[] = str_replace('codec_','',$key);
}
}
$settings['allow']['value'] = implode(";", $allow_codec);
// Reset to line defaults if no value selected
if (empty($settings['allow']['value'])) {
$settings['allow']['value'] = $this->line_defaults['allow'];
}
// If set, parse outboundcid content into cid_num and cid_name sccpline fields
if (!empty($settings['cid_num']['value'])) {
$outboundcid = $settings['cid_num']['value'];
if (preg_match('/"(.*)"\s?<(.*)>/', $outboundcid, $matches)) {
$settings['cid_num']['value'] = $matches[2];
$settings['cid_name']['value'] = $matches[1];
} else if (is_integer($outboundcid)) {
$settings['cid_num']['value'] = $outboundcid;
}
}
if ($this->line_defaults['dndFeature'] == 'off') {
$settings['dnd']['value'] = 'off';
}
if (!empty($_REQUEST['vm']) && ($_REQUEST['vm'] =='enabled')){ // mailbox
if (empty($settings['mailbox']['value'])) {
$settings['mailbox']['value']= $id;
}
}
// only store values that have been set; if need to display a default, must show in page.
$sqlSet = "name='{$id}'";
foreach($this->data_fld as $key => $val) {
if (!empty($settings[$val]['value'])) {
$sqlSet .= ", {$key}='{$settings[$val]['value']}'";
}
}
$stmt = "INSERT INTO sccpline SET {$sqlSet} ON DUPLICATE KEY UPDATE {$sqlSet}";
$sth = $this->database->prepare($stmt);
$sth->execute();
/*
If called from SCCP Phone, redirect to SCCP Phone page on submit.
This was last function in add so should be safe.
Prefer to add in Hooks, but is not followed even if set for $currentComponent
Do nothing if called from QuickCreateExtension when display is not set
*/
if (isset($_REQUEST['display'])) {
redirect("config.php?display=sccp_phone", false);
}
// Have changed something so need to reload the device
// TODO: are we reloading the device or reloading Asterisk
$this->reload_line($id);
return true;
}
public function delDevice($id) {
//Required by FreePBX.
// Delete associated default line buttons or will leave orphans
foreach (array($id) as $openId) {
$sth = $this->database->prepare("DELETE FROM sccpbuttonconfig WHERE name LIKE :openID AND buttontype = 'line'");
$openId = "{$openId}%";
$sth->bindParam(':openID', $openId);
$sth->execute();
}
$sth = $this->database->prepare("DELETE FROM sccpline WHERE name = ?");
$sth->execute(array($id));
return true;
}
public function getDevice($id) {
// FreePBX required method
$sql = "SELECT name AS id, name AS name ";
foreach($this->data_fld as $key => $val) {
$sql .= ", {$key} AS {$val}";
}
$sql .= " FROM sccpline WHERE name = '{$id}'";
$sth = $this->database->prepare($sql);
$tech = array();
try {
$sth->execute(array($id));
$tech = $sth->fetch(\PDO::FETCH_ASSOC);
$tech['dial']="SCCP/{$id}";
} catch(\Exception $e) {}
return $tech;
}
public function getDefaultDeviceSettings($id, $displayname, &$flag) {
// FreePBX required method
$settings = array();
$settingsFields = array('mailbox', 'incominglimit', 'context', 'directed_pickup_context', 'callgroup', 'pickupgroup', 'namedcallgroup',
'namedpickupgroup', 'adhocNumber', 'secondary_dialtone_digits', 'secondary_dialtone_tone', 'directed_pickup', 'pickup_modeanswer',
'transfer', 'echocancel', 'dnd', 'silencesuppression', 'musicclass', 'pin', 'allow', 'disallow');
foreach ($settingsFields as $key) {
$settings[$key] = array('value' => $this->line_defaults[$key], 'flag' => $flag++);
}
return array('dial' => 'SCCP', 'settings' => $settings);
}
public function getDeviceDisplay($display, $deviceInfo, $currentComponent, $primarySection) {
global $amp_conf;
$activeCodecs = array();
// load xml data to get help from same source as rest of module
$xml_vars = $amp_conf['AMPWEBROOT'] . '/admin/modules/sccp_manager/conf/sccpgeneral.xml.v433';
$this->xml_data = simplexml_load_file($xml_vars);
// load metainfo from chan-sccp - help information if not in xml. Only load first time as static data.
if (empty($this->sccpHelpInfo)) {
$sysConfiguration = \FreePbx::sccp_manager()->aminterface->getSCCPConfigMetaData('general');
foreach ($sysConfiguration['Options'] as $key => $valueArray) {
foreach ($valueArray['Description'] as $descKey => $descValue) {
$this->sccpHelpInfo[$valueArray['Name']] .= $descValue . '<br>';
}
}
unset($sysConfiguration);
}
$section = _("SCCP Extension Details");
$section_с = _("SCCP Codec Details");
$gn_category = "sccp";
//add sccp category
$currentComponent->addTabTranslation('sccp',_('SCCP'));
// get site and system defaults
$systemCodecs = array_fill_keys(explode(';',$this->line_defaults['allow']),true);
$siteAudioCodecs = array_intersect_key($systemCodecs, $this->freepbx->Codecs->getAudio());
$siteVideoCodecs = array_intersect_key($systemCodecs, $this->freepbx->Codecs->getVideo());
if (empty($deviceInfo['allow'])) {
// No allowed codecs so reset to site defaults
foreach ($systemCodecs as $lineCodec => $dummyVal) {
$activeCodecs[] = "devinfo_codec_{$lineCodec}";
}
} else {
// have allowed codecs for this line
foreach (explode(';',$deviceInfo['allow']) as $lineCodec) {
$activeCodecs[] = "devinfo_codec_{$lineCodec}";
}
}
// Fill Audio codecs information
foreach ($siteAudioCodecs as $key => $value) {
$audioCodecButtons[] = array('value' => "devinfo_codec_{$key}", 'text' => $key);
}
// Fill Video codecs information
foreach ($siteVideoCodecs as $key => $value) {
$videoCodecButtons[] = array('value' => "devinfo_codec_{$key}", 'text' => $key);
}
$tmparr['disallow'] = array('prompttext' => _('Disallowed Codecs'),
'value' => $this->line_defaults['disallow'],
'tt' => 'Codecs that are disallowed. Default and recommended value is all',
'level' => 1,
'section' => $section_с,
'category' => $gn_category
);
$el = array(
"elemname" => "devinfo_sccp_codec",
"prompttext" => _('Line Audio Codec:'),
"helptext" => _("Line Audio Codec. Uncheck all Audio and Video codecs to return to site defaults"),
"currentvalue" => $activeCodecs,
"valarray" => $audioCodecButtons,
"class" => $section_с,
"disable" => 0
);
// Override defaults with $el
$currentComponent->addguielem($section_с, new \gui_checkset(array_merge($this->guiDefaults['gui_checkset'],$el)), $gn_category);
unset($el);
$el = array(
"elemname" => "devinfo_sccp_vcodec",
"prompttext" => _('Line Video Codec:'),
"helptext" => _("Line Video Codec"),
"currentvalue" => $activeCodecs,
"valarray" => $videoCodecButtons,
"class" => $section_с,
"disable" => 0
);
$currentComponent->addguielem($section_с, new \gui_checkset(array_merge($this->guiDefaults['gui_checkset'],$el)), $gn_category);
$pageGroup = $this->xml_data->xpath('//page_group[@name="sccp_extension_config"]');
$elements = $pageGroup[0]->children();
foreach ($elements as $child) {
if (empty($child->help)) {
$child->help = 'Help is not available.';
$child->meta_help = '1';
}
switch ($child['type']) {
case 'IE':
$elementID = (string)$child->input[0]->name;
if (!empty($metainfo[$elementID])) {
if ($child->meta_help == '1' || $child->help == 'Help!') {
$child->help = $metainfo[$shortId];
}
}
$tmparr[$elementID] = array('prompttext' => _((string)$child->label),
'value' => $this->line_defaults[$elementID],
'tt' => (string)$child->help,
'level' => 1,
'section' => $section,
'category' => $gn_category
);
break;
case 'IS':
$select = array();
foreach ($child->xpath('button') as $value) {
$select[] = array('value' => strtolower((string)$value[@value]), 'text' => (string)$value);
}
$hideButton = false;
if (($this->line_defaults['dndFeature'] == 'off') && ($child['id'] == 5)) {
$hideButton = true;
}
$tmparr[(string)$child->name] = array('prompttext' => _((string)$child->label),
'value' => $this->line_defaults[(string)$child->name],
'tt' => (string)$child->help,
'select' => $select,
'level' => 1,
'disable' => $hideButton,
'hidden' => $hideButton,
'type' => 'radio',
'section' => $section,
'category' => $gn_category
);
unset($select);
break;
case 'SLD':
$select = array(
array( 'value' => '0x21', 'text' => 'Inside Dial Tone'),
array( 'value' => '0x22', 'text' => 'Outside Dial Tone'),
array( 'value' => '0x23', 'text' => 'Line Busy Tone'),
array( 'value' => '0x24', 'text' => 'Alerting Tone'),
array( 'value' => '0x25', 'text' => 'Reorder Tone'),
array( 'value' => '0x26', 'text' => 'Recorder Warning Tone'),
array( 'value' => '0x27', 'text' => 'Recorder Detected Tone'),
array( 'value' => '0x28', 'text' => 'Reverting Tone'),
array( 'value' => '0x29', 'text' => 'Receiver OffHook Tone'),
array( 'value' => '0x2A', 'text' => 'Partial Dial Tone'),
array( 'value' => '0x2B', 'text' => 'No Such Number Tone'),
array( 'value' => '0x2C', 'text' => 'Busy Verification Tone'),
array( 'value' => '0x2D', 'text' => 'Call Waiting Tone'),
array( 'value' => '0x2E', 'text' => 'Confirmation Tone'),
array( 'value' => '0x2F', 'text' => 'Camp On Indication Tone'),
array( 'value' => '0x30', 'text' => 'Recall Dial Tone'),
array( 'value' => '0x31', 'text' => 'Zip Zip'),
array( 'value' => '0x32', 'text' => 'Zip'),
array( 'value' => '0x33', 'text' => 'Beep Bonk'),
array( 'value' => '0x34', 'text' => 'Music Tone'),
array( 'value' => '0x35', 'text' => 'Hold Tone'),
array( 'value' => '0x36', 'text' => 'Test Tone'),
array( 'value' => '0x37', 'text' => 'DT Monitor Warning Tone'),
array( 'value' => '0x40', 'text' => 'Add Call Waiting'),
array( 'value' => '0x41', 'text' => 'Priority Call Wait'),
array( 'value' => '0x42', 'text' => 'Recall Dial'),
array( 'value' => '0x43', 'text' => 'Barg In'),
array( 'value' => '0x44', 'text' => 'Distinct Alert'),
array( 'value' => '0x45', 'text' => 'Priority Alert'),
array( 'value' => '0x46', 'text' => 'Reminder Ring'),
array( 'value' => '0x47', 'text' => 'Precedence RingBank'),
array( 'value' => '0x48', 'text' => 'Pre-EmptionTone'),
array( 'value' => '0x67', 'text' => '2105 HZ'),
array( 'value' => '0x68', 'text' => '2600 HZ'),
array( 'value' => '0x69', 'text' => '440 HZ'),
array( 'value' => '0x6A', 'text' => '300 HZ'),
array( 'value' => '0x77', 'text' => 'MLPP Pala'),
array( 'value' => '0x78', 'text' => 'MLPP Ica'),
array( 'value' => '0x79', 'text' => 'MLPP Vca'),
array( 'value' => '0x7A', 'text' => 'MLPP Bpa'),
array( 'value' => '0x7B', 'text' => 'MLPP Bnea'),
array( 'value' => '0x7C', 'text' => 'MLPP Upa')
);
$tmparr[(string)$child->name] = array('prompttext' => _((string)$child->label),
'value' => $this->line_defaults[(string)$child->name],
'tt' => (string)$child->help,
'select' => $select,
'level' => 1,
'type' => 'select',
'section' => $section,
'category' => $gn_category
);
unset($select);
break;
case 'SLG':
$elementID = (string)$child->name;
$named_group = \FreePbx::sccp_manager()->dbinterface->getNamedGroup($elementID);
if (!empty($named_group[$elementID])) {
foreach ($named_group[$elementID] as $val) {
$select[] = array('value' => $val, 'text' => $val);
}
}
// Disable and hide list elements if there are no valid values
$tmparr[(string)$child->name] = array('prompttext' => _((string)$child->label),
'value' => $this->line_defaults[(string)$child->name],
'tt' => (string)$child->help,
'select' => $select,
'level' => 1,
'disable' => empty($named_group[$elementID][0]),
'hidden' => empty($named_group[$elementID][0]),
'section' => $section,
'category' => $gn_category
);
unset($select);
break;
case 'SLM':
if (function_exists('music_list')){
foreach (music_list() as $value) {
$select[] = array('value' => $value, 'text' => _($value));
}
} else {
$select[] = array('value' => 'default', 'text' => _('default'));
}
$tmparr[(string)$child->name] = array('prompttext' => _((string)$child->label),
'value' => $this->line_defaults[(string)$child->name],
'tt' => (string)$child->help,
'select' => $select,
'level' => 1,
'type' => 'select',
'section' => $section,
'category' => $gn_category
);
unset($select);
break;
}
}
$select[] = array('value' => 'off', 'text' => 'Off');
$select[] = array('value' => 'user', 'text' => 'User');
$select[] = array('value' => 'auto', 'text' => 'Auto');
$tt = _("Automatic or Manual video mode. Valid values are 'auto', 'user' or 'off'. When set to 'auto', video will automatically start if both parties have a compatible code enabled. In 'user' mode the user needs to press the vidmode softkey before video will be tried. Default:'auto'");
$tmparr['videomode'] = array('prompttext' => _('Video Mode '), 'value' => 'auto', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section_с, 'category' => $gn_category);
unset($select);
return $tmparr;
}
public function reload_line($id) {
global $astman;
// TODO: Change to use amInterfaceClasses
$result = $astman->Command('sccp reload line ' . $id);
return $result;
}
public function getDeviceHeaders() {
return array(
'secret' => array('identifier' => _('Secret'), 'description' => sprintf(_('Secret [Enter "%s" to regenerate]'),"REGEN")),
);
}
}

View file

@ -0,0 +1,208 @@
<?php
/**
*
* Core Comsnd Interface
*
* https://www.voip-info.org/asterisk-manager-example-php/
*/
/* !TODO!: Re-Indent this file. -TODO-: What do you mean? coreaccessinterface ?? */
namespace FreePBX\modules\Sccp_manager\aminterface;
// ************************************************************************** Event *********************************************
abstract class Event extends IncomingMessage
{
protected $_events;
public function getName()
{
return $this->getKey('Event');
}
public function __construct($rawContent)
{
parent::__construct($rawContent);
$this->_events = array();
$this->_completed = false;
}
}
class UnknownEvent extends Event
{
public function __construct($rawContent = '')
{
}
}
class TableStart_Event extends Event
{
public function getTableName()
{
return $this->getKey('TableName');
}
}
class TableEnd_Event extends Event
{
public function getTableName()
{
return $this->getKey('TableName');
}
}
class SCCPSoftKeySetEntry_Event extends Event
{
// This is a list of tables, each table is an entry
protected $_data;
}
class ExtensionStatus_Event extends Event
{
// this is a list of tables, each table is an entry
public function getPrivilege()
{
return $this->getKey('Privilege');
}
public function getExtension()
{
return $this->getKey('Exten');
}
public function getContext()
{
return $this->getKey('Context');
}
public function getHint()
{
return $this->getKey('Hint');
}
public function getStatus()
{
return $this->getKey('Status');
}
}
class SCCPDeviceEntry_Event extends Event
{
// This is a list of tables, each table is an entry
}
class SCCPShowDevice_Event extends Event
{
// This is a list of tables
public function getCapabilities()
{
// TODO unused method - to be deleted?
$ret = array();
$codecs = explode(';', substr($this->getKey('Capabilities'), 1, -1));
foreach ($codecs as $codec) {
$codec_parts = explode(" ", $codec);
$ret[] = array("name" => $codec_parts[0], "value" => substr($codec_parts[1], 1, -1));
}
return $ret;
}
public function getCodecsPreference()
{
// TODO unused method - to be deleted?
$ret = array();
$codecs = explode(';', substr($this->getKey('CodecsPreference'), 1, -1));
foreach ($codecs as $codec) {
$codec_parts = explode(" ", $codec);
$ret[] = array("name" => $codec_parts[0], "value" => substr($codec_parts[1], 1, -1));
}
return $ret;
}
}
class SCCPDeviceButtonEntry_Event extends Event
{
}
class SCCPDeviceFeatureEntry_Event extends Event
{
// Returned by SCCPShowDevice
}
class SCCPVariableEntry_Event extends Event
{
// Returned by SCCPShowDevice
}
class SCCPDeviceLineEntry_Event extends Event
{
}
class SCCPDeviceStatisticsEntry_Event extends Event
{
}
class SCCPDeviceSpeeddialEntry_Event extends Event
{
}
abstract class ClosingEvent extends Event
{
public function __construct($message) {
parent::__construct($message);
$this->_completed = true;
}
public function getListItems() {
return intval($this->getKey('ListItems'));
}
}
class ResponseComplete_Event extends ClosingEvent
{
// dummy event to avoid unnecessary testing
public function listCorrectlyReceived($_message, $_eventCount){
return true;
}
}
class SCCPShowDeviceComplete_Event extends ClosingEvent
{
public function listCorrectlyReceived($_message, $_eventCount){
// Have end of list event. Check with number of lines received and send true if match.
// Remove 9 for the start and end events, and then 4.
if ($this->getKey('listitems') === substr_count( $_message, "\n") -13) {
return true;
}
return false;
}
}
class SCCPShowDevicesComplete_Event extends ClosingEvent
{
public function listCorrectlyReceived($_message, $_eventCount) {
// Have end of list event. Check with number of events received and send true if match.
// Remove 9 for the lines in the list start and end, and the 2 blank lines.
if ($this->getKey('listitems') === substr_count( $_message, "\n") -11) {
return true;
}
return false;
}
}
class ExtensionStateListComplete_Event extends ClosingEvent
{
public function listCorrectlyReceived($_message, $_eventCount){
// Have end of list event. Check with number of events received and send true if match.
// Remove 1 as the closing event is included in the count.
if ($this->getKey('listitems') === $_eventCount -1) {
return true;
}
return false;
}
}
class SCCPShowSoftKeySetsComplete_Event extends ClosingEvent
{
public function listCorrectlyReceived($_message, $_eventCount){
// Have the end of list event. Check the number of lines received and
// return true if match. Remove 8 for the complete event.
if ($this->getKey('listitems') === substr_count( $_message, "\n") -11) {
return true;
}
return false;
}
}

View file

@ -0,0 +1,428 @@
<?php
/**
*
* Core Comsnd Interface
*
* https://www.voip-info.org/asterisk-manager-example-php/
*/
/* !TODO!: Re-Indent this file. -TODO-: What do you mean? coreaccessinterface ?? */
namespace FreePBX\modules\Sccp_manager\aminterface;
class AMIException extends \Exception
{
}
abstract class Message
{
const EOL = "\r\n";
const EOM = "\r\n\r\n";
protected $lines;
protected $variables;
protected $keys;
protected $createdDate;
private $_responseHandler;
public function __construct()
{
$this->lines = array();
$this->variables = array();
$this->keys = array();
$this->createdDate = time();
}
public function _ToDebug($level, $msg)
{
}
public function getResponseHandler()
{
if (strlen($this->_responseHandler) > 0) {
// throw new AMIException('Hier:' . $this->_responseHandler);
return (string) $this->_responseHandler;
} else {
return "";
}
}
public function setResponseHandler($responseHandler)
{
if (0 == strlen($responseHandler)) {
return;
}
$className = '\\FreePBX\\modules\\Sccp_manager\\aminterface\\' . $responseHandler . '_Response';
if (class_exists($className, true)) {
$this->_responseHandler = $responseHandler;
} else {
return;
}
}
public function setVariable($key, $value)
{
$key = strtolower($key);
$this->variables[$key] = $value;
/* print_r('<br>----Set Value -------<br>');
print_r($key);
print_r($value);
*/
}
public function getVariable($key)
{
$key = strtolower($key);
if (!isset($this->variables[$key])) {
return null;
}
return $this->variables[$key];
}
protected function setKey($key, $value)
{
$key = strtolower((string) $key);
$this->keys[$key] = (string) $value;
/*
print_r('<br>----Set Key -------<br>');
print_r($key);
print_r($value);
*
*/
}
public function getKey($key)
{
$key = strtolower($key);
if (!isset($this->keys[$key])) {
return null;
}
//return (string)$this->keys[$key];
return $this->keys[$key];
}
public function getVariables()
{
return $this->variables;
}
public function getActionID()
{
return $this->getKey('ActionID');
}
public function getKeys()
{
return $this->keys;
}
private function serializeVariable($key, $value)
{
return "Variable: $key=$value";
}
protected function setSanitizedKey($key, $value)
{
$key = strtolower((string) $key);
$_string_key = array('actionid', 'descr');
if (array_search($key, $_string_key) !== false) {
$this->keys[$key] = (string) $this->sanitizeInput($value, 'string');
} else {
$this->keys[$key] = $this->sanitizeInput($value);
}
}
protected function sanitizeInput($value, $prefered_type = '')
{
if ($prefered_type == '') {
if (!isset($value) || $value === null || strlen($value) == 0) {
return null;
} elseif (is_numeric($value)) {
$prefered_type = 'numeric';
} elseif (is_string($value)) {
$prefered_type = 'string';
} else {
throw new AMIException("Don't know how to convert: '" . $value . "'\n");
}
}
if ($prefered_type !== '') {
switch ($prefered_type) {
case 'string':
if (!isset($value) || $value === null || strlen($value) == 0) {
return '';
}
if (filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)) {
return (boolean) $value;
} elseif (filter_var($value, FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE)) {
return (string) $value;
} elseif (filter_var($value, FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_NULL_ON_FAILURE)) {
return (string) htmlspecialchars($value, ENT_QUOTES);
} else {
throw new AMIException("Incoming String is not sanitary. Skipping: '" . $value . "'\n");
}
break;
case 'numeric':
if (!isset($value) || $value === null || strlen($value) == 0) {
return 0;
}
if (filter_var($value, FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX | FILTER_FLAG_ALLOW_OCTAL)) {
return intval($value, 0);
} elseif (filter_var($value, FILTER_VALIDATE_FLOAT, FILTER_FLAG_ALLOW_FRACTION | FILTER_FLAG_ALLOW_THOUSAND | FILTER_FLAG_ALLOW_SCIENTIFIC)) {
return (float) $value;
} else {
return (double) $value;
}
default:
throw new AMIException("Don't know how to convert: '" . $value . "'\n");
break;
}
}
}
protected function finishMessage($message)
{
return $message . self::EOL . self::EOL;
}
public function serialize()
{
$result = array();
foreach ($this->getKeys() as $k => $v) {
$result[] = $k . ': ' . $v;
}
foreach ($this->getVariables() as $k => $v) {
if (is_array($v)) {
foreach ($v as $singleValue) {
$result[] = $this->serializeVariable($k, $singleValue);
}
} else {
$result[] = $this->serializeVariable($k, $v);
}
}
$mStr = $this->finishMessage(implode(self::EOL, $result));
return $mStr;
}
public function setActionID($actionID)
{
if (0 == strlen($actionID)) {
throw new AMIException('ActionID cannot be empty.');
return;
}
if (strlen($actionID) > 69) {
throw new AMIException('ActionID can be at most 69 characters long.');
return;
}
$this->setKey('ActionID', $actionID);
}
public function __sleep()
{
return array('lines', 'variables', 'keys', 'createdDate');
}
}
abstract class IncomingMessage extends Message
{
protected $rawContent;
public function getEventList()
{
return $this->getKey('EventList');
}
public function getRawContent()
{
return $this->rawContent;
}
public function isComplete()
{
return $this->_completed;
}
public function __sleep()
{
$ret = parent::__sleep();
$ret[] = 'rawContent';
return $ret;
}
public function __construct($rawContent)
{
parent::__construct();
$this->rawContent = $rawContent;
$lines = explode(Message::EOL, $rawContent);
foreach ($lines as $line) {
$content = explode(':', $line);
$name = strtolower(trim($content[0]));
unset($content[0]);
$value = isset($content[1]) ? trim(implode(':', $content)) : '';
try {
$this->setSanitizedKey($name, $value);
} catch (AMIException $e) {
throw new AMIException("Error: '" . $e . "'\n Dump RawContent:\n" . $this->rawContent . "\n");
}
}
}
}
// namespace FreePBX\modules\Sccp_manager\aminterface\Message;
class LoginAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $user AMI username.
* @param string $password AMI password.
*
* @return void
*/
public function __construct($user, $password)
{
parent::__construct('Login');
$this->setKey('Username', $user);
$this->setKey('Secret', $password);
$this->setKey('Events', 'off'); // &----
$this->setResponseHandler('Login');
}
}
abstract class ActionMessage extends Message
{
public function __construct($what)
{
parent::__construct();
$this->setKey('Action', $what);
$this->setKey('ActionID', microtime(true));
}
}
class CommandAction extends ActionMessage
{
public function __construct($command)
{
parent::__construct('Command');
$this->setKey('Command', $command);
$this->setResponseHandler("Command");
}
}
class ReloadAction extends ActionMessage
{
public function __construct($module = false)
{
parent::__construct('Reload');
if ($module !== false) {
$this->setKey('Module', $module);
$this->setResponseHandler("Generic");
}
}
}
class ExtensionStateListAction extends ActionMessage
{
public function __construct()
{
parent::__construct('ExtensionStateList');
$this->setKey('Segment', 'general');
$this->setKey('ResultFormat', 'command');
$this->setResponseHandler("ExtensionStateList");
}
}
class SCCPShowGlobalsAction extends ActionMessage
{
public function __construct()
{
parent::__construct('SCCPShowGlobals');
}
}
class SCCPShowSoftkeySetsAction extends ActionMessage
{
public function __construct()
{
parent::__construct('SCCPShowSoftkeySets');
$this->setKey('Segment', 'general');
$this->setKey('ResultFormat', 'command');
$this->setResponseHandler("SCCPShowSoftkeySets");
}
}
class SCCPShowDeviceAction extends ActionMessage
{
public function __construct($devicename)
{
parent::__construct('SCCPShowDevice');
$this->setKey('Segment', 'general');
$this->setKey('ResultFormat', 'command');
$this->setKey('DeviceName', $devicename);
$this->setResponseHandler("SCCPShowDevice");
}
}
class SCCPShowDevicesAction extends ActionMessage
{
public function __construct()
{
parent::__construct('SCCPShowDevices');
$this->setKey('Segment', 'general');
$this->setKey('ResultFormat', 'command');
$this->setResponseHandler("SCCPShowDevices");
}
}
class SCCPTokenAckAction extends ActionMessage
{
public function __construct($DeviceName)
{
parent::__construct('SCCPTokenAck');
$this->setKey('DeviceId', $DeviceName);
$this->setResponseHandler("Generic");
}
}
class SCCPDeviceRestartAction extends ActionMessage
{
public function __construct($DeviceName, $Type = "restart")
{
parent::__construct('SCCPDeviceRestart');
$this->setResponseHandler("Generic");
if (empty($Type)) {
$Type = "restart";
}
$this->setKey('DeviceName', $DeviceName);
if (in_array(strtolower($Type), array('restart', 'full', 'reset'))) {
$this->setKey('Type', $Type);
} else {
throw new Exception('Param2 has to be one of \'restart\', \'full\', \'reset\'.');
}
}
}
class SCCPConfigMetaDataAction extends ActionMessage
{
public function __construct($segment = false)
{
parent::__construct('SCCPConfigMetaData');
if ($segment != false) {
$this->setKey('Segment', $segment);
}
$this->setResponseHandler("SCCPJSON");
}
}

View file

@ -0,0 +1,429 @@
<?php
/*
*
* Response class definitions
*
*/
namespace FreePBX\modules\Sccp_manager\aminterface;
// ************************************************************************** Response *********************************************
abstract class Response extends IncomingMessage
{
protected $_events;
protected $_completed;
protected $keys;
public function __construct($rawContent)
{
parent::__construct($rawContent);
$this->_events = array();
// this logic is false - even if we have an error, we will not get anymore data, so is completed.
$this->_completed = $this->isSuccess();
}
public function __sleep()
{
$ret = parent::__sleep();
$ret[] = '_completed';
$ret[] = '_events';
return $ret;
}
public function getEvents()
{
return $this->_events;
}
public function getClosingEvent() {
return $this->_events['ClosingEvent'];
}
public function removeClosingEvent() {
unset($this->_events['ClosingEvent']);
}
public function getCountOfEvents() {
return count($this->_events);
}
public function isSuccess()
{
// returns true if response message does not contain error
return stristr($this->getKey('Response'), 'Error') === false;
}
public function isList()
{
if ($this->getKey('EventList') === 'start' ) {
return true;
}
}
public function getMessage()
{
return $this->getKey('Message');
}
public function setActionId($actionId)
{
$this->setKey('ActionId', $actionId);
}
public function getVariable($_rawContent, $_fields = '')
{
$lines = explode(Message::EOL, $_rawContent);
foreach ($_fields as $key => $value) {
foreach ($lines as $data) {
$_pst = strpos($data, $value);
if ($_pst !== false) {
$this->setKey($key, substr($data, $_pst + strlen($value)));
}
}
}
}
}
class GenericResponse extends Response
{
}
//****************************************************************************
// There are two types of Response messages returned by AMI
// Self contained responses which include any data requested;
// List Responses which contain the data in event messages that follow
// the response message.Response and Event
// Following are the self contained Response classes.
//****************************************************************************
class Generic_Response extends Response
{
public function __construct($rawContent)
{
// Only used for self contained responses.
parent::__construct($rawContent);
// add dummy closing event
$this->_events['ClosingEvent'] = new ResponseComplete_Event($rawContent);
$this->_completed = true;
$this->eventListIsCompleted = true;
}
}
class Login_Response extends Generic_Response
{
}
class Command_Response extends Generic_Response
{
private $_temptable;
public function __construct($rawContent)
{
$this->_temptable = array();
parent::__construct($rawContent);
$lines = explode(Message::EOL, $rawContent);
foreach ($lines as $line) {
$content = explode(':', $line);
if (is_array($content)) {
switch (strtolower($content[0])) {
case 'actionid':
$this->_temptable['ActionID'] = trim($content[1]);
break;
case 'response':
$this->_temptable['Response'] = trim($content[1]);
break;
case 'privilege':
$this->_temptable['Privilege'] = trim($content[1]);
break;
case 'output':
// included for backward compatibility with earlier versions of chan_sccp_b. AMI api does not precede command output with Output
$this->_temptable['Output'] = explode(PHP_EOL,str_replace(PHP_EOL.'--END COMMAND--', '',trim($content[1])));
break;
default:
$this->_temptable['Output'] = explode(PHP_EOL,str_replace(PHP_EOL.'--END COMMAND--', '', trim($line)));
break;
}
}
}
}
public function getResult()
{
return $this->_temptable;
}
}
class SCCPJSON_Response extends Generic_Response
{
public function __construct($rawContent)
{
parent::__construct($rawContent);
$this->getVariable($rawContent, array("DataType" => "DataType:", "JSONRAW" => "JSON:"));
if (null !== $this->getKey('JSONRAW')) {
$this->setKey('Response', 'Success');
}
}
public function getResult()
{
if (($json = json_decode($this->getKey('JSON'), true)) != false) {
return $json;
}
}
}
//***************************************************************************//
// Following are the Response classes where the data is contained in a series.
// of event messages.
class SCCPGeneric_Response extends Response
{
protected $_tables;
private $_temptable;
public function __construct($rawContent)
{
parent::__construct($rawContent);
// Confirm that there is a list following. This overrides any setting
// made in one of the parent constructs.
$this->_completed = !$this->isList();
}
public function addEvent($event)
{
// Start of list is handled by the isList function in the Constructor
// which also defines the list end event
if ( empty($thisSetEventEntryType)) {
// This is empty as soon as we have received a TableStart.
// The next message is the first of the data sets
// We use this variable in the switch to add set entries
if (strpos($event->getName(), 'Entry')) {
$thisSetEventEntryType = $event->getName();
} else {
$thisSetEventEntryType = 'undefinedAsThisIsNotASet';
}
}
// Unknown events will cause an exception.
// All event classes must be defined within Event.class.
if (get_class($event) === 'FreePBX\modules\Sccp_manager\aminterface\UnknownEvent') {
$this->_events[] = $event;
return;
}
switch ( $event->getName()) {
case $thisSetEventEntryType :
$this->_temptable['Entries'][] = $event;
break;
case 'TableStart':
//initialise
$this->_temptable = array();
$this->_temptable['Name'] = $event->getTableName();
$this->_temptable['Entries'] = array();
$thisSetEventEntryType = '';
break;
case 'TableEnd':
//Close
if (!is_array($this->_tables)) {
$this->_tables = array();
}
$this->_tables[$event->getTableName()] = $this->_temptable;
$this->_temptable = array();
$thisSetEventEntryType = 'undefinedAsThisIsNotASet';
// Finished the table. Now check to see if everything was received
// If counts do not match return false and table will not be
//loaded
if ($event->getKey('TableEntries') != count($this->_tables[$event->getTableName()]['Entries'])) {
return false;
}
break;
//case $eventListEndEvent;
case $this->getKey('eventListEndEvent');
// Have the list end event. The correct number of entries is verified in the event constructor
$this->_events['ClosingEvent'] = $event;
$this->eventListEndEvent = null;
//return $this->_completed = true;
break;
default:
// add regular list event
$this->_events[] = $event;
}
}
protected function ConvertTableData( $_tablename, array $_fkey, array $_fields)
{
$result = array();
$_rawtable = $this->Table2Array($_tablename);
// Check that there is actually data to be converted
if (empty($_rawtable)) { return $result;}
foreach ($_rawtable as $_row) {
$all_key_ok = true;
// No need to test if $_fkey is array as array required
foreach ($_fkey as $_fid) {
if (empty($_row[$_fid])) {
$all_key_ok = false;
} else {
$set_name[$_fid] = $_row[$_fid];
}
}
$Data = &$result;
if ($all_key_ok) {
foreach ($set_name as $value_id) {
$Data = &$Data[$value_id];
}
// Label converter in case labels and keys are different
foreach ($_fields as $value_key => $value_id) {
$Data[$value_id] = $_row[$value_key];
}
}
}
return $result;
}
protected function ConvertEventData(array $_fkey, array $_fields)
{
$result = array();
foreach ($this->_events as $_row) {
$all_key_ok = true;
$tmp_result = $_row->getKeys();
$set_name = array();
// No need to test if $_fkey is arrray as array required
foreach ($_fkey as $_fid) {
if (empty($tmp_result[$_fid])) {
$all_key_ok = false;
} else {
$set_name[$_fid] = $tmp_result[$_fid];
}
}
$Data = &$result;
if ($all_key_ok) {
foreach ($set_name as $value_id) {
$Data = &$Data[$value_id];
}
// Label converter in case labels and keys are different - not actually required.
foreach ($_fields as $value_id) {
$Data[$value_id] = $tmp_result[$value_id];
}
}
}
return $result;
}
public function Table2Array( $tablename )
{
$result =array();
if (empty($tablename) || !is_array($this->_tables)) {
return $result;
}
foreach ($this->_tables[$tablename]['Entries'] as $trow) {
$result[]= $trow->getKeys();
}
return $result;
}
public function getResult()
{
return $this->getMessage();
}
}
class SCCPShowSoftkeySets_Response extends SCCPGeneric_Response
{
public function __construct($rawContent)
{
parent::__construct($rawContent);
$this->setKey('eventlistendevent', 'SCCPShowSoftKeySetsComplete');
}
public function getResult()
{
return $this->ConvertTableData(
'SoftKeySets',
array('set','mode'),
array('description'=>'description','label'=>'label','lblid'=>'lblid')
);
}
}
class SCCPShowDevices_Response extends SCCPGeneric_Response
{
public function __construct($rawContent)
{
parent::__construct($rawContent);
$this->setKey('eventlistendevent', 'SCCPShowDevicesComplete');
}
public function getResult()
{
return $this->ConvertTableData(
'Devices',
array('mac'),
array('mac'=>'name','address'=>'address','descr'=>'descr','regstate'=>'status',
'token'=>'token','act'=>'act', 'lines'=>'lines','nat'=>'nat','regtime'=>'regtime')
);
}
}
class SCCPShowDevice_Response extends SCCPGeneric_Response
{
public function __construct($rawContent)
{
parent::__construct($rawContent);
$this->setKey('eventlistendevent', 'SCCPShowDeviceComplete');
}
public function getResult()
{
// This object has a list of events _events, and a list of tables _tables.
$result = array();
foreach ($this->_events as $trow) {
$result = array_merge($result, $trow->getKeys());
}
// Now handle label changes so that keys from AMI correspond to db keys in _tables
$result['Buttons'] = $this->ConvertTableData(
'Buttons',
array('id'),
array('id'=>'id','channelobjecttype'=>'channelobjecttype','inst'=>'inst',
'typestr'=>'typestr', 'type'=>'type', 'pendupdt'=>'pendupdt', 'penddel'=>'penddel', 'default'=>'default'
)
);
$result['SpeeddialButtons'] = $this->ConvertTableData(
'SpeeddialButtons',
array('id'),
array('id'=>'id','channelobjecttype'=>'channelobjecttype','name'=>'name','number'=>'number','hint'=>'hint')
);
$result['CallStatistics'] = $this->ConvertTableData(
'CallStatistics',
array('type'),
array('type'=>'type','channelobjecttype'=>'channelobjecttype','calls'=>'calls','pcktsnt'=>'pcktsnt','pcktrcvd'=>'pcktrcvd',
'lost'=>'lost','jitter'=>'jitter','latency'=>'latency', 'quality'=>'quality','avgqual'=>'avgqual','meanqual'=>'meanqual',
'maxqual'=>'maxqual', 'rconceal'=>'rconceal', 'sconceal'=>'sconceal'
)
);
$result['SCCP_Vendor'] = array('vendor' => strtok($result['skinnyphonetype'], ' '), 'model' => strtok('('),
'model_id' => strtok(')'), 'vendor_addon' => strtok($result['configphonetype'], ' '),
'model_addon' => strtok(' '));
if (empty($result['SCCP_Vendor']['vendor']) || $result['SCCP_Vendor']['vendor'] == 'Undefined') {
$result['SCCP_Vendor'] = array('vendor' => 'Undefined', 'model' => $result['configphonetype'],
'model_id' => '', 'vendor_addon' => $result['SCCP_Vendor']['vendor_addon'],
'model_addon' => $result['SCCP_Vendor']['model_addon']
);
}
$result['MAC_Address'] =$result['macaddress'];
return $result;
}
}
class ExtensionStateList_Response extends SCCPGeneric_Response
{
public function __construct($rawContent)
{
parent::__construct($rawContent);
$this->setKey('eventlistendevent', 'ExtensionStateListComplete');
}
public function getResult()
{
$result = $this->ConvertEventData(array('exten','context'), array('exten','context','hint','status','statustext'));
return $result;
}
}

View file

@ -0,0 +1,524 @@
<?php
/**
*
* Core Comsnd Interface
*
* https://www.voip-info.org/asterisk-manager-example-php/
*/
namespace FreePBX\modules\Sccp_manager;
class aminterface
{
var $_socket;
var $_error;
var $_config;
var $_test;
private $_connect_state;
private $_lastActionClass;
private $_lastActionId;
private $_lastRequestedResponseHandler;
private $_ProcessingMessage;
private $_DumpMessage;
private $debug_level = 1;
private $_incomingRawMessage;
private $eventListEndEvent;
public function load_subspace($parent_class = null)
{
$driverNamespace = "\\FreePBX\\Modules\\Sccp_manager\\aminterface";
$drivers = array('Message' => 'Message.class.php',
'Response' => 'Response.class.php',
'Event' => 'Event.class.php'
);
foreach ($drivers as $key => $value) {
$class = $driverNamespace . "\\" . $key;
$driver = __DIR__ . "/amInterfaceClasses/" . $value;
if (!class_exists($class, false)) {
if (file_exists($driver)) {
include(__DIR__ . "/amInterfaceClasses/" . $value);
} else {
throw new \Exception("Class required but file not found " . $driver);
}
}
}
}
public function __construct($parent_class = null)
{
global $amp_conf;
$this->paren_class = $parent_class;
$this->_socket = false;
$this->_connect_state = false;
$this->_error = array();
$this->_config = array('host' => 'localhost',
'user' => '',
'pass' => '',
'port' => '5038',
'tsoket' => 'tcp://',
'timeout' => 30,
'enabled' => true
);
$this->_eventListeners = array();
$this->_incomingMsgObjectList = array();
$this->_lastActionId = false;
$this->_incomingRawMessage = array();
$this->eventListEndEvent = '';
$fld_conf = array('user' => 'AMPMGRUSER', 'pass' => 'AMPMGRPASS');
if (isset($amp_conf['AMPMGRUSER'])) {
foreach ($fld_conf as $key => $value) {
if (isset($amp_conf[$value])) {
$this->_config[$key] = $amp_conf[$value];
}
}
}
if ($this->_config['enabled']) {
$this->load_subspace();
}
if ($this->_config['enabled']) {
// Ami is not hard disabled in __construct line 63.
if ($this->open()) {
// Can open a connection. Now check compatibility with chan-sccp.
// will return true if compatible.
if (!$this->get_compatible_sccp(true)[1]) {
// Close the open socket as will not use
$this->close();
}
}
}
}
public function info()
{
$Ver = '13.0.4';
if ($this->_config['enabled']){
return array('Version' => $Ver,
'about' => 'AMI data ver: ' . $Ver, 'test' => get_declared_classes());
} else {
return array('Version' => $Ver,
'about' => 'Disabled AMI ver: ' . $Ver);
}
}
/*
* Opens a socket connection to ami.
*/
public function open()
{
$cString = $this->_config['tsoket'] . $this->_config['host'] . ':' . $this->_config['port'];
$this->_context = stream_context_create();
$errno = 0;
$errstr = '';
$this->_ProcessingMessage = '';
$this->_socket = @stream_socket_client(
$cString,
$errno,
$errstr,
$this->_config['timeout'],
STREAM_CLIENT_CONNECT,
$this->_context
);
if ($this->_socket === false) {
$this->_errorException('Error connecting to ami: ' . $errstr . $cString);
return false;
}
$msg = new aminterface\LoginAction($this->_config['user'], $this->_config['pass']);
$response = $this->send($msg);
if ($response != false) {
if (!$response->isSuccess()) {
$this->_errorException('Could not connect: ' . $response->getMessage());
return false;
} else {
@stream_set_blocking($this->_socket, 0);
$this->_connect_state = true;
$this->_ProcessingMessage = '';
}
}
return true;
}
/*
* Closes the connection to ami.
*/
public function close()
{
$this->_connect_state = false;
$this->_ProcessingMessage = '';
@stream_socket_shutdown($this->_socket, STREAM_SHUT_RDWR);
}
/*
* Send action message to ami, and wait for Response
*/
public function send($message)
{
$_incomingRawMessage = array();
$messageToSend = $message->serialize();
$length = strlen($messageToSend);
$this->_DumpMessage = '';
$this->_lastActionId = $message->getActionID();
$this->_lastRequestedResponseHandler = $message->getResponseHandler();
$this->_lastActionClass = $message;
$this->_incomingRawMessage[$this->_lastActionId] = '';
$this->eventListIsCompleted = array();
if (@fwrite($this->_socket, $messageToSend) < $length) {
$this->_errorException('Could not send message');
return false;
}
// Have sent a message and now have to wait for and read the reply
// The below infinite loop waits for $this->completed to be true.
// The loop calls readBuffer, which calls GetMessages, which calls Process
// This loop then continues until we have _thisComplete as an object variable
$this->eventListIsCompleted[$this->_lastActionId] = false;
while (true) {
stream_set_timeout($this->_socket, 1);
$this->readBuffer();
$info = stream_get_meta_data($this->_socket);
if ($info['timed_out'] == true) {
$this->_errorException("Read waittime: " . ($this->socket_param['timeout']) . " exceeded (timeout).\n");
return false;
}
if ($this->eventListIsCompleted[$this->_lastActionId]) {
$response = $this->_incomingMsgObjectList[$this->_lastActionId];
// need to test that the list was successfully completed here
$allReceived = $response->getClosingEvent()
->listCorrectlyReceived($this->_incomingRawMessage[$this->_lastActionId],
$response->getCountOfEvents());
// now tidy up removing any temp variables or objects
$response->removeClosingEvent();
unset($_incomingRawMessage[$this->_lastActionId]);
unset($this->_incomingMsgObjectList[$this->_lastActionId]);
unset($this->_lastActionId);
if ($allReceived) {
return $response;
}
// Something is missing from the events list received via AMI, or
// the control parameter at the end of the list has changed.
// This will cause an exception as returning a boolean instead of a Response
// Maybe should handle better, but
// need to break out of the loop as nothing more coming.
try {
throw new \invalidArgumentException("Counts do not match on returned AMI Result");
} catch ( \invalidArgumentException $e) {
echo substr(strrchr(get_class($response), '\\'), 1), " ", $e->getMessage(), "\n";
}
return $response;
}
}
}
protected function readBuffer ()
{
$read = @fread($this->_socket, 65535);
// AMI never returns EOF
if ($read === false ) {
$this->_errorException('Error reading');
}
// Do not return empty Messages
while ($read == "" ) {
$read = @fread($this->_socket, 65535);
}
// Add read to the rest of buffer from previous read
$this->_ProcessingMessage .= $read;
$this->getMessages();
}
protected function getMessages()
{
$msgs = array();
// Extract any complete messages and leave remainder for next read
while (($marker = strpos($this->_ProcessingMessage, aminterface\Message::EOM))) {
$msg = substr($this->_ProcessingMessage, 0, $marker);
$this->_ProcessingMessage = substr(
$this->_ProcessingMessage,
$marker + strlen(aminterface\Message::EOM)
);
$msgs[] = $msg;
}
$this->process($msgs);
}
public function process(array $msgs)
{
foreach ($msgs as $aMsg) {
// 2 types of message; Response or Event. Response only incudes data
// for JSON response and Command response. All other responses expect
// data in an event list - these events need to be attached to the response.
$resPos = strpos($aMsg, 'Response: '); // Have a Response message. This may not be 0.
$evePos = strpos($aMsg, 'Event: '); // Have an Event Message. This should always be 0.
// Add the incoming message to a string that can be checked
// against the completed message event when it is received.
$this->_incomingRawMessage[$this->_lastActionId] .= "\r\n\r\n" . $aMsg;
if (($resPos !== false) && (($resPos < $evePos) || $evePos === false)) {
$response = $this->_responseObjFromMsg($aMsg); // resp Ok
$this->eventListEndEvent = $response->getKey('eventlistendevent');
$this->_incomingMsgObjectList[$this->_lastActionId] = $response;
$this->eventListIsCompleted[$this->_lastActionId] = $response->isComplete();
} elseif ($evePos === 0) { // Event must be at the start of the msg.
$event = $this->_eventObjFromMsg($aMsg); // Event Ok
$this->eventListIsCompleted[$this->_lastActionId] = $event->isComplete();
$this->_incomingMsgObjectList[$this->_lastActionId]->addEvent($event);
} else {
// broken ami most probably through changes in chan_sccp_b.
// AMI is sending a message which is neither a response nor an event.
$this->_msgToDebug(1, 'resp broken ami');
$bMsg = 'Event: ResponseEvent' . "\r\n";
$bMsg .= 'ActionId: ' . $this->_lastActionId . "\r\n" . $aMsg;
$event = $this->_eventObjFromMsg($bMsg);
$this->_incomingMsgObjectList[$this->_lastActionId]->addEvent($event);
}
}
}
private function _msgToDebug($level, $msg)
{
if ($level > $this->debug_level) {
return;
}
print_r('<br> level: '.$level.' ');
print_r($msg);
print_r('<br>');
}
private function _responseObjFromMsg($message)
{
$_className = false;
$responseClass = '\\FreePBX\\modules\\Sccp_manager\\aminterface\\Generic_Response';
if ($this->_lastRequestedResponseHandler != false) {
$_className = '\\FreePBX\\modules\\Sccp_manager\\aminterface\\' . $this->_lastRequestedResponseHandler . '_Response';
}
if ($_className) {
if (class_exists($_className, true)) {
$responseClass = $_className;
} elseif ($responseHandler != false) {
$this->_errorException('Response Class ' . $_className . ' requested via responseHandler, could not be found');
}
}
$response = new $responseClass($message);
$actionId = $response->getActionID();
if ($actionId === null) {
$response->setActionId($this->_lastActionId);
}
return $response;
}
public function _eventObjFromMsg($message)
{
$eventType = explode(aminterface\Message::EOL,$message,2);
$name = trim(explode(':',$eventType[0],2)[1]);
$className = '\\FreePBX\\modules\\Sccp_manager\\aminterface\\' . $name . '_Event';
if (class_exists($className, true) === false) {
$className = '\\FreePBX\\modules\\Sccp_manager\\aminterface\\UnknownEvent';
}
return new $className($message);
}
protected function dispatch($message)
{
print_r("<br>------------dispatch----------<br>");
print_r($message);
return false;
die();
foreach ($this->_eventListeners as $data) {
$listener = $data[0];
$predicate = $data[1];
print_r($data);
if (is_callable($predicate) && !call_user_func($predicate, $message)) {
continue;
}
if ($listener instanceof \Closure) {
$listener($message);
} elseif (is_array($listener)) {
$listener[0]->$listener[1]($message);
} else {
$listener->handle($message);
}
}
print_r("<br>------------E dispatch----------<br>");
}
//-------------------Adaptive Function ------------------------------------------------------------
function core_list_hints()
{
$result = array();
if ($this->_connect_state) {
$_action = new \FreePBX\modules\Sccp_manager\aminterface\ExtensionStateListAction();
$_response = $this->send($_action);
$_res = $_response->getResult();
foreach ($_res as $key => $value) {
foreach ($value as $key2 => $value2) {
$result[$key2] = '@' . $key2;
}
}
}
return $result;
}
function core_list_all_hints()
{
$result = array();
if ($this->_connect_state) {
$_action = new \FreePBX\modules\Sccp_manager\aminterface\ExtensionStateListAction();
$_res = $this->send($_action)->getResult();
foreach ($_res as $key => $value) {
foreach ($value as $key2 => $value2) {
$result[$key.'@'.$key2] = $key.'@'.$key2;
}
}
}
return $result;
}
// --------------------- SCCP Comands
function sccp_list_keysets()
{
$result = array();
if ($this->_connect_state) {
$_action = new \FreePBX\modules\Sccp_manager\aminterface\SCCPShowSoftkeySetsAction();
$_res = $this->send($_action)->getResult();
foreach ($_res as $key => $value) {
$result[$key] = $key;
}
}
return $result;
}
function sccp_get_active_device()
{
$result = array();
if ($this->_connect_state) {
$_action = new \FreePBX\modules\Sccp_manager\aminterface\SCCPShowDevicesAction();
$result = (array)$this->send($_action)->getResult();
}
return $result;
}
function sccp_getdevice_info($devicename)
{
$result = array();
if ($this->_connect_state) {
$_action = new \FreePBX\modules\Sccp_manager\aminterface\SCCPShowDeviceAction($devicename);
$result = $this->send($_action)->getResult();
$result['MAC_Address'] = $result['macaddress'];
}
return $result;
}
function sccpDeviceReset($devicename, $action = '')
{
if ($this->_connect_state) {
if ($action == 'tokenack') {
$_action = new \FreePBX\modules\Sccp_manager\aminterface\SCCPTokenAckAction($devicename);
} else {
$_action = new \FreePBX\modules\Sccp_manager\aminterface\SCCPDeviceRestartAction($devicename, $action);
}
$_response = $this->send($_action);
$result['data'] = 'Device: '.$devicename.' Result: '.$_response->getMessage();
$result['Response']=$_response->getKey('Response');
}
return $result;
}
//------------------- Core Comands ----
function core_sccp_reload()
{
$result = array();
if ($this->_connect_state) {
$_action = new \FreePBX\modules\Sccp_manager\aminterface\ReloadAction('chan_sccp');
$result = ['Response' => $this->send($_action)->getMessage(), 'data' => ''];
}
return $result;
}
function getSCCPConfigMetaData($segment = '') {
if ($this->_connect_state) {
$_action = new \FreePBX\modules\Sccp_manager\aminterface\SCCPConfigMetaDataAction($segment);
$metadata = $this->send($_action)->getResult();
}
return $metadata;
}
function getSCCPVersion()
{
//Initialise result array
$result = array( 'RevisionHash' => '', 'vCode' => 0, 'RevisionNum' => 0, 'buildInfo' => '', 'Version' => 0);
$metadata = $this->getSCCPConfigMetaData();
if (isset($metadata['Version'])) {
$result['Version'] = $metadata['Version'];
$version_parts = array_map('intval',explode('.', $metadata['Version']));
if ($version_parts[0] === 4) {
switch ($version_parts[1]) {
case 1:
$result['vCode'] = 410;
break;
case 2:
$result['vCode'] = 420;
break;
case 3:
$result['vCode'] = 430;
if($version_parts[2] >= 3){
$result['vCode'] = 433;
}
break;
default:
$result['vCode'] = 400;
break;
}
}
if (array_key_exists("RevisionHash", $metadata)) {
$result['RevisionHash'] = $metadata["RevisionHash"];
}
if (isset($metadata['RevisionNum'])) {
if ($metadata['RevisionNum'] >= 11063) { // new method, RevisionNum is incremental
$result['vCode'] = 433;
}
$result['RevisionNum'] = $metadata["RevisionNum"];
}
if (isset($metadata['ConfigureEnabled'])) {
$result['buildInfo'] = $metadata['ConfigureEnabled'];
}
}
return $result;
}
function getRealTimeStatus()
{
// Initialise array with default values to eliminate testing later
$result = array();
$cmd_res = array();
$cmd_res = ['sccp' => ['message' => 'legacy value', 'realm' => '', 'status' => 'ERROR']];
if ($this->_connect_state) {
$_action = new \FreePBX\modules\Sccp_manager\aminterface\CommandAction('realtime mysql status');
$result = $this->send($_action)->getResult();
}
if (is_array($result['Output'])) {
foreach ($result['Output'] as $aline) {
if (strlen($aline) > 3) {
$temp_strings = explode(' ', $aline);
$cmd_res_key = $temp_strings[0];
foreach ($temp_strings as $test_string) {
if (strpos($test_string, '@')) {
$this_realm = $test_string;
break;
}
}
$cmd_res[$cmd_res_key] = array('message' => $aline, 'realm' => $this_realm, 'status' => strpos($aline, 'connected') ? 'OK' : 'ERROR');
}
}
}
return $cmd_res;
}
public function get_compatible_sccp($revNumComp=false) {
// only called with args from installer to get revision and compatibility
$res = $this->getSCCPVersion();
if ($res['RevisionNum'] < 11063) {
$this->useAmiInterface = false;
}
if ($revNumComp) {
return array($res['vCode'], true);
}
return $res['vCode'];
}
}

View file

@ -0,0 +1,450 @@
<?php
/**
*
* Core Comsnd Interface
*
*
*/
namespace FreePBX\modules\Sccp_manager;
class dbinterface
{
private $val_null = 'NONE'; /// REPLACE to null Field
public function __construct($parent_class = null)
{
$this->paren_class = $parent_class;
$this->db = \FreePBX::Database();
}
public function info()
{
$Ver = '14.0.0.1'; // This should be updated
return array('Version' => $Ver,
'about' => 'Data access interface ver: ' . $Ver);
}
/*
* Core Access Function
*/
public function get_db_SccpTableByID($dataid, $data = array(), $indexField = '')
{
$result = array();
$raw = $this->getSccpDeviceTableData($dataid, $data);
if (empty($raw) || empty($indexField)) {
return $raw;
}
foreach ($raw as $value) {
$id = $value[$indexField];
$result[$id] = $value;
}
return $result;
}
public function getSccpDeviceTableData(string $dataid, $data = array())
{
// $stmt is a single row fetch, $stmts is a fetchAll while stmtU is fetchAll UNIQUE
$stmt = '';
$stmts = '';
$stmtU = '';
switch ($dataid) {
case 'extGrid':
// only called by getExtensionGrid from hardware.extension.php view
$stmts = $this->db->prepare("SELECT sccpline.name, sccpline.label, sccpbuttonconfig.ref AS mac, '-|-' AS line_status
FROM sccpline LEFT JOIN sccpbuttonconfig
ON sccpline.name = TRIM(TRAILING '!silent' FROM sccpbuttonconfig.name) ORDER BY sccpline.name");
break;
case 'SccpExtension':
if (empty($data['name'])) {
$stmtU = $this->db->prepare('SELECT name, sccpline.* FROM sccpline ORDER BY name');
} else {
$stmts = $this->db->prepare('SELECT * FROM sccpline WHERE name = :name');
$stmts->bindParam(':name', $data['name'],\PDO::PARAM_STR);
}
break;
case 'phoneGrid':
switch ($data['type']) {
case "cisco-sip":
$stmts = $this->db->prepare("SELECT name, type, button, addon, description, 'not connected' AS status, '- -' AS address, 'N' AS new_hw
FROM sccpdeviceconfig WHERE type LIKE '%-sip' ORDER BY name");
break;
case "sccp": // Fall through to default intentionally
default:
$stmts = $this->db->prepare("SELECT name, type, button, addon, description, 'not connected' AS status, '- -' AS address, 'N' AS new_hw
FROM sccpdeviceconfig WHERE type not LIKE '%-sip' ORDER BY name");
break;
}
break;
case 'SccpDevice':
if (empty($data['fields'])) {
$fld = 'name, name as mac, type, button, addon, description';
} else {
switch ($data['fields']) {
case "all":
$fld ='*';
break;
case "sip_ext":
$fld ='button as sip_lines, description as description, addon';
break;
default:
$fld = $data['fields'];
break;
}
}
if (!empty($data['name'])) { //either filter by name or by type
$stmt = $this->db->prepare('SELECT ' . $fld . ' FROM sccpdeviceconfig WHERE name = :name ORDER BY name');
$stmt->bindParam(':name', $data['name'],\PDO::PARAM_STR);
} elseif (!empty($data['type'])) {
switch ($data['type']) {
case "cisco-sip":
$stmts = $this->db->prepare("SELECT {$fld} FROM sccpdeviceconfig WHERE TYPE LIKE '%-sip' ORDER BY name");
break;
case "cisco": // Fall through to default intentionally
default:
$stmts = $this->db->prepare("SELECT {$fld} FROM sccpdeviceconfig WHERE TYPE not LIKE '%-sip' ORDER BY name");
break;
}
} else { //no filter and no name provided - return all
$stmts = $this->db->prepare("SELECT {$fld} FROM sccpdeviceconfig ORDER BY name");
}
break;
case 'get_columns_sccpdevice':
$stmtU = $this->db->prepare('DESCRIBE sccpdevice');
break;
case 'get_columns_sccpuser':
$stmts = $this->db->prepare('DESCRIBE sccpuser');
break;
case 'get_columns_sccpline':
$stmtU = $this->db->prepare('DESCRIBE sccpline');
break;
case 'get_sccpdevice_byid':
$stmt = $this->db->prepare('SELECT t1.*, types.dns, types.buttons, types.loadimage, types.nametemplate as nametemplate,
addon.buttons as addon_buttons FROM sccpdevice AS t1
LEFT JOIN sccpdevmodel as types ON t1.type=types.model
LEFT JOIN sccpdevmodel as addon ON t1.addon=addon.model WHERE name = :name');
$stmt->bindParam(':name', $data['id'],\PDO::PARAM_STR);
break;
case 'get_sccpuser':
$stmt = $this->db->prepare('SELECT * FROM sccpuser WHERE name = :name');
$stmt->bindParam(':name', $data['id'],\PDO::PARAM_STR);
break;
case 'getAssignedExtensions':
// all extensions that are designed as default lines
$stmtU = $this->db->prepare("SELECT DISTINCT name, name FROM sccpbuttonconfig WHERE buttontype = 'line' AND instance =1");
break;
case 'getDefaultLine':
$stmt = $this->db->prepare("SELECT name FROM sccpbuttonconfig WHERE ref = '{$data['id']}' and instance =1 and buttontype = 'line'");
break;
case 'get_sccpdevice_buttons':
$sql = '';
if (!empty($data['buttontype'])) {
$sql .= 'buttontype = :buttontype';
}
if (!empty($data['id'])) {
$sql .= (empty($sql)) ? 'ref = :ref' : ' and ref = :ref';
}
if (!empty($sql)) {
$stmts = $this->db->prepare("SELECT * FROM sccpbuttonconfig WHERE {$sql} ORDER BY instance");
// Now bind labels - only bind label if it exists or bind will create exception.
// can only bind once have prepared, so need to test again.
if (!empty($data['buttontype'])) {
$stmts->bindParam(':buttontype', $data['buttontype'],\PDO::PARAM_STR);
}
if (!empty($data['id'])) {
$stmts->bindParam(':ref', $data['id'],\PDO::PARAM_STR);
}
} else {
$raw_settings = array();
}
break;
// No default case so will give exception of $raw_settings undefined if the
// dataid is not in the switch.
}
if (!empty($stmt)) {
$stmt->execute();
$raw_settings = $stmt->fetch(\PDO::FETCH_ASSOC);
} elseif (!empty($stmts)) {
$stmts->execute();
$raw_settings = $stmts->fetchAll(\PDO::FETCH_ASSOC);
} elseif (!empty($stmtU)) {
//returns an assoc array indexed on first field
$stmtU->execute();
$raw_settings = $stmtU->fetchAll(\PDO::FETCH_ASSOC|\PDO::FETCH_UNIQUE);
}
return $raw_settings;
}
public function get_db_SccpSetting()
{
$stmt = $this->db->prepare('SELECT keyword, sccpsettings.* FROM sccpsettings ORDER BY type, seq');
$stmt->execute();
$settingsFromDb = $stmt->fetchAll(\PDO::FETCH_ASSOC|\PDO::FETCH_UNIQUE);
return $settingsFromDb;
}
public function get_db_sysvalues()
{
$stmt = $this->db->prepare('SHOW VARIABLES LIKE \'%group_concat%\'');
$stmt->execute();
return $stmt->fetch(\PDO::FETCH_ASSOC);
}
/*
* Get Sccp Device Model information
*/
function getDb_model_info($get = 'all', $format_list = 'all', $filter = array())
{
$sel_inf = '*, 0 as validate';
if ($format_list === 'model') {
$sel_inf = "model, vendor, dns, buttons, '-;-' as validate";
}
switch ($get) {
case 'byciscoid':
if (!empty($filter)) {
if (!empty($filter['model'])) {
if (!strpos($filter['model'], 'loadInformation')) {
$filter['model'] = 'loadInformation' . $filter['model'];
}
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (loadinformationid = :model ) ORDER BY model");
$stmt->bindParam(':model', $filter['model'], \PDO::PARAM_STR);
} else {
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel ORDER BY model");
}
break;
}
break;
case 'byid':
if (!empty($filter)) {
if (!empty($filter['model'])) {
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE model = :model ORDER BY model");
$stmt->bindParam(':model', $filter['model'],\PDO::PARAM_STR);
} else {
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel ORDER BY model");
}
break;
}
break;
case 'extension':
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns = 0) and (enabled = 1) ORDER BY model");
break;
case 'enabled':
//$stmt = $db->prepare('SELECT ' . {$sel_inf} . ' FROM sccpdevmodel WHERE enabled = 1 ORDER BY model'); //previously this fell through to phones.
//break; // above includes expansion modules but was not original behaviour so commented out. Falls through to phones.
case 'phones':
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns != 0) and (enabled = 1) ORDER BY model");
break;
case 'ciscophones':
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns > 0) and (enabled = 1) AND vendor NOT LIKE '%-sip' ORDER BY model");
break;
case 'sipphones':
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns > 0) and (enabled = 1) AND vendor LIKE '%-sip' ORDER BY model");
break;
case 'all': // Fall through to default
default:
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel ORDER BY model");
break;
}
$stmt->execute();
return $stmt->fetchAll(\PDO::FETCH_ASSOC);
}
function write($table_name = "", $save_value = array(), $mode = 'update', $key_fld = "", $hwid = "")
{
// mode clear - Empty table before update
// mode update - update / replace record
$result = false;
switch ($table_name) {
case 'sccpsettings':
if ($mode == 'replace') { // Change mode name to be more transparent
$this->db->prepare('TRUNCATE sccpsettings')->execute();
$stmt = $this->db->prepare('INSERT INTO sccpsettings (keyword, data, seq, type, systemdefault) VALUES (:keyword,:data,:seq,:type,:systemdefault)');
} else {
$stmt = $this->db->prepare('REPLACE INTO sccpsettings (keyword, seq, type, data, systemdefault) VALUES (:keyword,:seq,:type,:data,:systemdefault)');
}
foreach ($save_value as $key => $dataArr) {
if (empty($dataArr)) {
continue;
}
$stmt->bindParam(':keyword',$dataArr['keyword'],\PDO::PARAM_STR);
$stmt->bindParam(':data',$dataArr['data'],\PDO::PARAM_STR);
$stmt->bindParam(':seq',$dataArr['seq'],\PDO::PARAM_INT);
$stmt->bindParam(':type',$dataArr['type'],\PDO::PARAM_INT);
$stmt->bindParam(':systemdefault',$dataArr['systemdefault'],\PDO::PARAM_STR);
$result = $stmt->execute();
}
break;
case 'sccpdevmodel': // Fall through to next intentionally
case 'sccpdevice': // Fall through to next intentionally
case 'sccpuser':
$sql_key = "";
$sql_var = "";
foreach ($save_value as $key_v => $data) {
if (!empty($sql_var)) {
$sql_var .= ', ';
}
if ($data === $this->val_null) {
$sql_var .= $key_v . '= NULL';
} else {
$sql_var .= $key_v . ' = \'' . $data . '\''; //quote data as normally is string
}
if ($key_v === $key_fld) {
$sql_key = $key_v . ' = \'' . $data . '\''; //quote data as normally is string
}
}
if (!empty($sql_var)) {
switch ($mode) {
case 'delete':
$stmt = $this->db->prepare("DELETE FROM {$table_name} WHERE {$sql_key}");
break;
case 'update':
$stmt = $this->db->prepare("UPDATE {$table_name} SET {$sql_var} WHERE {$sql_key}");
break;
case 'replace':
$stmt = $this->db->prepare("REPLACE INTO {$table_name} SET {$sql_var}");
break;
// no default mode - must be explicit.
}
}
$result = $stmt->execute();
break;
case 'sccpbuttons':
switch ($mode) {
case 'delete':
$sql = 'DELETE FROM sccpbuttonconfig WHERE ref = :hwid';
$stmt = $this->db->prepare($sql);
$stmt->bindParam(':hwid', $hwid,\PDO::PARAM_STR);
$result = $stmt->execute();
break;
case 'replace':
foreach ($save_value as $button_array) {
$stmt = $this->db->prepare('UPDATE sccpbuttonconfig SET name =:name WHERE ref = :ref AND reftype =:reftype AND instance = :instance AND buttontype = :buttontype AND options = :options');
$stmt->bindParam(':ref', $button_array['ref'],\PDO::PARAM_STR);
$stmt->bindParam(':reftype', $button_array['reftype'],\PDO::PARAM_STR);
$stmt->bindParam(':instance', $button_array['instance'],\PDO::PARAM_INT);
$stmt->bindParam(':buttontype', $button_array['buttontype'],\PDO::PARAM_STR);
$stmt->bindParam(':name', $button_array['name'],\PDO::PARAM_STR);
$stmt->bindParam(':options', $button_array['options'],\PDO::PARAM_STR);
$result= $stmt->execute();
}
break;
case 'add':
foreach ($save_value as $button_array) {
$stmt = $this->db->prepare("INSERT INTO sccpbuttonconfig SET ref = :ref, reftype = :reftype, instance = :instance, buttontype = :buttontype, name = :name, options = :options");
$stmt->bindParam(':ref', $button_array['ref'],\PDO::PARAM_STR);
$stmt->bindParam(':reftype', $button_array['reftype'],\PDO::PARAM_STR);
$stmt->bindParam(':instance', $button_array['instance'],\PDO::PARAM_INT);
$stmt->bindParam(':buttontype', $button_array['buttontype'],\PDO::PARAM_STR);
$stmt->bindParam(':name', $button_array['name'],\PDO::PARAM_STR);
$stmt->bindParam(':options', $button_array['options'],\PDO::PARAM_STR);
$result = $stmt->execute();
}
break;
case 'clear';
// Clear is equivalent of delete + insert. Mode is used in order to activate trigger.
$this->write('sccpbuttons', '', $mode = 'delete','', $hwid);
$this->write('sccpbuttons', $save_value, $mode = 'add','', $hwid);
break;
// No default case - must be specific in request.
}
}
return $result;
}
//******** Get SIP settings *******
public function getSipTableData(string $dataid, $line='') {
global $db;
$tech = array();
switch ($dataid) {
case "DeviceById":
// TODO: This needs to be rewritten
$stmt = $this->db->prepare("SELECT keyword,data FROM sip WHERE id = '${line}'");
$stmt->execute();
$tech = $stmt->fetchAll(\PDO::FETCH_COLUMN | \PDO::FETCH_GROUP);
foreach ($tech as &$value) {
$value = $value[0];
}
return $tech;
case "extensionList";
$stmt = $this->db->prepare("SELECT id as name, data as label FROM sip WHERE keyword = 'callerid' order by name");
$stmt->execute();
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
/*
foreach ($result as $value) {
if (empty($tech[$value['id']]['id'])) {
$tech[$value['id']]['id']= $value['id'];
}
$tech[$value['id']][$value['keyword']]=$value['data'];
}
*/
return $result;
}
}
/*
* Maybe Replace by SccpTables ??!
*
*/
public function dump_sccp_tables($data_path, $database, $user, $pass)
{
$filename = $data_path.'/sccp_backup_'.date('G_a_m_d_y').'.sql';
$result = exec('mysqldump '.$database.' --password='.$pass.' --user='.$user.' --single-transaction >'.$filename, $output);
return $filename;
}
public function updateTableDefaults($table, $field, $value) {
$stmt = $this->db->prepare("ALTER TABLE {$table} ALTER COLUMN {$field} SET DEFAULT '{$value}'");
$stmt->execute();
}
/*
* Check Table structure
*/
public function validate()
{
$result = 0;
$check_fields = [
'431' => ['private'=> "enum('on','off')"],
'433' => ['directed_pickup'=>'']
];
$stmt = $this->db->prepare('DESCRIBE sccpdevice');
$stmt->execute();
foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $value) {
$id_result[$value['Field']] = $value['Type'];
}
foreach ($check_fields as $key => $value) {
if (!empty(array_intersect_assoc($value, $id_result))) {
$result = $key;
} else {
// no match but maybe checking against an empty string so just need to check key does not exist
foreach ($value as $skey => $svalue) {
if (empty($svalue) && (!isset($id_result[$skey]))) {
$result = $key;
}
}
}
}
return $result;
}
public function getNamedGroup($callGroup) {
$sql = "SELECT {$callGroup} FROM sccpline GROUP BY {$callGroup}";
$sth = $this->db->prepare($sql);
$result = array();
$tech = array();
try {
$sth->execute();
$result = $sth->fetchAll();
foreach($result as $val) {
$tech[$callGroup][] = $val[0];
}
} catch(\Exception $e) {}
return $tech;
}
}

View file

@ -0,0 +1,455 @@
<?php
namespace FreePBX\modules\Sccp_manager;
class extconfigs
{
public function __construct($parent_class = null)
{
$this->paren_class = $parent_class;
}
public function info() {
$Ver = '13.2.0';
return array('Version' => $Ver,
'about' => 'Default Settings and Enums ver: ' . $Ver);
}
public function getExtConfig($id = '', $index = '') {
$result = array();
switch ($id) {
case 'keyset':
$result = $this->keysetdefault;
break;
case 'sccp_lang':
if (empty($index)) {
return $this->cisco_language; // return language array
} elseif (!empty($this->cisco_language[$index])) {
return $this->cisco_language[$index]; // return the matched value
}
break;
case 'sccpDefaults':
$result = $this->sccpDefaults;
break;
case 'sccp_timezone': // Sccp manager: 1303; server_info: 122
$result = array();
if (empty($index)) {
return array('offset' => '00', 'daylight' => '', 'cisco_code' => 'Greenwich Standard Time');
}
//See if DST is used in this TZ. Test if DST setting is different at
//various future intervals. If dst changes, this TZ uses dst
$usesDaylight = false;
$haveDstNow = date('I');
$futureDateArray = array(2,4,6,8);
foreach ($futureDateArray as $numMonths) {
$futureDate = (new \DateTime(null,new \DateTimeZone($index)))->modify("+{$numMonths} months");
if ($futureDate->format('I') != $haveDstNow) {
$usesDaylight = true;
break;
};
}
$thisTzOffset = (new \DateTime(null, new \DateTimeZone($index)))->getOffset();
// Now look for a match in cisco_tz_array based on offset and DST
// First correct offset if we have DST now as cisco offsets are
// based on non dst offsets
$tmpOffset = $thisTzOffset / 60;
if ($haveDstNow) {
$tmpOffset = $tmpOffset - 60;
}
foreach ($this->cisco_timezone as $key => $value) {
if (($value['offset'] == $tmpOffset) and ( $value['daylight'] == $usesDaylight )) {
// This code may not be the one typically used, but it has the correct values.
$cisco_code = $key . ' Standard' . (($usesDaylight) ? '/Daylight' : '') . ' Time';
$this->sccpvalues['tzoffset']['data'] = $tmpOffset;
return array('offset' => $tmpOffset, 'daylight' => ($usesDaylight) ? 'Daylight' : '', 'cisco_code' => $cisco_code);
break;
}
}
return array('offset' => '00', 'daylight' => '', 'cisco_code' => 'Greenwich Standard Time');
break;
default:
return array('noId');
break;
}
if (empty($index)) {
return $result;
} else {
if (isset($result[$index])) {
return $result[$index];
} else {
return array();
}
}
}
private function get_cisco_time_zone($tzc)
{
$tzdata = $this->cisco_timezone[$tzc];
$cisco_code = $tzc . ' Standard' . (($tzdata['daylight']) ? '/Daylight' : '') . ' Time';
return array('offset' => $tzdata['offset'], 'daylight' => $tzdata['daylight'], 'cisco_code' => $cisco_code);
}
private $sccpDefaults = array(
'servername' => 'VPBXSCCP',
'bindaddr' => '0.0.0.0', "port" => '2000', # chan_sccp also supports ipv6
'deny' => '0.0.0.0/0.0.0.0',
'permit' => '0.0.0.0/0.0.0.0', # !TODO!: please change this to 'internal' which would mean:
'dateformat' => 'D.M.Y',
'disallow' => 'all', "allow" => 'alaw;ulaw',
'hotline_enabled' => 'off',
'hotline_context' => 'default', # !TODO!: Should this not be from-internal on FreePBX ?
'hotline_extension' => '*60', # !TODO!: Is this a good default extension to dial for hotline ?
'hotline_label' => 'hotline',
'devicetable' => 'sccpdevice',
'linetable' => 'sccpline',
'displayconfig' => 'sccpgeneral',
'_dev_sshPassword' => 'cisco',
'_dev_sshUserId' => 'cisco',
'dev_deviceProtocol' => 'SCCP',
'dev_idleTimeout' => '60',
'ntp_config_enabled' => 'off',
'ntp_server' => 'pool.ntp.org',
'ntp_server_mode' => 'unicast',
'devlang' => 'English_United_States',
'dev_authenticationURL' => '',
'dev_informationURL' => '',
'dev_messagesURL' => '',
'dev_servicesURL' => '',
'dev_directoryURL' => '',
'dev_idleURL' => '',
'dev_secureauthenticationURL' => '',
'dev_secureinformationURL' => '',
'dev_securemessagesURL' => '',
'dev_secureservicesURL' => '',
'dev_securedirectoryURL' => '',
'dev_secureidleURL' => '',
'dev_proxyServerURL' => ''
);
private $keysetdefault = array('onhook' => 'redial,newcall,cfwdall,cfwdbusy,cfwdnoanswer,pickup,gpickup,dnd,private',
'connected' => 'hold,endcall,park,vidmode,select,cfwdall,cfwdbusy,idivert,monitor',
'onhold' => 'resume,newcall,endcall,transfer,conflist,select,dirtrfr,idivert,meetme',
'ringin' => 'answer,endcall,transvm,idivert',
'offhook' => 'redial,endcall,private,cfwdall,cfwdbusy,cfwdnoanswer,pickup,gpickup,meetme,barg',
'conntrans' => 'hold,endcall,transfer,conf,park,select,dirtrfr,monitor,vidmode,meetme,cfwdal',
'digitsfoll' => 'back,endcall,dial',
'connconf' => 'conflist,newcall,endcall,hold,vidmode,monitor',
'ringout' => 'empty,endcall,transfer',
'offhookfeat' => 'resume,newcall,endcall',
'onhint' => 'redial,newcall,pickup,gpickup',
'onstealable' => 'redial,newcall,barge,intrcpt,cfwdall,pickup,gpickup,dnd',
'holdconf' => 'resume,newcall,endcall,join',
'uriaction' => 'default');
// Cisco Language Code / Directory
//
private $cisco_language = array('ar_SA' => array('code' => 'ar', 'language' => 'Arabic', 'locale' => 'Arabic_Saudi_Arabia', 'codepage' => 'ISO8859-1'),
'bg_BG' => array('code' => 'bg', 'language' => 'Bulgarian', 'locale' => 'Bulgarian_Bulgaria', 'codepage' => 'ISO8859-1'),
'cz_CZ' => array('code' => 'cz', 'language' => 'Czech', 'locale' => 'Czech_Czech_Republic', 'codepage' => 'ISO8859-1'),
'da_DK' => array('code' => 'da', 'language' => 'Danish', 'locale' => 'Danish_Denmark', 'codepage' => 'ISO8859-1'),
'de_DE' => array('code' => 'de', 'language' => 'German', 'locale' => 'German_Germany', 'codepage' => 'ISO8859-1'),
'el_GR' => array('code' => 'el', 'language' => 'Greek', 'locale' => 'Greek_Greece', 'codepage' => 'ISO8859-1'),
'en_AU' => array('code' => 'en', 'language' => 'English', 'locale' => 'AU_English_United_States', 'codepage' => 'ISO8859-1'),
'en_GB' => array('code' => 'en', 'language' => 'English', 'locale' => 'English_United_Kingdom', 'codepage' => 'ISO8859-1'),
'en_US' => array('code' => 'en', 'language' => 'English', 'locale' => 'English_United_States', 'codepage' => 'ISO8859-1'),
'es_ES' => array('code' => 'es', 'language' => 'Spanish', 'locale' => 'Spanish_Spain', 'codepage' => 'ISO8859-1'),
'et_EE' => array('code' => 'et', 'language' => 'Estonian', 'locale' => 'Estonian_Estonia', 'codepage' => 'ISO8859-1'),
'fi_FI' => array('code' => 'fi', 'language' => 'Finnish', 'locale' => 'Finnish_Finland', 'codepage' => 'ISO8859-1'),
'fr_CA' => array('code' => 'fr', 'language' => 'French', 'locale' => 'French_Canada', 'codepage' => 'ISO8859-1'),
'fr_FR' => array('code' => 'fr', 'language' => 'French', 'locale' => 'French_France', 'codepage' => 'ISO8859-1'),
'he_IL' => array('code' => 'he', 'language' => 'Hebrew', 'locale' => 'Hebrew_Israel', 'codepage' => 'ISO8859-1'),
'hr_HR' => array('code' => 'hr', 'language' => 'Croatian', 'locale' => 'Croatian_Croatia', 'codepage' => 'ISO8859-1'),
'hu_HU' => array('code' => 'hu', 'language' => 'Hungarian', 'locale' => 'Hungarian_Hungary', 'codepage' => 'ISO8859-1'),
'it_IT' => array('code' => 'it', 'language' => 'Italian', 'locale' => 'Italian_Italy', 'codepage' => 'ISO8859-1'),
'ja_JP' => array('code' => 'ja', 'language' => 'Japanese', 'locale' => 'Japanese_Japan', 'codepage' => 'ISO8859-1'),
'ko_KO' => array('code' => 'ko', 'language' => 'Korean', 'locale' => 'Korean_Korea_Republic', 'codepage' => 'ISO8859-1'),
'lt_LT' => array('code' => 'lt', 'language' => 'Lithuanian', 'locale' => 'Lithuanian_Lithuania', 'codepage' => 'ISO8859-1'),
'lv_LV' => array('code' => 'lv', 'language' => 'Latvian', 'locale' => 'Latvian_Latvia', 'codepage' => 'ISO8859-1'),
'nl_NL' => array('code' => 'nl', 'language' => 'Dutch', 'locale' => 'Dutch_Netherlands', 'codepage' => 'ISO8859-1'),
'no_NO' => array('code' => 'no', 'language' => 'Norwegian', 'locale' => 'Norwegian_Norway', 'codepage' => 'ISO8859-1'),
'pl_PL' => array('code' => 'pl', 'language' => 'Polish', 'locale' => 'Polish_Poland', 'codepage' => 'ISO8859-1'),
'pt_BR' => array('code' => 'pt', 'language' => 'Portuguese', 'locale' => 'Portuguese_Brazil', 'codepage' => 'ISO8859-1'),
'pt_PT' => array('code' => 'pt', 'language' => 'Portuguese', 'locale' => 'Portuguese_Portugal', 'codepage' => 'ISO8859-1'),
'ro_RO' => array('code' => 'ro', 'language' => 'Romanian', 'locale' => 'Romanian_Romania', 'codepage' => 'ISO8859-1'),
'sk_SK' => array('code' => 'sk', 'language' => 'Slovakian', 'locale' => 'Slovak_Slovakia', 'codepage' => 'ISO8859-1'),
'sl_SL' => array('code' => 'sl', 'language' => 'Slovenian', 'locale' => 'Slovenian_Slovenia', 'codepage' => 'ISO8859-1'),
'sr_ME' => array('code' => 'sr', 'language' => 'Serbian', 'locale' => 'Serbian_Republic_of_Montenegro', 'codepage' => 'ISO8859-1'),
'sr_RS' => array('code' => 'rs', 'language' => 'Serbian', 'locale' => 'Serbian_Republic_of_Serbia', 'codepage' => 'ISO8859-1'),
'sv_SE' => array('code' => 'sv', 'language' => 'Swedish', 'locale' => 'Swedish_Sweden', 'codepage' => 'ISO8859-1'),
'th_TH' => array('code' => 'th', 'language' => 'Thailand', 'locale' => 'Thai_Thailand', 'codepage' => 'ISO8859-1'),
'tr_TR' => array('code' => 'tr', 'language' => 'Turkish', 'locale' => 'Turkish_Turkey', 'codepage' => 'ISO8859-1'),
'zh_CN' => array('code' => 'cn', 'language' => 'Chinese', 'locale' => 'Chinese_China', 'codepage' => 'ISO8859-1'),
'zh_TW' => array('code' => 'zh', 'language' => 'Chinese', 'locale' => 'Chinese_Taiwan', 'codepage' => 'ISO8859-1')
);
private $cisco_timezone = array(
'Dateline' => array('offset' => '-720', 'daylight' => false),
'Samoa' => array('offset' => '-660', 'daylight' => false),
'Hawaiian' => array('offset' => '-600', 'daylight' => false),
'Alaskan' => array('offset' => '-540', 'daylight' => true),
'Pacific' => array('offset' => '-480', 'daylight' => true),
'Mountain' => array('offset' => '-420', 'daylight' => true),
'US Mountain' => array('offset' => '-420', 'daylight' => false),
'Central' => array('offset' => '-360', 'daylight' => true),
'Mexico' => array('offset' => '-360', 'daylight' => true),
'Canada Central' => array('offset' => '-360', 'daylight' => false),
'SA Pacific' => array('offset' => '-300', 'daylight' => false),
'Eastern' => array('offset' => '-300', 'daylight' => true),
'US Eastern' => array('offset' => '-300', 'daylight' => false),
'Atlantic' => array('offset' => '-240', 'daylight' => true),
'SA Western' => array('offset' => '-240', 'daylight' => false),
'Pacific SA' => array('offset' => '-240', 'daylight' => false),
'Newfoundland' => array('offset' => '-210', 'daylight' => true),
'E. South America' => array('offset' => '-180', 'daylight' => true),
'SA Eastern' => array('offset' => '-180', 'daylight' => false),
'Pacific SA' => array('offset' => '-180', 'daylight' => true),
'Mid-Atlantic' => array('offset' => '-120', 'daylight' => true),
'Azores' => array('offset' => '-060', 'daylight' => true),
'GMT' => array('offset' => '00', 'daylight' => true),
'Greenwich' => array('offset' => '00', 'daylight' => false),
'W. Europe' => array('offset' => '60', 'daylight' => true),
'Central Europe' => array('offset' => '120', 'daylight' => true),
'South Africa' => array('offset' => '120', 'daylight' => false),
'Saudi Arabia' => array('offset' => '180', 'daylight' => false),
'Iran' => array('offset' => '210', 'daylight' => true),
'Caucasus' => array('offset' => '240', 'daylight' => true),
'Arabian' => array('offset' => '240', 'daylight' => false),
'Afghanistan' => array('offset' => '270', 'daylight' => false),
'West Asia' => array('offset' => '300', 'daylight' => false),
'India' => array('offset' => '330', 'daylight' => false),
'Central Asia' => array('offset' => '360', 'daylight' => false),
'SE Asia' => array('offset' => '420', 'daylight' => false),
'China' => array('offset' => '480', 'daylight' => false),
'Tokyo' => array('offset' => '540', 'daylight' => false),
'Cen. Australia' => array('offset' => '570', 'daylight' => true),
'AUS Central' => array('offset' => '570', 'daylight' => false),
'E. Australia' => array('offset' => '600', 'daylight' => false),
'AUS Eastern' => array('offset' => '600', 'daylight' => true),
'West Pacific' => array('offset' => '600', 'daylight' => false),
'Tasmania' => array('offset' => '600', 'daylight' => true),
'Central Pacific' => array('offset' => '660', 'daylight' => false),
'Fiji' => array('offset' => '720', 'daylight' => false),
'New Zealand' => array('offset' => '720', 'daylight' => true)
);
public function updateTftpStructure($settingsFromDb) {
global $amp_conf;
$adv_config = array('tftproot' => $settingsFromDb['tftp_path']['data'],
'firmware' => 'firmware',
'settings' => 'settings',
'locales' => 'locales',
'languages' => 'languages',
'templates' => 'templates',
'dialplan' => 'dialplan',
'softkey' => 'softkey',
'ringtones' => 'ringtones',
'wallpapers' => 'wallpapers',
'countries' => 'countries'
);
$adv_tree = array('pro' => array('templates' => 'tftproot',
'firmware' => 'tftproot',
'settings' => 'tftproot',
'locales' => 'tftproot',
'languages' => 'locales',
'templates' => 'tftproot',
'dialplan' => 'tftproot',
'softkey' => 'tftproot',
'ringtones' => 'tftproot',
'wallpapers' => 'tftproot',
'countries' => 'locales'
),
'def' => array('templates' => 'tftproot',
'firmware' => '',
'settings' => '',
'locales' => '',
'languages' => 'tftproot',
'dialplan' => '',
'softkey' => '',
'ringtones' => '',
'wallpapers' => '',
'countries' => ''
)
);
$base_tree = array('tftp_templates_path' => 'templates',
'tftp_firmware_path' => 'firmware',
'tftp_store_path' => 'settings',
'tftp_lang_path' => 'languages',
'tftp_dialplan_path' => 'dialplan',
'tftp_softkey_path' => 'softkey',
'tftp_ringtones_path' => 'ringtones',
'tftp_wallpapers_path' => 'wallpapers',
'tftp_countries_path' => 'countries'
);
$baseConfig = array();
if (empty($settingsFromDb['tftp_rewrite_path']['data'])) {
$settingsFromDb['tftp_rewrite_path']['data'] = $settingsFromDb['tftp_path']['data'];
} else {
// Have a setting in sccpsettings. It should start with $tftp_path
// If not we will replace it with $tftp_path. Avoids issues with legacy values
if (!strpos($settingsFromDb['tftp_rewrite_path']["data"],$settingsFromDb['tftp_path']['data'])) {
$settingsFromDb['tftp_rewrite_path']['data'] = $settingsFromDb['tftp_path']['data'];
}
}
$adv_ini = "{$settingsFromDb['tftp_rewrite_path']["data"]}/index.cnf";
$adv_tree_mode = 'def';
switch ($settingsFromDb['tftp_rewrite']['data']) {
case 'pro':
$adv_tree_mode = 'pro';
if (!empty($adv_ini) && file_exists($adv_ini)) {
$adv_ini_array = parse_ini_file($adv_ini);
$adv_config = array_merge($adv_config, $adv_ini_array);
}
// rewrite adv_ini to reflect the new $adv_config
if (file_exists($adv_ini)){
rename($adv_ini, "{$adv_ini}.old");
}
$indexFile = fopen($adv_ini,'w');
fwrite($indexFile, "[main]\n");
foreach ($adv_config as $advKey => $advVal) {
fwrite($indexFile, "{$advKey} = {$advVal}\n");
}
fclose($indexFile);
$settingsFromDb['tftp_rewrite']['data'] = 'pro';
break;
case 'on':
case 'internal':
case 'off':
default:
// not defined so set here to off
$settingsFromDb['tftp_rewrite']['data'] = 'off';
}
foreach ($adv_tree[$adv_tree_mode] as $key => $value) {
if (!empty($adv_config[$key])) {
if (!empty($value)) {
if (substr($adv_config[$key], 0, 1) != "/") {
$adv_config[$key] = $adv_config[$value] . '/' . $adv_config[$key];
}
} else {
$adv_config[$key] = $adv_config['tftproot'];
}
}
}
foreach ($base_tree as $key => $value) {
$baseConfig[$key] = $adv_config[$value];
if (!is_dir($baseConfig[$key])) {
if (!mkdir($baseConfig[$key], 0755, true)) {
die_freepbx(_("Error creating dir: $baseConfig[$key]"));
}
}
}
// Set up tftproot/settings so that can test if mapping is Enabled and configured.
if (!is_dir("{$settingsFromDb['tftp_path']['data']}/settings")) {
if (!mkdir("{$settingsFromDb['tftp_path']['data']}/settings", 0755, true)) {
die_freepbx(_("Error creating dir: {$settingsFromDb['tftp_path']['data']}/settings"));
}
}
// TODO: Need to add index.cnf, after setting defaults correctly
if (!file_exists("{$baseConfig['tftp_templates_path']}/XMLDefault.cnf.xml_template")) {
$src_path = $amp_conf['AMPWEBROOT'] . '/admin/modules/sccp_manager/conf/';
$dst_path = "{$baseConfig["tftp_templates_path"]}/";
foreach (glob("{$src_path}*.*_template") as $filename) {
copy($filename, $dst_path . basename($filename));
}
}
foreach ($baseConfig as $baseKey => $baseValue) {
$settingsFromDb[$baseKey] = array('keyword' => $baseKey, 'seq' => 20, 'type' => 0, 'data' => $baseValue, 'systemdefault' => '');
}
return $settingsFromDb;
}
public function validate_RealTime( $connector )
{
// This method only checks that asterisk is correctly configured for Realtime
// It is preventative and does not change anything for Sccp_manager
global $amp_conf;
$res = array();
/* if (empty($connector)) {
$connector = 'sccp';
}
$cnf_int = \FreePBX::Config();
$cnf_wr = \FreePBX::WriteConfig();
*/
$cnf_read = \FreePBX::LoadConfig();
// We are running inside FreePBX so must use the same database
$def_config = array('sccpdevice' => 'mysql,' . $amp_conf['AMPDBNAME'] . ',sccpdeviceconfig', 'sccpline' => 'mysql,' . $amp_conf['AMPDBNAME'] . ',sccplineconfig');
$backup_ext = array('_custom.conf', '.conf', '_additional.conf');
$def_bd_config = array('dbhost' => $amp_conf['AMPDBHOST'], 'dbname' => $amp_conf['AMPDBNAME'],
'dbuser' => $amp_conf['AMPDBUSER'], 'dbpass' => $amp_conf['AMPDBPASS'],
'dbport' => '3306', 'dbsock' => '/var/lib/mysql/mysql.sock'
);
$dir = $amp_conf['ASTETCDIR'];
$res_conf_sql = ini_get('pdo_mysql.default_socket');
$res_conf = '';
$ext_conf = '';
foreach ($backup_ext as $fext) {
if (file_exists($dir . '/extconfig' . $fext)) {
$ext_conf = $cnf_read->getConfig('extconfig' . $fext);
if (!empty($ext_conf['settings']['sccpdevice'])) {
if ($ext_conf['settings']['sccpdevice'] === $def_config['sccpdevice']) {
$res['sccpdevice'] = 'OK';
$res['extconfigfile'] = 'extconfig' . $fext;
} else {
$res['sccpdevice'] .= ' Error in line sccpdevice ';
}
}
if (!empty($ext_conf['settings']['sccpline'])) {
if ($ext_conf['settings']['sccpline'] === $def_config['sccpline']) {
$res['sccpline'] = 'OK';
} else {
$res['sccpline'] .= ' Error in line sccpline ';
}
}
}
}
$res['extconfig'] = 'OK';
if (empty($res['sccpdevice'])) {
$res['extconfig'] = ' Option "Sccpdevice" is not configured ';
}
if (empty($res['sccpline'])) {
$res['extconfig'] = ' Option "Sccpline" is not configured ';
}
if (empty($res['extconfigfile'])) {
$res['extconfig'] = 'File extconfig.conf does not exist';
}
if (!empty($res_conf_sql)) {
if (file_exists($res_conf_sql)) {
$def_bd_config['dbsock'] = $res_conf_sql;
}
}
// Check for mysql config files - should only be one depending on version
$mySqlConfigFiles = [ 'res_mysql.conf', 'res_config_mysql.conf' ];
foreach ($mySqlConfigFiles as $sqlConfigFile) {
if (file_exists( $dir . '/' . $sqlConfigFile )) {
$res_conf = $cnf_read->getConfig($sqlConfigFile);
if (empty($res_conf[$connector])) {
$res['mysqlconfig'] = 'Config not found in file: ' . $sqlConfigFile;
} else {
if ($res_conf[$connector]['dbsock'] != $def_bd_config['dbsock']) {
$res['mysqlconfig'] = 'Mysql Socket Error in file: ' . $sqlConfigFile;
}
}
if (empty($res['mysqlconfig'])) {
$res['mysqlconfig'] = 'OK';
}
}
}
if (empty($res['mysqlconfig'])) {
$res['mysqlconfig'] = 'Realtime Error: neither res_config_mysql.conf nor res_mysql.conf found in the path : ' . $dir;
}
return $res;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,835 @@
<?php
/**
*
* Core Comsnd Interface
*
*
*/
/* !TODO!: -TODO-: Would you like to use my XSD file to check if the provided template file is a correct cisco cnf.xml file ?
* !TODO!: -TODO-: I just don't understand how to use it here.. To check the incoming pattern ? To check the result of my script ?
* !TODO!: -TODO-: The most correct variant is to generate xml based on XSD template.
*/
namespace FreePBX\modules\Sccp_manager;
class xmlinterface
{
use \FreePBX\modules\Sccp_Manager\sccpManTraits\helperFunctions;
private $val_null = 'NONE'; /// REPLACE to null Field
public function __construct($parent_class = null)
{
$this->paren_class = $parent_class;
$this->langCodeArray = array(
'Arabic_Saudi_Arabia' => 'ar',
'Bulgarian_Bulgaria' => 'bg',
'Czech_Czech_Republic' => 'cz',
'Danish_Denmark' => 'da',
'German_Germany' => 'de',
'Greek_Greece' => 'el',
'AU_English_United_States' => 'en',
'English_United_Kingdom' => 'en',
'English_United_States' => 'en',
'Spanish_Spain' => 'es',
'Estonian_Estonia' => 'et',
'Finnish_Finland' => 'fi',
'French_Canada' => 'fr',
'French_France' => 'fr',
'Hebrew_Israel' => 'he',
'Croatian_Croatia' => 'hr',
'Hungarian_Hungary' => 'hu',
'Italian_Italy' => 'it',
'Japanese_Japan' => 'ja',
'Korean_Korea_Republic' => 'ko',
'Lithuanian_Lithuania' => 'lt',
'Latvian_Latvia' => 'lv',
'Dutch_Netherlands' => 'nl',
'Norwegian_Norway' => 'no',
'Polish_Poland' => 'pl',
'Portuguese_Brazil' => 'pt',
'Portuguese_Portugal' => 'pt',
'Romanian_Romania' => 'ro',
'Russian_Russian_Federation' => 'ru',
'Slovak_Slovakia' => 'sk',
'Slovenian_Slovenia' => 'sl',
'Serbian_Republic_of_Montenegro' => 'sr',
'Serbian_Republic_of_Serbia' => 'rs',
'Swedish_Sweden' => 'sv',
'Thai_Thailand' => 'th',
'Turkish_Turkey' => 'tr',
'Chinese_China' => 'cn',
'Chinese_Taiwan' => 'zh'
);
}
public function info()
{
$Ver = '13.0.6';
return array('Version' => $Ver,
'about' => 'Create XML data interface ver: ' . $Ver);
}
function create_default_XML($store_path = '', $data_values = array(), $model_information = array(), $lang_info = array())
{
$data_path = $data_values['tftp_path'];
if (empty($store_path) || empty($data_path) || empty($data_values)) {
return;
}
$def_xml_fields = array('authenticationURL', 'informationURL', 'messagesURL', 'servicesURL', 'directoryURL',
'secureauthenticationURL', 'secureinformationURL', 'securemessagesURL', 'secureservicesURL', 'securedirectoryURL', 'secureidleURL',
'proxyServerURL', 'idleTimeout', 'idleURL');
$def_xml_locale = array('userLocale', 'networkLocaleInfo', 'networkLocale');
$xml_name = $store_path . '/XMLDefault.cnf.xml';
$xml_template = $data_values['tftp_path'] . '/templates/XMLDefault.cnf.xml_template';
if (file_exists($xml_template)) {
$xml_work = simplexml_load_file($xml_template);
$xnode = &$xml_work->callManagerGroup->members;
$bind_tmp = $this->get_server_sccp_bind($data_values);
//error_log("bind_tmp:".print_r($bind_tmp, true), 0);
$ifc = 0;
foreach ($bind_tmp as $bind_value) {
$xnode_obj = clone $xnode->member;
$xnode_obj['priority'] = $ifc;
$xnode_obj->callManager->name = $data_values['servername'];
$xnode_obj->callManager->ports->ethernetPhonePort = $bind_value['port'];
$xnode_obj->callManager->processNodeName = $bind_value['ip'];
if ($ifc === 0) {
$this->replaceSimpleXmlNode($xnode->member, $xnode_obj);
} else {
$this->appendSimpleXmlNode($xnode->member, $xnode_obj);
}
$ifc++;
}
$this->replaceSimpleXmlNode($xml_work->callManagerGroup->members, $xnode);
foreach ($def_xml_fields as $value) {
if (!empty($data_values['dev_' . $value])) {
$xml_work->$value = trim($data_values['dev_' . $value]);
} else {
$node = $xml_work->$value;
if (!empty($node)) {
unset($node[0][0]);
}
}
}
foreach ($def_xml_locale as $key) {
if (!empty($xml_work->$key)) {
$xnode = &$xml_work->$key;
switch ($key) {
case 'userLocale':
case 'networkLocaleInfo':
if ($key == 'networkLocaleInfo') {
$lang = $data_values['netlang'];
} else {
$lang = $data_values['devlang'];
}
if (isset($lang_info[$lang])) {
$xnode->name = $lang_info[$lang]['locale'];
$xnode->langCode = $lang_info[$lang]['code'];
} else {
$xnode->name = '';
$xnode->langCode = '';
}
break;
case 'networkLocale':
$lang = $data_values['netlang'];
if (isset($lang_info[$lang])) {
$xnode = $lang_info[$lang]['language'];
} else {
$xnode = '';
}
break;
}
}
}
foreach ($model_information as $var) {
if (!empty($var['loadinformationid'])) {
$node = $xml_work->addChild($var['loadinformationid'], $var['loadimage']);
$node->addAttribute('model', $var['vendor'] . ' ' . $var['model']);
}
}
$this->saveXml($xml_work, $xml_name); // Save XMLDefault1.cnf.xml
}
}
function create_SEP_XML($store_path, $data_values, $dev_config, $dev_id, $lang_info = array())
{
// TODO: $data_values are system wide defaults, $dev_config are specific device values.
// Need to merge the two arrays so that device specific values override system values
$data_values = array_merge($data_values, $dev_config);
$var_xml_general_fields = array('authenticationurl' => 'dev_authenticationURL', 'informationurl' => 'dev_informationURL', 'messagesurl' => 'dev_messagesURL',
'servicesurl' => 'dev_servicesURL', 'directoryurl' => 'dev_directoryURL', 'idleurl' => 'dev_idleURL',
'secureauthenticationurl' => 'dev_secureauthenticationURL',
'secureinformationurl' => 'dev_secureinformationURL', 'securemessagesurl'=>'dev_securemessagesURL',
'secureservicesurl'=>'dev_secureservicesURL', 'securedirectoryurl'=>'dev_securedirectoryURL', 'secureidleurl' => 'dev_secureidleURL',
'proxyserverurl' => 'dev_proxyServerURL', 'idletimeout' => 'dev_idleTimeout',
'sshuserid' => 'dev_sshUserId', 'sshpassword' => 'dev_sshPassword', 'deviceprotocol' => 'dev_deviceProtocol',
'phonepersonalization' => 'phonepersonalization'
);
$var_xml_general_vars = array('capfAuthMode' => 'null', 'capfList' => 'null', 'mobility' => 'null',
'phoneServices' => 'null', 'certHash' => 'null',
'deviceSecurityMode' => '1');
$data_path = $dev_config['tftp_templates_path'];
if (empty($data_path)) {
die('Create_SEP_XML tftp_templates_path not defined');
}
$store_path = $dev_config['tftp_store_path'];
if (empty($store_path)) {
die('Create_SEP_XML tftp_store_path not defined');
}
if (!empty($dev_config['nametemplate'])) {
$xml_template = "{$data_path}/{$dev_config['nametemplate']}";
} else {
$xml_template = "{$data_path}/templates/SEP0000000000.cnf.xml_79df_template";
}
$xml_name = "{$store_path}/{$dev_id}.cnf.xml";
if (!file_exists($xml_template)) {
die('Error Hardware template :' . $xml_template . ' not found');
}
$xml_work = simplexml_load_file($xml_template);
foreach ($var_xml_general_vars as $key => $data) {
if (isset($xml_work->$key)) {
if ($data != 'null') {
$xml_work->$key = $data;
} else {
$node = $xml_work->$key;
unset($node[0][0]);
}
}
}
foreach ($xml_work as $key => $data) {
// Set System global Values
$key_l = strtolower($key);
if (!empty($var_xml_general_fields[$key_l])) {
$xml_work->$key = $data_values[$var_xml_general_fields[$key_l]];
}
// Set section Values
$xml_node = $xml_work->$key;
switch ($key_l) {
case 'devicepool':
$xml_node = $xml_work->$key;
foreach ($xml_work->$key->children() as $dkey => $ddata) {
switch (strtolower($dkey)) {
case 'datetimesetting':
$xnode = &$xml_node->$dkey;
$tz_id = $data_values['ntp_timezone'];
$TZdata = $data_values['ntp_timezone_id'];
if (empty($TZdata)) {
$TZdata = array('offset' => '0', 'daylight' => '', 'cisco_code' => 'Greenwich Standard Time');
}
$xnode->name = $tz_id;
$xnode->dateTemplate = $data_values['dateformat'];
$xnode->timeZone = $TZdata['cisco_code'];
// $xnode->timeZone = $tz_id.' Standard'.((empty($TZdata['daylight']))? '': '/'.$TZdata['daylight']).' Time';
if ($data_values['ntp_config_enabled'] == 'on') {
$xnode->ntps->ntp->name = $data_values['ntp_server'];
$xnode->ntps->ntp->ntpMode = $data_values['ntp_server_mode'];
} else {
$xnode->ntps = null;
}
// Ntp Config
break;
case 'srstinfo':
if ($data_values['srst_Option'] == 'user') {
break;
}
$xnode = &$xml_node->$dkey;
$xnode->name = $data_values['srst_Name'];
$xnode->srstOption = $data_values['srst_Option'];
$xnode->userModifiable = $data_values['srst_userModifiable'];
$xnode->isSecure = $data_values['srst_isSecure'];
// srst addresses are now stored as json;
$srst_addrs = $this->convertCsvToArray($data_values['srst_ip']);
//Now have an array of srst addresses - maybe empty
foreach ($srst_addrs as $netKey => $netValue) {
$nodeName = "ipAddr${netKey}";
$xnode->$nodeName = $netValue['ip'];
$nodeName = "port${netKey}";
$xnode->$nodeName = $netValue['port'];
}
break;
case 'connectionmonitorduration':
$xml_node->$dkey = strval(intval(intval($data_values['keepalive']) * 0.75));
break;
case 'callmanagergroup':
$xnode = &$xml_node->$dkey->members;
$bind_tmp = $this->get_server_sccp_bind($data_values);
$ifc = 0;
foreach ($bind_tmp as $bind_value) {
$xnode_obj = clone $xnode->member;
$xnode_obj['priority'] = $ifc;
$xnode_obj->callManager->name = $data_values['servername'];
if (!is_null($xnode_obj->callManager->description)) {
$xnode_obj->callManager->description = $data_values['servername'];
}
$xnode_obj->callManager->ports->ethernetPhonePort = $bind_value['port'];
$xnode_obj->callManager->processNodeName = $bind_value['ip'];
if (!empty($xnode_obj->callManager->ports->mgcpPorts)) {
unset($xnode_obj->callManager->ports->mgcpPorts);
}
if ($ifc === 0) {
$this->replaceSimpleXmlNode($xnode->member, $xnode_obj);
} else {
$this->appendSimpleXmlNode($xnode->member, $xnode_obj);
}
$ifc++;
}
}
}
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
break;
case 'vendorconfig':
$xml_node = $xml_work->$key;
foreach ($xml_work->$key->children() as $dkey => $ddata) {
if (isset($data_values[strtolower($dkey)])) {
$vtmp_data = $data_values[strtolower($dkey)];
if (!empty($vtmp_data)) {
switch ($vtmp_data) {
case 'off':
$xml_node->$dkey = 1;
break;
case 'on':
$xml_node->$dkey = 0;
break;
default:
$xml_node->$dkey = $vtmp_data;
break;
}
}
}
}
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
break;
case 'versionstamp':
$xml_work->$key = time();
break;
case 'loadinformation':
if (isset($dev_config["tftp_firmware"])) {
$xml_work->$key = (isset($dev_config["loadimage"])) ? $dev_config["tftp_firmware"] . $dev_config["loadimage"] : '';
} else {
$xml_work->$key = (isset($dev_config["loadimage"])) ? $dev_config["loadimage"] : '';
}
if (!empty($dev_config['addon'])) {
$xnode = $xml_work->addChild('addOnModules');
$ti = 1;
$hw_addon = explode(';', $dev_config['addon']);
foreach ($hw_addon as $add_key) {
if (!empty($dev_config['addon_info'][$dev_config['addon']])) {
$add_val = $dev_config['addon_info'][$dev_config['addon']];
$xnode_obj = $xnode->addChild('addOnModule');
$xnode_obj->addAttribute('idx', $ti);
$xnode_obj->addChild('loadInformation', $add_val);
$ti++;
}
}
}
break;
case 'commonprofile':
$xml_node->phonePassword = $data_values['dev_sshPassword'];
$xml_node->backgroundImageAccess = (($data_values['backgroundImageAccess'] == 'on') || ($data_values['backgroundImageAccess'] == 'true') ) ? 'true' : 'false';
$xml_node->callLogBlfEnabled = $data_values['callLogBlfEnabled'];
break;
case 'userlocale':
// Device language
$lang = $data_values['devlang'];
if (!empty($dev_config['devlang'])) {
$lang = $dev_config['devlang'];
}
$xml_node->winCharSet = $dev_config['phonecodepage'];
$xml_node->name = $dev_config['devlang'];
$xml_node->langCode = 'en';
if (isset($this->langCodeArray[$dev_config['devlang']])) {
$xml_node->langCode = $this->langCodeArray[$dev_config['devlang']];
}
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
break;
case 'networklocale':
$lang = $data_values['netlang'];
if (!empty($dev_config['netlang'])) {
$lang = $dev_config['netlang'];
}
if (isset($lang)) {
$xml_work->$key = $lang;
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
} else {
$xml_work->$key = '';
}
break;
case 'networklocaleinfo':
$lang = $data_values['netlang'];
if (!empty($dev_config['netlang'])) {
$lang = $dev_config['netlang'];
}
if (isset($lang)) {
$xml_node->name = $lang;
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
} else {
$xml_work->$key = '';
}
break;
default:
break;
}
}
$this->saveXml($xml_work, $xml_name); // Save
return time();
}
private function get_server_sccp_bind($data_values = array())
{
$res = array();
if ($data_values['bindaddr'] !== '0.0.0.0') {
$rkey = $data_values['bindaddr'];
$res[$rkey] = array('ip' => $data_values['bindaddr'], 'port' => $data_values['port']);
return $res;
}
$ip_fill = true;
if (!empty($data_values['ccm_address'])) {
// ccm_address is json from sccpsettings
$ccm_address = $this->convertCsvToArray($data_values['ccm_address'], true);
// This is a sanitised list of ipaddresses and ports
foreach ($ccm_address as $netValue) {
$res[$netValue['ip']] = $netValue;
}
}
if ($ip_fill) {
foreach ($data_values['server_if_list'] as $value) {
if (!empty($value['ip'])) {
if (!in_array($value['ip'], array('0.0.0.0', '127.0.0.1'), true)) {
$rkey = $value['ip'];
$res[$rkey] = array('ip' => $rkey, 'port' => $data_values['port']);
}
}
}
}
if (!empty($data_values['externhost'])) {
$rkey = $data_values['externhost'];
if (!in_array($rkey, array('0.0.0.0', '127.0.0.1', 'localhost'), true)) {
$res[$rkey] = array('ip' => $rkey, 'port' => $data_values['port']);
}
} else {
if (!empty($data_values['externip'])) {
$rkey = $data_values['externip'];
if (!in_array($rkey, array('0.0.0.0', '127.0.0.1'), true)) {
$res[$rkey] = array('ip' => $rkey, 'port' => $data_values['port']);
}
}
}
return $res;
}
function create_SEP_SIP_XML($store_path = '', $data_values = array(), $dev_config = array(), $dev_id = '', $lang_info = array())
{
$var_xml_general_fields = array('authenticationURL' => 'dev_authenticationURL', 'informationURL' => 'dev_informationURL', 'messagesURL' => 'dev_messagesURL',
'servicesURL' => 'dev_servicesURL', 'directoryURL' => 'dev_directoryURL', 'proxyServerURL' => 'dev_proxyServerURL', 'idleTimeout' => 'dev_idleTimeout',
'idleURL' => 'dev_idleURL', 'sshUserId' => 'dev_sshUserId', 'sshPassword' => 'dev_sshPassword',
'phonePersonalization' => 'phonepersonalization'
);
$var_xml_sipProfile = array('phoneLabel' => 'description',
'transferOnhookEnabled' => 'transferOnhookEnabled', 'enableVad' => 'enableVad', 'voipControlPort' => 'sipport'
);
$var_xml_sipline = array('name' => 'account', 'featureLabel' => 'account', 'displayName' => 'callerid', 'contact' => 'account',
'authName' => 'account', 'authPassword' => 'secret');
$var_xml_general_vars = array('capfAuthMode' => 'null', 'capfList' => 'null', 'mobility' => 'null',
'phoneServices' => 'null', 'certHash' => 'null', 'deviceProtocol' => 'SIP',
'deviceSecurityMode' => '1');
// $var_hw_config = $this->dbinterface->getSccpDeviceTableData("get_sccpdevice_byid", array('id' => $dev_id));
if (empty($dev_config)) {
return false;
}
$data_path = $dev_config['tftp_path'];
if (empty($store_path) || empty($data_path) || empty($data_values) || empty($dev_id)) {
return;
}
if (!empty($dev_config['nametemplate'])) {
$xml_template = $data_path . '/templates/' . $dev_config['nametemplate'];
if (!file_exists($xml_template)) {
$xml_template = $data_path . '/templates/SEP0000000000.cnf.xml_79df_sip_template';
}
} else {
$xml_template = $data_path . '/templates/SEP0000000000.cnf.xml_79df_sip_template';
}
$xml_name = $store_path . '/' . $dev_id . '.cnf.xml';
$sip_bind = $data_values['sbind'];
$bind_proto = 'tcp';
$bind_ip_def = '';
foreach ($sip_bind as $key => $value) {
if (empty($bind_ip_def)) {
$bind_ip_def = $key;
$bind_proto = (isset($value['tcp'])) ? 'tcp' : 'udp';
}
}
if (file_exists($xml_template)) {
$xml_work = simplexml_load_file($xml_template);
foreach ($var_xml_general_vars as $key => $data) {
if (isset($xml_work->$key)) {
if ($data != 'null') {
$xml_work->$key = $data;
} else {
$node = $xml_work->$key;
unset($node[0][0]);
}
}
}
foreach ($xml_work as $key => $data) {
// Set System global Values
if (!empty($var_xml_general_fields[$key])) {
$xml_work->$key = $data_values[$var_xml_general_fields[$key]];
}
// Set section Values
$xml_node = $xml_work->$key;
switch ($key) {
case 'devicePool':
$xml_node = $xml_work->$key;
foreach ($xml_work->$key->children() as $dkey => $ddata) {
switch ($dkey) {
case 'dateTimeSetting':
$xnode = &$xml_node->$dkey;
$tz_id = $data_values['ntp_timezone'];
$TZdata = $data_values['ntp_timezone_id'];
if (empty($TZdata)) {
$TZdata = array('offset' => '0', 'daylight' => '', 'cisco_code' => 'Greenwich Standard Time');
}
$xnode->dateTemplate = $data_values['dateformat'];
$xnode->timeZone = $TZdata['cisco_code'];
if ($data_values['ntp_config_enabled'] == 'on') {
$xnode->ntps->ntp->name = $data_values['ntp_server'];
$xnode->ntps->ntp->ntpMode = $data_values['ntp_server_mode'];
} else {
$xnode->ntps = null;
}
// Ntp Config
break;
case 'callManagerGroup':
$xnode = &$xml_node->$dkey->members;
$ifc = 0;
foreach ($sip_bind as $bind_ip => $bind_value) {
$xnode_obj = clone $xnode->member;
$xnode_obj['priority'] = $ifc;
$xnode_obj->callManager->name = $data_values['servername'];
$xnode_obj->callManager->ports->sipPort = $bind_value[$bind_proto];
// $xnode_obj->callManager->ports->securedSipPort = $bind_value['tlsport'];
$xnode_obj->callManager->processNodeName = $bind_ip;
if ($ifc === 0) {
$this->replaceSimpleXmlNode($xnode->member, $xnode_obj);
} else {
$this->appendSimpleXmlNode($xnode->member, $xnode_obj);
}
$ifc++;
}
}
}
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
break;
case 'sipProfile':
$xml_node = $xml_work->$key;
foreach ($xml_work->$key->children() as $dkey => $ddata) {
if (!empty($var_xml_sipProfile[$dkey])) {
if (!empty($data_values[$var_xml_sipProfile[$dkey]])) {
$xml_node->$dkey = $data_values[$var_xml_sipProfile[$dkey]];
} else {
$xml_node->$dkey = null;
}
}
switch ($dkey) {
case 'sipProxies':
$xnode = &$xml_node->$dkey;
$xnode->backupProxy = $bind_ip_def;
$xnode->backupProxyPort = $sip_bind[$bind_ip_def][$bind_proto];
$xnode->emergencyProxy = $bind_proto;
$xnode->emergencyProxyPort = $sip_bind[$bind_ip_def][$bind_proto];
$xnode->outboundProxy = $bind_proto;
$xnode->outboundProxyPort = $sip_bind[$bind_ip_def][$bind_proto];
$xnode->registerWithProxy = "true";
break;
case 'sipLines':
$xnode = &$xml_node->$dkey;
$ifc = 0;
if (!empty($data_values['siplines'])) {
foreach ($data_values['siplines'] as $spkey => $spvalue) {
// if $spvalue[]
$xnode_obj = clone $xnode->line;
$xnode_obj['button'] = $ifc + 1;
$xnode_obj['lineIndex'] = $ifc + 1;
//$xnode_obj->proxy = $data_values['bindaddr'];
$xnode_obj->featureID = "9";
if ($xnode_obj->proxy != 'USECALLMANAGER') {
$xnode_obj->proxy = $bind_proto;
$xnode_obj->port = $sip_bind[$bind_ip_def][$bind_proto];
}
foreach ($var_xml_sipline as $line_key => $line_val) {
$xnode_obj->$line_key = $spvalue[$line_val];
}
if ($ifc === 0) {
$this->replaceSimpleXmlNode($xnode->line, $xnode_obj);
} else {
$this->appendSimpleXmlNode($xnode->line, $xnode_obj);
}
$ifc++;
}
}
if (!empty($data_values['speeddial'])) {
foreach ($data_values['speeddial'] as $spkey => $spvalue) {
$xmlstr = '<line button="' . ($ifc + 1) . '"> <featureID>22</featureID>'
. '<featureLabel>' . $spvalue["name"] . '</featureLabel>'
. '<speedDialNumber>' . $spvalue["dial"] . '</speedDialNumber>'
. '<contact>' . $spvalue["dial"] . '</contact> <retrievalPrefix /></line>';
$xnode_obj = simplexml_load_string($xmlstr);
$this->appendSimpleXmlNode($xnode->line, $xnode_obj);
$ifc++;
}
}
break;
case 'softKeyFile':
case 'dialTemplate': // Доработать !
$xml_ext_file = '';
$template_path = (($dkey == 'softKeyFile') ? $dev_config['tftp_softkey_path'] : $dev_config['tftp_dialplan_path']);
$tmp_key = ($dkey == 'softKeyFile') ? 'softkeyset' : '_dialrules';
if (!empty($dev_config[$tmp_key])) {
$xml_ext_file = (($dkey == 'softKeyFile') ? 'softkey' . $dev_config[$tmp_key] . '.xml' : $dev_config[$tmp_key] . '.xml');
}
if (empty($xml_ext_file) || !file_exists($template_path . '/' . $xml_ext_file)) {
$xml_ext_file = (($dkey == 'softKeyFile') ? 'softkeydefault.xml' : 'dialplan.xml');
}
if (file_exists($template_path . '/' . $xml_ext_file)) {
$xml_node->$dkey = $xml_ext_file;
} else {
$xml_node->$dkey = null;
}
break;
}
}
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
break;
case 'versionStamp':
$xml_work->$key = time();
break;
case 'loadInformation':
// Set Path Image ????
if (isset($dev_config["tftp_firmware"])) {
$xml_work->$key = (isset($dev_config["loadimage"])) ? $dev_config["tftp_firmware"] . $dev_config["loadimage"] : '';
} else {
$xml_work->$key = (isset($dev_config["loadimage"])) ? $dev_config["loadimage"] : '';
}
if (!empty($dev_config['addon'])) {
$xnode = $xml_work->addChild('addOnModules');
$ti = 1;
$hw_addon = explode(';', $dev_config['addon']);
foreach ($hw_addon as $add_key) {
if (!empty($dev_config['addon_info'][$dev_config['addon']])) {
$add_val = $dev_config['addon_info'][$dev_config['addon']];
$xnode_obj = $xnode->addChild('addOnModule');
$xnode_obj->addAttribute('idx', $ti);
$xnode_obj->addChild('loadInformation', $add_val);
$ti++;
}
}
}
break;
case 'commonProfile':
$xml_node->phonePassword = $data_values['dev_sshPassword'];
$xml_node->backgroundImageAccess = (($data_values['backgroundImageAccess'] == 'on') || ($data_values['backgroundImageAccess'] == 'true') ) ? 'true' : 'false';
$xml_node->callLogBlfEnabled = $data_values['callLogBlfEnabled'];
break;
case 'userlocale':
// Device language
$lang = $data_values['devlang'];
if (!empty($dev_config['devlang'])) {
$lang = $dev_config['devlang'];
}
$xml_node->winCharSet = $dev_config['phonecodepage'];
$xml_node->name = $dev_config['devlang'];
$xml_node->langCode = 'en';
if (isset($this->langCodeArray['devlang'])) {
$xml_node->langCode = $this->langCodeArray['devlang'];
}
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
break;
case 'networklocale':
$lang = $data_values['netlang'];
if (!empty($dev_config['netlang'])) {
$lang = $dev_config['netlang'];
}
if (isset($lang)) {
$xml_work->$key = $lang;
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
} else {
$xml_work->$key = '';
}
break;
case 'networklocaleinfo':
$lang = $data_values['netlang'];
if (!empty($dev_config['netlang'])) {
$lang = $dev_config['netlang'];
}
if (isset($lang)) {
$xml_node->name = $lang;
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
} else {
$xml_work->$key = '';
}
break;
default:
break;
}
}
$this->saveXml($xml_work, $xml_name); // Save
} else {
die('Error Hardware template :' . $xml_template . ' not found');
}
return time();
}
function saveDialPlan($confDir, $get_settings)
{
$xmlstr = "<DIALTEMPLATE>\n";
$xmlstr .= "<versionStamp>" . time() . "</versionStamp>\n";
$dialFelds = array('match', 'timeout', 'rewrite', 'tone'); //str -to lo !
$hdr_prefix = 'sccp_dial_';
$hdr_arprefix = 'sccp_dial-ar_';
$save_data = array();
$integer_msg = _("%s must be a non-negative integer");
$errors = array();
foreach ($get_settings[$hdr_arprefix . 'dialtemplate'] as $key => $value) {
$xmlstr .= '<TEMPLATE';
if (!empty($value['match'])) {
foreach ($dialFelds as $fld) {
if (isset($value[$fld])) {
if ($value[$fld] == 'empty' || $value[$fld] == '') {
} else {
$xmlstr .= ' ' . $fld . '="' . (string) $value[$fld] . '"';
}
}
}
} else {
$errors = array('Fields need to match !!');
}
$xmlstr .= "/>\n";
}
$xmlstr .= '</DIALTEMPLATE>';
if (!empty($get_settings['idtemplate'])) {
if ($get_settings['idtemplate'] == '*new*') {
if (!empty($get_settings[$hdr_prefix . 'dialtemplate_name'])) {
$put_file = (string) $get_settings[$hdr_prefix . 'dialtemplate_name'];
} else {
$errors = array('Fields Dial Plan Name is requered !!');
}
} else {
$put_file = (string) $get_settings['idtemplate'];
}
} else {
$errors = array('Fields Dial Plan Name is required !!');
}
if (empty($errors)) {
$put_file = str_replace(array("\n", "\r", "\t", "/", "\\", ".", ","), '', $put_file);
$file = $confDir . '/dial' . $put_file . '.xml';
file_put_contents($file, $xmlstr);
}
return $errors;
}
function create_xmlSoftkeyset($config, $confDir, $name)
{
if (empty($config[$name])) {
if ($name == 'default') {
$typeSoft = $confDir["tftp_templates_path"] . '/SIPDefaultSoftKey.xml_template';
if (file_exists($typeSoft)) {
$file = $confDir["tftp_softkey_path"] . '/softkey' . $name . '.xml';
if (!copy($typeSoft, $file)) {
return array('error' => 'Access error' . $name);
}
}
return array();
} else {
return array('error' => 'Invalid softkey Name' . $name);
}
}
$errors = array();
$xmlstr = "<softKeyCfg>\n";
$xmlstr .= "<versionStamp>" . time() . "</versionStamp>\n";
$typeSoft = $confDir["tftp_templates_path"] . '/SIPTypeSoftKey.xml_template';
$read_soft = "";
if (file_exists($typeSoft)) {
$f_read = fopen($typeSoft, 'r');
while (!feof($f_read)) {
$read_soft .= fread($f_read, 8192);
}
fclose($f_read);
}
$xmlstr .= $read_soft;
$xmlstr .= " <softKeySets>\n";
foreach ($config[$name] as $key => $value) {
$xmlstr .= ' <softKeySet id="' . $key . '">' . "\n";
foreach (explode(",", $value) as $keyvalue) {
$xmlstr .= ' <softKey keyID="' . $keyvalue . '" />' . "\n";
}
$xmlstr .= " </softKeySet>\n";
}
$xmlstr .= " </softKeySets>\n";
$xmlstr .= '</softKeyCfg>';
if (empty($errors)) {
$file = $confDir["tftp_softkey_path"] . '/softkey' . $name . '.xml';
file_put_contents($file, $xmlstr);
}
return $errors;
}
private function replaceSimpleXmlNode($xml, $element = SimpleXMLElement)
{
$dom = dom_import_simplexml($xml);
$import = $dom->ownerDocument->importNode(
dom_import_simplexml($element),
true
);
$dom->parentNode->replaceChild($import, $dom);
}
private function appendSimpleXmlNode($xml, $element = SimpleXMLElement)
{
$dom = dom_import_simplexml($xml);
$import = $dom->ownerDocument->importNode(
dom_import_simplexml($element),
true
);
$dom->parentNode->appendChild($import->cloneNode(true));
}
}

View file

@ -0,0 +1,788 @@
<?php
namespace FreePBX\modules\Sccp_manager\sccpManTraits;
trait ajaxHelper {
public function ajaxRequest($req, &$setting) {
// Called first by BMO. Must return true or request will be aborted.
// See https://wiki.freepbx.org/display/FOP/BMO+Ajax+Calls
switch ($req) {
case 'backupsettings':
case 'savesettings':
case 'save_device':
case 'save_sip_device':
case 'save_ruser':
case 'save_dialplan_template':
case 'delete_hardware':
case 'getPhoneGrid':
case 'getExtensionGrid':
case 'getDeviceModel':
case 'getUserGrid':
case 'getSoftKey':
case 'getDialTemplate':
case 'get_ext_files':
case 'create_hw_tftp':
case 'reset_dev':
case 'reset_token':
case 'model_enabled':
case 'model_disabled':
case 'model_update':
case 'model_add':
case 'model_delete':
case 'update_button_label':
case 'updateSoftKey':
case 'deleteSoftKey':
case 'delete_dialplan':
return true;
break;
case 'validateMac':
return true;
break;
default:
return false;
}
}
// ajaxHandler is called after ajaxRequest returns true
public function ajaxHandler() {
$request = $_REQUEST;
$msg = array();
$cmd_id = $request['command'];
switch ($cmd_id) {
case 'savesettings':
// Consolidate this into a separate method to improve legibility
$this->handleSubmit($request);
// TODO: Need to be more specific on reload and only reload if critical settings changed.
$res = $this->aminterface->core_sccp_reload();
return array('status' => true, 'message' => 'Data saved', 'reload' => true, 'toastFlag' => 'success', 'search' => '?display=sccpsettings', 'hash' => '');
break;
case 'save_sip_device':
case 'save_device':
return $this->saveSccpDevice($request);
break;
case 'save_ruser':
//$res = $request;
$res = $this->handleRoamingUsers($request);
return array('status' => true, 'search' => '?display=sccp_phone', 'hash' => 'general');
break;
case 'save_dialplan_template':
/* !TODO!: -TODO-: dialplan templates should be removed (only required for very old devices (like ATA) */
// ------------------------------- Old + Sip device support - In the development---
$res = $this->saveDialPlan($request);
//public
if (empty($res)) {
return array('status' => true, 'search' => '?display=sccp_adv', 'hash' => 'sccpdialplan');
} else {
return array('status' => false, 'message' => print_r($res));
}
break;
case 'delete_dialplan':
if (!empty($request['dialplan'])) {
$get_file = $request['dialplan'];
$res = $this->deleteDialPlan($get_file);
return array('status' => true, 'message' => 'Dial Template has been deleted ! ', 'table_reload' => true);
} else {
return array('status' => false, 'message' => print_r($res));
}
break;
// ------------------------------- Old device support - In the development---
case 'delete_hardware':
if (!empty($request['idn'])) {
foreach ($request['idn'] as $idv) {
if ($this->strpos_array($idv, array('SEP', 'ATA', 'VG')) !== false) {
$this->dbinterface->write('sccpdevice', array('name' => $idv), 'delete', "name");
$this->dbinterface->write('sccpbuttons', array(), 'delete', '', $idv);
$this->deleteSccpDeviceXML($idv); // Концы в вводу !!
$this->aminterface->sccpDeviceReset($idv, 'reset');
}
}
return array('status' => true, 'table_reload' => true, 'message' => 'Hardware device has been deleted! ');
}
break;
case 'create_hw_tftp':
$ver_id = ' Test !';
if (!empty($request['idn'])) {
$models = array();
foreach ($request['idn'] as $idv) {
$this->deleteSccpDeviceXML($idv);
$models [] = array('name' => $idv);
}
} else {
$this->deleteSccpDeviceXML('all');
$models = $this->dbinterface->getSccpDeviceTableData("SccpDevice");
}
$this->createDefaultSccpXml(); // Default XML
$ver_id = ' on found active model !';
foreach ($models as $data) {
$ver_id = $this->createSccpDeviceXML($data['name']);
if ($ver_id == -1) {
return array('status' => false, 'message' => 'Error Create Configuration Divice :' . $data['name']);
}
};
if ($this->sccpvalues['siptftp']['data'] == 'on') { // Check SIP Support Enabled
$this->createSccpXmlSoftkey(); // Create Softkey Sets for SIP
}
// !TODO!: -TODO-: Do these returned message strings work with i18n ?
return array('status' => true, 'message' => 'Create new config files (version:' . $ver_id . ')');
break;
case 'reset_token':
case 'reset_dev':
$msg = '';
$msgr = array();
$msgr[] = "Reset command sent to device(s) ";
if (!empty($request['name'])) {
foreach ($request['name'] as $idv) {
$msg = strpos($idv, 'SEP-');
if (!(strpos($idv, 'SEP') === false)) {
if ($cmd_id == 'reset_token') {
$res = $this->aminterface->sccpDeviceReset($idv, 'tokenack');
$msgr[] = $msg . ' ' . $res['Response'] . ' ' . $res['data'];
} else {
$res = $this->aminterface->sccpDeviceReset($idv, 'reset');
$msgr[] = $msg . ' ' . $res['Response'] . ' ' . $res['data'];
}
}
if ($idv == 'all') {
$dev_list = $this->aminterface->sccp_get_active_device();
foreach ($dev_list as $key => $data) {
if ($cmd_id == 'reset_token') {
if (($data['token'] == 'Rej') || ($data['status'] == 'Token ')) {
$res = $this->aminterface->sccpDeviceReset($idv, 'tokenack');
$msgr[] = 'Sent Token reset to :' . $key;
}
} else {
$res = $this->aminterface->sccpDeviceReset($idv, 'reset');
$msgr[] = $res['Response'] . ' ' . $res['data'];
}
}
}
}
}
return array('status' => (($res['Response'] == 'Error')? false : true ), 'message' => $msgr, 'reload' => false, 'table_reload' => true);
break;
case 'update_button_label':
$msg = '';
$hw_list = array();
if (!empty($request['name'])) {
foreach ($request['name'] as $idv) {
if (!(strpos($idv, 'SEP') === false)) {
$hw_list[] = array('name' => $idv);
}
if ($idv == 'all') {
}
}
}
$res = $this->updateSccpButtons($hw_list);
$msg .= $res['Response'] . (empty($res['data']) ? '' : ' raw data: ' . $res['data'] . ' ');
return array('status' => true, 'message' => 'Update Buttons Labels Complete: ' . $msg, 'reload' => false, 'table_reload' => true);
case 'model_add':
$save_settings = array();
$key_name = array('model', 'vendor', 'dns', 'buttons', 'loadimage', 'loadinformationid', 'nametemplate');
$upd_mode = 'replace';
case 'model_update':
if ($request['command'] == 'model_update') {
$key_name = array('model','vendor','dns', 'buttons', 'loadimage', 'loadinformationid', 'nametemplate');
$upd_mode = 'update';
}
if (!empty($request['model'])) {
foreach ($key_name as $key => $value) {
if (!empty($request[$value])) {
$save_settings[$value] = $request[$value];
} else {
$save_settings[$value] = $this->val_null; // null
}
}
$this->dbinterface->write('sccpdevmodel', $save_settings, $upd_mode, "model");
return array('status' => true, 'table_reload' => true);
}
return $save_settings;
break;
case 'model_enabled':
$model_set = '1'; // fall through intentionally
case 'model_disabled':
if ($request['command'] == 'model_disabled') {
$model_set = '0';
}
$msg = '';
$save_settings = array();
if (!empty($request['model'])) {
foreach ($request['model'] as $idv) {
$this->dbinterface->write('sccpdevmodel', array('model' => $idv, 'enabled' => $model_set), 'update', "model");
}
}
return array('status' => true, 'table_reload' => true);
break;
case 'model_delete':
if (!empty($request['model'])) {
$this->dbinterface->write('sccpdevmodel', array('model' => $request['model']), 'delete', "model");
return array('status' => true, 'table_reload' => true);
}
break;
case 'getDeviceModel':
switch ($request['type']) {
case 'all':
case 'extension':
case 'enabled':
$devices = $this->getSccpModelInformation($request['type'], $validate = true);
break;
}
if (empty($devices)) {
return array();
}
return $devices;
break;
case 'deleteSoftKey':
if (!empty($request['softkey'])) {
$id_name = $request['softkey'];
unset($this->sccp_conf_init[$id_name]);
$this->createDefaultSccpConfig($this->sccpvalues, $this->sccppath["asterisk"], $this->sccp_conf_init);
$msg = print_r($this->aminterface->core_sccp_reload(), 1);
return array('status' => true, 'table_reload' => true);
}
break;
case 'updateSoftKey':
if (!empty($request['id'])) {
$id_name = preg_replace('/[^A-Za-z0-9]/', '', $request['id']);
$this->sccp_conf_init[$id_name]['type'] = "softkeyset";
foreach ($this->extconfigs->getExtConfig('keyset') as $keyl => $vall) {
if (!empty($request[$keyl])) {
$this->sccp_conf_init[$id_name][$keyl] = $request[$keyl];
}
}
$this->createDefaultSccpConfig($this->sccpvalues, $this->sccppath["asterisk"], $this->sccp_conf_init);
// !TODO!: -TODO-: Check SIP Support Enabled
$this->createSccpXmlSoftkey();
$msg = print_r($this->aminterface->core_sccp_reload(), 1);
return array('status' => true, 'table_reload' => true);
}
break;
case 'getSoftKey':
$result = array();
$i = 0;
$keyl = 'default';
foreach ($this->aminterface->sccp_list_keysets() as $keyl => $vall) {
$result[$i]['softkeys'] = $keyl;
if ($keyl == 'default') {
foreach ($this->extconfigs->getExtConfig('keyset') as $key => $value) {
$result[$i][$key] = str_replace(',', '<br>', $value);
}
} else {
foreach ($this->getMyConfig('softkeyset', $keyl) as $key => $value) {
$result[$i][$key] = str_replace(',', '<br>', $value);
}
}
$i++;
}
return $result;
break;
case 'getExtensionGrid':
$lineList = $this->dbinterface->getSccpDeviceTableData($request['type']);
if (empty($lineList)) {
return array();
}
$activeDevices = $this->aminterface->sccp_get_active_device();
$uniqueLineList = array();
foreach ($lineList as $key => &$lineArr) {
if (array_key_exists($lineArr['mac'], $activeDevices)) {
$lineArr['line_status'] = "{$activeDevices[$lineArr['mac']]['status']} | {$activeDevices[$lineArr['mac']]['act']}";
}
if (array_key_exists($lineArr['name'], $uniqueLineList)) {
$lineList[$uniqueLineList[$lineArr['name']]]['mac'] .= '<br>' . $lineArr['mac'];
$lineList[$uniqueLineList[$lineArr['name']]]['line_status'] .= '<br>' . $lineArr['line_status'];
unset($lineList[$key]); // Drop this array as no longer used
continue;
}
$uniqueLineList[$lineArr['name']] = $key;
}
unset($lineArr, $uniqueLineList); // unset reference and temp vars.
return array_values($lineList); // Reindex array and return
break;
case 'getPhoneGrid':
$dbDevices = array();
// Find all devices defined in the database.
$dbDevices = $this->dbinterface->getSccpDeviceTableData('phoneGrid', array('type' => $request['type']));
// Return if only interested in SIP devices
if ($request['type'] == 'cisco-sip') {
return $dbDevices; //this may be empty
}
// Find all devices currently connected
$activeDevices = $this->aminterface->sccp_get_active_device();
foreach ($dbDevices as &$dev_id) {
if (!empty($activeDevices[$dev_id['name']])) {
// Device is in db and is connected
$dev_id['description'] = $activeDevices[$dev_id['name']]['descr'];
$dev_id['status'] = $activeDevices[$dev_id['name']]['status'];
$dev_id['address'] = $activeDevices[$dev_id['name']]['address'];
$dev_id['new_hw'] = 'N';
// No further action required on this active device
unset($activeDevices[$dev_id['name']]);
}
}
unset($dev_id); // unset reference.
if (!empty($activeDevices)) {
// Have a device that is connected but is not currently in the database
// This device must have connected via hotline or config in sccp.conf.
// Pass parameters to addDevice so that can be added to db.
foreach ($activeDevices as $dev_ids) {
$id_name = $dev_ids['name'];
$dev_data = $this->aminterface->sccp_getdevice_info($id_name);
if (!empty($dev_data['SCCP_Vendor']['model_id'])) {
$dev_addon = $dev_data['SCCP_Vendor']['model_addon'];
if (empty($dev_addon)) {
$dev_addon = null;
}
$dev_schema = $this->getSccpModelInformation('byciscoid', false, "all", array('model' => $dev_data['SCCP_Vendor']['model_id']));
if (empty($dev_schema)) {
$dev_schema[0]['model'] = "ERROR in Model Schema";
}
$dbDevices[] = array(
'name' => $id_name,
'mac' => $id_name,
'button' => '---',
'type' => $dev_schema[0]['model'],
'new_hw' => 'Y',
'description' => '*NEW* ' . $dev_ids['descr'],
'status' => '*NEW* ' . $dev_ids['status'],
'address' => $dev_ids['address'],
'addon' => $dev_addon
);
}
}
}
return $dbDevices;
break;
case 'getDialTemplate':
// ------------------------------- Old device support - In the development---
$result = $this->getDialPlanList();
if (empty($result)) {
$result = array();
}
return $result;
break;
case 'backupsettings':
// ------------------------------- Old device support - In the development---
$filename = $this->createSccpBackup();
$file_name = basename($filename);
header("Content-Type: application/zip");
header("Content-Disposition: attachment; filename=$file_name");
header("Content-Length: " . filesize($filename));
readfile($filename);
unlink($filename);
// return array('status' => false, 'message' => $result);
return $result;
break;
case 'validateMac':
break;
case 'get_ext_files':
return $this->getFilesFromProvisioner($request);
break;
}
}
function handleSubmit($request, $validateonly = false) {
$hdr_prefix = 'sccp_';
$hdr_arprefix = 'sccp-ar_';
$save_settings = array();
$save_codec = array();
$count_mods = 0;
$dbSaveArray = array();
$errors = array();
if (isset($request["{$hdr_prefix}createlangdir"]) && ($request["{$hdr_prefix}createlangdir"] == 'yes')) {
$this->initializeTFtpLanguagePath();
}
// if uncheck all codecs, audiocodecs key is missing so nothing changes in db.
// Unsetting all codecs will now return to chan-sccp defaults.
// all codecs are currently treated as audiocodecs. To treat videocodecs separately name in video codec section of
// server.codec needs to be changed from audiocodecs to videocodecs.
if (!isset($request['audiocodecs'])) {
$save_settings['allow'] = $this->sccpvalues['allow'];
$save_settings['allow']['data'] = $this->sccpvalues['allow']['systemdefault'];
} else {
foreach ($request['audiocodecs'] as $keycodeс => $dumVal) {
$save_codec[] = $keycodeс;
}
$save_settings['allow'] = $this->sccpvalues['allow'];
$save_settings['allow']['data'] = implode(";", $save_codec);
}
unset($request['audiocodecs']);
if (isset($request[$hdr_prefix . 'ntp_timezone'])) {
$TZdata = $this->extconfigs->getExtConfig('sccp_timezone', $request[$hdr_prefix . 'ntp_timezone']);
if (!empty($TZdata)) {
$save_settings['tzoffset'] = array(
'keyword' => 'tzoffset',
'data' => $TZdata['offset']/60,
'seq' => '98',
'type' => '2',
'systemdefault' => ''
);
}
unset($request[$hdr_prefix . 'ntp_timezone']);
}
// Now handle remaining data. First get table defaults
$sccpdevice_def = (array)$this->getTableDefaults('sccpdevice', false);
$sccpline_def = (array)$this->getTableDefaults('sccpline', false);
// before handling arrays, need to see if deny and permit are set in the request
// if they have been cleared by the users, will not be present
foreach (['deny','permit'] as $keyVal) {
if (!isset($request[$hdr_arprefix.$keyVal])) {
$tmpArr = $this->convertCsvToArray($this->sccpvalues[$keyVal]['systemdefault']);
if (isset($tmpArr[0]['internal'])) {
$request[$hdr_arprefix.$keyVal][0] = $tmpArr[0];
} else {
$request[$hdr_arprefix.$keyVal][1]['net'] = $tmpArr[0]['net'];
$request[$hdr_arprefix.$keyVal][1]['mask'] = $tmpArr[0]['mask'];
}
}
}
foreach ($request as $key => $value) {
// First handle any arrays as their prefix is part common with normal data
//$netvalue = array();
$key = (str_replace($hdr_arprefix, '', $key, $count_mods));
if ($count_mods) {
// Only arrays : network lists or ip lists.
$save_settings[$key]['keyword'] = $key;
$save_settings[$key]['type'] = $this->sccpvalues[$key]['type'];
$save_settings[$key]['seq'] = $this->sccpvalues[$key]['seq'];
$save_settings[$key]['data'] = $this->convertArrayToCsv($value);
$save_settings[$key]['systemdefault'] = $this->sccpvalues[$key]['systemdefault'];
continue;
}
// Now handle any normal data - arrays will not match as already handled.
if (strpos($key, $hdr_prefix) === 0) {
$key = (str_replace($hdr_prefix, '', $key, $count_mods));
if (($count_mods) && (!empty($this->sccpvalues[$key])) && ($this->sccpvalues[$key]['data'] != $value)) {
$save_settings[$key] = $this->sccpvalues[$key];
$save_settings[$key]['data'] = $value;
}
continue;
}
// Finally treat values to be saved to sccpdevice and sccpline defaults.
// TODO: Need to verify the tables defined in showGroup - some options maybe
// device options, but if set by freePbx extensions, be in sccpline.
foreach (array('sccpdevice', 'sccpline') as $tableName) {
$key = (str_replace("{$tableName}_", '', $key, $count_mods));
if ($count_mods) {
// Have default to be saved to db table default
$tableName_def = "{$tableName}_def";
if ((array_key_exists($key, ${$tableName_def})) && (${$tableName_def}[$key]['data'] == $value)) {
// Value unchanged so ignore
} else {
$dbSaveArray[$key] = array('table' => $tableName, 'field' => $key, 'Default' => $value);
}
// If have matched on device, cannot match on line
continue 2;
}
}
}
$extSettings = $this->extconfigs->updateTftpStructure(array_merge($this->sccpvalues, $save_settings));
$save_settings = array_merge($save_settings, $extSettings);
//dbug($save_settings);
if (!empty($save_settings)) {
$this->saveSccpSettings($save_settings);
$this->sccpvalues = $this->dbinterface->get_db_SccpSetting();
}
// now add the site defaults from sccpsettings to sccpdevice for permit and deny, so that these will override
foreach (['deny', 'permit'] as $fieldId) {
$output = array();
foreach ($this->convertCsvToArray($this->sccpvalues[$fieldId]['data']) as $netValue) {
if (isset($netValue['internal'])) {
$output[] = 'internal';
continue;
}
$output[] = implode('/', $netValue);
}
$dbSaveArray[$fieldId] = array('table' => 'sccpdevice', 'field' => $fieldId, 'Default' => implode(';',$output));
}
foreach ($dbSaveArray as $key => $rowToSave) {
$this->dbinterface->updateTableDefaults($rowToSave['table'], $rowToSave['field'], $rowToSave['Default']);
}
// rewrite sccp.conf
$this->createDefaultSccpConfig($this->sccpvalues, $this->sccppath["asterisk"], $this->sccp_conf_init);
$this->createDefaultSccpXml();
}
public function getMyConfig($var = null, $id = "noid") {
// TODO: this function has little purpose - need to integrate into AjaxHelper
switch ($var) {
case "softkeyset":
$final = array();
$i = 0;
if ($id == "noid") {
foreach ($this->sccp_conf_init as $key => $value) {
if ($this->sccp_conf_init[$key]['type'] == 'softkeyset') {
$final[$i] = $value;
$i++;
}
}
} else {
if (!empty($this->sccp_conf_init[$id])) {
if ($this->sccp_conf_init[$id]['type'] == 'softkeyset') {
$final = $this->sccp_conf_init[$id];
}
}
}
break;
}
return $final;
}
public function getFilesFromProvisioner($request) {
$filesToGet = array();
$totalFiles = 0;
$provisionerUrl = "https://github.com/dkgroot/provision_sccp/raw/master/";
// TODO: Maybe should always fetch to ensure have latest, backing up old version
if (!file_exists("{$this->sccppath['tftp_path']}/masterFilesStructure.xml")) {
if (!$this->getFileListFromProvisioner($this->sccppath['tftp_path'])) {
return array('status' => false,
'message' => "{$provisionerUrl}tools/tftpbootFiles.xml cannot be found. Check your internet connection, and that this path exists",
'reload' => false);
}
}
$tftpBootXml = simplexml_load_file("{$this->sccppath['tftp_path']}/masterFilesStructure.xml");
switch ($request['type']) {
case 'firmware':
$device = $request['device'];
$firmwareDir = $tftpBootXml->xpath("//Directory[@name='firmware']");
$result = $firmwareDir[0]->xpath("//Directory[@name='{$device}']");
$filesToGet['firmware'] = (array)$result[0]->FileName;
$totalFiles += count($filesToGet['firmware']);
$srcDir['firmware'] = $provisionerUrl . (string)$result[0]->DirectoryPath;
$dstDir['firmware'] = "{$this->sccppath['tftp_firmware_path']}/{$device}";
$msg = "Firmware for {$device} has been successfully downloaded";
break;
case 'locale':
$language = $request['locale'];
// Get locales
$localeDir = $tftpBootXml->xpath("//Directory[@name='languages']");
$result = $localeDir[0]->xpath("//Directory[@name='{$language}']");
$filesToGet['language'] = (array)$result[0]->FileName;
$totalFiles += count($filesToGet['language']);
$srcDir['language'] = $provisionerUrl . (string)$result[0]->DirectoryPath;
$dstDir['language'] = "{$this->sccppath['tftp_lang_path']}/{$language}";
// Get countries. Country is a substring of locale with exception of korea
$country = explode('_', $language);
array_shift($country);
$countryName = array_shift($country);
while (count($country)>=1) {
$countryName .= '_' . array_shift($country);
}
$msg = "{$language} Locale and Country tones have been successfully downloaded";
//fall through intentionally to also get country files
case 'country':
if ($totalFiles == 0) {
//Request is for countries; if >0, have fallen through from locale
$countryName = $request['country'];
$msg = "{$countryName} country tones have been successfully downloaded";
}
$result = $tftpBootXml->xpath("//Directory[@name='{$countryName}']");
$filesToGet['country'] = (array)$result[0]->FileName;
$totalFiles += count($filesToGet['country']);
$srcDir['country'] = $provisionerUrl . (string)$result[0]->DirectoryPath;
$dstDir['country'] = "{$this->sccppath['tftp_countries_path']}/{$countryName}";
break;
default:
return array('status' => false, 'message' => 'Invalid request', 'reload' => false);
break;
}
// Now get the files
$filesRetrieved = 0;
foreach (array('language','country', 'firmware') as $section){
if (!isset($dstDir[$section])) {
// No request for this section
continue;
}
$srcDir = $srcDir[$section];
$dstDir = $dstDir[$section];
if (!is_dir($dstDir)) {
mkdir($dstDir, 0755);
}
foreach ($filesToGet[$section] as $srcFile) {
try {
file_put_contents("{$dstDir}/{$srcFile}",
file_get_contents($srcDir. $srcFile));
} catch (\Exception $e) {
return array('status' => false,
'message' => "{$countriesSrcDir}{$srcFile} cannot be found. Check your internet connection, and that this path exists",
'reload' => false);
}
$filesRetrieved ++;
$percentComplete = $filesRetrieved *100 / $totalFiles;
$data = "{$percentComplete},";
echo $data;
ob_flush();
flush();
}
}
return array('status' => true, 'message' => $msg, 'reload' => true);
}
function saveSccpDevice($get_settings, $validateonly = false) {
$hdr_prefix = 'sccp_hw_';
$hdr_arprefix = 'sccp_hw-ar_';
$hdr_vendPrefix = 'vendorconfig_';
$save_buttons = array();
$save_settings = array();
$save_codec = array();
$name_dev = '';
$db_field = array_keys($this->dbinterface->getSccpDeviceTableData("get_columns_sccpdevice"));
$hw_id = (empty($get_settings['sccp_device_id'])) ? 'new' : $get_settings['sccp_device_id'];
$hw_type = (empty($get_settings['sccp_device_typeid'])) ? 'sccpdevice' : $get_settings['sccp_device_typeid'];
$update_hw = ($hw_id == 'new') ? 'add' : 'clear'; // Clear is delete + add. Only used for buttons
$hw_prefix = 'SEP';
if (!empty($get_settings[$hdr_prefix . 'type'])) {
$value = $get_settings[$hdr_prefix . 'type'];
if (strpos($value, 'ATA') !== false) {
$hw_prefix = 'ATA';
}
if (strpos($value, 'VG') !== false) {
$hw_prefix = 'VG';
}
}
foreach ($db_field as $key) {
$value = "";
switch ($key) {
case 'name':
if (!empty($get_settings[$hdr_prefix . 'mac'])) {
$value = $get_settings[$hdr_prefix . 'mac'];
$value = strtoupper(str_replace(array('.', '-', ':'), '', $value)); // Delete mac separators from string
$value = sprintf("%012s", $value);
if ($hw_prefix == 'VG') {
$value = $hw_prefix . $value . '0';
} else {
$value = $hw_prefix . $value;
}
$name_dev = $value;
}
break;
case 'phonecodepage':
// phonecodepage depends on 2 variables - language and phone type (uses java or not).
// Non java phones use ISO8859-1 or CP1251 (Cyrillic); java phones use UTF-8. See @dkgroot.
// Below list is not definitive or necessarily accurate - needs to be maintained.
$nonJavaPhones = array(
'6901', '6911', '6921', '6945', '7902', '7905', '7910', '7911', '7912', '7914', '7915', '7916', '7920', '7925', '7926', '7931', '7935', '7936', '7937', '7940', '7960'
);
// TODO: May be other exceptions so use switch. Historically this is the only one handled
if (!empty($get_settings["{$hdr_prefix}devlang"])) {
switch ($get_settings["{$hdr_prefix}devlang"]) {
case 'Russian_Russian_Federation':
$value = (in_array($get_settings['sccp_hw_type'], $nonJavaPhones, true)) ? 'CP1251' : 'utf-8';
break;
default:
$value = (in_array($get_settings['sccp_hw_type'], $nonJavaPhones, true)) ? 'ISO8859-1' : 'utf-8';
break;
}
}
break;
default:
// handle vendor prefix
if (!empty($get_settings["${hdr_vendPrefix}${key}"])) {
$value = $get_settings["${hdr_vendPrefix}${key}"];
}
// handle array prefix
if (!empty($get_settings["${hdr_arprefix}${key}"])) {
// Only 3 types of array returned permit,deny, setvar
$arr_data = '';
$arr_clear = false;
$output = array();
foreach ($get_settings["${hdr_arprefix}${key}"] as $netValue) {
switch ($key) {
case 'permit':
case 'deny';
// Now have an array of settings each with keys net and Mask
// TODO: This needs to be optimised
//foreach ($valueArr as $netValue) {
if (isset($netValue['inherit'])) {
$save_settings['deny'] = 'NONE';
continue 2;
}
if (isset($netValue['internal'])) {
$output[] = 'internal';
continue 2;
}
if (empty($netValue['net'])) {
// empty net so ignored
continue 2;
}
$netValue['mask'] = (empty($netValue['mask'])) ? "255.255.255.0" : $netValue['mask'];
$output[]= implode('/', $netValue);
//}
break;
case 'setvar':
$output[] = implode(';', $netValue);
break;
// No default case
}
}
$save_settings[$key] = implode(';', $output);
unset($output);
}
// Now only have normal prefix
if (!empty($get_settings["{$hdr_prefix}{$key}"])) {
$value = $get_settings["{$hdr_prefix}{$key}"];
}
}
if (!empty($value)) {
$save_settings[$key] = $value;
}
}
// Save this device.
$this->dbinterface->write('sccpdevice', $save_settings, 'replace');
// Retrieve the phone buttons from $_REQUEST ($get_settings) and write back to
// update sccpdeviceconfig via Trigger
$save_buttons = $this->getPhoneButtons($get_settings, $name_dev, $hw_type);
$this->dbinterface->write('sccpbuttons', $save_buttons, $update_hw, '', $name_dev);
// Create new XML for this device, and then reset or restart the device
// so that it loads the file from TFT.
$msg = "Device Saved";
$toastFlag = 'success';
if (!$this->createSccpDeviceXML($name_dev)){
// will only be false if creating SIP SEP with no line.
$msg = "Device Saved but SEP config file not created as no SIP line attached to this device";
$toastFlag = 'warning';
};
$hash = '#sipdevice';
if ($get_settings['sccp_device_typeid'] != 'sipdevice') {
$hash = '#sccpdevice';
// cannot restart SIP device via chan-sccp.
if ($hw_id == 'new') {
$this->aminterface->sccpDeviceReset($name_dev, 'reset');
} else {
$this->aminterface->sccpDeviceReset($name_dev, 'restart');
}
}
$search = '?display=sccp_phone';
return array('status' => true, 'message' => $msg, 'reload' => true, 'toastFlag' => $toastFlag, 'search' => $search, 'hash' => $hash);
}
}
?>

View file

@ -0,0 +1,153 @@
<?php
namespace FreePBX\modules\Sccp_manager\sccpManTraits;
trait bmoFunctions {
//Need to reload freePBX for modifications below to work
/*
//want to catch extensions
public static function myConfigPageInits() {
return array("extensions");
}
*/
public function doConfigPageInit($page) {
if ($page == "extensions") {
}
$this->doGeneralPost();
}
// Try to change extensions which is part of core
/*
public static function myGuiHooks() {
return array('core');
}
*/
/*
public function doGuiHook(&$cc) {
if ($_REQUEST['display'] == "extensions" ) {
if ($_REQUEST['tech_hardware'] == 'sccp_custom') {
this is the add extensions form
On submit returns to extensions page. Users prefer that it returns
To Sccp Phone.
Below adds redirect URL, but it is not followed
$cc->setRedirectURL("config.php?display=sccp_phone");
so force redirect at end of addDevice in SccpClass
}
}
}
*/
/* unused but FPBX API requires it */
public function install() {
}
/* unused but FPBX API requires it */
public function uninstall() {
}
/* unused but FPBX API requires it */
public function backup() {
}
/* unused but FPBX API requires it */
public function restore($backup) {
}
public function getActionBar($request) {
$buttons = array();
switch ($request['display']) {
case 'sccp_adv':
if (empty($request['tech_hardware'])) {
break;
}
$buttons = array(
'submit' => array(
'name' => 'ajaxsubmit',
'id' => 'ajaxsubmit',
'value' => _("Save")
),
'Save' => array(
'name' => 'ajaxsubmit2',
'id' => 'ajaxsubmit2',
'stayonpage' => 'yes',
'value' => _("Save + Continue")
),
'cancel' => array(
'name' => 'cancel',
'id' => 'ajaxcancel',
'data-search' => '?display=sccp_adv',
'data-hash' => 'sccpdialplan',
'value' => _("Cancel")
),
);
break;
case 'sccp_phone':
if (empty($request['tech_hardware'])) {
break;
}
$buttons = array(
'submit' => array(
'name' => 'ajaxsubmit',
'id' => 'ajaxsubmit',
'value' => _("Save")
),
'Save' => array(
'name' => 'ajaxsubmit2',
'id' => 'ajaxsubmit2',
'stayonpage' => 'yes',
'value' => _("Save + Continue")
),
'cancel' => array(
'name' => 'cancel',
'id' => 'ajaxcancel',
'data-search' => '?display=sccp_phone',
'data-hash' => 'sccpdevice',
'value' => _("Cancel")
),
);
break;
case 'sccpsettings':
// TODO: Need to change to have save and save and continue
$buttons = array(
'submit' => array(
'name' => 'ajaxsubmit',
'id' => 'ajaxsubmit',
'value' => _("Save")
),
'reset' => array(
'name' => 'reset',
'id' => 'ajaxcancel',
'data-reload' => 'reload',
'value' => _("Cancel")
),
);
break;
}
return $buttons;
}
public function getRightNav($request) {
global $amp_conf;
if (isset($request['tech_hardware']) && ($request['tech_hardware'] == 'cisco')) {
return load_view($amp_conf['AMPWEBROOT'] .'/admin/modules/sccp_manager/views/hardware.rnav.php', array('request' => $request));
}
}
public function doGeneralPost() {
if (!isset($_REQUEST['Submit'])) {
return;
}
}
}
?>

View file

@ -0,0 +1,523 @@
<?php
namespace FreePBX\modules\Sccp_manager\sccpManTraits;
trait helperfunctions {
private function convertCsvToArray($stringToConvert = "") {
// Take a csv string form of net/mask or ip/port and convert to an array
// sub arrays are separated by ";"
$outputArr = array();
if (empty($stringToConvert)) {
return $outputArr;
}
foreach (explode(";", $stringToConvert) as $value) {
//internal is always the first setting if present
if ($value == 'internal') {
$outputArr[] = array('internal' => 'on');
continue;
}
// Now handle rest of value types
$subArr = explode("/", $value);
if (count($subArr) === 2) {
// Have net/mask
$outputArr[] = array('net' => $subArr[0], 'mask' => $subArr[1]);
} else {
// have ip:port
$subArr = explode(":", $value);
$outputArr[] = array('ip' => $subArr[0], 'port' => $subArr[1]);
}
}
return $outputArr;
}
private function convertArrayToCsv(array $arrayToConvert) {
// About to save to db so need to convert to string
// Take an array form of net mask or ip port and convert to a csv
// sub arrays are separated by ";"
if (empty($arrayToConvert)) {
return '';
}
$output = array();
// Internal is always element 0, nets and ips start at element 1.
if ((isset($arrayToConvert[1]['net'])) || (isset($arrayToConvert[0]['internal']))) {
// Have net masks
foreach ($arrayToConvert as $netValue) {
if (isset($netValue['internal'])) {
$output[] = 'internal';
continue;
}
if (empty($netValue['net'])) {
// If network not set, user error, has added empty row so delete
continue;
}
// If the mask has not been set, set to this subnet
$netValue['mask'] = (empty($netValue['mask'])) ? "255.255.255.0" : $netValue['mask'];
$output[] = implode('/', $netValue);
}
} else {
// Have ip addresses
foreach ($arrayToConvert as $ipArr) {
if (isset($ipArr['internal'])) {
// should not be set for an ip address
continue;
}
if (empty($ipArr['ip'])) {
// If ip not set, user error, has added empty row so delete
continue;
}
$ipArr['port'] = (empty($ipArr['port'])) ? "2000" : $ipArr['port'];
$output[] = implode(':', $ipArr);
}
}
return implode(';', $output);
}
private function getIpInformation($type = '') {
$interfaces = array();
switch ($type) {
case 'ip4':
exec("/sbin/ip -4 -o addr", $result, $ret);
break;
case 'ip6':
exec("/sbin/ip -6 -o addr", $result, $ret);
break;
default:
exec("/sbin/ip -o addr", $result, $ret);
break;
}
foreach ($result as $line) {
$vals = preg_split("/\s+/", $line);
if ($vals[3] == "mtu") {
continue;
}
if ($vals[2] != "inet" && $vals[2] != "inet6") {
continue;
}
if (preg_match("/(.+?)(?:@.+)?:$/", $vals[1], $res)) {
continue;
}
$ret = preg_match("/(\d*+.\d*+.\d*+.\d*+)[\/(\d*+)]*/", $vals[3], $ip);
$interfaces[$vals[1] . ':' . $vals[2]] = array('name' => $vals[1], 'type' => $vals[2], 'ip' => ((empty($ip[1]) ? '' : $ip[1])));
}
return $interfaces;
}
private function before($thing, $inthat) {
return substr($inthat, 0, strpos($inthat, $thing));
}
private function array_key_exists_recursive($key, $arr) {
if (array_key_exists($key, $arr)) {
return true;
}
foreach ($arr as $currentKey => $value) {
if (is_array($value)) {
return $this->array_key_exists_recursive($key, $value);
}
}
return false;
}
private function strpos_array($haystack, $needles) {
if (is_array($needles)) {
foreach ($needles as $str) {
if (is_array($str)) {
$pos = $this->strpos_array($haystack, $str);
} else {
$pos = strpos($haystack, $str);
}
if ($pos !== FALSE) {
return $pos;
}
}
} else {
return strpos($haystack, $needles);
}
return FALSE;
}
private function getTableDefaults($table, $trim_underscore = true) {
$def_val = array();
// TODO: This is ugly and overkill - needs to be cleaned up in dbinterface
if ($table == 'sccpsettings') {
// sccpsettings has a different structure and already have values in $sccpvalues
return $this->sccpvalues;
}
$sccpTableDesc = $this->dbinterface->getSccpDeviceTableData("get_columns_{$table}");
foreach ($sccpTableDesc as $key => $data) {
// function has 2 roles: return actual table keys (trim_underscore = false)
// return sanitised keys to add defaults (trim_underscore = true)
if ($trim_underscore) {
// Remove any leading (or trailing but should be none) underscore
// These are only used to hide fields from chan-sccp for compatibility
$key = trim($key,'_');
}
$def_val[$key] = array("keyword" => $key, "data" => $data['Default'], "seq" => "99");
}
return $def_val;
}
private function getTableEnums($table, $trim_underscore = true) {
$enumFields = array();
$sccpTableDesc = $this->dbinterface->getSccpDeviceTableData("get_columns_{$table}");
foreach ($sccpTableDesc as $key => $data) {
// function has 2 roles: return actual table keys (trim_underscore = false)
// return sanitised keys to add defaults (trim_underscore = true)
if ($trim_underscore) {
// Remove any leading (or trailing but should be none) underscore
// These are only used to hide fields from chan-sccp for compatibility
$key = trim($key,'_');
}
$typeArray = explode('(', $data['Type']);
if ($typeArray[0] == 'enum') {
$enumOptions = explode(',', trim($typeArray[1],')'));
$enumFields[$key] = $enumOptions;
}
}
return $enumFields;
}
private function findAllFiles($searchDir, $file_mask = array(), $mode = 'full') {
$result = array();
if (!is_dir($searchDir)) {
return $result;
}
foreach (array_diff(scandir($searchDir),array('.', '..')) as $value) {
if (is_file("$searchDir/$value")) {
$extFound = '';
$foundFile = true;
if (!empty($file_mask)) {
$foundFile = false;
foreach ($file_mask as $k) {
if (strpos($value, $k) !== false) {
$foundFile = true;
$extFound = $k;
break;
}
}
}
if ($foundFile) {
switch ($mode) {
case 'fileonly':
$result[] = $value;
break;
case 'fileBaseName':
$result[] = basename("/$value", $extFound);
break;
case 'dirFileBaseName':
$result[] = $searchDir . "/" . basename("/$value", $extFound);
break;
default:
$result[] = "$searchDir/$value";
break;
}
}
continue;
}
// Now iterate over sub directories
$sub_find = $this->findAllFiles("$searchDir/$value", $file_mask, $mode);
if (!empty($sub_find)) {
foreach ($sub_find as $sub_value) {
$result[] = $sub_value;
}
}
}
return $result;
}
function is_assoc($array) {
foreach (array_keys($array) as $k => $v) {
if ($k !== $v)
return true;
}
return false;
}
function tftpReadTestFile($remoteFileName, $host = "127.0.0.1")
{
// https://datatracker.ietf.org/doc/html/rfc1350
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
// Set timeout so that do not hang if no data received.
socket_set_option($socket,SOL_SOCKET, SO_RCVTIMEO, array('sec'=>1, 'usec'=>0));
if ($socket) {
$port = 69; // Initial TFTP port. Changed in received packet.
// create the RRQ request packet
$packet = chr(0) . chr(1) . $remoteFileName . chr(0) . 'netascii' . chr(0);
// UDP is connectionless, so we just send it.
socket_sendto($socket, $packet, strlen($packet), MSG_EOR, $host, $port);
$buffer = null;
$port = "";
$ret = "";
// MSG_WAITALL is blocking but socket has timeout set to 1 sec.
$numbytes = socket_recvfrom($socket, $buffer, 84, MSG_WAITALL, $host, $port);
if ($numbytes < 2) {
// socket has timed out before data received.
return false;
}
// unpack the returned buffer and discard the first two bytes.
$pkt = unpack("nopcode/nblockno/a*data", $buffer);
// send ack and close socket.
$packet = chr(4) . chr($pkt["blockno"]);
socket_sendto($socket, $packet, strlen($packet), MSG_EOR, $host, $port);
socket_close($socket);
if ($pkt["opcode"] == 3 && $numbytes) {
return $pkt["data"];
}
}
return false;
}
public function initialiseConfInit(){
$read_config = \FreePBX::LoadConfig()->getConfig('sccp.conf');
$sccp_conf_init['general'] = $read_config['general'];
foreach ($read_config as $key => $value) {
if (isset($read_config[$key]['type'])) { // copy soft key
if ($read_config[$key]['type'] == 'softkeyset') {
$sccp_conf_init[$key] = $read_config[$key];
}
}
}
return $sccp_conf_init;
}
public function checkTftpMapping(){
exec('in.tftpd -V', $tftpInfo);
$info['TFTP Server'] = array('Version' => 'Not Found', 'about' => 'Mapping not available');
if (isset($tftpInfo[0])) {
$tftpInfo = explode(',',$tftpInfo[0]);
$info['TFTP Server'] = array('Version' => $tftpInfo[0], 'about' => 'Mapping not available');
$tftpInfo[1] = trim($tftpInfo[1]);
$this->sccpvalues['tftp_rewrite']['data'] = 'off';
if ($tftpInfo[1] == 'with remap') {
$info['TFTP Server'] = array('Version' => $tftpInfo[0], 'about' => $tftpInfo[1]);
$remoteFileName = ".sccp_manager_remap_probe_sentinel_temp".mt_rand(0, 9999999).".tlzz";
$remoteFileContent = "# This is a test file created by Sccp_Manager. It can be deleted without impact";
$testFtpDir = "{$this->sccpvalues['tftp_path']['data']}/settings";
// write a sentinel to a tftp subdirectory to see if mapping is working
if (is_dir($testFtpDir) && is_writable($testFtpDir)) {
$tempFile = "${testFtpDir}/{$remoteFileName}";
file_put_contents($tempFile, $remoteFileContent);
// try to pull the written file through tftp.
// this way we can determine if mapping is active and using sccp_manager maps
if ($remoteFileContent == $this->tftpReadTestFile($remoteFileName)) {
//found the file and contents are correct
$this->sccpvalues['tftp_rewrite']['data'] = 'pro';
} else {
// Did not find sentinel so mapping not available
$this->sccpvalues['tftp_rewrite']['data'] = 'off';
}
unlink($tempFile);
}
return true;
}
}
return false;
}
// helper function to save xml with proper indentation
public function saveXml($xml, $filename) {
$dom = new \DOMDocument("1.0");
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$dom->loadXML($xml->asXML());
$dom->save($filename);
}
public function getFileListFromProvisioner(string $tftpRootPath) {
$provisionerUrl = "https://github.com/dkgroot/provision_sccp/raw/master/";
// Get master tftpboot directory structure
try {
file_put_contents("{$tftpRootPath}/masterFilesStructure.xml",file_get_contents("{$provisionerUrl}tools/tftpbootFiles.xml"));
} catch (\Exception $e) {
return false;
}
return true;
}
public function getChanSccpSettings() {
// This is a utility function for debug only, and is not used by core code
foreach (array('general','line', 'device') as $section) {
$sysConfig = $this->aminterface->getSCCPConfigMetaData($section);
dbug($sysConfig);
}
unset($sysConfig);
}
public function createDefaultSccpConfig(array $sccpvalues, string $asteriskPath, $conf_init) {
global $cnf_wr;
// Make sccp.conf data
// [general] section
// TODO: Need to review sccpsettings seq numbering, as will speed this up, and remove the need for $permittedSettings.
$cnf_wr = \FreePBX::WriteConfig();
//clear old general settings, and initiate with allow/disallow and permit/deny keys in correct order
$conf_init['general'] = array();
$conf_init['general']['disallow'] = 'all';
$conf_init['general']['allow'] = '';
$conf_init['general']['deny'] = '0.0.0.0/0.0.0.0';
$conf_init['general']['permit'] = '0.0.0.0/0.0.0.0';
// permitted chan-sccp settings array
$permittedSettings = array(
'debug', 'servername', 'keepalive', 'context', 'dateformat', 'bindaddr', 'port', 'secbindaddr', 'secport', 'disallow', 'allow', 'deny', 'permit',
'localnet', 'externip', 'externrefresh', 'firstdigittimeout', 'digittimeout', 'digittimeoutchar', 'recorddigittimeoutchar', 'simulate_enbloc',
'ringtype', 'autoanswer_ring_time', 'autoanswer_tone', 'remotehangup_tone', 'transfer', 'transfer_tone', 'transfer_on_hangup', 'dnd_tone',
'callwaiting_tone', 'callwaiting_interval', 'musicclass', 'language', 'callevents', 'accountcode', 'sccp_tos', 'sccp_cos', 'audio_tos',
'audio_cos', 'video_tos', 'video_cos', 'echocancel', 'silencesuppression', 'earlyrtp', 'dndFeature', 'private', 'mwilamp', 'mwioncall',
'cfwdall', 'cfwdbusy', 'cfwdnoanswer', 'cfwdnoanswer_timeout', 'nat', 'directrtp', 'allowoverlap', 'pickup_modeanswer',
'callhistory_answered_elsewhere', 'amaflags', 'callanswerorder', 'devicetable', 'linetable', 'meetmeopts', 'jbenable', 'jbforce',
'jblog', 'jbmaxsize', 'jbresyncthreshold', 'jbimpl', 'hotline_enabled', 'hotline_extension', 'hotline_context', 'hotline_label', 'fallback',
'backoff_time', 'server_priority');
foreach ($sccpvalues as $key => $value) {
if (!in_array($key, $permittedSettings, true)) {
continue;
}
if ($value['seq'] == 0) {
switch ($key) {
case "allow":
case "disallow":
case "deny":
case "localnet":
case "permit":
$conf_init['general'][$key] = explode(';', $value['data']);
break;
case "devlang":
/*
$lang_data = $this->extconfigs->getExtConfig('sccp_lang', $value['data']);
if (!empty($lang_data)) {
// TODO: will always get here, but lang_data['codepage'] will be empty as not a valid key
$this->sccp_conf_init['general']['phonecodepage'] = $lang_data['codepage'];
}
break;
*/
case "netlang": // Remove Key
case "tftp_path":
case "sccp_compatible": // This is equal to SccpDBmodel
break;
default:
if (!empty($value['data'])) {
$conf_init['general'][$key] = $value['data'];
}
}
}
}
//
// ----- It is a very bad idea to add an external configuration file "sccp_custom.conf" !!!!
// This will complicate solving problems caused by unexpected solutions from users.
//
if (file_exists($asteriskPath . "/sccp_custom.conf")) {
$conf_init['HEADER'] = array(
"; ;",
"; It is a very bad idea to add an external configuration file !!!! ;",
"; This will complicate solving problems caused by unexpected solutions ;",
"; from users. ;",
";--------------------------------------------------------------------------------;",
"#include sccp_custom.conf"
);
}
$cnf_wr->WriteConfig('sccp.conf', $conf_init);
}
public function initVarfromXml() {
if ((array) $this->xml_data) {
foreach ($this->xml_data->xpath('//page_group') as $item) {
foreach ($item->children() as $child) {
$seq = 0;
if (!empty($child['seq'])) {
$seq = (string) $child['seq'];
}
if ($seq < 99) {
if ($child['type'] == 'IE') {
foreach ($child->xpath('input') as $value) {
$tp = 0;
if (empty($value->value)) {
$datav = (string) $value->default;
} else {
$datav = (string) $value->value;
}
if (strtolower($value->type) == 'number') {
$tp = 1;
}
if (empty($this->sccpvalues[(string) $value->name])) {
$this->sccpvalues[(string) $value->name] = array('keyword' => (string) $value->name, 'data' => $datav, 'type' => $tp, 'seq' => $seq, 'systemdefault' => '');
}
}
}
if ($child['type'] == 'IS' || $child['type'] == 'IED') {
if (empty($child->value)) {
$datav = (string) $child->default;
} else {
$datav = (string) $child->value;
}
if (empty($this->sccpvalues[(string) $child->name])) {
$this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq, 'systemdefault' => '');
}
}
if (in_array($child['type'], array('SLD', 'SLS', 'SLT', 'SLNA', 'SLDA', 'SL', 'SLM', 'SLZ', 'SLTZN', 'SLA'))) {
if (empty($child->value)) {
$datav = (string) $child->default;
} else {
$datav = (string) $child->value;
}
if (empty($this->sccpvalues[(string) $child->name])) {
$this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq, 'systemdefault' => '');
}
}
}
}
}
}
}
public function getSipConfig() {
// Only called from sccp_manager class when saving SIP device
$result = array();
$tmp_binds = \FreePBX::Sipsettings()->getBinds();
$if_list = $this->getIpInformation('ip4');
if (!is_array($tmp_binds)) {
// FreePBX has no sip bindings.
die_freepbx(_("SIP server configuration error ! No SIP protocols enabled"));
}
foreach ($tmp_binds as $fpbx_protocol => $fpbx_bind) {
foreach ($fpbx_bind as $protocol_ip => $protocol_port_arr) {
if (empty($protocol_port_arr)) {
continue;
}
if (($protocol_ip == '0.0.0.0') || ($protocol_ip == '[::]')) {
foreach ($if_list as $if_type => $if_data) {
if ($if_data['ip'] == "127.0.0.1") {
continue;
}
if (empty($result[$fpbx_protocol][$if_data['ip']])) {
$result[$fpbx_protocol][$if_data['ip']]= $protocol_port_arr;
} else {
$result[$fpbx_protocol][$if_data['ip']]= array_merge($result[$fpbx_protocol][$if_data['ip']],$protocol_port_arr);
}
$result[$fpbx_protocol][$if_data['ip']]['ip']=$if_data['ip'];
}
} else {
$result[$fpbx_protocol][$protocol_ip]=$protocol_port_arr;
$result[$fpbx_protocol][$protocol_ip]['ip']=$protocol_ip;
}
}
}
if (empty($result)) {
die_freepbx(_("SIP server configuration error ! No SIP protocols enabled"));
}
return $result;
}
}
?>

21
sccpManagerUpdater.json Normal file
View file

@ -0,0 +1,21 @@
{
"rawname": "sccp_manager",
"repo": "stable",
"name": "Sccp Manager",
"version": "14.5.0.4",
"publisher": "Steve Lad",
"license": "GPL",
"licenselink": "http://www.gnu.org/licenses/gpl.txt",
"changelog": "*14.5.0.4* Preserve softkeys across installs. Fix truncated values\n*14.5.0.3* Fix issue 32\n*14.4.0.5* Fix issue 59\n*14.4.0.1* Fix regression in SQL not compatible with MariaDb 5\n*14.4.0.1* Upgrade installer to prevent data loss when run\n*14.3.0.30* Fix issue returning after save\n*14.3.0.28* Fix issue with RNav\n*14.3.0.27* Improve handling of SIP devices\n*14.3.0.15* Install master files list via installer\n*14.2.0.3* Fix module database definition\n*14.2.0.3* Fix module database definition\n*14.2.0.2* First release of new version without old interface\n*13.0.0.1* Packaging of ver 1.0.0.1\n*12.0.0.1* Packaging of ver 1.0.0.1",
"category": "Sccp Connectivity",
"description": "The Sccp Manager module lets you manage the chan-sccp driver.",
"depends": {
"version": "16.0"
},
"supported": {
"version": "15.0"
},
"location": "https://github.com/chan-sccp/sccp_manager/archive/refs/tags/v14.5.0.4.tar.gz",
"md5sum": "80b454d5cfdd602bffeec350e6e76bac",
"packaged": "1643364518"
}

View file

@ -1,42 +1,81 @@
<?php
/* $Id:$ */
/* !TODO!: In an ideal world this should roll back everything the install.php script did, except for what existed before install.php was run */
/* !TODO!: This would require the install.php to make a note of all the actions that were skipped and/or performed */
/* !TODO!: Might be a good idea to create a backup of the database before removing anything */
// !TODO!: -TODO-: I remove only that which is related to the Manager, it is in my opinion not a critical configuration information. This information is partially present in other files.
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
if (!defined('FREEPBX_IS_AUTH')) {
die('No direct script access allowed');
}
global $db;
$version = FreePBX::Config()->get('ASTVERSION');
global $db;
$version = FreePBX::Config()->get('ASTVERSION');
global $sqlTables;
$sqlTables = array('sccpbuttonconfig','sccpdevice','sccpline','sccpuser','sccpsettings','sccpdevmodel');
createBackUpConfig();
echo "dropping table sccpdevmodel..";
sql("DROP TABLE IF EXISTS `sccpdevmodel`");
echo "dropping table sccpsettings..";
sql("DROP TABLE IF EXISTS `sccpsettings`");
if (!empty($version)) {
// Woo, we have a version
$check = $db->getRow("SELECT 1 FROM `kvstore` LIMIT 0", DB_FETCHMODE_ASSOC);
if (!(DB::IsError($check))) {
//print_r("none, creating table :". $value);
echo "Deleting key FROM kvstore..";
sql("DELETE FROM kvstore WHERE module = 'sccpsettings'");
sql("DELETE FROM kvstore WHERE module = 'Sccp_manager'");
}
function createBackUpConfig()
{
global $amp_conf;
global $sqlTables;
outn("<li>" . _("Creating Config BackUp") . "</li>");
$cnf_int = \FreePBX::Config();
$backup_files = array('extensions','extconfig','res_mysql', 'res_config_mysql','sccp','sccp_hardware','sccp_extensions');
$backup_ext = array('_custom.conf', '_additional.conf','.conf');
$dir = $cnf_int->get('ASTETCDIR');
/* Comment: Maybe save in sccpsettings, if the chan_sccp tables already existed in the database or if they were created by install.php */
/* So that you know if it is save to drop/delete them */
/* DROP VIEW `sccpdeviceconfig`;
DROP TABLE `buttonconfig`;
DROP TABLE `sccpdevice`;
DROP TABLE `sccpdevmodel`;
DROP TABLE `sccpline`;
DROP TABLE `sccpsettings`;
*/
}
$sqlTables = array('sccpbuttonconfig','sccpdevice','sccpline','sccpuser','sccpsettings','sccpdevmodel');
$sqlTablesString = implode(' ',$sqlTables);
$sqlBuFile = $dir.'/sccp_backup_'.date("Ymd").'.sql';
$result = exec("mysqldump {$amp_conf['AMPDBNAME']} {$sqlTablesString}
--password={$amp_conf['AMPDBPASS']}
--user={$amp_conf['AMPDBUSER']}
--single-transaction >{$sqlBuFile}");
try {
$zip = new \ZipArchive();
} catch (\Exception $e) {
outn("<br>");
outn("<font color='red'>PHPx.x-zip not installed where x.x is the installed PHP version. Install it before continuing !</font>");
die_freepbx();
}
$filename = $dir . "/sccp_uninstall_backup" . date("Ymd"). ".zip";
if ($zip->open($filename, \ZIPARCHIVE::CREATE)) {
foreach ($backup_files as $file) {
foreach ($backup_ext as $b_ext) {
if (file_exists($dir . '/'.$file . $b_ext)) {
$zip->addFile($dir . '/'.$file . $b_ext);
}
}
}
if (file_exists($sqlBuFile)) {
$zip->addFile($sqlBuFile);
}
$zip->close();
} else {
outn("<li>" . _("Error Creating BackUp: ") . $filename ."</li>");
outn("<br>");
outn("<font color='red'>PHPx.x-zip not installed where x.x is the installed PHP version. Install it before continuing !</font>");
die_freepbx();
}
unlink($sqlBuFile);
outn("<li>" . _("Config backup created: ") . $filename ."</li>");
}
echo "done<br>\n";
if (!empty($version)) {
$check = $db->getRow("SELECT 1 FROM `kvstore` LIMIT 0", DB_FETCHMODE_ASSOC);
if (!(DB::IsError($check))) {
outn("<li>" . _("Deleting keys FROM kvstore..") . "</li>");
sql("DELETE FROM kvstore WHERE module = 'sccpsettings'");
sql("DELETE FROM kvstore WHERE module = 'Sccp_manager'");
}
}
// FreePbx removes all tables via module.xml, and uninstaller will error
// If the tables do not exist.
//outn("<li>" . _('Removing all Sccp_manager tables') . "</li>");
//foreach ($sqlTables as $table) {
//$sql = "DROP TABLE IF EXISTS {$table}";
//}
// Still need to handle views as FreePBX does not know about these.
outn("<li>" . _('Removing all Sccp_manager views') . "</li>");
$db->query("DROP VIEW IF EXISTS sccpdeviceconfig");
outn("<li>" . _("Uninstall Complete") . "</li>");
?>

View file

@ -12,12 +12,12 @@
<div class="display no-border">
<h1><?php echo _("Cisco Dial Template") ?></h1>
<div id="toolbar-sccp-dialtemplate">
<a class="btn btn-default" href="config.php?display=sccp_adv&amp;tech_hardware=dialplan&amp;extdisplay=*new*"><i class="fa fa-plus">&nbsp;</i><?php echo _("Add Dialplan") ?></a>
<a class="btn btn-default" href="config.php?display=sccp_adv&tech_hardware=dialplan&extdisplay=*new*"><i class="fa fa-plus">&nbsp;</i><?php echo _("Add Dialplan") ?></a>
<button id="remove-sccp-dialtemplate" class="btn btn-danger btn-remove" data-type="dialtemplate" data-section="sccp-dialtemplate" disabled>
<i class="glyphicon glyphicon-remove"></i> <span><?php echo _('Delete') ?></span>
</button>
</div>
<table data-cookie="true" data-cookie-id-table="sccp-dialtemplate-table" data-url="ajax.php?module=sccp_manager&amp;command=getDialTemplate" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-dialtemplate" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list-sccp" id="table-sccp-dialtemplate" data-id="id">
<table data-cookie="true" data-cookie-id-table="sccp-dialtemplate-table" data-url="ajax.php?module=sccp_manager&command=getDialTemplate" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-dialtemplate" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list-sccp" id="table-sccp-dialtemplate" data-id="id">
<thead>
<tr>
<!-- <th data-checkbox="true"></th> -->
@ -34,7 +34,9 @@
function DispayDPActionsKeyFormatter(value, row, index) {
var exp_model = '';
exp_model += '<a href="?display=sccp_adv&tech_hardware=dialplan&extdisplay=' + row['id'] + '"><i class="fa fa-pencil"></i></a> &nbsp; &nbsp;\n';
exp_model += '</a> &nbsp;<a class="btn-item-delete" data-for="dialplan" data-id="' + row['id'] + '"><i class="fa fa-trash"></i></a>';
if (row['id'] !== 'dialplan') {
exp_model += '</a> &nbsp;<a class="btn-item-delete" data-for="dialplan" data-id="' + row['id'] + '"><i class="fa fa-trash"></i></a>';
}
return exp_model;
}
</script>
</script>

View file

@ -1,6 +1,6 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
@ -8,7 +8,7 @@
$keymultiselect = array('AllRight' =>'>>', 'Right' => '>', 'AllLeft' => '<<', 'Left' => '<');
// ------------------------------------- Key Set Value ---------------------------------------------------------
$keysetarray = $this->extconfigs->getextConfig('keyset');
$keysetarray = $this->extconfigs->getExtConfig('keyset');
/*$keysetarray1 = array('onhook' => array('redial','newcall','cfwdall','dnd','pickup','gpickup','private'),
'connected' => array('hold','endcall','park','vidmode','select','cfwdall','cfwdbusy','idivert'),
@ -26,59 +26,57 @@ $keysetarray = $this->extconfigs->getextConfig('keyset');
'uriaction' => array('default'));
*/
// ------------------------------------- Key Set Display information ---------------------------------------------------------
$keynamearray = array('onhook' => array(sname => 'ONHOOK', name =>'Display Onhook',help =>'help.'),
'connected' => array(sname => 'CONNECTED', name =>'Display Connected',help =>'help.'),
'onhold' => array(sname => 'ONHOLD', name =>'Display onhold',help =>'help.'),
'ringin' => array(sname => 'RINGIN', name =>'Display ringin',help =>'help.'),
'offhook' => array(sname => 'OFFHOOK', name =>'Display offhook',help =>'help.'),
'conntrans' => array(sname => 'CONNTRANS', name =>'Display conntrans',help =>'help.'),
'digitsfoll' => array(sname => 'DIGITSFOLL', name =>'Display digitsfoll',help =>'help.'),
'connconf' => array(sname => 'CONNCONF', name =>'Display connconf',help =>'help.'),
'ringout' => array(sname => 'RINGOUT', name =>'Display ringout',help =>'help.'),
'offhookfeat'=> array(sname => 'OFFHOOKFEAT', name =>'Display offhookfeat',help =>'help.'),
'onhint' => array(sname => 'ONHINT', name =>'Display onhint',help =>'help.'),
'onstealable'=> array(sname => 'onstealable', name =>'Display onstealable',help =>'help.'),
'holdconf' => array(sname => 'HOLDCONF', name =>'Display holdconf',help =>'help.'),
'uriaction' => array(sname => '', name =>'Display uriaction',help =>'help.')
$keynamearray = array('onhook' => array('sname' => 'ONHOOK', 'name' =>'Display Onhook', 'help' =>'help.'),
'connected' => array('sname' => 'CONNECTED', 'name' =>'Display Connected', 'help' =>'help.'),
'onhold' => array('sname' => 'ONHOLD', 'name' =>'Display onhold', 'help' =>'help.'),
'ringin' => array('sname' => 'RINGIN', 'name' =>'Display ringin', 'help' =>'help.'),
'offhook' => array('sname' => 'OFFHOOK', 'name' =>'Display offhook', 'help' =>'help.'),
'conntrans' => array('sname' => 'CONNTRANS', 'name' =>'Display conntrans', 'help' =>'help.'),
'digitsfoll' => array('sname' => 'DIGITSFOLL', 'name' =>'Display digitsfoll', 'help' =>'help.'),
'connconf' => array('sname' => 'CONNCONF', 'name' =>'Display connconf', 'help' =>'help.'),
'ringout' => array('sname' => 'RINGOUT', 'name' =>'Display ringout', 'help' =>'help.'),
'offhookfeat'=> array('sname' => 'OFFHOOKFEAT', 'name' =>'Display offhookfeat', 'help' =>'help.'),
'onhint' => array('sname' => 'ONHINT', 'name' =>'Display onhint', 'help' =>'help.'),
'onstealable'=> array('sname' => 'onstealable', 'name' =>'Display onstealable', 'help' =>'help.'),
'holdconf' => array('sname' => 'HOLDCONF', 'name' =>'Display holdconf', 'help' =>'help.'),
'uriaction' => array('sname' => '', 'name' =>'Display uriaction', 'help' =>'help.')
);
?>
<form autocomplete="off" name="frm_keyset" id="frm_keyset" class="fpbx-submit" action="" method="post">
<input type="hidden" name="category" value="keysetform">
<input type="hidden" name="Submit" value="Submit">
<div class="fpbx-container container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="display no-border">
<div id="toolbar-all">
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" onclick="load_oncliсk(this,'*new*')" data-target=".edit_new_keyset"><i class="fa fa-bolt"></i> <?php echo _("Add Keyset"); ?></button>
</div>
<table data-cookie="true" data-cookie-id-table="sccp_keyset-all" data-url="ajax.php?module=sccp_manager&amp;command=getSoftKey&amp;type=active" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-all" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list" id="softkey-all" data-unique-id="softkeys">
<thead>
<tr>
<!-- <th data-checkbox="true"></th> -->
<th data-sortable="true" data-field="softkeys"><?php echo _('KeySetName')?></th>
<?php
$i = 0;
foreach ($keynamearray as $key => $value) {
if ($i < 9 ){
echo '<th data-sortable="false" data-field="'.$key.'">'._($value['sname']).'</th>';
}
$i ++;
<div class="fpbx-container container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="display no-border">
<div id="toolbar-all">
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" onclick="load_oncliсk(this,'*new*')" data-target=".edit_new_keyset"><i class="fa fa-bolt"></i> <?php echo _("Add Keyset"); ?></button>
</div>
<table data-cookie="true" data-cookie-id-table="sccp_keyset-all" data-url="ajax.php?module=sccp_manager&command=getSoftKey&type=active" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-all" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list" id="softkey-all" data-unique-id="softkeys">
<thead>
<tr>
<th data-sortable="true" data-field="softkeys"><?php echo _('KeySetName')?></th>
<?php
$i = 0;
foreach ($keynamearray as $key => $value) {
if ($i < 12) {
echo '<th data-sortable="false" data-field="'.$key.'">'._($value['sname']).'</th>';
}
?>
<th data-field="actions" data-formatter="DispayActionsKeyFormatter"><?php echo _('Actions')?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
$i ++;
}
?>
<th data-field="actions" data-formatter="DispayActionsKeyFormatter"><?php echo _('Actions')?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</form>
<!-- Begin Form Input New / Edit -->
@ -90,76 +88,82 @@ $keynamearray = array('onhook' => array(sname => 'ONHOOK', name =>'Display On
<h4 class="modal-title" id="gridSystemModalLabel">Add New KeySet</h4>
</div>
<div class="modal-body">
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="new_keysetname">Name Keyset</label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="new_devmodel"></i>
</div><div class="col-md-9">
<input type="text" maxlength="15" class="form-control" id="new_keySetname" name="new_keySetname" value="SoftKeyset">
</div> </div></div>
<div class="row"><div class="col-md-12">
<span id="new_devmodel-help" class="help-block fpbx-help-block">Help. max len = 15</span>
</div></div></div>
<style type="text/css">
input:invalid {border: red solid 3px;}
</style>
<div class="element-container">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="new_keysetname">Name Keyset</label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="new_devmodel"></i>
</div>
<div class="col-md-9">
<input type="text" maxlength="15" pattern="[a-zA-Z0-9]{4,15}" class="form-control" id="new_keySetname" name="new_keySetname" value="SoftKeyset">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="new_devmodel-help" class="help-block fpbx-help-block">Max length 15 letters or numbers without spaces</span>
</div>
</div>
</div>
<ul class="nav nav-tabs" role="tablist">
<?php
$i = 0;
foreach ($keysetarray as $key => $value) {
if ($i == 0) {
echo '<li role="presentation" data-name="'.$key.'" class="active">';
} else {
echo '<li role="presentation" data-name="'.$key.'" class="change-tab">';
}
echo '<a href="#'.$key.'" aria-controls="'.$key.'" role="tab" data-toggle="tab">'._($key);
echo '</a></li>';
$i ++;
}
?>
</ul>
<div class="tab-content display">
<?php
<?php
$i = 0;
foreach ($keysetarray as $key => $value) {
if ($i == 0) {
echo '<div role="tabpanel" id="'.$key.'" class="tab-pane active">';
} else {
echo '<div role="tabpanel" id="'.$key.'" class="tab-pane">';
}
echo '<div class="element-container"><div class="row"><div class="form-group"><div class="col-md-3"><label class="control-label" for="'.$key.'">'._($keynamearray[$key]['name']).'</label>';
echo '<i class="fa fa-question-circle fpbx-help-icon" data-for="'.$key.'"></i></div>';
echo '<div class="col-md-4"><select multiple class="form-control sccpmultiselect" name="av_'.$key.'" id="source_'.$key.'">';
$row_dada= explode(',', $value);
foreach ($row_dada as $data) {
echo '<option value="'.$data.'">'.$data.'</option>';
}
echo '</select></div><div class="col-md-1">';
foreach ($keymultiselect as $btkey =>$btval) {
echo '<input type="button" class="btnMultiselect" data-id="'.$key.'" data-key="'.$btkey.'" value="'.$btval.'">';
}
echo '</div><div class="col-md-4"><select multiple class="form-control" name="sel_'.$key.'" id="destination_'.$key.'">';
echo '</select></div></div></div><div class="row"><div class="col-md-12">';
echo '<span id="'.$key.'-help" class="help-block fpbx-help-block">'._($keynamearray[$key]['help']).'</span>';
echo '</div></div></div></div>';
$i ++;
}
?>
</div>
foreach ($keysetarray as $key => $value) {
if ($i == 0) {
echo '<li role="presentation" data-name="'.$key.'" class="active">';
} else {
echo '<li role="presentation" data-name="'.$key.'" class="change-tab">';
}
echo '<a href="#'.$key.'" aria-controls="'.$key.'" role="tab" data-toggle="tab">'._($key);
echo '</a></li>';
$i ++;
}
?>
</ul>
<div class="tab-content display">
<?php
$i = 0;
foreach ($keysetarray as $key => $value) {
if ($i == 0) {
echo '<div role="tabpanel" id="'.$key.'" class="tab-pane active">';
} else {
echo '<div role="tabpanel" id="'.$key.'" class="tab-pane">';
}
echo '<div class="element-container"><div class="row"><div class="form-group"><div class="col-md-3"><label class="control-label" for="'.$key.'">'._($keynamearray[$key]['name']).'</label>';
echo '<i class="fa fa-question-circle fpbx-help-icon" data-for="'.$key.'"></i></div>';
echo '<div class="col-md-4"><select multiple class="form-control sccpmultiselect" name="av_'.$key.'" id="source_'.$key.'">';
$row_dada= explode(',', $value);
foreach ($row_dada as $data) {
echo '<option value="'.$data.'">'.$data.'</option>';
}
echo '</select></div><div class="col-md-1">';
foreach ($keymultiselect as $btkey => $btval) {
echo '<input type="button" class="btnMultiselect" data-id="'.$key.'" data-key="'.$btkey.'" value="'.$btval.'">';
}
echo '</div><div class="col-md-4"><select multiple class="form-control" name="sel_'.$key.'" id="destination_'.$key.'">';
echo '</select></div></div></div><div class="row"><div class="col-md-12">';
echo '<span id="'.$key.'-help" class="help-block fpbx-help-block">'._($keynamearray[$key]['help']).'</span>';
echo '</div></div></div></div>';
$i ++;
}
?>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary sccp_update" data-id="keyset_add" data-mode="new" id="keyset_add" data-dismiss="modal">Save</button>
</div>
</div>
</div>
</div>
</div>
<script>
function DispayActionsKeyFormatter(value, row, index) {
var exp_model = '';
@ -169,4 +173,4 @@ $keynamearray = array('onhook' => array(sname => 'ONHOOK', name =>'Display On
}
return exp_model;
}
</script>
</script>

View file

@ -4,7 +4,8 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$requestType = 'firmware';
global $amp_conf;
?>
<div class="fpbx-container container-fluid">
@ -13,12 +14,13 @@
<div class="display no-border">
<div id="toolbar-model">
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target=".add_new_model"><i class="fa fa-bolt"></i> <?php echo _("Add model"); ?></button>
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target=".add_new_model"><i class="fa fa-bolt"></i> <?php echo _("Add model"); ?>
</button>
<button data-id="model_disabled" class="btn btn-danger sccp_update btn-tab-select" data-type="sccp_model" data-table="table-models" disabled data-section="all">
<i class="glyphicon glyphicon-remove"></i> <span><?php echo _('Disabled') ?></span>
<i class="glyphicon glyphicon-remove"></i> <span><?php echo _('Disable') ?></span>
</button>
<button data-id="model_enabled" class="btn btn-danger sccp_update btn-tab-select" data-table="table-models" data-type="sccp_model" disabled data-section="all">
<i class="glyphicon glyphicon-active"></i> <span><?php echo _('Enabled') ?></span>
<i class="glyphicon glyphicon-active"></i> <span><?php echo _('Enable') ?></span>
</button>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
@ -27,12 +29,14 @@
</a>
<ul class="dropdown-menu">
<li><a class="dropitem" data-id="enabled" tabindex="-1" href="#"><span><?php echo _('Show Enabled') ?></span></a></li>
<li><a class="dropitem" data-id="extension" tabindex="-1" href="#"><span><?php echo _('Expansion Module')?></span></a></li>
<li><a class="dropitem" data-id="all" tabindex="-1" href="#"><span><?php echo _('Show All') ?></span></a></li>
<li><a class="dropitem" data-id="extension" tabindex="-1" href="#"><span><?php echo _('Expansion Module')?></span></a></li>
<li><a class="dropitem" data-id="all" tabindex="-1" href="#"><span><?php echo _('Show All') ?></span></a></li>
</ul>
</div>
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target=".get_ext_file_<?php echo $requestType; ?>"><i class="fa fa-bolt"></i> <?php echo _("Update Files from Provisioner"); ?>
</button>
</div>
<table data-cookie="true" data-row-style="SetRowColor" data-cookie-id-table="sccp_model-all" data-url="ajax.php?module=sccp_manager&amp;command=getDeviceModel&amp;type=enabled" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-model" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-condensed" id="table-models" data-id="model" data-unique-id="model">
<table data-cookie="true" data-row-style="SetRowColor" data-cookie-id-table="sccp_model-all" data-url="ajax.php?module=sccp_manager&command=getDeviceModel&type=enabled" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-model" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-condensed" id="table-models" data-id="model" data-unique-id="model">
<thead>
<tr>
<th data-checkbox="true"></th>
@ -41,9 +45,9 @@
<th data-sortable="true" data-field="vendor"><?php echo _('Vendor');?></th>
<th data-sortable="false" data-formatter="DisplayDnsFormatter" data-field="dns"><?php echo _('Expansion Module');?></th>
<th data-sortable="false" data-field="buttons"><?php echo _('Buttons');?></th>
<th data-sortable="false" data-formatter="SetColColorFirm" data-field="loadimage"><?php echo _('Loadimage');?></th>
<th data-sortable="false" data-formatter="SetColFirmNf" data-field="loadimage"><?php echo _('Loadimage');?></th>
<th data-sortable="false" data-field="loadinformationid"><?php echo _('Loadinformation ID');?></th>
<th data-sortable="false" data-formatter="SetColColorTempl" data-field="nametemplate"><?php echo _('Model template');?></th>
<th data-sortable="false" data-formatter="SetColTemplNf" data-field="nametemplate"><?php echo _('Model template');?></th>
<th data-field="actions" data-formatter="DispayActionsModelFormatter"><?php echo _('Actions');?></th>
</tr>
</thead>
@ -60,7 +64,7 @@
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="gridSystemModalLabel"><?php echo _('Modal title');?></h4>
<h4 class="modal-title" id="gridSystemModalLabel"><?php echo _('Add new model');?></h4>
</div>
<div class="modal-body">
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
@ -80,25 +84,24 @@
<input type="text" class="form-control" id="new_vendor" name="new_vendor" value="CISCO">
</div> </div></div>
<div class="row"><div class="col-md-12">
<span id="new_vendor-help" class="help-block fpbx-help-block">Help.</span>
<span id="new_vendor-help" class="help-block fpbx-help-block">Use "CISCO" for the Skinny Client Control Protocol and "CISCO-SIP" for the CISCO Sip Protocol</span>
</div></div></div>
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="new_dns"><?php echo _('Expansion Module');?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="new_dns"></i>
</div><div class="col-md-9">
<select name="new_dns" id="new_dns">
<option value="1">Phone - no sidecars.</option>
<select name="new_dns" id="new_dns">
<option value="1" selected='selected'>Phone - no sidecars.</option>
<option value="2">Phone - one sidecar.</option>
<option value="3">Phone - two sidecars.</option>
<option value="0" selected='selected'>Sidecar</option>
<option value="0">Sidecar</option>
</select>
</div> </div></div>
<div class="row"><div class="col-md-12">
<span id="new_dns-help" class="help-block fpbx-help-block">Help.</span>
</div></div></div>
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="new_buttons"><?php echo _('Model Line Buttons');?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="new_buttons"></i>
@ -108,8 +111,7 @@
<div class="row"><div class="col-md-12">
<span id="new_buttons-help" class="help-block fpbx-help-block">Help.</span>
</div></div></div>
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="new_loadimage"><?php echo _('Load Image');?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="new_loadimage"></i>
@ -129,7 +131,7 @@
<div class="row"><div class="col-md-12">
<span id="new_loadinformationid-help" class="help-block fpbx-help-block">Help.</span>
</div></div></div>
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="new_nametemplate"><?php echo _('Model template XML');?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="new_nametemplate"></i>
@ -142,14 +144,34 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo _('Close');?></button>
<button type="button" class="btn btn-primary sccp_update" data-id="model_add" id="add_new_model" data-dismiss="modal"><?php echo _('Add New model whithout Enabled');?></button>
</div>
<button type="button" class="btn btn-primary sccp_update" data-id="model_add" id="add_new_model" data-dismiss="modal"><?php echo _('Add New model - Disabled');?></button>
</div>
</div>
</div>
</div>
<?php
$selectArray = array();
//below probably unnecessary as installer should ensure that a copy always exists
// TODO: Maybe should always check here to ensure that have latest
if (!file_exists("{$this->sccppath['tftp_path']}/masterFilesStructure.xml")) {
if (!$this->getFileListFromProvisioner($this->sccppath['tftp_path'])) {
// File does not exist and cannot get from internet.
return $result;
};
}
$tftpBootXml = simplexml_load_file("{$this->sccppath['tftp_path']}/masterFilesStructure.xml");
$firmwareDir = $tftpBootXml->xpath("//Directory[@name='firmware']");
foreach ($firmwareDir[0] as $child) {
if (!empty((string)$child['name'])) {
$selectArray[(string)$child['name']] = (string)$child['name'];
}
};
include($amp_conf['AMPWEBROOT'] . '/admin/modules/sccp_manager/views/getFileModal.html');
?>
<div class="modal fade" id="edit_model" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
@ -158,7 +180,6 @@
<h4 class="modal-title" id="gridSystemModalLabel"><?php echo _('Modal title');?></h4>
</div>
<div class="modal-body">
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="editd_model"><?php echo _('Device Model');?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="editd_model"></i>
@ -169,10 +190,44 @@
<span id="editd_model-help" class="help-block fpbx-help-block">Help.</span>
</div></div></div>
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="editd_vendor"><?php echo _('Vendor name');?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="editd_vendor"></i>
</div><div class="col-md-9">
<input type="text" class="form-control" id="editd_vendor" name="editd_vendor" value="CISCO">
</div> </div></div>
<div class="row"><div class="col-md-12">
<span id="editd_vendor-help" class="help-block fpbx-help-block">Use "CISCO" for the Skinny Client Control Protocol and "CISCO-SIP" for the CISCO Sip Protocol</span>
</div></div></div>
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="editd_dns"><?php echo _('Expansion Module');?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="editd_dns"></i>
</div><div class="col-md-9">
<select name="editd_dns" id="editd_dns">
<option value="1" selected='selected'>Phone - no sidecars.</option>
<option value="2">Phone - one sidecar.</option>
<option value="3">Phone - two sidecars.</option>
<option value="0">Sidecar</option>
</select>
</div> </div></div>
<div class="row"><div class="col-md-12">
<span id="editd_dns-help" class="help-block fpbx-help-block">Help.</span>
</div></div></div>
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="editd_buttons"><?php echo _('Model Line Buttons');?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="editd_buttons"></i>
</div><div class="col-md-9">
<input type="number" min="1" min="96" class="form-control" id="editd_buttons" name="editd_buttons" value="1">
</div> </div></div>
<div class="row"><div class="col-md-12">
<span id="editd_buttons-help" class="help-block fpbx-help-block">Help.</span>
</div></div></div>
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="editd_loadimage"><?php echo _('Load Image');?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="edit_devimage"></i>
<i class="fa fa-question-circle fpbx-help-icon" data-for="editd_loadimage"></i>
</div><div class="col-md-9">
<input type="text" class="form-control" id="editd_loadimage" name="editd_loadimage" value="">
</div> </div></div>
@ -180,6 +235,16 @@
<span id="editd_loadimage-help" class="help-block fpbx-help-block">Help.</span>
</div></div></div>
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="editd_loadinformationid"><?php echo _('Load Information ID');?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="editd_loadinformationid"></i>
</div><div class="col-md-9">
<input type="text" class="form-control" id="editd_loadinformationid" name="editd_loadinformationid" value="">
</div> </div></div>
<div class="row"><div class="col-md-12">
<span id="editd_loadinformationid-help" class="help-block fpbx-help-block">Help.</span>
</div></div></div>
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="editd_nametemplate"><?php echo _('Model template XML');?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="editd_nametemplate"></i>
@ -189,13 +254,11 @@
<div class="row"><div class="col-md-12">
<span id="editd_nametemplate-help" class="help-block fpbx-help-block">Help.</span>
</div></div></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo _('Close');?></button>
<button type="button" class="btn btn-primary sccp_update" data-id="model_apply" data-dismiss="modal"><?php echo _('apply');?></button>
</div>
</div>
</div>
</div>
</div>
@ -204,8 +267,8 @@
<script>
function StatusIconFormatter(value, row) {
return (value === '1') ? '<i class="fa fa-check-square-o" style="color:green" title="<?php echo _("Device is enabled")?>"></i>' : '<i class="fa fa-square-o" title="<?php echo _("Device is disabled")?>"></i>';
}
return (value === '1') ? '<i class="fa fa-check-square-o" style="color:green" title="<?php echo _("Device is enabled")?>"></i>' : '<i class="fa fa-square-o" title="<?php echo _("Device is disabled")?>"></i>';
}
function DisplayDnsFormatter(value, row, index) {
var exp_model = ['Expansion Module', 'Not Available', 'One ExpModule', 'Two ExpModule'];
return exp_model[value];
@ -214,7 +277,7 @@
// function DispayInputFormatter(value, row, index) {
// return (value == null) ? '<input class="tabl-edit form-control" name="' + row['model'] + '_template" type="text" value="">' : '<input class="tabl-edit form-control" name="' + row['model'] + '_template" type="text" value="' + value + '">';
// }
function DispayActionsModelFormatter(value, row, index) {
var exp_model = '';
// exp_model += '<a href="#edit_model" class="btn btn-info" onclick="load_model(this, &quot;'+row['model']+'&quot;)" data-toggle="modal"><i class="fa fa-pencil"></i></a>';
@ -223,25 +286,24 @@
return exp_model;
}
function SetColColorFirm(value, row, index) {
function SetColFirmNf(value, row, index) {
if (row['validate'].split(';')[0] === 'no') {
return 'No found '+ value;
return "File not found<br />" + value;
}
return value;
}
function SetColColorTempl(value, row, index) {
function SetColTemplNf(value, row, index) {
if (row['validate'].split(';')[1] === 'no') {
return 'No found ' + value ;
return "File not found<br /> " + value ;
}
return value;
}
function SetRowColor(row, index) {
var tclass = "active";
if (row['enabled'] === 1) {
tclass = (index % 2 === 0) ? "info" : "info";
}
}
if ((row['validate'] === 'yes;yes') || (row['validate'] === 'yes;-')) {
// tclass = (row['enabled'] === '1') ? "danger" : "warning";
} else {
@ -249,7 +311,7 @@
}
return {classes: tclass};
}
function load_model(elmnt,clr) {
// $("#edit_devmodel").text(clr);
var drow = $("#table-models").bootstrapTable('getRowByUniqueId',clr);
@ -259,6 +321,10 @@
document.getElementById("editd_model").value = clr;
document.getElementById("editd_loadimage").value = drow['loadimage'];
document.getElementById("editd_nametemplate").value = drow['nametemplate'];
document.getElementById("editd_loadinformationid").value = drow['loadinformationid'];
document.getElementById("editd_dns").value = drow['dns'];
document.getElementById("editd_vendor").value = drow['vendor'];
document.getElementById("editd_buttons").value = drow['buttons'];
}
}
</script>

View file

@ -4,77 +4,147 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$def_val = null;
$def_val = array();
$dev_id = null;
$dev_new = null;
$device_warning= null;
// Default value from Server setings
//Get default values. Will use these for a new device, and modify for an existing.
$def_val = $this->getTableDefaults('sccpdevice');
$def_val['netlang'] = array("keyword" => 'netlang', "data" => $this->sccpvalues['netlang']['data'], "seq" => "99");
$def_val['devlang'] = array("keyword" => 'devlang', "data" => $this->sccpvalues['devlang']['data'], "seq" => "99");
$def_val['directed_pickup_context'] = array("keyword" => 'directed_pickup_context', "data" => $this->sccpvalues['directed_pickup_context']['data'], "seq" => "99");
if (!empty($_REQUEST['new_id'])) {
// Adding device that is connected but not in database
$dev_id = $_REQUEST['new_id'];
$val = str_replace(array('SEP','ATA','VG'), '', $dev_id);
$val = implode('.',sscanf($val, '%4s%4s%4s')); // Convert to Cisco display Format
$def_val['mac'] = array("keyword" => 'mac', "data" => $val, "seq" => "99");
$val = $_REQUEST['type'];
$def_val['type'] = array("keyword" => 'type', "data" => $val, "seq" => "99");
// Overwrite some specific defaults based on $_REQUEST
$def_val['type'] = array("keyword" => 'type', "data" => $_REQUEST['type'], "seq" => "99");
if (!empty($_REQUEST['addon'])) {
$def_val['addon'] = array("keyword" => 'type', "data" => $_REQUEST['addon'], "seq" => "99");
}
}
if (!empty($_REQUEST['id'])) {
// Editing an existing Device. Overwrite any defaults that are already set for this device.
$dev_id = $_REQUEST['id'];
$dev_new = $dev_id;
$db_res = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
$db_res = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array("id" => $dev_id));
foreach ($db_res as $key => $val) {
if (!empty($val)) {
switch ($key) {
case 'name':
$key = 'mac';
$val = str_replace(array('SEP','ATA','VG'), '', $val);
$val = implode('.',sscanf($val, '%4s%4s%4s')); // Convert to Cisco display Format
case 'phonepersonalization':
$def_val['phonepersonalization'] = array("keyword" => 'phonepersonalization', "data" => $val, "seq" => "99");
break;
case '_hwlang':
$tmpar = explode(":",$val);
$def_val['netlang'] = array("keyword" => 'netlang', "data" => $tmpar[0], "seq" => "99");
$def_val['devlang'] = array("keyword" => 'devlang', "data" => $tmpar[1], "seq" => "99");
default:
// Overwrite existing defaults after checking that data is still valid after schema updates
// Do not strip underscores as these fields are new in the schema and so should be valid.
$enumFields = $this->getTableEnums('sccpdevice', false);
if (array_key_exists($key, $enumFields)){
// This field is (now) an enum. Check the current value is acceptable.
// Quote value as enum values are quoted.
if (in_array("'{$val}'", $enumFields[$key])) {
// The value is valid so will keep
$def_val[$key] = array('keyword' => $key, 'data' => $val, 'seq' => 99);
}
// Do not store value and let defaults apply
break;
}
$def_val[$key] = array("keyword" => $key, "data" => $val, "seq" => "99");
// Need to assign defaultLine as not set in the db.
$def_val['defaultLine'] = $this->dbinterface->getSccpDeviceTableData('getDefaultLine', array('id' => $dev_id))['name'];
break;
// case 'permit':
// case 'deny':
// $def_val[$key . '_net'] = array("keyword" => $key, "data" => before('/', $val), "seq" => "99");
// $key = $key . '_mask';
// $val = after('/', $val);
// break;
}
$def_val[$key] = array("keyword" => $key, "data" => $val, "seq" => "99");
}
}
}
?>
if (!empty($def_val['type'])) {
$tmp_raw = $this->getSccpModelInformation('byid', true, 'all', array('model'=>$def_val['type']));
if (!empty($tmp_raw[0])) {
$tmp_raw = $tmp_raw[0];
}
if (!empty($tmp_raw['validate'])) {
$tmpar = explode(";", $tmp_raw['validate']);
if ($tmpar[0] != 'yes') {
$device_warning['Image'] = array('Device firmware not found : '.$tmp_raw['loadimage']);
}
if ($tmpar[1] != 'yes') {
$device_warning['Template'] = array('Missing device configuration template : '. $tmp_raw['nametemplate']);
}
if (!empty($device_warning)) {
?>
<div class="fpbx-container container-fluid">
<div class="row">
<div class="container">
<h2 style="border:2px solid Tomato;color:Tomato;" >Warning in the SCCP Device</h2>
<div class="table-responsive">
<pre>
<?php
foreach ($device_warning as $key => $value) {
echo '<h3>'.$key.'</h3>';
if (is_array($value)) {
echo '<li>'._(implode('</li><li>', $value)).'</li>';
} else {
echo '<li>'. _($value).'</li>';
}
}
?>
</pre>
</div>
</div>
</div>
</div>
<br>
<?php }
}
} ?>
<form autocomplete="off" name="frm_adddevice" id="frm_adddevice" class="fpbx-submit" action="" method="post" data-id="hw_edit">
<input type="hidden" name="category" value="adddevice_form">
<input type="hidden" name="Submit" value="Submit">
<?php
if (empty($dev_new)){
if (empty($dev_id)) {
echo '<input type="hidden" name="sccp_deviceid" value="new">';
} else {
echo '<input type="hidden" name="sccp_deviceid" value="'.$dev_id.'">';
$val = str_replace(array('SEP','ATA','VG'), '', $dev_id);
$val = implode(':', sscanf($val, '%2s%2s%2s%2s%2s%2s')); // Convert to Cisco display Format
$def_val['mac'] = array("keyword" => 'mac', "data" => $val, "seq" => "99");
echo '<input type="hidden" name="sccp_device_id" value="'.$dev_id.'">';
}
if (empty($dev_id)){
echo $this->ShowGroup('sccp_hw_dev', 1, 'sccp_hw', $def_val);
} else {
echo $this->ShowGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val);
if ($_REQUEST['tech_hardware'] == 'cisco') {
echo '<input type="hidden" name="sccp_device_typeid" value="sccpdevice">';
if (empty($dev_id)) {
echo $this->showGroup('sccp_hw_dev', 1, 'sccp_hw', $def_val);
} else {
echo $this->showGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val);
}
echo $this->showGroup('sccp_hw_dev2', 1, 'sccp_hw', $def_val);
echo $this->showGroup('sccp_hw_dev_advance', 1, 'sccp_hw', $def_val);
echo $this->showGroup('sccp_hw_dev_softkey', 1, 'sccp_hw', $def_val);
// echo $this->showGroup('sccp_hw_dev_pickup', 1, 'sccp_hw', $def_val); This are line properties and does not exist!
echo $this->showGroup('sccp_hw_dev_conference', 1, 'sccp_hw', $def_val);
echo $this->showGroup('sccp_dev_vendor_conf', 1, 'vendorconfig', $def_val);
echo $this->showGroup('sccp_hw_dev_network', 1, 'sccp_hw', $def_val);
} else if ($_REQUEST['tech_hardware'] == 'cisco-sip') {
echo '<input type="hidden" name="sccp_device_typeid" value="sipdevice">';
/*
if (empty($dev_new)) {
echo '<input type="hidden" name="sccp_deviceid" value="new">';
} else {
echo '<input type="hidden" name="sccp_deviceid" value="'.$dev_id.'">';
}
*/
if (empty($dev_id)) {
echo $this->showGroup('sccp_hw_sip_dev', 1, 'sccp_hw', $def_val);
} else {
echo $this->showGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val);
}
echo $this->showGroup('sccp_hw_sip_dev2', 1, 'sccp_hw', $def_val);
echo $this->showGroup('sccp_hw_sip_conf', 1, 'sccp_hw', $def_val);
}
echo $this->ShowGroup('sccp_hw_dev2', 1, 'sccp_hw', $def_val);
echo $this->ShowGroup('sccp_hw_dev_advance', 1, 'sccp_hw', $def_val);
echo $this->ShowGroup('sccp_hw_dev_softkey', 1, 'sccp_hw', $def_val);
echo $this->ShowGroup('sccp_hw_dev_pickup', 1, 'sccp_hw', $def_val);
echo $this->ShowGroup('sccp_hw_dev_conference', 1, 'sccp_hw', $def_val);
echo $this->ShowGroup('sccp_hw_dev_network', 1, 'sccp_hw', $def_val);
?>
?>
</form>

34
views/form.addruser.php Normal file
View file

@ -0,0 +1,34 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$def_val = null;
$dev_id = null;
$dev_new = null;
if (!empty($_REQUEST['ru_id'])) {
$dev_id = $_REQUEST['ru_id'];
$def_val['id'] = array("keyword" => 'id', "data" => $dev_id, "seq" => "99");
$db_res = $this->dbinterface->getSccpDeviceTableData('get_sccpuser', array("id" => $dev_id));
if (!empty($db_res)) {
foreach ($db_res as $key => $val) {
if (!empty($val)) {
$def_val[$key] = array("keyword" => $key, "data" => $val, "seq" => "99");
}
}
}
}
?>
<form autocomplete="off" name="frm_addruser" id="frm_addruser" class="fpbx-submit" action="" method="post" data-id="ruser_edit">
<input type="hidden" name="category" value="addruser_form">
<input type="hidden" name="Submit" value="Submit">
<?php
echo $this->showGroup('sccp_ruser', 1, 'sccp_ru', $def_val);
echo $this->showGroup('sccp_ruser_time', 1, 'sccp_ru', $def_val);
?>
</form>

View file

@ -1,60 +1,57 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$forminfo =array(
array("name"=>"dev_buttons",label=>"Buttons Configuration"),
array("name"=>"button",label=>"Buttons ",help=>"help.")
);
array('name'=>'dev_buttons', 'label'=>'Buttons Configuration'),
array('name'=>'button', 'label'=>'Buttons', 'help'=>'help')
);
//$buttons_type= array("empty","line","service","feature","speeddial");
// "feature","service" -- Add leter !
$buttons_type= array("empty","line","silent","monitor","speeddial","feature","adv.line");
$feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'devstate'=> "Change Status");
$lines_list = $this->dbinterface->get_db_SccpTableData('SccpExtension');
//$hint_list = $this->dbinterface->get_db_SccpTableData('SccpExtension');
$data_sort = Array();
$hint_list1 = $this->get_hint_info();
foreach ($hint_list1 as $key => $value) {
$data_sort[$value['name']] = $key;
if ($_REQUEST['tech_hardware'] === 'cisco') {
$lines_list = $this->dbinterface->getSccpDeviceTableData('SccpExtension');
} else {
$lines_list = $this->dbinterface->getSipTableData('extensionList');
}
ksort($data_sort);
//print_r(count($data_sort));
//print_r(count($hint_list1));
foreach ($data_sort as $key => $value) {
$hint_list[$value] = $hint_list1[$value];
}
//print_r($hint_list);
//ksort($hint_list);
//natsort($hint_list);
$hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ;
$line_id =0;
$max_buttons =56;
$max_buttons =56; //Don't know hardware type so set a maximum. On save, this is set to actual max buttons
$show_buttons =1;
//print_r($hint_list);
if (!empty($_REQUEST['id'])) {
$dev_id = $_REQUEST['id'];
$db_buttons = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id));
$db_device = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
$max_buttons = $db_device['buttons'];
if (!empty($db_device['addon_buttons'])){
$max_buttons += $db_device['addon_buttons'];
$db_buttons = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_buttons', array("id" => $dev_id));
$db_device = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array("id" => $dev_id));
$show_buttons = $db_device['buttons'];
if (!empty($db_device['addon_buttons'])) {
$show_buttons += $db_device['addon_buttons'];
}
$show_buttons = $max_buttons;
//$show_buttons = $max_buttons;
}
if (!empty($_REQUEST['new_id'])) {
$val = $_REQUEST['type'];
$dev_schema = $this-> getSccp_model_information('byid', false, "all", array('model' =>$val));
// $db_device = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $val));
$max_buttons = $dev_schema[0]['buttons'];
$dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val));
// $db_device = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array("id" => $val));
$show_buttons = $dev_schema[0]['buttons'];
if (!empty($_REQUEST['addon'])) {
$val = $_REQUEST['addon'];
$dev_schema = $this-> getSccp_model_information('byid', false, "all", array('model' =>$val));
$max_buttons += $dev_schema[0]['buttons'];
$dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val));
$show_buttons += $dev_schema[0]['buttons'];
}
$show_buttons = $max_buttons;
//$show_buttons = $max_buttons;
}
if (!empty($_REQUEST['ru_id'])) {
$dev_id = $_REQUEST['ru_id'];
$db_buttons = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_buttons', array("id" => $dev_id));
$show_buttons = $max_buttons;
}
?>
@ -62,12 +59,14 @@ if (!empty($_REQUEST['new_id'])) {
<form autocomplete="off" name="frm_editbuttons" id="frm_editbuttons" class="fpbx-submit" action="" method="post" data-id="hw_edit">
<input type="hidden" name="category" value="frm_editbuttons">
<input type="hidden" name="Submit" value="Submit">
<input type="hidden" name="buttonscount" value="<?php echo $max_buttons?>">
<input type="hidden" name="buttonscount" id="buttonscount" value="<?php echo $show_buttons;?>">
<input type="hidden" name="devButtonCnt" id="devButtonCnt" value="<?php echo (!empty($db_device['buttons']))?$db_device['buttons']:0;?>">
<input type="hidden" name="addonCnt" id="addonCnt" value="<?php echo (!empty($db_device['dns']))?$db_device['dns']:0;?>">
<div class="section-title" data-for="<?php echo $forminfo[0]['name'];?>">
<h3><i class="fa fa-minus"></i><?php echo _($forminfo[0]['label']) ?></h3>
</div>
<div class="section" data-id="<?php echo $forminfo[0]['name'];?>">
<div class="row"> <div class="form-group">
<div class="row"> <div class="form-group">
<div class="col-sm-2">
<label class="control-label">Help</label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="frmbuttons"></i>
@ -88,110 +87,109 @@ if (!empty($_REQUEST['new_id'])) {
hold = To be implemented</li><li>transfer = To be implemented</li><li>multiblink = To be implemented</li><li>mobility = To be implemented</li><li>conference = To be implemented</li>
</ui></ui>");?></span>
</div>
</div></div>
<?php
for ($line_id = 0; $line_id <=$max_buttons; $line_id ++){
// print_r($db_buttons[$line_id]);
$show_form_mode = '';
$defaul_tv = (empty($db_buttons[$line_id])) ? "empty": $db_buttons[$line_id]['type'];
$defaul_btn = (empty($db_buttons[$line_id])) ? "": $db_buttons[$line_id]['name'];
$defaul_opt = (empty($db_buttons[$line_id])) ? array(''): explode(',',$db_buttons[$line_id]['options']);
$show_form_mode = $defaul_tv;
$def_hint = ''; // Hint check Box
$def_hint_btn = ''; // Hint Combo Box
$def_silent = '';
$defaul_advline = '';
if (strpos($defaul_btn,'@') >0) {
$defaul_tv = 'adv.line';
$show_form_mode = 'adv.line';
$defaul_btn = strtok($defaul_btn,'@');
$defaul_advline = strtok('@');
}
if ($line_id == 0) {
$show_form_mode = 'line';
}
if (stripos($defaul_btn,'!') >0) {
$defaul_btn = strtok($defaul_btn,'!');
$defaul_tv = 'silent';
$def_silent = 'checked';
}
if ($defaul_tv == "feature") {
$defaul_ftr = $defaul_opt[0];
$defaul_fcod = (empty($defaul_opt[1])) ? '': $defaul_opt[1];
// print_r($defaul_fcod);
}
foreach ($defaul_opt as $data_i) {
if (strpos($data_i,'@')>0) {
$test_btn = strtok($data_i,'@');
$def_hint = 'checked';
$defaul_btn = $data_i;
$def_hint_btn = $data_i;
if ($test_btn == $defaul_opt[0]) {
foreach ($lines_list as $data){
if ($data['name']==$test_btn) {
</div></div>
<?php
for ($line_id = 0; $line_id <$max_buttons; $line_id ++) {
$show_form_mode = '';
$defaul_tv = (empty($db_buttons[$line_id])) ? "empty": $db_buttons[$line_id]['buttontype'];
$defaul_btn = (empty($db_buttons[$line_id])) ? "": $db_buttons[$line_id]['name'];
$defaul_opt = (empty($db_buttons[$line_id])) ? array(''): explode(',', $db_buttons[$line_id]['options']);
$show_form_mode = $defaul_tv;
$def_hint = ''; // Hint check Box
$def_hint_btn = ''; // Hint Combo Box
$def_park = ''; // Hint check Box
$def_silent = '';
$defaul_advline = '';
$defaul_ftr = '';
if (strpos($defaul_btn, '@') >0) {
$defaul_tv = 'adv.line';
$show_form_mode = 'adv.line';
$defaul_btn = strtok($defaul_btn, '@');
$defaul_advline = strtok('@');
}
if ($line_id == 0) {
$show_form_mode = 'line';
}
if (stripos($defaul_btn, '!') >0) {
$defaul_btn = strtok($defaul_btn, '!');
$defaul_tv = 'silent';
$def_silent = 'checked';
}
if ($defaul_tv == "feature") {
$defaul_ftr = $defaul_opt[0];
$defaul_fcod = (empty($defaul_opt[1])) ? '': $defaul_opt[1];
$def_park = (empty($defaul_opt[2])) ? '': 'checked';
// print_r($defaul_opt);
}
foreach ($defaul_opt as $data_i) {
if (strpos($data_i, '@')>0) {
$test_btn = strtok($data_i, '@');
$def_hint = 'checked';
$defaul_btn = $data_i;
$def_hint_btn = $data_i;
if ($test_btn == $defaul_opt[0]) {
foreach ($lines_list as $data) {
if ($data['name']==$test_btn) {
$show_form_mode = 'line';
$defaul_tv = 'monitor';
$defaul_btn = $test_btn;
break;
}
}
}
}
}
}
// print_r($defaul_btn);
// print_r($defaul_opt);
echo '<!-- Begin button :'.$line_id.' -->';
echo '<div class="line_button element-container" '.(($line_id < $show_buttons)?"":"hidden ").'data-id="'.$line_id.'">';
// echo 'Mode : '.$show_form_mode. ' opt: ';
// print_r( $defaul_opt);
}
}
?>
<div class="row"> <div class="form-group">
echo '<!-- Begin button :'.$line_id.' -->';
echo '<div class="line_button element-container" '.(($line_id < $show_buttons)?"":"hidden ").'data-id="'.$line_id.'">';
?>
<div class="row"> <div class="form-group">
<div class="col-sm-2">
<label class="control-label" for="<?php echo $forminfo[1]['name'].$line_id; ?> "><?php echo _($forminfo[1]['label'].$line_id).(($line_id =="0")?' Default ':''); ?></label>
</div>
<div class="col-sm-5">
<div class="col-xs-3">
<!-- Line Type Select -->
<select class="form-control lineselect" data-id="<?php echo $line_id;?>" name="<?php echo $forminfo[1]['name'].$line_id.'_type';?>" >
<?php
if ($line_id == 0) {
echo '<option value="line" selected >DEF LINE</option>';
}else {
foreach ($buttons_type as $data){
$select = (($data == $defaul_tv)?"selected":"");
echo '<option value="'.$data.'" '.$select.' >'.$data.'</option>';
}
}
?>
<select class="form-control buttontype" data-id="<?php echo $line_id;?>" name="<?php echo $forminfo[1]['name'].$line_id.'_type';?>">
<?php
if ($line_id == 0) {
echo '<option value="line" selected >DEF LINE</option>';
} else {
foreach ($buttons_type as $data) {
$select = (($data == $defaul_tv)?"selected":"");
echo '<option value="'.$data.'" '.$select.' >'.$data.'</option>';
}
}
?>
</select>
</div>
<!-- if Line Type = feature Show Futures -->
<div class="col-xs-7">
<select class ="form-control linefeature_<?php echo $line_id.(($show_form_mode=='feature')?'':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_feature';?>" >
<?php
foreach ($feature_list as $fkey => $fval) {
$select = (($fkey == $defaul_ftr)?"selected":"");
echo '<option value="'.$fkey.'" '.$select.' >'.$fval.'</option>';
}
?>
<select data-type="feature" class ="futuretype form-control lineid_<?php echo $line_id.(($show_form_mode=='feature')?'':' hidden');?>" data-id="<?php echo $line_id;?>" name="<?php echo $forminfo[1]['name'].$line_id.'_feature';?>" >
<?php
foreach ($feature_list as $fkey => $fval) {
$select = (($fkey == $defaul_ftr)?"selected":"");
echo '<option value="'.$fkey.'" '.$select.' >'.$fval.'</option>';
}
?>
</select>
<!-- if Line Type = line Show SCCP Num -->
<select class ="form-control lineselect_<?php echo $line_id.(($show_form_mode=='line' || $show_form_mode=='adv.line')?'':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_line';?>" >
<?php
foreach ($lines_list as $data){
$select = (($data['name']==$defaul_btn)?"selected":"");
echo '<option value="'.$data['name'].'" '.$select.' >'.$data['name'].' / '.$data['label'].'</option>';
}
?>
<select data-type='line' class ="form-control lineid_<?php echo $line_id.(($show_form_mode=='line' || $show_form_mode=='adv.line')?'':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_line';?>" id="<?php echo $forminfo[1]['name'].$line_id.'_line';?>">
<?php
foreach ($lines_list as $data) {
$select = (($data['name']==$defaul_btn)?'selected="selected"':"");
echo '<option value="'.$data['name'].'" '.$select.' >'.$data['name'].' / '.$data['label'].'</option>';
}
?>
</select>
<!-- if Line Type = Othe Show Input -->
<div class="linevalue_<?php echo $line_id.(($show_form_mode=='speeddial')? '':' hidden');?>" >
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_input" name="'.$forminfo[1]['name'].$line_id.'_input" placeholder="Name" value="'.$db_buttons[$line_id]['name'].'" >';
<!-- if Line Type = Othe Show Input -->
<div data-type='speeddial' class="lineid_<?php echo $line_id.(($show_form_mode=='speeddial')? '':' hidden');?>" >
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_input" name="'.$forminfo[1]['name'].$line_id.'_input" placeholder="Name" value="'.$db_buttons[$line_id]['name'].'" >';
?>
</div>
</div>
@ -199,63 +197,78 @@ if (!empty($_REQUEST['new_id'])) {
</div>
<div class="col-md-5">
<!-- if Line Type = speeddial Show Hint line -->
<div class="linespeed_<?php echo $line_id.(($show_form_mode=='speeddial')? '':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_hint';?>">
<?php
echo '<div class="col-xs-5">';
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_phone" name="'.$forminfo[1]['name'].$line_id.'_phone" placeholder="Phone" value="'.$defaul_opt[0].'">';
echo '</div><div class="col-xs-2 radioset" data-toggle="buttons">';
echo '<input class="form-control" type="checkbox" name="'.$forminfo[1]['name'].$line_id.'_hint" id="'.$forminfo[1]['name'].$line_id.'_hint" '.$def_hint.' value= "hint">';
echo '<label for="'.$forminfo[1]['name'].$line_id.'_hint">hints</label>';
echo '</div><div class="col-xs-5">';
<div data-type='hintline' class="lineid_<?php echo $line_id.(($show_form_mode=='speeddial')? '':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_hint';?>">
<?php
echo '<div class="col-xs-5">';
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_phone" name="'.$forminfo[1]['name'].$line_id.'_phone" placeholder="Phone" value="'.$defaul_opt[0].'">';
echo '</div><div class="col-xs-2 radioset" data-toggle="buttons">';
echo '<input class="form-control" type="checkbox" name="'.$forminfo[1]['name'].$line_id.'_hint" id="'.$forminfo[1]['name'].$line_id.'_hint" '.$def_hint.' value= "hint">';
echo '<label for="'.$forminfo[1]['name'].$line_id.'_hint">hints</label>';
echo '</div><div class="col-xs-5">';
echo '<select class="form-control" name="'.$forminfo[1]['name'].$line_id.'_hline" >';
foreach ($hint_list as $data){
$select = (($data['hint']==$def_hint_btn)?"selected":"");
echo '<option value="'.$data['hint'].'" '.$select.' >'.$data['name'].' / '.$data['label'].'</option>';
}
echo '</select>';
echo '</div>';
echo '<select class="form-control" name="'.$forminfo[1]['name'].$line_id.'_hline" >';
foreach ($hint_list as $data) {
$select = (($data['key']==$def_hint_btn)?"selected":"");
echo '<option value="'.$data['key'].'" '.$select.' >'.$data['exten'].' / '.$data['label'].'</option>';
}
echo '</select>';
echo '</div>';
?>
</div>
<div class="linefeature_<?php echo $line_id.(($show_form_mode=='feature')? '':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_hint';?>">
<div class="col-xs-5">
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_flabel" name="'.$forminfo[1]['name'].$line_id.'_flabel" placeholder="Display Label" value="'.$db_buttons[$line_id]['name'].'" >';
<!-- if Line Type = feature Show Futures Park -->
<div data-type='feature' class="lineid_<?php echo $line_id.(($show_form_mode=='feature')? '':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_hint';?>">
<div class="col-xs-4">
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_flabel" name="'.$forminfo[1]['name'].$line_id.'_flabel" placeholder="Display Label" value="'.$db_buttons[$line_id]['name'].'" >';
?>
</div>
<div class="col-xs-5">
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_fvalue" name="'.$forminfo[1]['name'].$line_id.'_fvalue" placeholder="code" value="'.$defaul_fcod.'" >';
<div class="col-xs-4">
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_fvalue" name="'.$forminfo[1]['name'].$line_id.'_fvalue" placeholder="code" value="'.$defaul_fcod.'" >';
?>
</div>
</div>
<!-- if Line Type = Advanced Show Hint line -->
<div class="lineadv_<?php echo $line_id.(($show_form_mode=='adv.line')? '':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_hint';?>">
<div data-type='adv_line' class="lineid_<?php echo $line_id.(($show_form_mode=='adv.line')? '':' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_hint';?>">
<div class="col-xs-5">
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_advline" name="'.$forminfo[1]['name'].$line_id.'_advline" placeholder="[+=][01]:[cidname]" value="'.$defaul_advline.'" >';
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_advline" name="'.$forminfo[1]['name'].$line_id.'_advline" placeholder="[+=][01]:[cidname]" value="'.$defaul_advline.'" >';
?>
</div>
<div class="col-xs-5">
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_advopt" name="'.$forminfo[1]['name'].$line_id.'_advopt" placeholder="ButtonLabel,Options" value="'.$db_buttons[$line_id]['options'].'" >';
<?php
echo '<input class="form-control" type="text" id="'.$forminfo[1]['name'].$line_id.'_advopt" name="'.$forminfo[1]['name'].$line_id.'_advopt" placeholder="ButtonLabel,Options" value="'.$db_buttons[$line_id]['options'].'" >';
?>
</div>
</div>
<!-- if Line Type = feature Show Futures Park -->
<div data-type='featurep' class="lineid_<?php echo $line_id.(($show_form_mode=='feature')? (($defaul_ftr=='parkinglot')? ' ':' hidden'):' hidden');?>" name="<?php echo $forminfo[1]['name'].$line_id.'_park';?>">
<div class="col-xs-4">
<div class="radioset" data-toggle="buttons">
<?php
echo '<input class="form-control" type="checkbox" name="'.$forminfo[1]['name'].$line_id.'_retrieve" id="'.$forminfo[1]['name'].$line_id.'_retrieve" '.$def_park.' value="retrieve">';
echo '<label for="'.$forminfo[1]['name'].$line_id.'_retrieve">RetrieveSingle</label>';
?>
</div>
</div>
</div>
</div>
</div></div>
</div>
<?php
<?php
echo '<!-- End button :'.$line_id.' -->';
}
?>
</div>
}
?>
</div>
</form>
<div class="section-butom" data-for="<?php echo $forminfo[0]['name'];?>">
<h3></h3>
</div>

View file

@ -0,0 +1,16 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
?>
<form autocomplete="off" name="frm_advanced" id="frm_adddevice" class="fpbx-submit" action="" method="post" data-id="hw_edit">
<input type="hidden" name="category" value="deviceadvanced_form">
<input type="hidden" name="Submit" value="Submit">
<?php
echo $this->showGroup('sccp_hw_addv_device', 1, 'sccp_hw', $def_val);
?>
</form>

View file

@ -1,12 +1,12 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//$list_data = $this->get_DialPlan('dialplan');
//$list_data = $this->getDialPlan('dialplan');
//print_r($list_data);
//$dialFelds = array('match','timeout','line','rewrite','tone');
//$dialFelds = array('match','timeout','User','rewrite','tone');
@ -16,13 +16,13 @@ if (!empty($_REQUEST['extdisplay'])) {
$dev_id = $_REQUEST['extdisplay'];
}
if ($dev_id != '*new*') {
$list_data= $this->get_DialPlan($dev_id );
$list_data= $this->getDialPlan($dev_id);
$data_s= '';
foreach ($list_data['template'] as $key => $value) {
foreach ($dialFelds as $fld) {
if (isset($value[$fld])) {
$data_s .=(string)$value[$fld];
}
}
$data_s .= '/';
}
$data_s = substr($data_s, 0, -1);
@ -37,12 +37,12 @@ if ($dev_id != '*new*') {
<form autocomplete="off" name="frm_editdialtemplate" id="frm_editbuttons" class="fpbx-submit" action="" method="post" data-id="dial_template">
<input type="hidden" name="idtemplate" value="<?php echo $dev_id;?>">
<input type="hidden" name="idtemplate" value="<?php echo str_replace('dial', '', $dev_id);?>">
<input type="hidden" name="Submit" value="Submit">
<?php
if ($dev_id == '*new*') {
echo $this->ShowGroup('sccp_dp_new_template',0,'sccp_dial',$def_val);
}
<?php
if ($dev_id == '*new*') {
echo $this->showGroup('sccp_dp_new_template', 0, 'sccp_dial', $def_val);
}
?>
<div class="panel panel-default">
@ -73,8 +73,8 @@ if ($dev_id != '*new*') {
</div>
<?php
// echo $this->ShowGroup('sccp_dp_new_template',0,'sccp_dial',$def_val);
echo $this->ShowGroup('sccp_dp_template',0,'sccp_dial',$def_val);
<?php
// echo $this->showGroup('sccp_dp_new_template',0,'sccp_dial',$def_val);
echo $this->showGroup('sccp_dp_template', 0, 'sccp_dial', $def_val);
?>
</form>

View file

@ -1,861 +0,0 @@
<?php
/*
* IE - Text Input
* IED - Text Input Dynamic
* ITED- Input Dynamic Table
* IS - Radio box
* SL - Select element
* SLA - Select element (from - data )
* Input element Select SLD - Date format
* SLZ - Time Zone
* SLZN - Time Zone List
* SLT - TFTP Lang
* SLM - Music on hold
* SLK - System KeySet
* * Input element Select SLS - System Language
* Input element Select SDM - Model List
* SDE - Extension List
* Help elemen HLP - Help Element
*/
$npref = $form_prefix.'_';
$napref = $form_prefix.'-ar_';
if (empty($form_prefix)){
$npref = "sccp_";
$napref ="sccp-ar_";
}
$day_format = array("D.M.Y", "D.M.YA", "Y.M.D", "YA.M.D", "M-D-Y", "M-D-YA", "D-M-Y", "D-M-YA", "Y-M-D", "YA-M-D", "M/D/Y", "M/D/YA",
"D/M/Y", "D/M/YA", "Y/M/D", "YA/M/D", "M/D/Y", "M/D/YA");
$mysql_table = array("sccpdevice","sccpdeviceconfig");
//$time_zone_name = timezone_identifiers_list();
$time_zone = array('-12' => 'GTM -12', '-11' => 'GTM -11', '-10' => 'GTM -10', '-09' => 'GTM -9',
'-08' => 'GTM -8', '-07' => 'GTM -7', '-06' => 'GTM -6', '-05' => 'GTM -5',
'-04' => 'GTM -4', '-03' => 'GTM -3', '-02' => 'GTM -2', '-01' => 'GTM -1',
'00' => 'GTM time', '01' => 'GTM +1', '02' => 'GTM +2', '03' => 'GTM +3',
'04' => 'GTM +4', '05' => 'GTM +5', '06' => 'GTM +6', '07' => 'GTM +7',
'08' => 'GTM +8', '09' => 'GTM +9', '10' => 'GTM +10', '11'=> 'GTM +11', '12' => 'GTM +12');
$time_zone_name = \FreePBX::Sccp_manager()-> extconfigs-> getextConfig('cisco_timezone');
//$time_zone = \FreePBX::Sccp_manager()-> extconfigs-> getextConfig('cisco_time');
//$system_time_zone = \FreePBX::Sccp_manager()->getSysnemTimeZone();
//print_r($metainfo);
if (\FreePBX::Modules()->checkStatus("soundlang")) {
$syslangs = \FreePBX::Soundlang()->getLanguages();
if (!is_array($syslangs)) {
$syslangs = array();
}
}
if (function_exists('music_list')){
$moh_list = music_list();
// $cur = (isset($mohsilence) && $mohsilence != "" ? $mohsilence : 'default');
}
if (!is_array($moh_list)){
$moh_list = array('default');
}
$sofkey_list = \FreePBX::Sccp_manager()-> srvinterface -> sccp_list_keysets();
$model_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWDevice");
$extension_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWextension");
$extension_list[]=array(model=>'NONE', vendor=>'CISCO', dns=>'0');
$items = $itm -> children();
if ($h_show==1) {
$sec_class ='';
if (!empty($items ->class)){
$sec_class = (string)$items ->class;
}
?>
<div class="section-title" data-for="<?php echo $npref.$itm['name'];?>">
<h3><i class="fa fa-minus"></i><?php echo _($items ->label) ?></h3>
</div>
<div class="section <?php echo $sec_class;?>" data-id="<?php echo $npref.$itm['name'];?>">
<?php
}
foreach ($items as $child) {
if (empty($child->help)) {
$child->help = 'Help is not available.';
$child->meta_help = '1';
}
// $child->meta_help = '1'; // Remove comments to see original help !
if ($child['type'] == 'IE') {
$res_input = '';
$res_name = '';
$res_oid = (string)$child->input[0]->name;
$res_id = $npref.$res_oid;
if (!empty($metainfo[$res_oid])){
if ($child->meta_help == '1' || $child->help == 'Help!') {
$child->help = $metainfo[$res_oid]['Description'];
}
}
// --- Add Hiden option
$res_sec_class ='';
if (!empty($child ->class)){
$res_sec_class = (string)$child ->class;
}
if (empty($child->nameseparator)) {
$child->nameseparator = ' / ';
}
$i = 0;
echo '<!-- Begin '.$child->label.' -->';
?>
<div class="element-container">
<div class="row"> <div class="form-group <?php echo $res_sec_class; ?>">
<div class="col-md-3">
<label class="control-label" for="<?php echo $res_id; ?>"><?php echo _($child->label);?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="<?php echo $res_id; ?>"></i>
</div>
<div class="col-md-9">
<?php
foreach ($child->xpath('input') as $value) {
$res_n = (string)$value->name;
$res_name = $npref . $res_n;
if (empty($res_id)) {
$res_id = $res_name;
}
if (!empty($fvalues[$res_n])) {
if (!empty($fvalues[$res_n]['data'])) {
$value->value = $fvalues[$res_n]['data'];
}
}
if (empty($value->value)) {
$value->value = $value->default;
}
if (empty($value->type)) {
$value->type = 'text';
}
if (empty($value->class)) {
$value->class = 'form-control';
}
if ($i > 0) echo $child->nameseparator;
//
echo '<input type="' . $value->type . '" class="' . $value->class . '" id="' . $res_id . '" name="' . $res_name . '" value="' . $value->value.'"';
if (isset($value->options)){
foreach ($value->options ->attributes() as $optkey =>$optval){
echo ' '.$optkey.'="'.$optval.'"';
}
}
if (!empty($value->min)) echo ' min="'.$value->min.'"';
if (!empty($value->max)) echo ' max="'.$value->max.'"';
echo '>';
$i ++;
}
?>
</div>
</div></div>
<div class="row"><div class="col-md-12">
<span id="<?php echo $res_id;?>-help" class="help-block fpbx-help-block"><?php echo _($child->help);?></span>
</div></div>
</div>
<?php
echo '<!-- END '.$child->label.' -->';
}
if ($child['type'] == 'IED') {
$res_input = '';
$res_name = '';
$res_value = '';
$opt_at = array();
$res_n = (string)$child->name;
if (!empty($metainfo[$res_n])){
if ($child->meta_help == '1' || $child->help == 'Help!') {
$child->help = $metainfo[$res_n]['Description'];
}
}
// $res_value
$lnhtm = '';
$res_id = $napref.$child->name;
$i = 0;
$max_row = 255;
if (!empty($child->max_row)) {
$max_row = $child->max_row;
}
if (!empty($fvalues[$res_n])) {
if (!empty($fvalues[$res_n]['data'])) {
$res_value = explode(';', $fvalues[$res_n]['data']);
}
}
if (empty($res_value)) {
$res_value = array((string) $child->default);
// $res_value = explode('/', (string) $child->default);
}
echo '<!-- Begin '.$child->label.' -->';
?>
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="<?php echo $res_id; ?>"><?php echo _($child->label);?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="<?php echo $res_id; ?>"></i>
</div>
<div class="col-md-9">
<?php
if (!empty($child->cbutton)) {
echo '<div class="form-group form-inline">';
foreach ($child->xpath('cbutton') as $value) {
$res_n = $res_id.'[0]['.$value['field'].']';
$res_vf = '';
if ($value['value']=='NONE' && empty($res_value)){
$res_vf = 'active';
}
$ch_key = array_search($value['value'],$res_value);
if ($ch_key !== false) {
unset($res_value[$ch_key]);
$res_vf = 'active';
$res_value = explode(';', implode(';', $res_value));
}
$opt_hide ='';
$opt_class="button-checkbox";
if (!empty($value->option_hide)) {
$opt_class .= " sccp_button_hide";
$opt_hide = ' data-vhide="'.$value->option_hide.'" data-btn="checkbox" data-clhide="'.$value->option_hide['class'].'" ';
}
if (!empty($child->option_show)) {
if (empty($opt_hide)) {
$opt_hide =' class="sccp_button_hide" ';
}
$opt_hide .= ' data-vshow="'.$child->option_show.'" data-clshow="'.$child->option_show['class'].'" ';
}
if (!empty($value->option_disabled)) {
$opt_class .= " sccp_button_disabled";
$opt_hide = ' data-vhide="'.$value->option_disabled.'" data-btn="checkbox" data-clhide="'.$value->option_disabled['class'].'" ';
}
if (!empty($value->class)) {
$opt_class .= " ".(string)$value->class;
}
echo '<span class="'.$opt_class.'"'.$opt_hide.'><button type="button" class="btn '.$res_vf.'" data-color="primary">';
echo '<i class="state-icon '. (($res_vf == 'active')?'glyphicon glyphicon-check"':'glyphicon glyphicon-uncheck'). '"></i> ';
echo $value.'</button><input type="checkbox" name="'. $res_n.'" class="hidden" '. (($res_vf == 'active')?'checked="checked"':'') .'/></span>';
}
echo '</div>';
}
$opt_class = "col-sm-7 ".$res_id."-gr";
if (!empty($child->class)) {
$opt_class .= " ".(string)$child->class;
}
echo '<div class = "'.$opt_class.'">';
foreach ($res_value as $dat_v) {
?>
<div class = "<?php echo $res_id;?> form-group form-inline" data-nextid=<?php echo $i+1;?> >
<?php
$res_vf = explode('/', $dat_v);
$i2 = 0;
foreach ($child->xpath('input') as $value) {
$res_n = $res_id.'['.$i.']['.$value['field'].']';
$fields_id = (string)$value['field'];
$opt_at[$fields_id]['nameseparator']=(string)$value['nameseparator'];
if (!empty($value->class)) {
$opt_at[$fields_id]['class']='form-control ' .(string)$value->class;
}
$opt_at[$fields_id]['nameseparator']=(string)$value['nameseparator'];
echo '<input type="text" name="'. $res_n.'" class="'.$opt_at[$fields_id]['class'].'" value="'.$res_vf[$i2].'"';
if (isset($value->options)){
foreach ($value->options ->attributes() as $optkey =>$optval){
$opt_at[$fields_id]['options'][$optkey]=(string)$optval;
echo ' '.$optkey.'="'.$optval.'"';
}
}
echo '> '.(string)$value['nameseparator'].' ';
$i2 ++;
}
if (!empty($child->add_pluss)) {
echo '<button type="button" class="btn btn-primary btn-lg input-js-add" id="'.$res_id.'-btn" data-id="'.$res_id.'" data-for="'.$res_id.'" data-max="'.$max_row.'"data-json="'.bin2hex(json_encode($opt_at)).'"><i class="fa fa-plus pull-right"></i></button>';
}
echo '</div>';
$i++;
}
?>
</div>
<?php
if (!empty($child->addbutton)) {
echo '<div class = "col-sm-5 '.$res_id.'-gr">';
echo '<input type="button" id="'.$res_id.'-btn" data-id="'.$res_id.'" data-for="'.$res_id.'" data-max="'.$max_row.'"data-json="'.bin2hex(json_encode($opt_at)).'" class="input-js-add" value="'._($child->addbutton).'" />';
echo '</div>';
}
?>
</div>
</div>
</div>
</div>
</div>
<div class="row"><div class="col-md-12">
<span id="<?php echo $res_id;?>-help" class="help-block fpbx-help-block"><?php echo _($child->help);?></span>
</div></div>
</div>
<?php
echo '<!-- END '.$child->label.' -->';
}
if ($child['type'] == 'IS') {
$res_n = (string)$child->name;
$res_id = $npref.$child->name;
if (!empty($metainfo[$res_n])){
if ($child->meta_help == '1' || $child->help == 'Help!') {
$child->help = $metainfo[$res_n]['Description'];
}
}
// --- Add Hiden option
$res_sec_class ='';
if (!empty($child ->class)){
$res_sec_class = (string)$child ->class;
}
echo '<!-- Begin '.$child->label.' -->';
?>
<div class="element-container">
<div class="row"><div class="form-group <?php echo $res_sec_class;?>">
<div class="col-md-3 radioset">
<label class="control-label" for="<?php echo $res_id; ?>"><?php echo _($child->label);?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="<?php echo $res_id; ?>"></i>
</div>
<div class="col-md-9 radioset " data-hide="on">
<?php
$i = 0;
// $res_v = 'no';
$opt_hide = '';
if (empty($child->default)) {
$res_v = 'no';
} else {
$res_v = (string)$child->default;
}
if (!empty($child->value)) {
$res_v = (string)$child->value;
}
if (!empty($fvalues[$res_n])) {
if (!empty($fvalues[$res_n]['data'])) {
$res_v = (string)$fvalues[$res_n]['data'];
}
}
if (!empty($child->option_hide)) {
$opt_hide = ' class="sccp_button_hide" data-vhide="'.$child->option_hide.'" data-clhide="'.$child->option_hide['class'].'" ';
}
if (!empty($child->option_show)) {
if (empty($opt_hide)) {
$opt_hide =' class="sccp_button_hide" ';
}
$opt_hide .= ' data-vshow="'.$child->option_show.'" data-clshow="'.$child->option_show['class'].'" ';
}
foreach ($child->xpath('button') as $value) {
$val_check = (string)$value[@value];
if ($val_check == '' || $val_check == 'NONE' || $val_check == 'none' ) {
$val_check = (((string)$value[@value] == $res_v) ? " checked" : "");
} else {
$val_check = (strtolower((string)$value[@value]) == strtolower($res_v) ? " checked" : "");
}
echo '<input type="radio" name="' . $res_id . '" id="' . $res_id. '_' . $i .'" value="' . $value[@value] . '"' . $val_check . $opt_hide.'>';
echo '<label for="' . $res_id. '_' . $i . '">' . _($value) . '</label>';
$i++;
}
?>
</div>
</div></div>
<div class="row"><div class="col-md-12">
<span id="<?php echo $res_id;?>-help" class="help-block fpbx-help-block"><?php echo _($child->help);?></span>
</div></div>
</div>
<?php
echo '<!-- END '.$child->label.' -->';
}
/*
* Input element Select SLD - Date format
* SLZ - Time Zone
*
* SLM - Music on hold
* SLK - System KeySet
*/
if ($child['type'] == 'SLD' || $child['type'] == 'SLM'|| $child['type'] == 'SLK' ) {
// $value = $child -> select;
$res_n = (string)$child ->name;
$res_id = $npref.$res_n;
if (!empty($metainfo[$res_n])){
if ($child->meta_help == '1' || $child->help == 'Help!') {
$child->help = $metainfo[$res_n]['Description'];
}
}
if (empty($child->class)) {
$child->class = 'form-control';
}
if ($child['type'] == 'SLD') {
$select_opt= $day_format;
}
if ($child['type'] == 'SLM') {
$select_opt= $moh_list;
}
if ($child['type'] == 'SLK') {
$select_opt= $sofkey_list;
}
// if ($child['type'] == 'SLZ') {
// $select_opt= $time_zone;
// }
echo '<!-- Begin '.$child->label.' -->';
?>
<div class="element-container">
<div class="row"> <div class="form-group">
<div class="col-md-3">
<label class="control-label" for="<?php echo $res_id; ?>"><?php echo _($child->label);?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="<?php echo $res_id; ?>"></i>
</div>
<div class="col-md-9"><div class = "lnet form-group form-inline" data-nextid=1> <?php
echo '<select name="'.$res_id.'" class="'. $child->class . '" id="' . $res_id . '">';
if (!empty($fvalues[$res_n])) {
if (!empty($fvalues[$res_n]['data'])) {
$child->value = $fvalues[$res_n]['data'];
}
}
foreach ($select_opt as $key) {
echo '<option value="' . $key . '"';
if ($key == $child->value) {
echo ' selected="selected"';
}
echo '>' . $key . '</option>';
}
?> </select>
</div></div>
</div></div>
<div class="row"><div class="col-md-12">
<span id="<?php echo $res_id;?>-help" class="help-block fpbx-help-block"><?php echo _($child->help);?></span>
</div></div>
</div>
<?php
echo '<!-- END '.$child->label.' -->';
}
/*
* Input element Select SLS - System Language
*/
if ($child['type'] == 'SLS' || $child['type'] == 'SLT' || $child['type'] == 'SLA' || $child['type'] == 'SLZ' || $child['type'] == 'SLZN') {
// $value = $child -> select;
$res_n = (string)$child ->name;
$res_id = $npref.$res_n;
$child->value ='';
if (!empty($metainfo[$res_n])){
if ($child->meta_help == '1' || $child->help == 'Help!') {
$child->help = $metainfo[$res_n]['Description'];
}
}
if ($child['type'] == 'SLS') {
$select_opt= $syslangs;
}
if ($child['type'] == 'SLT') {
$select_opt= $tftp_lang;
}
if ($child['type'] == 'SLZN') {
$select_opt= $time_zone_name;
}
if ($child['type'] == 'SLZ') {
$select_opt= $time_zone;
// $child->value = ($system_time_zone[offset]/60);
}
if ($child['type'] == 'SLA') {
$select_opt ='';
if (!empty($fvalues[$res_n])) {
if (!empty($fvalues[$res_n]['data'])) {
$res_value = explode(';', $fvalues[$res_n]['data']);
}
if (empty($res_value)) {
$res_value = array((string) $child->default);
}
foreach ($res_value as $key) {
$select_opt[$key]= $key;
}
}
}
if (empty($child->class)) {
$child->class = 'form-control';
}
if (!empty($fvalues[$res_n])) {
if (!empty($fvalues[$res_n]['data'])) {
$child->value = $fvalues[$res_n]['data'];
}
}
if (empty($child->value)){
if (!empty($child->default)){
$child->value = $child->default;
}
}
echo '<!-- Begin '.$child->label.' -->';
?>
<div class="element-container">
<div class="row"> <div class="form-group">
<div class="col-md-3">
<label class="control-label" for="<?php echo $res_id; ?>"><?php echo _($child->label);?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="<?php echo $res_id; ?>"></i>
</div>
<div class="col-md-9"> <!-- <div class = "lnet form-group form-inline" data-nextid=1> --> <?php
echo '<select name="'.$res_id.'" class="'. $child->class . '" id="' . $res_id . '">';
foreach ($select_opt as $key => $val) {
if (is_array($val)) {
$opt_key = (isset($val['id'])) ? $val['id'] : $key;
$opt_val = (isset($val['val'])) ? $val['val'] : $val;
} else {
$opt_key = $key;
$opt_val = $val;
}
echo '<option value="' . $opt_key . '"';
if ($opt_key == $child->value) {
echo ' selected="selected"';
}
echo '>' . $opt_val. '</option>';
}
?> </select>
<!-- </div> --> </div>
</div></div>
<div class="row"><div class="col-md-12">
<span id="<?php echo $res_id;?>-help" class="help-block fpbx-help-block"><?php echo _($child->help);?></span>
</div></div>
</div>
<!--END System Language-->
<?php
echo '<!-- END '.$child->label.' -->';
}
/*
* Input element Select
*/
if ($child['type'] == 'SL') {
$res_n = (string)$child->name;
$res_id = $npref.$child->name;
if (!empty($metainfo[$res_n])){
if ($child->meta_help == '1' || $child->help == 'Help!') {
$child->help = $metainfo[$res_n]['Description'];
}
}
if (empty($child ->class)) {
$child->class = 'form-control';
}
echo '<!-- Begin '.$child->label.' -->';
?>
<div class="element-container">
<div class="row"> <div class="form-group">
<div class="col-md-3">
<label class="control-label" for="<?php echo $res_id; ?>"><?php echo _($child->label);?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="<?php echo $res_id; ?>"></i>
</div>
<div class="col-md-9"> <div class = "lnet form-group form-inline" data-nextid=1> <?php
echo '<select name="'.$res_id.'" class="'. $child->class . '" id="' . $res_id . '">';
if (!empty($fvalues[$res_n])) {
if (!empty($fvalues[$res_n]['data'])) {
$child->value = $fvalues[$res_n]['data'];
}
}
foreach ($child->xpath('select') as $value) {
if (!empty($value[@value])) {
$key = $value[@value];
} else {
$key = (string)$value;
}
echo '<option value="' . $key . '"';
if (strtolower((string)$key) == strtolower((string)$child->value)) {
echo ' selected="selected"';
}
echo '>' . (string)$value. '</option>';
}
?> </select>
</div> </div>
</div></div>
<div class="row"><div class="col-md-12">
<span id="<?php echo $res_id;?>-help" class="help-block fpbx-help-block"><?php echo _($child->help);?></span>
</div></div>
</div>
<?php
echo '<!-- END '.$child->label.' -->';
}
/*
* Input element Select SDM - Model List
* SDE - Extension List
*/
if ($child['type'] == 'SDM' || $child['type'] == 'SDE' ) {
// $value = $child -> select;
$res_n = (string)$child ->name;
$res_id = $npref.$res_n;
if (!empty($metainfo[$res_n])){
if ($child->meta_help == '1' || $child->help == 'Help!') {
$child->help = $metainfo[$res_n]['Description'];
}
}
if (empty($child->class)) {
$child->class = 'form-control';
}
if ($child['type'] == 'SDM') {
$select_opt= $model_list;
}
if ($child['type'] == 'SDE') {
$select_opt= $extension_list;
}
echo '<!-- Begin '.$child->label.' -->';
?>
<div class="element-container">
<div class="row"> <div class="form-group">
<div class="col-md-3">
<label class="control-label" for="<?php echo $res_id; ?>"><?php echo _($child->label);?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="<?php echo $res_id; ?>"></i>
</div>
<div class="col-md-9"><div class = "lnet form-group form-inline" data-nextid=1> <?php
echo '<select name="'.$res_id.'" class="'. $child->class . '" id="' . $res_id . '"';
if (isset($child->options)){
foreach ($child->options->attributes() as $optkey =>$optval){
echo ' '.$optkey.'="'.$optval.'"';
}
}
echo '>';
$fld = (string)$child->select['name'];
$flv = (string)$child->select;
$flk = (string)$child->select['dataid'];
$flkv= (string)$child->select['dataval'];
$key = (string)$child->default;
if (!empty($fvalues[$res_n])) {
if (!empty($fvalues[$res_n]['data'])) {
$child->value = $fvalues[$res_n]['data'];
$key = $fvalues[$res_n]['data'];
}
}
foreach ($select_opt as $data) {
echo '<option value="' . $data[$fld] . '"';
if ($key == $data[$fld]) {
echo ' selected="selected"';
}
if (!empty($flk)){
echo ' data-id="'.$data[$flk].'"';
}
if (!empty($flkv)){
echo ' data-val="'.$data[$flkv].'"';
}
echo '>' . $data[$flv] . '</option>';
}
?> </select>
</div></div>
</div></div>
<div class="row"><div class="col-md-12">
<span id="<?php echo $res_id;?>-help" class="help-block fpbx-help-block"><?php echo _($child->help);?></span>
</div></div>
</div>
<?php
echo '<!-- END '.$child->label.' -->';
}
if ($child['type'] == 'ITED') {
$res_input = '';
$res_name = '';
$res_na = (string)$child->name;
// $res_value
$lnhtm = '';
$res_id = $napref.$child->name;
$i = 0;
if (!empty($fvalues[$res_na])) {
if (!empty($fvalues[$res_na]['data'])) {
$res_value = explode(';', $fvalues[$res_na]['data']);
}
}
if (empty($res_value)) {
$res_value = array((string) $child->default);
// $res_value = explode('/', (string) $child->default);
}
echo '<!-- Begin '.$res_id.' -->';
?>
<table class="table table-striped" id="dp-table-<?php echo $res_id;?>">
<?php
foreach ($res_value as $dat_v) {
echo '<tr data-nextid="'.($i+1).'" class="'.$res_id.'" id="'.$res_id.'-row-'.($i).'"> ';
if (!empty($child->label)) {
echo '<td class=""> <div class="input-group">'.$child->label.'</div></td>';
}
$res_vf = explode('/', $dat_v);
$i2 = 0;
foreach ($child->xpath('element') as $value) {
$fields_id = (string)strtolower($value['field']);
$res_n = $res_id.'['.$i.']['.$fields_id.']';
$res_ni = $res_id.'_'.$i.'_'.$fields_id;
$opt_at[$fields_id]['display_prefix']=(string)$value['display_prefix'];
$opt_at[$fields_id]['display_sufix']=(string)$value['display_sufix'];
if (empty($value->options->class)) {
$opt_at[$fields_id]['options']['class']='form-control';
}
$opt_at[$fields_id]['type']=(string)$value['type'];
$res_opt['addon'] ='';
if (isset($value->options)){
foreach ($value->options ->attributes() as $optkey =>$optval){
$opt_at[$fields_id]['options'][$optkey]=(string)$optval;
$res_opt['addon'] .=' '.$optkey.'="'.$optval.'"';
}
}
echo '<td class="">';
$res_opt['inp_st'] = '<div class="input-group"> <span class="input-group-addon" id="basep_'.$res_n.'">'.$opt_at[$fields_id]['display_prefix'].'</span>';
$res_opt['inp_end'] = '<span class="input-group-addon" id="bases_'.$res_n.'">'.$opt_at[$fields_id]['display_sufix'].'</span></div>';
switch ($value['type']){
case 'date':
echo $res_opt['inp_st'].'<input type="date" name="'. $res_n.'" value="'.$res_vf[$i2].'"'.$res_opt['addon']. '>'.$res_opt['inp_end'];
break;
case 'number':
echo $res_opt['inp_st'].'<input type="number" name="'. $res_n.'" value="'.$res_vf[$i2].'"'.$res_opt['addon']. '>'.$res_opt['inp_end'];
break;
case 'input':
echo $res_opt['inp_st'].'<input type="text" name="'. $res_n.'" value="'.$res_vf[$i2].'"'.$res_opt['addon']. '>'.$res_opt['inp_end'];
break;
case 'title':
if ($i > 0 ) {
break;
}
case 'label':
$opt_at[$fields_id]['data'] = (string)$value;
echo '<label '.$res_opt['addon'].' >'.(string)$value.'</label>';
break;
case 'select':
echo $res_opt['inp_st'].'<select name="'.$res_n.'" id="' . $res_n . '"'. $res_opt['addon'].'>';
$opt_at[$fields_id]['data']='';
foreach ($value->xpath('data') as $optselect ){
$opt_at[$fields_id]['data'].= (string)$optselect.';';
echo '<option value="' . $optselect. '"';
if (strtolower((string)$optselect) == strtolower((string)$res_vf[$i2])) {
echo ' selected="selected"';
}
echo '>' . (string)$optselect. '</option>';
}
echo '</select>'.$res_opt['inp_end'];
break;
}
echo '</td>';
$i2 ++;
}
echo '<td><input type="button" id="'.$res_id.'-btn" data-id="'.($i).'" data-for="'.$res_id.'" data-json="'.bin2hex(json_encode($opt_at)).'" class="table-js-add" value="+" />';
if ($i > 0 ) {
echo '<input type="button" id="'.$res_id.'-btndel" data-id="'.($i).'" data-for="'.$res_id.'" class="table-js-del" value="-" />';
}
echo '</td></tr>';
$i++;
}
echo '</table>';
echo '<!-- END '.$res_id.' -->';
}
if ($child['type'] == 'HLP' ) {
$res_n = (string)$child ->name;
$res_id = $npref.$res_n;
if (empty($child->class)) {
$child->class = 'form-control';
}
echo '<!-- Begin '.$child->label.' -->';
?>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-info-circle"></i> <nbsp> <?php echo _($child->label);?>
<a data-toggle="collapse" href="<?php echo '#'.$res_id;?>"><i class="fa fa-plus pull-right"></i></a></h3>
</div>
<div class="panel-body collapse" id="<?php echo $res_id;?>">
<?php
foreach ($child->xpath('element') as $value) {
switch ($value['type']){
case 'p':
case 'h1':
case 'h2':
case 'h3':
case 'h4':
echo '<'.$value['type'].'>'._((string)$value).'</'.$value['type'].'>';
break;
case 'table':
echo '<'.$value['type'].' class="table" >';
foreach ($value->xpath('row') as $trow) {
echo '<tr>';
foreach ($trow->xpath('col') as $tcol) {
echo '<td>'._((string)$tcol).'</td>';
}
echo '</tr>';
}
echo '</'.$value['type'].'>';
break;
}
}
?>
</div>
</div>
<?php
echo '<!-- END '.$child->label.' -->';
}
}
?>
<?php
if ($h_show==1) {
echo '</div>';
}
?>

View file

@ -1,5 +1,4 @@
<div class="element-container"> <div class="row"> <div class="form-group">
<div class="col-md-3"> <label class="control-label" for="ERROR">Error Load form config </label>
<div class="element-container"> <div class="row"> <div class="form-group">
<div class="col-md-3"> <label class="control-label" for="ERROR">Error loadinging form configuration </label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="ERROR"></i>
</div></div></div></div>

113
views/formShowSysDefs.php Normal file
View file

@ -0,0 +1,113 @@
<?php
/*
* IE - Text Input
* IED - Text Input Dynamic
* ITED- Input Dynamic Table
* IS - Radio box
* SL - Select element
* SLA - Select element (from - data )
* Input element Select SLD - Date format
* SLZ - Time Zone
* SLTZN - Time Zone List
* SLT - TFTP Lang
* SLM - Music on hold
* SLK - System KeySet
* * Input element Select SLS - System Language
* Input element Select SDM - Model List
* SDE - Extension List
* Help elemen HLP - Help Element
*/
// This will not work if the field already has the underscore
$npref = $form_prefix.'_';
$napref = $form_prefix.'-ar_';
if (empty($form_prefix)) {
$npref = "sccp_";
$napref ="sccp-ar_";
//} elseif ($form_prefix == 'vendorconfig') {
// $npref = 'vendorconfig';
// $napref = 'vendorconfig-ar';
}
if (empty($fvalues)) {
$fvalues = $sccp_defaults;
}
$items = $itm -> children();
if ($h_show==1) {
$sec_class ='';
if (!empty($items ->class)) {
$sec_class = (string)$items ->class;
}
?>
<div class="section-title" data-for="<?php echo $npref.$itm['name'];?>">
<h3><i class="fa fa-minus"></i><?php echo _($items ->label) ?></h3>
</div>
<div class="section <?php echo $sec_class;?>" data-id="<?php echo $npref.$itm['name'];?>">
<?php
}
foreach ($items as $child) {
$disabledButtons = array();
if (empty($child->help)) {
$child->help = 'Help is not available.';
$child->meta_help = '1';
}
echo "<!-- Begin {$child->label} -->";
switch ($child['type']) {
case 'IE':
\FreePbx::sccp_manager()->formcreate->addElementIE($child, $fvalues, $sccp_defaults,$npref);
break;
case 'IED':
\FreePbx::sccp_manager()->formcreate->addElementIED($child, $fvalues, $sccp_defaults,$npref, $napref);
break;
case 'ISC':
// This is a special case for Provision mode. Set some parameters here and fall through to IS.
$disabledButtons = array('pro' => 'Provision');
if ($sccp_defaults['tftp_rewrite']['data'] == 'pro') {
$disabledButtons = array('off' => 'Off');
}
case 'IS':
\FreePbx::sccp_manager()->formcreate->addElementIS($child, $fvalues, $sccp_defaults,$npref, $disabledButtons);
break;
case 'SLD':
case 'SLM':
case 'SLK':
case 'SLP':
case 'SLS':
case 'SLTD':
case 'SLTN':
case 'SLA':
case 'SLZ':
case 'SL':
\FreePbx::sccp_manager()->formcreate->addElementSL($child, $fvalues, $sccp_defaults,$npref, $installedLangs);
break;
case 'SLDA':
case 'SLNA':
\FreePbx::sccp_manager()->formcreate->addElementSLNA($child, $fvalues, $sccp_defaults,$npref, $installedLangs);
break;
case 'SDM':
case 'SDMS':
case 'SDML':
case 'SDMF':
case 'SDE':
case 'SDD':
\FreePbx::sccp_manager()->formcreate->addElementSD($child, $fvalues, $sccp_defaults,$npref);
break;
case 'ITED':
\FreePbx::sccp_manager()->formcreate->addElementITED($child, $fvalues, $sccp_defaults, $npref, $napref);
break;
case 'HLP':
\FreePbx::sccp_manager()->formcreate->addElementHLP($child, $fvalues, $sccp_defaults,$npref);
break;
case 'SLTZN':
\FreePbx::sccp_manager()->formcreate->addElementSLTZN($child, $fvalues, $sccp_defaults,$npref);
break;
}
echo "<!-- END {$child->label} -->";
}
if ($h_show==1) {
echo '</div>';
}
?>

85
views/getFileModal.html Normal file
View file

@ -0,0 +1,85 @@
<!--Begin modal include-->
<div class="modal fade get_ext_file_<?php echo $requestType;?>" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="gridSystemModalLabel"><?php echo _('Get Files From Provisioner');?></h4>
</div>
<div class="modal-body">
<div class="element-container">
<div class="row">
<div class="col-md-12">
<?php echo "Sccp_Manager will try to download {$requestType} files from Provision_Sccp on GitHub.<br>
This site, dkgroot/provision_sccp, is unrelated to Sccp_Manager, and the files found cannot be warrantied<br>
If you accept this, please select the {$requestType} that you want to try to get files for and then Get Files From Provisioner<br><br>
Please be patient - this may take some time depending on your internet link<br><br>" ?>
</div>
</div>
</div>
<div class="element-container">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="get_model_files"><?php echo _('Fetch Files for');?></label>
<i class="fa fa-question-circle fpbx-help-icon" ></i>
</div>
<div class="col-md-3">
<div class = "lnet form-group form-inline" data-nextid=1>
<?php
switch ($requestType) {
case 'firmware':
echo "<select class='form-control' id='ext_device'>";
break;
case 'locale':
echo "<select class='form-control' id='ext_locale'>";
break;
case 'country':
echo "<select class='form-control' id='ext_country'>";
break;
}
foreach ($selectArray as $key => $val) {
echo "<option value= '{$val}'";
if (($val == 'English_United_Kingdom') || ($val == 'United_Kingdom')) {
echo ' selected="selected"';
}
echo ">{$val}</option>";
}
?>
</select>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="new_model-help" class="help-block fpbx-help-block">Help.</span>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo _('Cancel');?></button>
<button type="button" class="btn btn-primary sccp_get_ext" data-id="get_ext_files" data-type=<?php echo '"'.$requestType.'"';?> onclick="showProgress();" id="get_model_files" data-dismiss="modal"><?php echo _('Get Files from Provisioner');?></button>
</div>
</div>
</div>
</div>
<!--End modal include-->
<!--Start progress modal include-->
<div id="pleaseWaitDialog" class="modal" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1>Getting files .....please wait</h1>
</div>
<div class="modal-body">
<div class="progress">
<div id="progress-bar" class="progress-bar progress-bar-striped progress-bar-animated active" role="progressbar" style="width:0%">
</div>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!--End progress modal include-->

View file

@ -5,7 +5,12 @@
* and open the template in the editor.
*/
// vim: set ai ts=4 sw=4 ft=phtml:
$roming_enable = '';
if (!empty($this->sccpvalues['system_rouminguser'])) {
if ($this->sccpvalues['system_rouminguser']['data'] == 'yes') {
$roming_enable = 'yes';
}
}
?>
<div class="fpbx-container container-fluid">
<div class="row">
@ -13,17 +18,15 @@
<div class="display no-border">
<h1><?php echo _("Extensions (Line)") ?></h1>
<div id="toolbar-sccp-extension">
<a class="btn btn-default" href="config.php?display=extensions&amp;tech_hardware=sccp_custom"><i class="fa fa-plus">&nbsp;</i><?php echo _("Add Extension") ?></a>
<button id="remove-sccp-extension" class="btn btn-danger btn-remove" data-type="extensions" data-section="sccp-extension" disabled>
<i class="glyphicon glyphicon-remove"></i> <span><?php echo _('Delete') ?></span>
</button>
<a class="btn btn-default" href="config.php?display=extensions&tech_hardware=sccp_custom"><i class="fa fa-plus">&nbsp;</i><?php echo _("Add Extension") ?></a>
</div>
<table data-cookie="true" data-cookie-id-table="sccp-extension-table" data-url="ajax.php?module=sccp_manager&amp;command=getExtensionGrid&amp;type=sccp" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-sip" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list-sccp" id="table-sccp-extension" data-id="name">
<table data-cookie="true" data-cookie-id-table="sccp-extension-table" data-url="ajax.php?module=sccp_manager&command=getExtensionGrid&type=extGrid" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-sip" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list-sccp" id="table-sccp-extension" data-id="name">
<thead>
<tr>
<!-- <th data-checkbox="true"></th> -->
<th data-sortable="true" data-field="name"><?php echo _('Extension') ?></th>
<th data-sortable="true" data-field="label"><?php echo _('Display Name') ?></th>
<th data-sortable="true" data-field="mac"><?php echo _('Device') ?></th>
<th data-sortable="true" data-field="line_status" class="text-center"><?php echo _('Status | Active') ?></th>
<th data-field="actions" data-formatter="DispayPhoneActionsKeyFormatter"><?php echo _('Actions') ?></th>
</tr>
</thead>
@ -34,6 +37,14 @@
</div>
<script>
function DispayPhoneActionsKeyFormatter(value, row, index) {
var exp_dev = '';
var rmn_dev = '<?php echo $roming_enable ?>';
exp_dev += '<a href="config.php?display=extensions&amp;extdisplay=' + row['name'] + '"><i class="fa fa-pencil"></i></a> &nbsp;';
exp_dev += '<a class="clickable delete" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>';
if (rmn_dev == 'yes') {
exp_dev += '<a href="config.php?display=sccp_phone&amp;tech_hardware=r_user&amp;ru_id=' + row['name'] + '"><i class="fa fa-bicycle"></i></a> &nbsp;';
}
return exp_dev;
return '<a href="config.php?display=extensions&amp;extdisplay=' + row['name'] + '"><i class="fa fa-pencil"></i></a> &nbsp;<a class="clickable delete" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>';
}
</script>
</script>

View file

@ -12,15 +12,18 @@
<div class="row">
<div class="col-sm-12">
<div class="display no-border">
<h1><?php echo _("Device Phone") ?></h1>
<h1><?php echo _("Device SCCP Phone") ?></h1>
<div id="toolbar-sccp-phone">
<a class="btn btn-default" href="config.php?display=sccp_phone&amp;tech_hardware=cisco"><i class="fa fa-plus">&nbsp;</i><?php echo _("Add Device Phone") ?></a>
<a class="btn btn-default" href="config.php?display=sccp_phone&tech_hardware=cisco"><i class="fa fa-plus">&nbsp;</i><?php echo _("Add Device Phone") ?></a>
<button id="remove-sccp-phone" class="btn btn-danger sccp_update btn-tab-select" data-id="delete_hardware" disabled>
<i class="glyphicon glyphicon-remove"></i> <span><?php echo _('Delete') ?></span>
</button>
<button name="cr_sccp_phone_xml" class="btn sccp_update btn-default" data-id="create-cnf">
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Create CNF') ?></span>
</button>
<button name="update_button_label" class="btn sccp_update btn-default" data-id="update_button_label">
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Update Button label') ?></span>
</button>
<button name="reset_sccp_phone" class="btn sccp_update btn-default" data-id="reset_dev">
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Reset Device') ?></span>
</button>
@ -28,16 +31,19 @@
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Reset Token Device') ?></span>
</button>
</div>
<table data-cookie="true" data-cookie-id-table="sccp-phone" data-url="ajax.php?module=sccp_manager&amp;command=getPhoneGrid&amp;type=sccp" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-sip" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list" id="table-sip" data-id="mac">
<table data-cookie="true" data-cookie-id-table="sccp-phone" data-url="ajax.php?module=sccp_manager&command=getPhoneGrid&type=sccp"
data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-sccp" data-maintain-selected="true"
data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true"
data-search="true" class="table table-striped ext-list" id="table-sccp" data-id="name">
<thead>
<tr>
<th data-checkbox="true"></th>
<th data-sortable="true" data-field="mac"><?php echo _('Device SEP ID') ?></th>
<th data-sortable="true" data-field="description"><?php echo _('Device Descriptions') ?></th>
<th data-sortable="true" data-field="name"><?php echo _('Device ID') ?></th>
<th data-sortable="true" data-field="description"><?php echo _('Device Description') ?></th>
<th data-sortable="true" data-formatter="DispayTypeFormatter" data-field="type"><?php echo _('Device type') ?></th>
<th data-sortable="false" data-field="button" data-formatter="LineFormatter"><?php echo _('Line') ?></th>
<th data-sortable="false" data-field="status"><?php echo _('Status') ?></th>
<th data-sortable="false" data-field="address"><?php echo _('Address') ?></th>
<th data-sortable="true" data-field="button" data-formatter="LineFormatter"><?php echo _('Line') ?></th>
<th data-sortable="true" data-field="status"><?php echo _('Status') ?></th>
<th data-sortable="true" data-field="address"><?php echo _('Address') ?></th>
<th data-field="actions" data-formatter="DispayDeviceActionsKeyFormatter"><?php echo _('Actions') ?></th>
</tr>
</thead>
@ -51,10 +57,15 @@
function DispayTypeFormatter(value, row, index) {
var exp_model = value;
if (row['addon'] !== null ) {
exp_model += ' + ' + row['addon'];
var posd = row['addon'].indexOf(';');
if (posd >0) {
exp_model += ' + 2x ' + row['addon'].substring(0, posd);
} else {
exp_model += ' + ' + row['addon'];
}
}
return exp_model;
}
function DispayDeviceActionsKeyFormatter(value, row, index) {
var exp_model = '';
@ -62,26 +73,28 @@
exp_model += '<a href="?display=sccp_phone&tech_hardware=cisco&new_id=' + row['name'] + '&type='+ row['type'];
if (row['addon'] !== null ) {
exp_model += '&addon='+ row['addon'];
}
}
exp_model += '"><i class="fa fa-pencil"></i></a> &nbsp; &nbsp;\n';
} else {
exp_model += '<a href="?display=sccp_phone&tech_hardware=cisco&id=' + row['name'] + '"><i class="fa fa-pencil"></i></a> &nbsp; &nbsp;\n';
exp_model += '</a> &nbsp;<a class="btn-item-delete" data-for="hardware" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>';
}
return exp_model;
}
}
function LineFormatter(value, row, index) {
var data = value.split(";");
if (value === null) {
return '-- EMPTY --';
}
var data = value.split(";");
result = '';
for (var i = 0; i < data.length; i++) {
var val = data[i].split(',');
if (val[0] === 'line') {
var val = data[i].split(',');
if (val[0] === 'line') {
result = result + val[1] + '<br>';
}
}
}
}
return result;
}
</script>
</script>

View file

@ -1,23 +1,33 @@
<div id="toolbar-sccpbnav">
<a href="config.php?display=sccp_phone#sccpdevice" class = "btn btn-default"><i class="fa fa-list"></i>&nbsp;<?php echo _("List Device")?></a>
<a href="config.php?display=sccp_phone&amp;tech_hardware=cisco" class = "btn btn-default"><i class="fa fa-plus"></i>&nbsp;<?php echo _("Add Device")?></a>
<div id="toolbar-sccp-rnav">
<a class="btn btn-default" href="config.php?display=sccp_phone#sccpdevice">
<i class="fa fa-list"></i>&nbsp;
<?php echo _("List Device")?>
</a>
<a class="btn btn-default" href="config.php?display=sccp_phone&tech_hardware=cisco">
<i class="fa fa-plus">&nbsp;</i>
<?php echo _("Add Device")?>
</a>
</div>
<table id="sccpnavgrid"
data-search="true"
data-toolbar="#toolbar-sccpnav"
data-url="ajax.php?module=sccp_manager&amp;command=getPhoneGrid&amp;type=sccp"
data-cache="false"
data-toggle="table"
class="table">
<thead>
<tr>
<th data-sortable="true" data-field="mac"><?php echo _('SEP ID') ?></th>
<th data-sortable="true" data-field="description"><?php echo _('Descriptions') ?></th>
</tr>
</thead>
data-search="true"
data-toolbar="#toolbar-sccp-rnav"
data-url="ajax.php?module=sccp_manager&command=getPhoneGrid&type=sccp"
data-cache="false"
data-toggle="table"
class="table">
<thead>
<tr>
<th data-sortable="true" data-field="name"><?php echo _('SEP ID')?></th>
<th data-sortable="true" data-field="description"><?php echo _('Descriptions')?></th>
</tr>
</thead>
</table>
<script type="text/javascript">
$("#sccpnavgrid").on('click-row.bs.table',function(e,row,elem){
window.location = '?display=sccp_phone&tech_hardware=cisco&id='+row['mac'];
})
$("#sccpnavgrid").on('click-row.bs.table',function(e,row,elem){
if (row['new_hw'] == 'Y' ) {
window.location = '?display=sccp_phone&tech_hardware=cisco&new_id=' +row['name'] +'&' +row['type'];
} else {
window.location = '?display=sccp_phone&tech_hardware=cisco&id='+row['name'];
};
})
</script>

92
views/hardware.sphone.php Normal file
View file

@ -0,0 +1,92 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// vim: set ai ts=4 sw=4 ft=phtml:
?>
<div class="fpbx-container container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="display no-border">
<h1><?php echo _("Device SIP Phone") ?></h1>
<div id="toolbar-sccp-sphone">
<a class="btn btn-default" href="config.php?display=sccp_phone&tech_hardware=cisco-sip"><i class="fa fa-plus">&nbsp;</i><?php echo _("Add Device Phone") ?></a>
<button id="remove-sccp-sphone" class="btn btn-danger sccp_update btn-tab-select" data-id="delete_hardware" disabled>
<i class="glyphicon glyphicon-remove"></i> <span><?php echo _('Delete') ?></span>
</button>
<button name="cr_sip_phone_xml" class="btn sccp_update btn-default" data-id="create-cnf">
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Create CNF') ?></span>
</button>
</div>
<table data-cookie="true" data-cookie-id-table="sccp-sphone" data-url="ajax.php?module=sccp_manager&command=getPhoneGrid&type=cisco-sip"
data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-sip" data-maintain-selected="true"
data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true"
data-search="true" class="table table-striped ext-list" id="table-sip" data-id="name">
<thead>
<tr>
<th data-checkbox="true"></th>
<th data-sortable="true" data-field="name"><?php echo _('Device ID') ?></th>
<th data-sortable="true" data-field="description"><?php echo _('Device Description') ?></th>
<th data-sortable="true" data-formatter="DispayTypeFormatter" data-field="type"><?php echo _('Device type') ?></th>
<th data-sortable="true" data-field="button" data-formatter="LineFormatter"><?php echo _('Line') ?></th>
<th data-sortable="true" data-field="status"><?php echo _('Status') ?></th>
<th data-sortable="true" data-field="address"><?php echo _('Address') ?></th>
<th data-field="actions" data-formatter="DispayDeviceActionsKeyFormatterS"><?php echo _('Actions') ?></th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<script>
function DispayTypeFormatter(value, row, index) {
var exp_model = value;
if (row['addon'] !== null ) {
var posd = row['addon'].indexOf(';');
if (posd >0) {
exp_model += ' + 2x ' + row['addon'].substring(0, posd);
} else {
exp_model += ' + ' + row['addon'];
}
}
return exp_model;
}
function DispayDeviceActionsKeyFormatterS(value, row, index) {
var exp_model = '';
if (row['new_hw'] == "Y") {
exp_model += '<a href="?display=sccp_phone&tech_hardware=cisco-sip&new_id=' + row['name'] + '&type='+ row['type'];
if (row['addon'] !== null ) {
exp_model += '&addon='+ row['addon'];
}
exp_model += '"><i class="fa fa-pencil"></i></a> &nbsp; &nbsp;\n';
} else {
exp_model += '<a href="?display=sccp_phone&tech_hardware=cisco-sip&id=' + row['name'] + '"><i class="fa fa-pencil"></i></a> &nbsp; &nbsp;\n';
exp_model += '</a> &nbsp;<a class="btn-item-delete" data-for="hardware" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>';
}
return exp_model;
}
function LineFormatter(value, row, index) {
if (value === null) {
return '-- EMPTY --';
}
var data = value.split(";");
result = '';
for (var i = 0; i < data.length; i++) {
var val = data[i].split(',');
if (val[0] === 'line') {
result = result + val[1] + '<br>';
}
}
return result;
}
</script>

View file

@ -1,6 +1,6 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
@ -9,11 +9,15 @@
<form autocomplete="off" name="frm_advanced" id="frm_ntp" class="fpbx-submit" action="" method="post">
<input type="hidden" name="category" value="advancedform">
<input type="hidden" name="Submit" value="Submit">
<?php
echo $this->ShowGroup('sccp_srst',1);
// echo $this->ShowGroup('sccp_dev_time',1);
?>
<?php
// originally, this was populated by sccpgeneral.xml but that should be static
// now will populate from the db defaults.
$defaultVals = $this->getTableDefaults('sccpdevice', true);
echo $this->showGroup('sccp_srst', 1);
echo $this->showGroup('sccp_dev_vendor_conf', 1, 'sccpdevice', $defaultVals);
?>
</form>

View file

@ -1,51 +1,62 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$def_val = null;
$dev_id = null;
$sccp_codec = $this->getCodecs('audio', true);
$sccp_disalow_def = $this->extconfigs->getextConfig('sccpDefaults','disallow');
$sccp_disalow = $sccp_disalow_def;
$audio_codecs = $this->getCodecs('audio');
$video_codecs = $this->getCodecs('video');
$sccp_disallow_def = $this->sccpvalues['disallow']['data'];
$sys_disallow_def = $this->sccpvalues['disallow']['systemdefault'];
if (!empty($_REQUEST['id'])) {
$dev_id = $_REQUEST['id'];
$db_res = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
if (!empty($db_res['allow'])) {
$i = 1;
foreach(explode(';', $db_res['allow']) as $c){
$codec_list[$c] = $i;
$i ++;
}
foreach ($sccp_codec as $c => $v) {
if (!isset($codec_list[$c])) {
$codec_list[$c] = false;
}
}
}
if (!empty($db_res['disallow'])) {
$sccp_disalow = $db_res['disallow'];
}
} else {
$codec_list = $sccp_codec;
if (empty($sccp_disallow_def)) {
$sccp_disallow_def = $sys_disallow_def;
}
?>
<!-- Codec selection is at the line level - this page sets site defaults based on chan-sccp defaults -->
<form autocomplete="off" name="frm_codec" id="frm_codec" class="fpbx-submit" action="" method="post">
<input type="hidden" name="category" value="codecform">
<input type="hidden" name="Submit" value="Submit">
<div class="section" data-id="sccp_dcodecs">
<!--Codec disallow-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="sccp_disallow"><?php echo _("Disallow") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="sccp_disallow"></i>
</div>
<div class="col-md-9 radioset">
<input id="sccp_disallow" type="text" name="sccp_disallow" value="<?php echo $sccp_disallow_def ?>">
<label for="sccp_disallow"><?php echo _("Recomended default: all") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="sccp_disallow-help" class="help-block fpbx-help-block"><?php echo _("Default : all. If you wish to change (Not Recommended) please enter a semicolon separated list for example: alaw;ulaw;...") ?></span>
</div>
</div>
</div>
<!--END Codec disallow-->
</div>
<!--SCCP Audio Codecs-->
<div class="section-title" data-for="sccp_acodecs">
<h3><i class="fa fa-minus"></i><?php echo _("SCCP Codecs") ?></h3>
<h3><i class="fa fa-minus"></i><?php echo _("SCCP Audio Codecs ") ?></h3>
</div>
<div class="section" data-id="sccp_acodecs">
<!--Codecs-->
<div class="element-container">
@ -54,24 +65,29 @@ if (!empty($_REQUEST['id'])) {
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="codecw"><?php echo _("SCCP Audio Codecs (allow)") ?></label>
<label class="control-label" for="codecw"><?php echo _("Allow") ?></label>
</div>
<div class="col-md-9">
<div>
<?php echo show_help(_("This is the default Codec setting for SCCP Device.")) ?>
<?php echo show_help(_("These are the default audio codec settings for this site. Unchecked codecs cannot be assigned to extensions.
<br>Order can be changed by dragging and dropping to indicate priority. This priority applies for all extensions
<br>Higher priority enabled codecs are at the top
<br>Precedence for ulaw and alaw, if used, should be set according to your region
<br>If your region uses alaw, it is important that alaw has the highest priority
<br>To return to chan-sccp defaults, uncheck ALL codecs (both Audio and Video)."),"Helpful information",true) ?>
</div>
<?php
$seq = 1;
echo '<ul class="sortable">';
foreach ($codec_list as $codec => $codec_state) {
foreach ($audio_codecs as $codec => $codec_state) {
$codec_trans = _($codec);
$codec_checked = $codec_state ? 'checked' : '';
echo '<li><a href="#">'
. '<img src="assets/sipsettings/images/arrow_up_down.png" height="16" width="16" border="0" alt="move" style="float:none; margin-left:-6px; margin-bottom:-3px;cursor:move" /> '
. '<input type="checkbox" '
. ($codec_checked ? 'value="' . $seq++ . '" ' : '')
. 'name="voicecodecs[' . $codec . ']" '
. 'name="audiocodecs[' . $codec . ']" '
. 'id="' . $codec . '" '
. 'class="audio-codecs" '
. $codec_checked
@ -90,36 +106,57 @@ if (!empty($_REQUEST['id'])) {
</div>
<!--END Codecs-->
</div>
<!--END SCCP Audio Codecs-->
<!--Codec disallow-->
<!--SCCP Video Codecs-->
<div class="section-title" data-for="sccp_vcodecs">
<h3><i class="fa fa-minus"></i><?php echo _("SCCP Video Codecs ") ?></h3>
</div>
<div class="section" data-id="sccp_vcodecs">
<!--Codecs-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="sccp_disallow"><?php echo _("Codec Disallow") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="sccp_disallow"></i>
<label class="control-label" for="codecw"><?php echo _("Allow") ?></label>
</div>
<div class="col-md-9 radioset">
<input id="sccp_disallow" type="text" name="sccp_disallow" value="<?php echo $sccp_disalow ?>">
<label for="sccp_disallow"><?php echo _("default : " . $sccp_disalow_def) ?></label>
<div class="col-md-9">
<div>
<?php echo show_help(_("These are the default video codec settings for this site.")) ?>
</div>
<?php
$seq = 1;
echo '<ul class="sortable">';
// Although classed as video codecs, all stored under allow so name is audiocodecs.
foreach ($video_codecs as $codec => $codec_state) {
$codec_trans = _($codec);
$codec_checked = $codec_state ? 'checked' : '';
echo '<li><a href="#">'
. '<img src="assets/sipsettings/images/arrow_up_down.png" height="16" width="16" border="0" alt="move" style="float:none; margin-left:-6px; margin-bottom:-3px;cursor:move" /> '
. '<input type="checkbox" '
. ($codec_checked ? 'value="' . $seq++ . '" ' : '')
. 'name="audiocodecs[' . $codec . ']" '
. 'id="' . $codec . '" '
. 'class="video-codecs" '
. $codec_checked
. ' />'
. '&nbsp;&nbsp;<label for="' . $codec . '"> '
. '<small>' . $codec_trans . '</small>'
. " </label></a></li>\n";
}
echo '</ul>';
?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="sccp_disallow-help" class="help-block fpbx-help-block"><?php echo _("Defaut : all. Plz eneter format: alaw,ulaw") ?></span>
</div>
</div>
<!--END Codecs-->
</div>
<!--END Codec disallow-->
<!--END SCCP Audio Codecs-->
<!--END SCCP Video Codecs-->
</div>
</form>

View file

@ -1,6 +1,6 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
@ -12,8 +12,8 @@
<?php
echo $this->ShowGroup('sccp_dev_ntp',1);
echo $this->ShowGroup('sccp_dev_time',1);
echo $this->showGroup('sccp_dev_ntp', 1);
echo $this->showGroup('sccp_dev_time', 1);
?>
</form>

View file

@ -1,32 +1,33 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
$data = 'none;';
foreach ($this->get_DialPlanList() as $value) {
$data .= $value['id'].';';
}
if (strlen($data) >0 ){
$data = substr ($data,0,-1);
}
$this->sccpvalues['dial_template'] = array('keyword' => 'dial_template', 'data' => $data, 'type' => '10', 'seq' => '90');
*
*/
?>
<form autocomplete="off" name="frm_device" id="frm_device" class="fpbx-submit" action="" method="post">
<input type="hidden" name="category" value="deviceform">
<input type="hidden" name="Submit" value="Submit">
<div class="fpbx-container container-fluid">
<div class="row">
<div class="container">
<h2 style="border:2px solid Tomato;color:Tomato;" ><?php echo _("Warning : Any changes to the device configuration can cause all phones to restart.<br>It is important to read the information on hotline below before using this capability"); ?></h2>
</div>
</div>
</div>
<?php
echo $this->ShowGroup('sccp_dev_config',1);
echo $this->ShowGroup('sccp_dev_group_config',1);
echo $this->ShowGroup('sccp_dev_advconfig',1);
echo $this->ShowGroup('sccp_dev_softkey',1);
echo $this->ShowGroup('sccp_dev_url',1);
echo $this->ShowGroup('sccp_hotline_config',1);
?>
$def_val_line = $this->getTableDefaults('sccpline');
$def_val_device = $this->getTableDefaults('sccpdevice');
//echo $this->showGroup('sccp_dev_config', 1, 'sccpdevice', $def_val_device);
echo $this->showGroup('sccp_dev_config', 1);
echo $this->showGroup('sccp_dev_group_config', 1);
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);
?>
</form>

View file

@ -4,138 +4,209 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// vim: set ai ts=4 sw=4 ft=phtml:
// print_r($this->sccp_conf_init);
// print_r($this->sccpvalues);
//print_r('<br><br>');
$test_ami = 0;
$test_any = 0;
global $amp_conf;
$driver = $this->FreePBX->Core->getAllDriversInfo();
$core = $this->srvinterface->getSCCPVersion();
$ast_realtime = $this->srvinterface->sccp_realtime_status();
$core = $this->aminterface->getSCCPVersion();
$ast_realtime = $this->aminterface->getRealTimeStatus();
$ast_realm = (empty($ast_realtime['sccp']) ? '':'sccp');
//$ast_realm = (empty($ast_realtime['sccp']) ? '' : 'sccp');
// if there are multiple connections, this will only return the first.
foreach ($ast_realtime as $key => $value) {
if (empty($ast_realm)) {
if ($value['status'] == 'OK') {
$ast_realm = $key;
}
if ($value['status'] === 'OK') {
$ast_realm = $key;
}
}
}
$conf_realtime = $this->extconfigs->validate_RealTime($ast_realm);
$db_Schema = $this->dbinterface->validate();
$mysql_info = $this->dbinterface->get_db_sysvalues();
$compatible = $this->aminterface->get_compatible_sccp();
$info = array();
$info['srvinterface'] = $this->srvinterface->info();
//$info['srvinterface'] = $this->srvinterface->info();
$moduleXml = simplexml_load_file("{$amp_conf['AMPWEBROOT']}/admin/modules/sccp_manager/module.xml");
$info['extconfigs'] = $this->extconfigs->info();
$info['dbinterface'] = $this->dbinterface->info();
$db_Schema = $this->dbinterface->validate();
$info['aminterface'] = $this->aminterface->info();
$info['XML'] = $this->xmlinterface->info();
$info['sccp_class'] = $driver['sccp'];
$info['Core_sccp'] = array('Version' => $core['Version'], 'about'=> 'Sccp ver.'. $core['Version'].' r'.$core['vCode']. ' Revision :'. $core['RevisionNum']. ' Hash :'. $core['RevisionHash']);
$info['Asterisk'] = array('Version' => FreePBX::Config()->get('ASTVERSION'), 'about'=> 'Asterisk.');
$info['Core_sccp'] = array('Version' => $core['Version'],
'about' => "Sccp ver: {$core['Version']} r{$core['vCode']} Revision: {$core['RevisionNum']} Hash: {$core['RevisionHash']}");
$capabilityArray = array( "park", "pickup", "realtime", "video", "conference", "dirtrfr", "feature_monitor", "functions", "manager_events",
"devicestate", "devstate_feature", "dynamic_speeddial", "dynamic_speeddial_cid", "experimental", "debug");
$info['chan-sccp build info'] = array('Version' => $core['Version'], 'about' => 'Following options NOT built: ' . implode('; ',array_diff($capabilityArray, $core['buildInfo'])));
$info['Asterisk'] = array('Version' => FreePBX::Config()->get('ASTVERSION'), 'about' => 'Asterisk.');
if (!empty($this->sccpvalues['SccpDBmodel'])) {
$info['DB Model'] = array('Version' => $this->sccpvalues['SccpDBmodel']['data'], 'about'=> 'SCCP DB Configure');
$info['DB Model'] = array('Version' => $this->sccpvalues['SccpDBmodel']['data'], 'about' => 'SCCP DB Configure');
}
if (!empty($this->sccpvalues['tftp_rewrite'])) {
if ($this->sccpvalues['tftp_rewrite']['data'] == 'pro') {
$info['Provision_SCCP'] = array('Version' => 'base', 'about'=> 'Provision Sccp enabled');
} else {
$info['TFTP_Rewrite'] = array('Version' => 'base', 'about'=> 'Rewrite Supported');
exec('in.tftpd -V', $tftpInfo);
$info['TFTP Server'] = array('Version' => 'Not Found', 'about' => 'Mapping not available');
if (isset($tftpInfo[0])) {
$tftpInfo = explode(',',$tftpInfo[0]);
$info['TFTP Server'] = array('Version' => $tftpInfo[0], 'about' => 'Mapping not available');
$tftpInfo[1] = trim($tftpInfo[1]);
if ($tftpInfo[1] == 'with remap') {
$info['TFTP Server'] = array('Version' => $tftpInfo[0], 'about' => $tftpInfo[1]);
}
}
$info['Сompatible'] = array('Version' => $this->srvinterface->get_compatible_sccp(), 'about'=> 'Ok');
if (!empty($this->sccpvalues['tftp_rewrite']['data'])) {
switch ($this->sccpvalues['tftp_rewrite']['data']) {
case 'custom':
case 'pro':
$info['Provision_SCCP'] = array('Version' => 'base', 'about' => 'Provision Sccp enabled');
break;
default:
if ($tftpInfo[1] == 'with remap') {
$info['TFTP_Mapping'] = array('Version' => 'off', 'about' => "TFTP mapping is available but the mapping file is not included in tftpd-hpa default settings.<br>
To enable Provision mode, add option <br>
-m /etc/asterisk/sccpManagerRewrite.rules <br>
to the tftpd defaults, (location dependant on the system), and restart the tftpd server");
} else {
$info['TFTP_Mapping'] = array('Version' => 'off', 'about' => "Mapping capability is not built into the TFTP server. To enable Provision, upgrade the TFTP server.");
}
break;
}
}
// Finished testing tftp server options
$info['Сompatible'] = array('Version' => $compatible, 'about' => 'Ok');
if (!empty($this->sccpvalues['SccpDBmodel'])) {
if ($this->srvinterface->get_compatible_sccp()> $this->sccpvalues['SccpDBmodel']['data']){
if ($compatible > $this->sccpvalues['SccpDBmodel']['data']) {
$info['Сompatible']['about'] = '<div class="alert signature alert-danger"> Reinstall SCCP manager required</div>';
}
}
if ($db_Schema == 0) {
$info['DB_Schema'] = array('Version' => 'Error', 'about'=> '<div class="alert signature alert-danger"> ERROR DB Version </div>');
$info['DB_Schema'] = array('Version' => 'Error', 'about' => '<div class="alert signature alert-danger"> ERROR DB Version </div>');
} else {
$info['DB_Schema'] = array('Version' => $db_Schema, 'about'=> (($this->srvinterface->get_compatible_sccp() == $db_Schema ) ? 'Ok' : 'Incompatable Version'));
$info['DB_Schema'] = array('Version' => $db_Schema, 'about' => (($compatible == $db_Schema ) ? 'Ok' : 'Incompatible Version'));
}
if (empty($ast_realtime)) {
$info['RealTime'] = array('Version' => 'Error', 'about'=> '<div class="alert signature alert-danger"> No found Real Time connections</div>');
$info['RealTime'] = array('Version' => 'Error', 'about' => '<div class="alert signature alert-danger"> No RealTime connections found</div>');
} else {
$rt_info = '';
$rt_sccp = 'Failed';
foreach ($ast_realtime as $key => $value) {
if ($key == $ast_realm) {
if ($value['status'] == 'OK') {
$rt_sccp = 'TEST OK';
$rt_info .= 'SCCP conettions found';
$rt_sccp = 'TEST OK';
$rt_info .= '<div> Using SCCP connection found to database: '.$value['realm'] . ' with connector: ['. $key .']</div>';
} else {
$rt_sccp = 'SCCP ERROR';
$rt_info .= '<div class="alert signature alert-danger"> Error : '. $value['message']. '</div>';
$rt_info .= '<div class="alert signature alert-danger"> Error : ' . $value['message'] . '</div>';
}
} else if ($value['status'] == 'ERROR') {
$rt_info .= '<div> Found error in realtime sectoin ['.$key.'] : '. $value['message']. '</div>';
} elseif ($value['status'] == 'ERROR') {
$rt_info .= '<div> No connector found for [' . $key . '] : ' . $value['message'] . '</div>';
} elseif ($value['status'] == 'OK') {
$rt_info .= '<div> Alternative connector found to database '.$value['realm'] . ' with connector: ['. $key . '] </div>';
}
}
$info['RealTime'] = array('Version' => $rt_sccp, 'about'=> $rt_info);
$info['RealTime'] = array('Version' => $rt_sccp, 'about' => $rt_info);
}
// There are potential issues with string Type Declarations in PHP 5.
$info['PHP'] = array('Version' => phpversion(), 'about' => version_compare(phpversion(), '7.0.0', '>' ) ? 'OK' : 'PHP 7 Preferred - Please upgrade if possible');
$mariaDbInfo = exec('mysql -V');
$info['MariaDb'] = array('Version' => explode(" ",$mariaDbInfo)[3], 'about' => $mariaDbInfo);
if (empty($conf_realtime)) {
$info['ConfigsRealTime'] = array('Version' => 'Error', 'about'=> '<div class="alert signature alert-danger"> No found Real Time Configs</div>');
$info['ConfigsRealTime'] = array('Version' => 'Error', 'about' => '<div class="alert signature alert-danger"> Realtime configuration was not found</div>');
} else {
$rt_info = '';
foreach ($conf_realtime as $key => $value) {
if (($value != 'OK') && ($key != 'extconfigfile')) {
$rt_info .= '<div> Found error in section '.$key.' :'. $value. '</div>';
$rt_info .= '<div> Found error in section ' . $key . ' :' . $value . '</div>';
}
}
}
if (!empty($rt_info)) {
$info['ConfigsRealTime'] = array('Version' => 'Error', 'about'=> $rt_info);
$info['ConfigsRealTime'] = array('Version' => 'Error', 'about' => $rt_info);
}
}
//global $amp_conf;
/*
print_r("<br> Request:<br><pre>");
$json = '';
print_r("<br>");
// print_r($conf_realtime);
print_r("<br>");
print_r("<br>");
print_r($this->dbinterface->validate());
// print_r("DIRECT START");
// print_r($this->sccpvalues['ccm_address']);
print_r("<br>");
// print_r($this->getIP_information2());
// print_r($this->srvinterface->getеtestChanSCCP_GlablsInfo());
// print_r($this->sccp_metainfo);
print("</pre>");
// $mysql_info
if ($mysql_info['Value'] <= '2000') {
$this->info_warning['MySql'] = array('Increase Mysql Group Concat Max. Length', 'Step 1: Go to mysql path <br> nano /etc/my.cnf',
'Step 2: And add the following line below [mysqld] as shown below <br> [mysqld] <br>group_concat_max_len = 4096 or more',
'Step 3: Save and restart <br> systemctl restart mariadb.service<br> Or <br> service mysqld restart');
}
// $lang_arr = $this->extconfigs->getextConfig('sccp_lang','sk_SK');
// print_r('<br>');
// print_r(timezone_identifiers_list());
// print_r('<br>');
//print_r($this->dbinterface->info());
*/
if (!empty($this->class_error)) {
?>
// Check Time Zone compatibility
$conf_tz = $this->sccpvalues['ntp_timezone']['data'];
$cisco_tz = $this->extconfigs->getExtConfig('sccp_timezone', $conf_tz);
if ($cisco_tz['offset'] == 0) {
if (!empty($conf_tz)) {
$tmp_dt = new DateTime(null, new DateTimeZone($conf_tz));
$tmp_ofset = $tmp_dt->getOffset();
if (($cisco_tz['offset'] != ($tmp_ofset / 60) )) {
$this->info_warning['NTP'] = array('The selected NTP time zone is not supported by cisco devices.', 'We will use the Greenwich Time zone');
}
}
}
if (!empty($this->info_warning)) {
?>
<div class="fpbx-container container-fluid">
<div class="row">
<div class="container">
<h2 style="border:2px solid Tomato;color:Tomato;" >Sccp Manager Error</h2>
<div class="table-responsive">
<br> There are Error in the SCCP Module:<br><pre>
<?php print_r($this->class_error); ?>
<h2 style="border:2px solid Tomato;color:Tomato;" >Sccp Manager Warning</h2>
<div class="table-responsive">
<br> There are Warning in the SCCP Module:<br><pre>
<?php
foreach ($this->info_warning as $key => $value) {
echo '<h3>' . $key . '</h3>';
if (is_array($value)) {
echo '<li>' . _(implode('</li><li>', $value)) . '</li>';
} else {
echo '<li>' . _($value) . '</li>';
}
echo '<br>';
}
?>
</pre>
<br> Correct these problems before continuing to work. <br>
<br><h3 style="border:2px solid Tomato;color:Green;" > Open 'SCCP Conectivity -> Server Config' to change global settings</h3> <br>
<br><h4 style="border:2px solid Tomato;color:Green;" > Check these problems before continuing to work.</h4> <br>
</div>
</div>
</div>
</div>
<br>
<?php } ?>
<br>
<?php
}
if (!empty($this->class_error)) {
?>
<div class="fpbx-container container-fluid">
<div class="row">
<div class="container">
<h2 style="border:2px solid Tomato;color:Tomato;" >Diagnostic information about SCCP Manager errors</h2>
<div class="table-responsive">
<br> There is an error in the :<br><pre>
<?php print_r($this->class_error); ?>
</pre>
<br> Correct these problems before continuing to work. <br>
<br><h3 style="border:2px solid Tomato;color:Green;" > Open 'SCCP Connectivity' -> Server Config' to change global settings</h3> <br>
</div>
</div>
</div>
</div>
<br>
<?php } ?>
<div class="fpbx-container container-fluid">
<div class="row">
<div class="container">
<h2>Sccp Manager V.<?php print_r($this->sccp_manager_ver); ?> Info </h2>
<div class="table-responsive">
<h2>Sccp Manager v<?php print_r((string) $moduleXml->version); ?> Info </h2>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
@ -145,11 +216,11 @@ if (!empty($this->class_error)) {
</tr>
</thead>
<tbody>
<?php
foreach ($info as $key => $value) {
echo '<tr><td>' . $key . '</td><td>' . $value['Version'] . '</td><td>' . $value['about'] . '</td></tr>';
}
?>
<?php
foreach ($info as $key => $value) {
echo '<tr><td>' . $key . '</td><td>' . $value['Version'] . '</td><td>' . $value['about'] . '</td></tr>';
}
?>
</tbody>
</table>
</div>
@ -158,5 +229,4 @@ if (!empty($this->class_error)) {
</div>
</div>
<?php echo $this->ShowGroup('sccp_info',0); ?>
<?php echo $this->showGroup('sccp_info', 0); ?>

View file

@ -14,15 +14,22 @@
<!-- div id="toolbar-all">
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" onclick="load_oncliсk(this,'*new*')" data-target=".new_network"><i class="fa fa-bolt"></i> <?php echo _("Add Keyset"); ?></button>
</div -->
<?php
echo $this->ShowGroup('sccp_general',1);
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);
echo $this->ShowGroup('sccp_extpath_config',1);
?>
<div class="fpbx-container container-fluid">
<div class="row">
<div class="container">
<h2 style="border:2px solid Tomato;color:Tomato;" ><?php echo _("Warning : Any changes to the server configuration can cause all phones to restart"); ?></h2>
</div>
</div>
</div>
<?php
$def_val_device = $this->getTableDefaults('sccpdevice');
echo $this->showGroup('sccp_general', 1);
echo $this->showGroup('sccp_net', 1);
echo $this->showGroup('sccp_lang', 1);
echo $this->showGroup('sccp_extpath_config', 1);
?>
</form>
@ -32,21 +39,20 @@
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="gridSystemModalLabel_Net">Add New Network</h4>
<h4 class="modal-title" id="gridSystemModalLabel_Net">Device</h4>
</div>
<div class="modal-body">
<ul class="nav nav-tabs" role="tablist">
<?php
// echo $this->ShowGroup('add_network_1',0);
?>
<?php
// echo $this->showGroup('add_network_1',0);
?>
</ul>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary sccp_update" data-id="network_add" data-mode="new" id="network_add" data-dismiss="modal">Save</button>
</div>
</div>
</div>
</div>
</div>

14
views/server.url.php Normal file
View file

@ -0,0 +1,14 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
?>
<form autocomplete="off" name="frm_url" id="frm_url" class="fpbx-submit" action="" method="post">
<input type="hidden" name="category" value=" deviceurlform">
<input type="hidden" name="Submit" value="Submit">
<?php
echo $this->showGroup('sccp_dev_url', 1,);
?>
</form>