Compare commits
293 commits
v14.2.0.11
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5752d9f393 | ||
|
|
b28ec36e20 | ||
|
|
9519f0243a | ||
|
|
f5e51a52b7 | ||
|
|
4cf414e995 | ||
|
|
fb66f0e239 | ||
|
|
60e973b4a6 | ||
|
|
2ea478c117 | ||
|
|
fbbbefb25e | ||
|
|
e7bc2492ef | ||
|
|
f7e13505e9 | ||
|
|
b752640f81 | ||
|
|
da62493384 | ||
|
|
722285bc3d | ||
|
|
09acfd097d | ||
|
|
bd84870c6b | ||
|
|
60777bf3e3 | ||
|
|
1c5fa400ae | ||
|
|
a8e3dbdd30 | ||
|
|
381fe184bd | ||
|
|
e08ad858f5 | ||
|
|
ddd10f3ca9 | ||
|
|
d7ad8397da | ||
|
|
4e17791fa1 | ||
|
|
5796297bae | ||
|
|
546de5add1 | ||
|
|
b1769e6378 | ||
|
|
360ceea6cd | ||
|
|
0dec44161f | ||
|
|
6808154c3a | ||
|
|
e25fab14ff | ||
|
|
e088deee12 | ||
|
|
8051c30987 | ||
|
|
5c4848442a | ||
|
|
24cc8be3a7 | ||
|
|
4f468517e7 | ||
|
|
c3089d6d7f | ||
|
|
12cb1307ba | ||
|
|
3ce99c94d8 | ||
|
|
70b318019e | ||
|
|
82bd9cbaef | ||
|
|
34d6e976f2 | ||
|
|
6681a07c96 | ||
|
|
8013474e75 | ||
|
|
88f4fba2c0 | ||
|
|
a8dfaac9bb | ||
|
|
745ef87fea | ||
|
|
048077fce8 | ||
|
|
fa9f28aac3 | ||
|
|
1f73ade196 | ||
|
|
8c725874d7 | ||
|
|
b39983c690 | ||
|
|
8f91e2c6e6 | ||
|
|
463ab79add | ||
|
|
198b3fffa8 | ||
|
|
21f9123ece | ||
|
|
3381ad189b | ||
|
|
b9ca187d30 | ||
|
|
2d9a272589 | ||
|
|
a68ac219d3 | ||
|
|
4833638c8e | ||
|
|
ad698eb5c0 | ||
|
|
6cf10cc13b | ||
|
|
378d3b2ff7 | ||
|
|
354e3a2f47 | ||
|
|
ce365acdf2 | ||
|
|
84b65309a3 | ||
|
|
89b1a1cd3f | ||
|
|
8953484e1f | ||
|
|
8268bbf81a | ||
|
|
10a0ddb123 | ||
|
|
8d412ce4ae | ||
|
|
61beae544e | ||
|
|
c473c62ada | ||
|
|
fe780283a8 | ||
|
|
7d4c7c5e50 | ||
|
|
f4aa2eda1c | ||
|
|
03206f8384 | ||
|
|
c0e7a3bc0a | ||
|
|
9a6bff2d27 | ||
|
|
0bc2eed76b | ||
|
|
1489968b9e | ||
|
|
3737462fa7 | ||
|
|
380a9a52f2 | ||
|
|
eb73d61684 | ||
|
|
bca54bddff | ||
|
|
01a703f5cf | ||
|
|
90ebbd20f8 | ||
|
|
5586a896cb | ||
|
|
f8f447b89c | ||
|
|
64ab034443 | ||
|
|
88409eb6c8 | ||
|
|
9470072e7c | ||
|
|
00a83d65ca | ||
|
|
00781216d9 | ||
|
|
a395120fac | ||
|
|
c2fb5f4492 | ||
|
|
ef944e37c3 | ||
|
|
2830dfeeb1 | ||
|
|
a2217e6e37 | ||
|
|
1b979222fa | ||
|
|
04738f0657 | ||
|
|
ec9d1cc720 | ||
|
|
2b90440df7 | ||
|
|
aca38997c7 | ||
|
|
2e990783bb | ||
|
|
e69db63dd2 | ||
|
|
c674fdea96 | ||
|
|
0d2bfdbecd | ||
|
|
48ace0574a | ||
|
|
5bd1455e91 | ||
|
|
67f2a8b2a3 | ||
|
|
2dc613f063 | ||
|
|
8f6c7be74e | ||
|
|
570171bce0 | ||
|
|
1bea598588 | ||
|
|
43677651df | ||
|
|
c209932eb5 | ||
|
|
3a1a89fdb8 | ||
|
|
fbb61be0f1 | ||
|
|
b7d5851643 | ||
|
|
90729f74aa | ||
|
|
031ef0087e | ||
|
|
91d6ad2f48 | ||
|
|
662e2a4aa3 | ||
|
|
a40c110efe | ||
|
|
0b03d58c09 | ||
|
|
481c8929a9 | ||
|
|
8dc1175b37 | ||
|
|
b30340eab5 | ||
|
|
31e8a48e12 | ||
|
|
0f352eeb59 | ||
|
|
14215b64ca | ||
|
|
6567923ff1 | ||
|
|
b3fc62caa7 | ||
|
|
f1cc0f1bf6 | ||
|
|
b133b2bc3a | ||
|
|
2c8842d21a | ||
|
|
6775b6686b | ||
|
|
4ffcfaf6b7 | ||
|
|
74ddfcd413 | ||
|
|
7ab6eba556 | ||
|
|
28bb5a63da | ||
|
|
ab7b295b87 | ||
|
|
d8d2f946ce | ||
|
|
43a656cebc | ||
|
|
e313b9da3f | ||
|
|
3ea36f5459 | ||
|
|
b7a64e854f | ||
|
|
e8cabfbd1a | ||
|
|
1338336dd9 | ||
|
|
49fd6a5c91 | ||
|
|
d8287157bd | ||
|
|
85e77ab34c | ||
|
|
40cace04e4 | ||
|
|
97c1f6d5d4 | ||
|
|
60f7d74cf4 | ||
|
|
a267f075c8 | ||
|
|
d432ff7a05 | ||
|
|
472d73489e | ||
|
|
fb25407611 | ||
|
|
f2d15ebd5e | ||
|
|
1f910c7e97 | ||
|
|
d43570b471 | ||
|
|
b753482898 | ||
|
|
646a975a5f | ||
|
|
48a2793886 | ||
|
|
b659f55170 | ||
|
|
4e9dcb09f3 | ||
|
|
a1e52d01a4 | ||
|
|
26f750296a | ||
|
|
80cf629c0f | ||
|
|
75858d7cc1 | ||
|
|
97cfa12fea | ||
|
|
312229d4cf | ||
|
|
83d54c0fad | ||
|
|
4151b4fdae | ||
|
|
215cacae41 | ||
|
|
3a53e9ac8b | ||
|
|
3475efc2c6 | ||
|
|
a4aa4eb03b | ||
|
|
97c1395eb1 | ||
|
|
65f3a6cd37 | ||
|
|
4b40811d60 | ||
|
|
be5890e61f | ||
|
|
477eb69146 | ||
|
|
2898f5e3c9 | ||
|
|
b3b3858965 | ||
|
|
d9fa0ad8bf | ||
|
|
3d69090767 | ||
|
|
5c4bbaabba | ||
|
|
913cbd14c4 | ||
|
|
d7fd77dfe8 | ||
|
|
1b32e0977e | ||
|
|
a4f8fa4600 | ||
|
|
ef77bce159 | ||
|
|
2ffe4028e6 | ||
|
|
6e26428b1d | ||
|
|
2b709c9037 | ||
|
|
651f3adb44 | ||
|
|
5a184ededb | ||
|
|
248abe6cb7 | ||
|
|
30cbe1ba95 | ||
|
|
2a98d8cfdb | ||
|
|
71fef35ebd | ||
|
|
ce115dab8b | ||
|
|
d966bfa303 | ||
|
|
ba4dfb2f0d | ||
|
|
acb0141d99 | ||
|
|
6429b6add9 | ||
|
|
11da8356a5 | ||
|
|
945e77f9bc | ||
|
|
f929267910 | ||
|
|
2e5028f438 | ||
|
|
acdf777bcc | ||
|
|
8b06495938 | ||
|
|
fea6d88aa5 | ||
|
|
44e0846761 | ||
|
|
a6a9850a3c | ||
|
|
b15729a340 | ||
|
|
a493165153 | ||
|
|
2809b0796e | ||
|
|
503f227b98 | ||
|
|
b6dfb51993 | ||
|
|
6ecc981a02 | ||
|
|
dd9888e55e | ||
|
|
7dc4438ad8 | ||
|
|
93fe6d45e1 | ||
|
|
927186151e | ||
|
|
dcd9c75886 | ||
|
|
02f0b401d0 | ||
|
|
e50c32a1ac | ||
|
|
3b91ad2188 | ||
|
|
01b5e9e868 | ||
|
|
64624fa597 | ||
|
|
3ec730b71b | ||
|
|
ace4945eb0 | ||
|
|
b7766fcf64 | ||
|
|
063556f898 | ||
|
|
d1e72714af | ||
|
|
22d845ced3 | ||
|
|
f882a66eb4 | ||
|
|
ee419ae193 | ||
|
|
f74978c1b3 | ||
|
|
7721e7a8a0 | ||
|
|
b1a7fe3510 | ||
|
|
4fcf16b317 | ||
|
|
d8cc6f3ba1 | ||
|
|
bab83c7e3e | ||
|
|
d83c3ab93f | ||
|
|
4da4f391d6 | ||
|
|
838ff633aa | ||
|
|
3a03815daf | ||
|
|
fb9ea64134 | ||
|
|
97c4c93fb6 | ||
|
|
852156878d | ||
|
|
0e36336033 | ||
|
|
9be50bab5c | ||
|
|
e841c7cb40 | ||
|
|
ff1c451fe1 | ||
|
|
4d7463f341 | ||
|
|
9daf307081 | ||
|
|
cdac0f0276 | ||
|
|
d7e196cf21 | ||
|
|
ec79925661 | ||
|
|
d422776ad6 | ||
|
|
4e15376181 | ||
|
|
cb890aa264 | ||
|
|
95cd7b4d9b | ||
|
|
c271dbf3c2 | ||
|
|
649b717ce7 | ||
|
|
34a7f6a163 | ||
|
|
be8aa5cd92 | ||
|
|
55285cf625 | ||
|
|
2dad547e3d | ||
|
|
310256dc5d | ||
|
|
d6cfa86978 | ||
|
|
510b4259ac | ||
|
|
de3c58178b | ||
|
|
57bc13f782 | ||
|
|
f36c224f87 | ||
|
|
efdf2d0469 | ||
|
|
afe3382aed | ||
|
|
5df918a04b | ||
|
|
416cedc425 | ||
|
|
a146cd2354 | ||
|
|
b420f35ad2 | ||
|
|
815b7dbd2a | ||
|
|
790b5f7949 | ||
|
|
b2ee6ad853 | ||
|
|
922ae3eaf7 | ||
|
|
4c40809071 | ||
|
|
5e5cf3ffda |
25
README.md
25
README.md
|
|
@ -70,9 +70,20 @@ How to install sccp_manager
|
||||||
3. Click Upload Modules.
|
3. Click Upload Modules.
|
||||||
4. Enter one of the following urls:
|
4. Enter one of the following urls:
|
||||||
|
|
||||||
Stable
|
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
|
||||||
```
|
```
|
||||||
https://github.com/chan-sccp/sccp_manager/archive/refs/heads/Legacy.zip
|
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.
|
Develop.
|
||||||
|
|
||||||
|
|
@ -81,12 +92,7 @@ _This is development software and so may have issues_
|
||||||
```
|
```
|
||||||
https://github.com/chan-sccp/sccp_manager/archive/refs/heads/develop.zip
|
https://github.com/chan-sccp/sccp_manager/archive/refs/heads/develop.zip
|
||||||
```
|
```
|
||||||
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.
|
|
||||||
```
|
|
||||||
https://github.com/chan-sccp/sccp_manager/archive/refs/heads/v14.2.zip
|
|
||||||
```
|
|
||||||
|
|
||||||
5. Click Download From Web.
|
5. Click Download From Web.
|
||||||
6. Click Manage Local Modules.
|
6. Click Manage Local Modules.
|
||||||
|
|
@ -98,7 +104,10 @@ https://github.com/chan-sccp/sccp_manager/archive/refs/heads/v14.2.zip
|
||||||
|
|
||||||
### Module update to latest state
|
### Module update to latest state
|
||||||
|
|
||||||
If you installed the Develop branch, the module can be updated to the latest version via FreePBX. FreePBX -> Admin -> Module Admin.
|
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:
|
### IMPORTANT NOTES:
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -95,98 +95,98 @@
|
||||||
<phonePassword></phonePassword>
|
<phonePassword></phonePassword>
|
||||||
<backgroundImageAccess>true</backgroundImageAccess>
|
<backgroundImageAccess>true</backgroundImageAccess>
|
||||||
<callLogBlfEnabled>2</callLogBlfEnabled>
|
<callLogBlfEnabled>2</callLogBlfEnabled>
|
||||||
</commonProfile>
|
</commonProfile>
|
||||||
<vendorConfig>
|
<vendorConfig>
|
||||||
<ehookEnable>1</ehookEnable>
|
<ehookEnable>1</ehookEnable>
|
||||||
<!--
|
<!--
|
||||||
Headset Hookswitch Control
|
Headset Hookswitch Control
|
||||||
This allows the headset to take the phone off-hook (with appropriate
|
This allows the headset to take the phone off-hook (with appropriate
|
||||||
cables/connections etc)
|
cables/connections etc)
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<disableSpeaker>false</disableSpeaker>
|
<disableSpeaker>false</disableSpeaker>
|
||||||
<!--
|
<!--
|
||||||
Disable only the speakerphone functionality.
|
Disable only the speakerphone functionality.
|
||||||
Disabling speakerphone functionality will not affect the handset.
|
Disabling speakerphone functionality will not affect the handset.
|
||||||
true = Disabled.
|
true = Disabled.
|
||||||
false = Enabled (default).
|
false = Enabled (default).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<disableSpeakerAndHeadset>false</disableSpeakerAndHeadset>
|
<disableSpeakerAndHeadset>false</disableSpeakerAndHeadset>
|
||||||
<!--
|
<!--
|
||||||
Enables and disables the speakerphone and headset.
|
Enables and disables the speakerphone and headset.
|
||||||
true = Disabled.
|
true = Disabled.
|
||||||
false = Enabled (default).
|
false = Enabled (default).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<pcPort>0</pcPort>
|
<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.
|
have access to an Ethernet connection for a PC connection through the phone.
|
||||||
0 = Enabled (default).
|
0 = Enabled (default).
|
||||||
1 = Disabled.
|
1 = Disabled.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<settingsAccess>1</settingsAccess>
|
<settingsAccess>1</settingsAccess>
|
||||||
<!--
|
<!--
|
||||||
Enables and disables the Settings button on an IP phone.
|
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.
|
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.
|
0 = Disabled.
|
||||||
1 = Enabled (default). The phone user can modify features by using the Settings menu.
|
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>
|
<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.
|
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.
|
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.
|
0 = Disabled.
|
||||||
1 = Enabled (default).
|
1 = Enabled (default).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<voiceVlanAccess>0</voiceVlanAccess>
|
<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.
|
VLAN of the PC to which the IP phone's Ethernet port is connected.
|
||||||
0 = Enabled (default).
|
0 = Enabled (default).
|
||||||
1 = Disabled.
|
1 = Disabled.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<videoCapability>1</videoCapability>
|
<videoCapability>1</videoCapability>
|
||||||
<!--
|
<!--
|
||||||
a 7975G doesn't have any "real" video capability, it requires software
|
a 7975G doesn't have any "real" video capability, it requires software
|
||||||
called video advantage to stream webcam/video from a pc connected to
|
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.
|
curiosity for now.
|
||||||
|
|
||||||
Make sure this is only set when video is available. Seems to cause sporadic issues if not.
|
Make sure this is only set when video is available. Seems to cause sporadic issues if not.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<autoSelectLineEnable>0</autoSelectLineEnable>
|
<autoSelectLineEnable>0</autoSelectLineEnable>
|
||||||
<!--
|
<!--
|
||||||
Enables and disables auto line selection.
|
Enables and disables auto line selection.
|
||||||
0 = Disabled.
|
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.
|
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.
|
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.
|
Disabling the web server functionality of the phone will block access to the phones internal web pages.
|
||||||
These pages provide statistics and configuration information.
|
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.
|
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 setting will also affect any serviceability application such as CiscoWorks 2000 that relies on web access.
|
||||||
The following options are available.
|
The following options are available.
|
||||||
Disabled: Phone does not accept any HTTP connection. HTTP server is disabled on the phone.
|
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.
|
Read Only: Phone displays web pages but does not allow any configuration.
|
||||||
Full: Phone displays web pages and allows configuration.
|
Full: Phone displays web pages and allows configuration.
|
||||||
0 = Enabled (default).
|
0 = Enabled (default).
|
||||||
1 = Disabled.
|
1 = Disabled.
|
||||||
2 = Read Only.
|
2 = Read Only.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<daysDisplayNotActive>1,7</daysDisplayNotActive> <!-- sunday = 1, sat = 7 -->
|
<daysDisplayNotActive>1,7</daysDisplayNotActive> <!-- sunday = 1, sat = 7 -->
|
||||||
<displayOnTime>08:00</displayOnTime>
|
<displayOnTime>08:00</displayOnTime>
|
||||||
<displayOnDuration>12:00</displayOnDuration>
|
<displayOnDuration>12:00</displayOnDuration>
|
||||||
|
|
@ -200,52 +200,52 @@
|
||||||
<!-- <headsetWidebandUIControl>1</headsetWidebandUIControl> -->
|
<!-- <headsetWidebandUIControl>1</headsetWidebandUIControl> -->
|
||||||
<!--
|
<!--
|
||||||
Enables or disables wideband headset option on supported IP phones.
|
Enables or disables wideband headset option on supported IP phones.
|
||||||
If the headsetWidebandUIControl parameter is set to Enable (0), the option set
|
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
|
in the phone UI, by the phone user, has priority over the value set for this
|
||||||
parameter.
|
parameter.
|
||||||
0 = Enabled (default). Enables wideband headset on phone.
|
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> -->
|
<!-- <handsetWidebandUIControl>1</handsetWidebandUIControl> -->
|
||||||
<!--
|
<!--
|
||||||
Enables or disables control of handset options by phone user.
|
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.
|
0 = Enabled (default). Allows phone user to select either narrowband or wideband handset in the phone UI.
|
||||||
1 = Disabled.
|
1 = Disabled.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- <headsetWidebandEnable>1</headsetWidebandEnable> -->
|
<!-- <headsetWidebandEnable>1</headsetWidebandEnable> -->
|
||||||
<!--
|
<!--
|
||||||
Enables or disables control of headset option by phone user.
|
Enables or disables control of headset option by phone user.
|
||||||
0 = Enabled (default). Allows phone user to select either narrowband or wideband headset
|
0 = Enabled (default). Allows phone user to select either narrowband or wideband headset
|
||||||
1 = Disabled.
|
1 = Disabled.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- <handsetWidebandEnable>1</handsetWidebandEnable> -->
|
<!-- <handsetWidebandEnable>1</handsetWidebandEnable> -->
|
||||||
<!--
|
<!--
|
||||||
Enables or disables wideband handset option on supported IP phones.
|
Enables or disables wideband handset option on supported IP phones.
|
||||||
If the handsetWidebandUIControl parameter is set to Enable (1), the option
|
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
|
set in the phone UI, by the phone user, has priority over the value set for
|
||||||
this parameter.
|
this parameter.
|
||||||
0 = Phone default (default), equal to disabled or enabled and set by manufacturer.
|
0 = Phone default (default), equal to disabled or enabled and set by manufacturer.
|
||||||
1 = Enabled. Enables wideband handset on phone.
|
1 = Enabled. Enables wideband handset on phone.
|
||||||
2 = Disabled. Disables wideband headset on phone.
|
2 = Disabled. Disables wideband headset on phone.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<spanToPCPort>1</spanToPCPort>
|
<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.
|
and a connection to a PC.
|
||||||
0 = Enabled (default).
|
0 = Enabled (default).
|
||||||
1 = Disabled.
|
1 = Disabled.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<g722CodecSupport>2</g722CodecSupport>
|
<g722CodecSupport>2</g722CodecSupport>
|
||||||
<!--
|
<!--
|
||||||
Enables and disables the registration of the G.722 codec on the IP phone.
|
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.
|
0 = Phone default (default), equal to disabled or enabled and set by manufacturer.
|
||||||
1 = Disabled. Disables G.722-64K2 codec on phone.
|
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
|
See also advertiseG722Codec
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
@ -256,10 +256,10 @@
|
||||||
<enableLldpPcPort>1</enableLldpPcPort>
|
<enableLldpPcPort>1</enableLldpPcPort>
|
||||||
<lldpAssetId></lldpAssetId>
|
<lldpAssetId></lldpAssetId>
|
||||||
<powerPriority>1</powerPriority>
|
<powerPriority>1</powerPriority>
|
||||||
<!--
|
<!--
|
||||||
I have the above turned on just for curiosity.
|
I have the above turned on just for curiosity.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<sshAccess>0</sshAccess> <!-- 0 = enabled -->
|
<sshAccess>0</sshAccess> <!-- 0 = enabled -->
|
||||||
<sshPort>22</sshPort>
|
<sshPort>22</sshPort>
|
||||||
<!--
|
<!--
|
||||||
|
|
@ -275,8 +275,8 @@
|
||||||
-->
|
-->
|
||||||
<loadServer></loadServer>
|
<loadServer></loadServer>
|
||||||
<!--
|
<!--
|
||||||
Indicates that the phone will use an alternative server to obtain firmware loads and upgrades, rather than the defined 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.
|
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
|
If this field is left blank, the phone will use the designated TFTP server to obtain its load files and upgrades
|
||||||
string
|
string
|
||||||
length = 256
|
length = 256
|
||||||
|
|
@ -286,13 +286,13 @@
|
||||||
<!--
|
<!--
|
||||||
Only on 7921/7925/7926
|
Only on 7921/7925/7926
|
||||||
|
|
||||||
Indicates whether WLAN Profile 1 can be modified by the user.
|
Indicates whether WLAN Profile 1 can be modified by the user.
|
||||||
If the profile is locked, the user can not modify it.
|
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.
|
To allow the user to edit only the username and password in the profile, set it to restricted.
|
||||||
0 = Unlocked
|
0 = Unlocked
|
||||||
1 = Locked
|
1 = Locked
|
||||||
2 = Restricted
|
2 = Restricted
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<WlanProfile2>0</WlanProfile1>
|
<WlanProfile2>0</WlanProfile1>
|
||||||
<WlanProfile3>0</WlanProfile1>
|
<WlanProfile3>0</WlanProfile1>
|
||||||
|
|
@ -300,11 +300,11 @@
|
||||||
<specialNumbers></specialNumbers>
|
<specialNumbers></specialNumbers>
|
||||||
<!--
|
<!--
|
||||||
Only on 7921/7925/7926
|
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.
|
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.
|
You may enter one or more special numbers in this field.
|
||||||
To enter more than one special number, use a comma as separator.
|
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.
|
For example, if you want to enter 411, 511, and 911 as special numbers, enter 411,511,911 in the field without spaces.
|
||||||
string
|
string
|
||||||
length = 16
|
length = 16
|
||||||
|
|
@ -313,7 +313,7 @@
|
||||||
<PushToTalkURL></PushToTalkURL>
|
<PushToTalkURL></PushToTalkURL>
|
||||||
<!--
|
<!--
|
||||||
Only on 7921/7925/7926
|
Only on 7921/7925/7926
|
||||||
|
|
||||||
This parameter specifies the URL which the phone contacts for application services.
|
This parameter specifies the URL which the phone contacts for application services.
|
||||||
-->
|
-->
|
||||||
<sendKeyAction></sendKeyAction>
|
<sendKeyAction></sendKeyAction>
|
||||||
|
|
@ -331,7 +331,7 @@
|
||||||
-->
|
-->
|
||||||
<appButtonTimer></appButtonTimer>
|
<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>
|
<appButtonPriority></appButtonPriority>
|
||||||
<!--
|
<!--
|
||||||
|
|
@ -349,7 +349,7 @@
|
||||||
<!--
|
<!--
|
||||||
Only on 7921/7925/7926
|
Only on 7921/7925/7926
|
||||||
This parameter controls when the phone performs scanning. The parameter values are as follow.
|
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.
|
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.
|
Continuous: Phone scans continuously even when it is not in a call.
|
||||||
-->
|
-->
|
||||||
|
|
@ -420,10 +420,10 @@
|
||||||
</vendorConfig>
|
</vendorConfig>
|
||||||
<versionStamp>{Jan 01 2003 00:00:00}</versionStamp>
|
<versionStamp>{Jan 01 2003 00:00:00}</versionStamp>
|
||||||
<loadInformation>P00308010100</loadInformation>
|
<loadInformation>P00308010100</loadInformation>
|
||||||
<!--
|
<!--
|
||||||
The firmware version that the phone looks for at boot.
|
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.
|
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.
|
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
|
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.
|
new firmware version number.
|
||||||
|
|
||||||
|
|
@ -457,26 +457,32 @@
|
||||||
<proxyServerURL></proxyServerURL>
|
<proxyServerURL></proxyServerURL>
|
||||||
<servicesURL>http://x.x.x.x/cisco_menu/menu.php</servicesURL>
|
<servicesURL>http://x.x.x.x/cisco_menu/menu.php</servicesURL>
|
||||||
<directoryURL>http://x.x.x.x/cisco_menu/directory/menu.php</directoryURL>
|
<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
|
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)
|
put my phone book under services)
|
||||||
-->
|
-->
|
||||||
<idleURL>http://x.x.x.x/cisco_menu/idle.php</idleURL>
|
<idleURL>http://x.x.x.x/cisco_menu/idle.php</idleURL>
|
||||||
<!--
|
<!--
|
||||||
URL of CiscoIPPhoneImage.
|
URL of CiscoIPPhoneImage.
|
||||||
Requires a non-zero setting in idleTimeout.
|
Requires a non-zero setting in idleTimeout.
|
||||||
-->
|
-->
|
||||||
<idleTimeout>3600</idleTimeout>
|
<idleTimeout>3600</idleTimeout>
|
||||||
|
|
||||||
<deviceSecurityMode>1</deviceSecurityMode>
|
<deviceSecurityMode>1</deviceSecurityMode>
|
||||||
<phonePersonalization>1</phonePersonalization>
|
<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>
|
<singleButtonBarge>1</singleButtonBarge>
|
||||||
<joinAcrossLines>1</joinAcrossLines>
|
<joinAcrossLines>1</joinAcrossLines>
|
||||||
<autoCallPickupEnable>false</autoCallPickupEnable>
|
<autoCallPickupEnable>false</autoCallPickupEnable>
|
||||||
<blfAudibleAlertSettingOfIdleStation>1</blfAudibleAlertSettingOfIdleStation>
|
<blfAudibleAlertSettingOfIdleStation>1</blfAudibleAlertSettingOfIdleStation>
|
||||||
<blfAudibleAlertSettingOfBusyStation>1</blfAudibleAlertSettingOfBusyStation>
|
<blfAudibleAlertSettingOfBusyStation>1</blfAudibleAlertSettingOfBusyStation>
|
||||||
<advertiseG722Codec>1</advertiseG722Codec>
|
<advertiseG722Codec>1</advertiseG722Codec>
|
||||||
|
|
||||||
<mobility>
|
<mobility>
|
||||||
<handoffdn></handoffdn>
|
<handoffdn></handoffdn>
|
||||||
|
|
@ -488,7 +494,7 @@
|
||||||
<dtmfTxfCode>*84</dtmfTxfCode>
|
<dtmfTxfCode>*84</dtmfTxfCode>
|
||||||
<dtmfCnfCode>*85</dtmfCnfCode>
|
<dtmfCnfCode>*85</dtmfCnfCode>
|
||||||
</mobility>
|
</mobility>
|
||||||
|
|
||||||
<dscpForSCCPPhoneConfig>104</dscpForSCCPPhoneConfig>
|
<dscpForSCCPPhoneConfig>104</dscpForSCCPPhoneConfig>
|
||||||
<dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices>
|
<dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices>
|
||||||
<dscpForCm2Dvce>184</dscpForCm2Dvce>
|
<dscpForCm2Dvce>184</dscpForCm2Dvce>
|
||||||
|
|
@ -508,7 +514,7 @@
|
||||||
1 = Use ServicerURL / DirectoryURL and MessagesURL (Above)
|
1 = Use ServicerURL / DirectoryURL and MessagesURL (Above)
|
||||||
2 = Use Both (Merge Both)
|
2 = Use Both (Merge Both)
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Below
|
<!-- Below
|
||||||
type = 0 -> applicaton menu
|
type = 0 -> applicaton menu
|
||||||
type = 1 -> contacts menu
|
type = 1 -> contacts menu
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,9 @@ and open the template in the editor.
|
||||||
.sccpmultiselect {
|
.sccpmultiselect {
|
||||||
min-height: 100px;
|
min-height: 100px;
|
||||||
padding: 1px 1px;
|
padding: 1px 1px;
|
||||||
|
|
||||||
}
|
}
|
||||||
.sccpbtn {
|
.sccpbtn {
|
||||||
min-height: 10px;
|
min-height: 10px;
|
||||||
padding: 1px 1px;
|
padding: 1px 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ $(document).ready(function () {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
$('#ajaxcancel').on('click', function (e) {
|
$('#ajaxcancel').on('click', function (e) {
|
||||||
// console.log('Calncel');
|
console.log('Cancel');
|
||||||
if ($(this).data('hash') != null) {
|
if ($(this).data('hash') != null) {
|
||||||
location.hash = $(this).data('hash');
|
location.hash = $(this).data('hash');
|
||||||
}
|
}
|
||||||
|
|
@ -24,7 +24,6 @@ $(document).ready(function () {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// ajaxsubmit2 is "Save and continue" - saves form data and stays on form
|
// ajaxsubmit2 is "Save and continue" - saves form data and stays on form
|
||||||
$('#ajaxsubmit2').on('click', function (e) {
|
$('#ajaxsubmit2').on('click', function (e) {
|
||||||
var vdata = '';
|
var vdata = '';
|
||||||
|
|
@ -55,7 +54,7 @@ $(document).ready(function () {
|
||||||
if (data.message) {
|
if (data.message) {
|
||||||
bs_alert(data.message,data.status);
|
bs_alert(data.message,data.status);
|
||||||
} else {
|
} else {
|
||||||
fpbxToast(_('Data saved'),_('Data saved'), 'success');
|
fpbxToast(_('Data saved'),'', 'success');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bs_alert(data.message,data.status);
|
bs_alert(data.message,data.status);
|
||||||
|
|
@ -91,23 +90,23 @@ $(document).ready(function () {
|
||||||
if (data.table_reload === true) {
|
if (data.table_reload === true) {
|
||||||
$('table').bootstrapTable('refresh');
|
$('table').bootstrapTable('refresh');
|
||||||
}
|
}
|
||||||
if (data.hash != null) {
|
var newLocation = location.href;
|
||||||
location.hash = data.hash;
|
newLocation = ('path' in data && data.path !== '') ? data.path : location.pathname;
|
||||||
}
|
newLocation += ('search' in data && data.search !== '') ? `${data.search}` : `${location.search}`;
|
||||||
if (data.href != null) {
|
// location.hash is set by (".change-tab") at line 198 for settings
|
||||||
location.href = data.href;
|
newLocation += ('hash' in data && data.hash !== '' ) ? data.hash : location.hash;
|
||||||
}
|
|
||||||
if (data.path != null) {
|
|
||||||
location.path = data.path;
|
|
||||||
}
|
|
||||||
if (data.search != null) {
|
|
||||||
location.search = data.search;
|
|
||||||
}
|
|
||||||
if (data.message) {
|
if (data.message) {
|
||||||
fpbxToast(_('Configuration saved. Reloading Module'),_('Configuration saved'), 'success');
|
fpbxToast(_(data.message),'', data.toastFlag);
|
||||||
|
// If posting warning, allow time to read
|
||||||
|
var toastDelay = (data.toastFlag == 'success') ? 500 : 1500;
|
||||||
if (data.reload === true) {
|
if (data.reload === true) {
|
||||||
//Need setTimout or reload will kill Toast
|
setTimeout(function(){
|
||||||
setTimeout(function(){location.reload();},500);
|
location.replace(newLocation);
|
||||||
|
if (data.search == `?display=sccpsettings`) {
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toastDelay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -117,10 +116,6 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".input-js-add").click(function () {
|
|
||||||
add_dynamic_input($(this), $(this).data('for'), "", "");
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".table").on('click', '.table-js-add', function (e) {
|
$(".table").on('click', '.table-js-add', function (e) {
|
||||||
add_dynamic_table($(this), $(this).data('for'), "", "");
|
add_dynamic_table($(this), $(this).data('for'), "", "");
|
||||||
});
|
});
|
||||||
|
|
@ -129,7 +124,6 @@ $(document).ready(function () {
|
||||||
del_dynamic_table($(this), $(this).data('for'));
|
del_dynamic_table($(this), $(this).data('for'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$(".table").on('click', '.btn-item-delete', function (e) {
|
$(".table").on('click', '.btn-item-delete', function (e) {
|
||||||
var dev_cmd = '';
|
var dev_cmd = '';
|
||||||
var dev_id = $(this).data('id');
|
var dev_id = $(this).data('id');
|
||||||
|
|
@ -195,6 +189,11 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
// ---------------------------------------
|
// ---------------------------------------
|
||||||
|
|
||||||
|
// Set location.hash when changing tabs so that can return to same tab after reload.
|
||||||
|
$(".change-tab").click(function(){
|
||||||
|
window.location.hash = '#' + $(this).attr('data-name');
|
||||||
|
});
|
||||||
|
|
||||||
$('.btnMultiselect').click(function (e) {
|
$('.btnMultiselect').click(function (e) {
|
||||||
var kid = $(this).data('id');
|
var kid = $(this).data('id');
|
||||||
if ($(this).data('key') === 'Right') {
|
if ($(this).data('key') === 'Right') {
|
||||||
|
|
@ -211,6 +210,22 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
// Set focus on the mac entry field. It will not stay but ensures that focusout brings it back
|
||||||
|
$('#sccp_hw_mac').focus();
|
||||||
|
|
||||||
|
$('#sccp_hw_mac').focusout(function() {
|
||||||
|
var value = $(this).val();
|
||||||
|
const regex = new RegExp('^([0-9A-Fa-f]{2}[:.-]?){5}([0-9A-Fa-f]{2})$');
|
||||||
|
if ( regex.test(value) === false ) {
|
||||||
|
$('#ajaxsubmit2').attr('disabled', 'disabled');
|
||||||
|
$('#ajaxsubmit').attr('disabled', 'disabled');
|
||||||
|
fpbxToast(_('Invalid Mac Address'),_('Invalid Mac Address'), 'warning');
|
||||||
|
setTimeout(function(){ $('#sccp_hw_mac').focus();},2000);
|
||||||
|
} else {
|
||||||
|
$('#ajaxsubmit2').removeAttr('disabled');
|
||||||
|
$('#ajaxsubmit').removeAttr('disabled');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
// Form.buttons - Form.adddevice
|
// Form.buttons - Form.adddevice
|
||||||
$('.futuretype').change(function (e) {
|
$('.futuretype').change(function (e) {
|
||||||
|
|
@ -269,31 +284,67 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// Form.adddevice
|
// Form.adddevice
|
||||||
$('.hw_select').change(function (e) {
|
$('.hw_select').mouseover(function (e) {
|
||||||
// console.log('HwSelect');
|
|
||||||
var type_id = $('#sccp_hw_type').find(':selected').data('id');
|
var type_id = $('#sccp_hw_type').find(':selected').data('id');
|
||||||
var btn_dev = $('#sccp_hw_type').find(':selected').data('val');
|
if (type_id == null) {
|
||||||
// var btn_add=$('#sccp_hw_addon').find(':selected').data('val');
|
var type_id = $('#addonCnt').val();
|
||||||
|
}
|
||||||
if (type_id === 1) {
|
if (type_id == 1) {
|
||||||
if ($('#sccp_hw_addon').val() !== 'NONE') {
|
if ($('#sccp_hw_addon').val() !== 'NONE') {
|
||||||
$('#sccp_hw_addon').val('NONE').change();
|
$('#sccp_hw_addon').val('NONE').change();
|
||||||
}
|
}
|
||||||
$('#sccp_hw_addon').attr("disabled", "disabled");
|
$('#sccp_hw_addon').attr("disabled", "disabled");
|
||||||
} else {
|
} else {
|
||||||
$('#sccp_hw_addon').removeAttr('disabled');
|
$('#sccp_hw_addon').prop('disabled',false);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.hw_select').change(function (e) {
|
||||||
|
// data-val contains the number of buttons for this type
|
||||||
|
// data-id contains the max number of addons (1 = 0, 3 = 2)
|
||||||
|
var type_id = $('#sccp_hw_type').find(':selected').data('id');
|
||||||
|
var btn_dev = $('#sccp_hw_type').find(':selected').data('val');
|
||||||
|
// when edit, btn_dev is undefined as no select, so send btn_dev and type_id with page
|
||||||
|
if (btn_dev == null) {
|
||||||
|
var btn_dev = $('#devButtonCnt').val();
|
||||||
|
var type_id = $('#addonCnt').val();
|
||||||
|
}
|
||||||
|
if (type_id == 1) {
|
||||||
|
if ($('#sccp_hw_addon').val() !== 'NONE') {
|
||||||
|
$('#sccp_hw_addon').val('NONE').change();
|
||||||
|
}
|
||||||
|
$('#sccp_hw_addon').attr("disabled", "disabled");
|
||||||
|
} else {
|
||||||
|
$('#sccp_hw_addon').prop('disabled',false);
|
||||||
|
}
|
||||||
var btn_add = $('#sccp_hw_addon').find(':selected').data('val');
|
var btn_add = $('#sccp_hw_addon').find(':selected').data('val');
|
||||||
|
// btn_add is empty if none selected
|
||||||
|
if ((btn_add == null) || (btn_add == '')) {
|
||||||
|
var btn_add = 0;
|
||||||
|
}
|
||||||
|
var totButtons = parseInt(btn_dev, 10) + parseInt(btn_add, 10);
|
||||||
|
$('#buttonscount').attr('value', totButtons);
|
||||||
$('.line_button').each(function () {
|
$('.line_button').each(function () {
|
||||||
if ($(this).data('id') < btn_dev + btn_add) {
|
if ($(this).data('id') < totButtons) {
|
||||||
$(this).removeClass('hidden');
|
$(this).removeClass('hidden');
|
||||||
$(this).removeAttr('hidden')
|
$(this).removeAttr('hidden');
|
||||||
} else {
|
} else {
|
||||||
$(this).addClass('hidden');
|
$(this).addClass('hidden');
|
||||||
|
$(this).attr('hidden', true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.lineSelect').change(function (e) {
|
||||||
|
var line_id = $('#sccp_hw_defaultLine option:selected').val();
|
||||||
|
$("select.lineid_0 option:selected").prop("selected",false);
|
||||||
|
$("select.lineid_0 option[value=" + line_id + "]").prop("selected",true);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#button0_line').change(function (e) {
|
||||||
|
var line_id = $('#button0_line option:selected').val();
|
||||||
|
$("#sccp_hw_defaultLine option:selected").prop("selected",false);
|
||||||
|
$("#sccp_hw_defaultLine option[value=" + line_id + "]").prop("selected",true);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.sccp_button_hide').each(function () {
|
$('.sccp_button_hide').each(function () {
|
||||||
|
|
@ -473,6 +524,8 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('.sccp_update').on('click', function (e) {
|
$('.sccp_update').on('click', function (e) {
|
||||||
// console.log($(this).data('id'));
|
// console.log($(this).data('id'));
|
||||||
|
|
||||||
|
|
@ -504,7 +557,6 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------- Server.model form ----------------
|
// ----------------------- Server.model form ----------------
|
||||||
|
|
||||||
if ($(this).data('id') === 'model_add') {
|
if ($(this).data('id') === 'model_add') {
|
||||||
var dev_cmd = 'model_add';
|
var dev_cmd = 'model_add';
|
||||||
// var dev_fld = ["model","vendor","dns","buttons","loadimage","loadinformationid","validate","enabled"];
|
// var dev_fld = ["model","vendor","dns","buttons","loadimage","loadinformationid","validate","enabled"];
|
||||||
|
|
@ -613,7 +665,7 @@ $(document).ready(function () {
|
||||||
url: 'ajax.php?module=sccp_manager&command=' + dev_cmd,
|
url: 'ajax.php?module=sccp_manager&command=' + dev_cmd,
|
||||||
data: datas,
|
data: datas,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
// console.log(data);
|
|
||||||
if (data.status === true) {
|
if (data.status === true) {
|
||||||
if (data.table_reload === true) {
|
if (data.table_reload === true) {
|
||||||
$('table').bootstrapTable('refresh');
|
$('table').bootstrapTable('refresh');
|
||||||
|
|
@ -646,6 +698,83 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.sccp_get_ext').on('click', function (e) {
|
||||||
|
// console.log($(this).data('id'));
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------------- Get external Files----------------
|
||||||
|
if ($(this).data('id') === 'get_ext_files') {
|
||||||
|
var dev_cmd = 'get_ext_files';
|
||||||
|
var dev_fld = ["device", "locale", "country"];
|
||||||
|
datas = 'type=' + $(this).data('type') + '&' + 'name=' + '&';
|
||||||
|
|
||||||
|
for (var i = 0; i < dev_fld.length; i++) {
|
||||||
|
datas = datas + dev_fld[i] + '=' + $('#ext_' + dev_fld[i]).val() + '&';
|
||||||
|
}
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dev_cmd !== '') {
|
||||||
|
$.ajax({
|
||||||
|
// Need to modify xhr here to add listener
|
||||||
|
xhr: function() {
|
||||||
|
const controller = new AbortController();
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.addEventListener('progress', function(evt) {
|
||||||
|
var result = evt.srcElement.responseText.split(',');
|
||||||
|
var percentComplete = result[result.length - 2]; //last element is empty.
|
||||||
|
$('#progress-bar').css('width', percentComplete + '%');
|
||||||
|
if (percentComplete == 100 ) {
|
||||||
|
controller.abort();
|
||||||
|
}
|
||||||
|
}, true, { signal: controller.signal });
|
||||||
|
return xhr;
|
||||||
|
},
|
||||||
|
type: 'POST',
|
||||||
|
url: 'ajax.php?module=sccp_manager&command=' + dev_cmd,
|
||||||
|
data: datas,
|
||||||
|
success: function (data) {
|
||||||
|
|
||||||
|
$('#pleaseWaitDialog').modal('hide');
|
||||||
|
console.log(data);
|
||||||
|
data = JSON.parse(data.replace(/^(.*\{)/,"\{"));
|
||||||
|
console.log(data);
|
||||||
|
if (data.status === true) {
|
||||||
|
if (data.table_reload === true) {
|
||||||
|
$('table').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
if (data.message) {
|
||||||
|
fpbxToast(data.message,_('Operation Result'), 'success');
|
||||||
|
if (data.reload === true) {
|
||||||
|
//Need setTimout or reload will kill Toast
|
||||||
|
setTimeout(function(){location.reload();},500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Array.isArray(data.message)) {
|
||||||
|
data.message.forEach(function (entry) {
|
||||||
|
fpbxToast(data.message[1],_('Error Result'), 'warning');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (data.message) {
|
||||||
|
fpbxToast(data.message,_('Error Result'), 'warning');
|
||||||
|
} else {
|
||||||
|
if (data) {
|
||||||
|
bs_alert(data,data.status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#cr_sccp_phone_xml').on('click', function (e) {
|
$('#cr_sccp_phone_xml').on('click', function (e) {
|
||||||
// console.log("asasdasdasdasd");
|
// console.log("asasdasdasdasd");
|
||||||
// console.log($('#update-sccp-phone').find(':selected').data('val'));
|
// console.log($('#update-sccp-phone').find(':selected').data('val'));
|
||||||
|
|
@ -787,32 +916,51 @@ function load_oncliсk(e, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// call from here not document.ready as have dynamic content
|
||||||
|
$(document).on('click', ".input-js-remove" , function () {
|
||||||
|
// delete the current row
|
||||||
|
var pname = $(this).data('id');
|
||||||
|
$('#' + pname).remove();
|
||||||
|
});
|
||||||
|
|
||||||
function add_dynamic_input(pe, pclass, vdefault)
|
$(document).on('click', ".input-js-add" , function () {
|
||||||
{
|
// Add new row to networks or ip array
|
||||||
// We'd like a new one, please.
|
var pcls = $(this).data('for'),
|
||||||
pcls = pe.data('for');
|
pname = $(this).data('id'),
|
||||||
pname = pe.data('id');
|
pmax = $(this).data('max'),
|
||||||
pmax = pe.data('max');
|
prow = $(this).data('row'),
|
||||||
jdata = JSON.parse(hex2bin(pe.data('json')));
|
pcount = $("." + pcls).length;
|
||||||
|
if (pcount == pmax){
|
||||||
|
//already reached max elements
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var last = $("." + pcls + ":last"),
|
jdata = JSON.parse(hex2bin($(this).data('json')));
|
||||||
ourid = last.data('nextid'),
|
|
||||||
nextid = ourid + 1;
|
var last = $("." + pcls).last(),
|
||||||
var html = "<div class = '" + pcls + " form-group form-inline' data-nextid=" + nextid + ">";
|
ourid = last.data('nextid'),
|
||||||
|
nextid = ourid + 1,
|
||||||
|
html = "<div class = '" + pcls + "' id ='" + pname + nextid + "' form-group form-inline' data-nextid=" + nextid + ">";
|
||||||
for (var key in jdata) {
|
for (var key in jdata) {
|
||||||
html_opt = '';
|
html_opt = '';
|
||||||
html_calss = jdata[key]['class'];
|
|
||||||
for (var skey in jdata[key]['options']) {
|
for (var skey in jdata[key]['options']) {
|
||||||
html_opt += ' ' + skey + '="' + jdata[key]['options'][skey] + '"';
|
html_opt += ' ' + skey + '="' + jdata[key]['options'][skey] + '"';
|
||||||
}
|
}
|
||||||
html += "<input type='text' name='" + pname + "[" + ourid + "][" + key + "]' class='" + html_calss + "' " + html_opt + " value='" + vdefault + "'> " + jdata[key]['nameseparator'] + " ";
|
html += "<input type='text' name='" + pname + "[" + nextid + "][" + key + "]' class " + html_opt + "> " + jdata[key]['nameseparator'] + " ";
|
||||||
}
|
}
|
||||||
|
// add remove button
|
||||||
|
html += "<button type='button' class='btn btn-danger btn-lg input-js-remove' id='" + pname + nextid + "-btn-remove' data-id='" + pname + nextid + "' data-for='" + pname + "'>";
|
||||||
|
html += "<i class='fa fa-minus pull-right'></i></button>";
|
||||||
|
// add plus button
|
||||||
|
html += "<button type='button' class='btn btn-primary btn-lg input-js-add' id='" + pname + nextid + "-btn-add' data-id='" + pname + "'";
|
||||||
|
html += " data-row='" + nextid + "' data-for='" + pname + "' data-max='" + pmax + "' data-json='" + $(this).data('json') + "' >";
|
||||||
|
html += "<i class='fa fa-plus pull-right'></i></button>";
|
||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
if (pmax >= nextid) {
|
|
||||||
last.after(html);
|
last.after(html);
|
||||||
}
|
|
||||||
}
|
$('#' + pname + prow + '-btn-add').remove();
|
||||||
|
});
|
||||||
|
|
||||||
function del_dynamic_table(pe, pclass, vdefault)
|
function del_dynamic_table(pe, pclass, vdefault)
|
||||||
{
|
{
|
||||||
|
|
@ -1037,6 +1185,14 @@ function hex2bin(hex)
|
||||||
return String.fromCharCode.apply(String, bytes);
|
return String.fromCharCode.apply(String, bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showProgress() {
|
||||||
|
$('#pleaseWaitDialog').modal();
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeProgress() {
|
||||||
|
$('#pleaseWaitDialog').modal('hide');
|
||||||
|
}
|
||||||
|
|
||||||
function sleep(milliseconds)
|
function sleep(milliseconds)
|
||||||
{
|
{
|
||||||
var start = new Date().getTime();
|
var start = new Date().getTime();
|
||||||
|
|
@ -1046,3 +1202,101 @@ function sleep(milliseconds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// There are 2 dynamically created button Classes
|
||||||
|
// sccp_restore for restoring system defaults, and sccp_edit for entering
|
||||||
|
// custom values. Clicking on these buttons is handled by the 2 functions below.
|
||||||
|
$(".sccp-restore").click(function() {
|
||||||
|
//input is sent by data-for where for is an attribute
|
||||||
|
var id = $(this).data("for"), input = $("#" + id);
|
||||||
|
var edit_style = document.getElementById("edit_" + id).style;
|
||||||
|
input = document.getElementsByName(id);
|
||||||
|
if (input.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($(this).is(":checked")) {
|
||||||
|
console.log('restore/checked');
|
||||||
|
// Restoring defaults
|
||||||
|
// show the edit block and populate with default values.
|
||||||
|
edit_style.display = 'block';
|
||||||
|
var defaultVal = $(this).data("default");
|
||||||
|
if ($(this).data("type") === 'radio') {
|
||||||
|
// simulate read only for checkboxes except default
|
||||||
|
input.forEach(
|
||||||
|
function(radioElement) {
|
||||||
|
radioElement.setAttribute('disabled', true);
|
||||||
|
if (radioElement.value === defaultVal){
|
||||||
|
radioElement.removeAttribute('disabled');
|
||||||
|
radioElement.checked = true;
|
||||||
|
} else {
|
||||||
|
radioElement.removeAttribute('checked');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
} else if ($(this).data("type") === 'text') {
|
||||||
|
if ((input[0].id === "sccp_bindaddr") || (input[0].id === "sccp_externip")) {
|
||||||
|
// TODO: This is a dirty hack as default value is wrong - need to improve
|
||||||
|
input[0].value = '0.0.0.0';
|
||||||
|
} else {
|
||||||
|
input[0].value = defaultVal;
|
||||||
|
input[0].readOnly = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('restore/unchecked');
|
||||||
|
edit_style.display = 'none';
|
||||||
|
if ($(this).data("type") === 'radio') {
|
||||||
|
input.forEach(
|
||||||
|
function(radioElement) {
|
||||||
|
//Revert to original value as have unchecked customise.
|
||||||
|
radioElement.checked = radioElement.defaultChecked;
|
||||||
|
radioElement.name.value = radioElement.name.defaultValue;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else if ($(this).data("type") === 'text') {
|
||||||
|
//Revert to original value as have unchecked customise.
|
||||||
|
input[0].value = input[0].defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".sccp-edit").click(function() {
|
||||||
|
//input is sent by data-xxx where xxx is an attribute
|
||||||
|
var id = $(this).data("for"), input = $("#" + id);
|
||||||
|
var edit_style = document.getElementById("edit_" + id).style;
|
||||||
|
input = document.getElementsByName(id);
|
||||||
|
|
||||||
|
if (input.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($(this).is(":checked")) {
|
||||||
|
// editing away from the default value
|
||||||
|
console.log('edit/checked');
|
||||||
|
edit_style.display = 'block';
|
||||||
|
if ($(this).data("type") === 'radio') {
|
||||||
|
input.forEach(
|
||||||
|
function(radioElement) {
|
||||||
|
radioElement.removeAttribute('disabled');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
} else if ($(this).data("type") === 'text') {
|
||||||
|
input[0].focus();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('edit/unchecked');
|
||||||
|
edit_style.display = 'none';
|
||||||
|
if ($(this).data("type") === 'radio') {
|
||||||
|
input.forEach(
|
||||||
|
function(radioElement) {
|
||||||
|
//Revert to original value as have unchecked customise.
|
||||||
|
radioElement.checked = radioElement.defaultChecked;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else if ($(this).data("type") === 'text') {
|
||||||
|
//Revert to original value as have unchecked customise.
|
||||||
|
input[0].value = input[0].defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
|
||||||
803
conf/CiscoIPPhone.xsd
Normal file
803
conf/CiscoIPPhone.xsd
Normal 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>
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
</srstInfo>
|
</srstInfo>
|
||||||
<connectionMonitorDuration>120</connectionMonitorDuration>
|
<connectionMonitorDuration>120</connectionMonitorDuration>
|
||||||
</devicePool>
|
</devicePool>
|
||||||
<versionStamp>{Jan 01 2003 00:00:00}</versionStamp>
|
<versionStamp>{Jan 01 2003 00:00:00}</versionStamp>
|
||||||
<loadInformation>P00308010100</loadInformation>
|
<loadInformation>P00308010100</loadInformation>
|
||||||
<vendorConfig>
|
<vendorConfig>
|
||||||
<disableSpeaker>false</disableSpeaker>
|
<disableSpeaker>false</disableSpeaker>
|
||||||
|
|
|
||||||
|
|
@ -1,525 +0,0 @@
|
||||||
<?php
|
|
||||||
// vim: set ai ts=4 sw=4 ft=php:
|
|
||||||
// Version for SCCP Manager 13.0.X
|
|
||||||
//
|
|
||||||
// Template for Sccp Driver
|
|
||||||
/*
|
|
||||||
* Required Functions for Core Drivers
|
|
||||||
* getInfo
|
|
||||||
* addDevice
|
|
||||||
* delDevice
|
|
||||||
* getDevice
|
|
||||||
* getDefaultDeviceSettings
|
|
||||||
* getDeviceDisplay
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
//
|
|
||||||
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" => 'mailbox',
|
|
||||||
"musicclass" => 'musicclass', "allow" => 'allow',"disallow" => 'disallow',
|
|
||||||
"videomode" => 'videomode',
|
|
||||||
"dnd" => 'dnd', "silencesuppression" => 'silencesuppression',
|
|
||||||
"secondary_dialtone_digits" => 'secondary_dialtone_digits', "secondary_dialtone_tone" => 'secondary_dialtone_tone',
|
|
||||||
'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup'
|
|
||||||
);
|
|
||||||
private $guiDefaults =array(
|
|
||||||
'gui_checkset' => array( "elemname" => "",
|
|
||||||
"prompttext" => "",
|
|
||||||
"helptext" => "",
|
|
||||||
"currentvalue" => "",
|
|
||||||
"valarray" => array(),
|
|
||||||
"jsonclick" => '',
|
|
||||||
"jsvalidation" => "",
|
|
||||||
"failvalidationmsg" => "",
|
|
||||||
"canbeempty" => true,
|
|
||||||
"maxchars" => 0,
|
|
||||||
"disable" => false,
|
|
||||||
"inputgroup" => false,
|
|
||||||
"class" => "",
|
|
||||||
"cblabel" => 'Enable',
|
|
||||||
"disabled_value" => 'DEFAULT',
|
|
||||||
"check_enables" => 'true',
|
|
||||||
"cbdisable" => false,
|
|
||||||
"cbclass" => '')
|
|
||||||
);
|
|
||||||
|
|
||||||
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) {
|
|
||||||
global $currentcomponent;
|
|
||||||
$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 (strpos($key,'codec_') !== false ) {
|
|
||||||
$allow_codec[] =substr($key,6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$settings['allow']['value'] = implode(",", $allow_codec);
|
|
||||||
|
|
||||||
// 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 (!empty($_REQUEST['vm']) && ($_REQUEST['vm'] =='enabled')){ // mailbox
|
|
||||||
if (empty($settings['mailbox']['value'])) {
|
|
||||||
$settings['mailbox']['value']= $id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$tech = Array();
|
|
||||||
$sql = "DESCRIBE sccpline";
|
|
||||||
foreach ($this->database->query($sql) as $row) {
|
|
||||||
$tech[$row["Field"]]=$row["Field"];
|
|
||||||
}
|
|
||||||
$sqlCol = 'name';
|
|
||||||
$sqlVal = "'{$id}'";
|
|
||||||
foreach($this->data_fld as $key => $val) {
|
|
||||||
if (isset($tech[$key])) {
|
|
||||||
if (isset($settings[$val]['value'])){
|
|
||||||
$sqlCol .= ", {$key}";
|
|
||||||
$sqlVal .= ", '{$settings[$val]['value']}'";
|
|
||||||
} else {
|
|
||||||
$sqlCol .= ", {$key}";
|
|
||||||
$sqlVal .= ", DEFAULT( {$key} )";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$sql = "REPLACE INTO sccpline ( {$sqlCol} ) VALUES ( {$sqlVal} );";
|
|
||||||
|
|
||||||
$sth = $this->database->prepare($sql);
|
|
||||||
$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) {
|
|
||||||
$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 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(
|
|
||||||
"mailbox" => array(
|
|
||||||
"value" => "",
|
|
||||||
"flag" => $flag++
|
|
||||||
),
|
|
||||||
"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" => "on",
|
|
||||||
"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++
|
|
||||||
),
|
|
||||||
"allow" => array(
|
|
||||||
"value" => "all",
|
|
||||||
"flag" => $flag++
|
|
||||||
),
|
|
||||||
"disallow" => array(
|
|
||||||
"value" => "all",
|
|
||||||
"flag" => $flag++
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return array(
|
|
||||||
"dial" => $dial,
|
|
||||||
"settings" => $settings
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDeviceDisplay($display, $deviceInfo, $currentcomponent, $primarySection) {
|
|
||||||
$section = _("SCCP Extension Details");
|
|
||||||
$section_с = _("SCCP Codec Details");
|
|
||||||
$gn_category = "sccp";
|
|
||||||
global $currentcomponent, $display;
|
|
||||||
$named_group = $this->getNamedGroup();
|
|
||||||
//add sccp category
|
|
||||||
$currentcomponent->addTabTranslation('sccp',_('SCCP'));
|
|
||||||
|
|
||||||
//Fill Codecs Informations
|
|
||||||
|
|
||||||
$Sccp_Codec = array('alaw', 'ulaw', 'g722', 'g723', 'g726', 'g729', 'gsm', 'h264', 'h263', 'h261');
|
|
||||||
$allCodecs = $this->freepbx->Codecs->getAudio(true);
|
|
||||||
$allVCodecs = $this->freepbx->Codecs->getVideo();
|
|
||||||
$ACodec_cur = array('all');
|
|
||||||
$VCodec_cur = array('all');
|
|
||||||
|
|
||||||
foreach ($allCodecs as $c => $v) {
|
|
||||||
if (array_search($c,$Sccp_Codec) !=null) {
|
|
||||||
$currentcomponent->addoptlistitem('devinfo_sccp_codec', "devinfo_codec_"."$c", "$c");
|
|
||||||
if (isset($deviceInfo['allow'])) {
|
|
||||||
if (strpos($deviceInfo['allow'],$c)!== false) {
|
|
||||||
$ACodec_cur[] ="devinfo_codec_"."$c";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($allVCodecs as $c => $v) {
|
|
||||||
if (array_search($c,$Sccp_Codec) !=null) {
|
|
||||||
$currentcomponent->addoptlistitem('devinfo_sccp_vcodec', "devinfo_codec_"."$c", "$c");
|
|
||||||
if (isset($deviceInfo['allow'])) {
|
|
||||||
if (strpos($deviceInfo['allow'],$c)!== false) {
|
|
||||||
$VCodec_cur[] ="devinfo_codec_"."$c";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$el = array(
|
|
||||||
"elemname" => "devinfo_sccp_codec",
|
|
||||||
"prompttext" => _('Line Audio Codec:'),
|
|
||||||
"helptext" => _("Line Audio Codec"),
|
|
||||||
"currentvalue" => $ACodec_cur,
|
|
||||||
"valarray" => $currentcomponent->getoptlist('devinfo_sccp_codec'),
|
|
||||||
"class" => $section_с,
|
|
||||||
"disable" => 0
|
|
||||||
);
|
|
||||||
|
|
||||||
$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" => $VCodec_cur,
|
|
||||||
"valarray" => $currentcomponent->getoptlist('devinfo_sccp_vcodec'),
|
|
||||||
"class" => $section_с,
|
|
||||||
"disable" => 0
|
|
||||||
);
|
|
||||||
$currentcomponent->addguielem($section_с, new \gui_checkset(array_merge($this->guiDefaults['gui_checkset'],$el)), $gn_category);
|
|
||||||
|
|
||||||
$tmparr = array();
|
|
||||||
$tt = _("Name or id of linked maibox");
|
|
||||||
$tmparr['mailbox'] = array('prompttext' => _('Mailbox'), 'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section,'category' => $gn_category);
|
|
||||||
|
|
||||||
$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' => '', 'tt' => $tt, 'level' => 1, 'section' => $section,'category' => $gn_category);
|
|
||||||
|
|
||||||
$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,'category' => $gn_category);
|
|
||||||
|
|
||||||
$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,'category' => $gn_category);
|
|
||||||
|
|
||||||
$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,'category' => $gn_category);
|
|
||||||
|
|
||||||
$tt = _("Named PickupGroup : ");
|
|
||||||
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,'category' => $gn_category);
|
|
||||||
|
|
||||||
$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,'category' => $gn_category);
|
|
||||||
|
|
||||||
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,'category' => $gn_category);
|
|
||||||
|
|
||||||
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,'category' => $gn_category);
|
|
||||||
|
|
||||||
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,'category' => $gn_category);
|
|
||||||
|
|
||||||
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,'category' => $gn_category);
|
|
||||||
|
|
||||||
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,'category' => $gn_category);
|
|
||||||
|
|
||||||
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,'category' => $gn_category);
|
|
||||||
|
|
||||||
unset($select);
|
|
||||||
$select[] = array('value' => 'on', 'text' => 'Yes');
|
|
||||||
$select[] = array('value' => 'off', 'text' => 'No');
|
|
||||||
$tt = _("Silence Suppression. Asterisk Not supported");
|
|
||||||
$tmparr['silencesuppression'] = array('prompttext' => _('Silence Suppression'), 'value' => 'off', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section,'category' => $gn_category);
|
|
||||||
|
|
||||||
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,'category' => $gn_category);
|
|
||||||
unset($select);
|
|
||||||
|
|
||||||
$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 ,'category' => $gn_category);
|
|
||||||
unset($select);
|
|
||||||
|
|
||||||
$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);
|
|
||||||
|
|
||||||
$tt = _("Codec disallow");
|
|
||||||
$tmparr['disallow'] = array('prompttext' => _('Codec disallow'), 'value' => 'all', 'tt' => $tt, 'level' => 1, 'section' => $section_с,'category' => $gn_category);
|
|
||||||
unset($select);
|
|
||||||
|
|
||||||
$devopts = $tmparr;
|
|
||||||
return $devopts;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function reload_line($id) {
|
|
||||||
global $astman;
|
|
||||||
// TODO: Change to use amInterfaceClasses
|
|
||||||
$result = $astman->Command('sccp reload line ' . $id);
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getNamedGroup() {
|
|
||||||
$sql = "select namedcallgroup from sccpline group by namedcallgroup";
|
|
||||||
$sth = $this->database->prepare($sql);
|
|
||||||
$result = array();
|
|
||||||
$tech = array();
|
|
||||||
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 getDeviceHeaders() {
|
|
||||||
return array(
|
|
||||||
'secret' => array('identifier' => _('Secret'), 'description' => sprintf(_('Secret [Enter "%s" to regenerate]'),"REGEN")),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
conf/mappingRulesHeader
Normal file
9
conf/mappingRulesHeader
Normal 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
|
||||||
|
#
|
||||||
|
|
@ -41,10 +41,3 @@ hotline_context=default
|
||||||
hotline_extension=111
|
hotline_extension=111
|
||||||
devicetable=sccpdevice
|
devicetable=sccpdevice
|
||||||
linetable=sccpline
|
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
|
|
@ -1,12 +0,0 @@
|
||||||
[main]
|
|
||||||
debug = on ; The output in the browser window for more information
|
|
||||||
tftproot = /tftpboot
|
|
||||||
;default_language = English_United_States
|
|
||||||
|
|
||||||
firmware = firmware
|
|
||||||
settings = /tftpboot
|
|
||||||
wallpapers = /tftpboot/Desktops
|
|
||||||
ringtones = ringtones
|
|
||||||
locales = locales
|
|
||||||
countries = countries
|
|
||||||
languages = /tftpboot/languages
|
|
||||||
2882
contrib/masterFilesStructure.xml
Normal file
2882
contrib/masterFilesStructure.xml
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -174,27 +174,28 @@ ri ^(ATA030204SCCP090202A.zup)$ firmware/ata186/\1
|
||||||
# Sub-Directory Handling
|
# Sub-Directory Handling
|
||||||
|
|
||||||
# settings
|
# settings
|
||||||
#ri ^(.+\.tlv)?$ settings/\1
|
ri ^(.+\.tlv)?$ settings/\1
|
||||||
#ri ^\/(.+\.tlv)?$ settings/\1
|
ri ^\/(.+\.tlv)?$ settings/\1
|
||||||
#ri ^((.+\.cnf.xml)(\.enc)?(\.sgn)?)$ settings/\1
|
ri ^((.+\.cnf.xml)(\.enc)?(\.sgn)?)$ settings/\1
|
||||||
#ri ^\/((.+\-cnf.xml)(\.enc)?(\.sgn)?)$ settings/\1
|
ri ^\/((.+\-cnf.xml)(\.enc)?(\.sgn)?)$ settings/\1
|
||||||
#ri ^\/((SPA504G-cfg.xml)(\.enc)?(\.sgn)?)$ settings/\1
|
ri ^\/((SPA504G-cfg.xml)(\.enc)?(\.sgn)?)$ settings/\1
|
||||||
|
|
||||||
# Keep firmware in a separate directory (optional)
|
# Keep firmware in a separate directory (optional)
|
||||||
#ri ^(.+\.loads)$ firmware/\1
|
#ri ^(.+\.loads)$ firmware/\1
|
||||||
#ri ^(.+\.sbn)$ firmware/\1
|
#ri ^(.+\.sbn)$ firmware/\1
|
||||||
|
|
||||||
# Keep locales in a separate directory (optional)
|
|
||||||
ri ^(.+)\/(.+-sccp.jar)$ languages/\1/\2
|
|
||||||
ri ^(.+)\/(.+-sip.jar)$ languages/\1/\2
|
|
||||||
ri ^(.+)\/(.+-dictionary.xml)$ languages/\1/\2
|
|
||||||
ri ^(.+)\/(.+-dictionary-ext.xml)$ languages/\1/\2
|
|
||||||
ri ^(.+)\/(.+-tones.xml)$ languages/\1/\2
|
|
||||||
ri ^(.+)\/(.+-font.xml)$ languages/\1/\2
|
|
||||||
ri ^(.+)\/(.+-kate.xml)$ languages/\1/\2
|
|
||||||
ri ^(.+)\/(gk.+)(\.cfg)$ languages/\1/\2\3
|
|
||||||
|
|
||||||
#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)
|
# Keep ring-tones in a separate directory (optional)
|
||||||
ri ^([R|r]ing[L|l]ist)(\.xml|-wb\.xml)(\.sgn)?$ ringtones/ringlist.xml
|
ri ^([R|r]ing[L|l]ist)(\.xml|-wb\.xml)(\.sgn)?$ ringtones/ringlist.xml
|
||||||
|
|
@ -205,6 +206,9 @@ ri ^(.+)(\.raw|\.rwb|\.pcm)(\.sgn)?$ ringtones/\1\2\3
|
||||||
#ri ^Desktops/(.+)/(List\.xml)(\.sgn)?$ wallpapers/\1/\2\3
|
#ri ^Desktops/(.+)/(List\.xml)(\.sgn)?$ wallpapers/\1/\2\3
|
||||||
#ri ^Desktops/(.+)/(.+\.png)(\.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
|
ri ^authorized_keys$ settings/authorized_keys
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ service tftp
|
||||||
wait = yes
|
wait = yes
|
||||||
user = root
|
user = root
|
||||||
server = /usr/sbin/in.tftpd
|
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
|
disable = no
|
||||||
per_source = 11
|
per_source = 11
|
||||||
cps = 100 2
|
cps = 100 2
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -910,8 +910,8 @@ msgid "General Device configuration"
|
||||||
msgstr "Абонентского устройство"
|
msgstr "Абонентского устройство"
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
msgid "Device SEP ID.[XXXXXXXXXXXX]=MAC"
|
msgid "Device ID.[XXXXXXXXXXXX]=MAC"
|
||||||
msgstr "Устройство SEP ID : [XXXXXXXXXXXX]=MAC"
|
msgstr "Устройство ID : [XXXXXXXXXXXX]=MAC"
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
msgid ""
|
msgid ""
|
||||||
|
|
@ -955,8 +955,8 @@ msgid "Device Label"
|
||||||
msgstr "Название Устройства"
|
msgstr "Название Устройства"
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
msgid "Device SEP ID"
|
msgid "Device ID"
|
||||||
msgstr "Идентификатор устройства SEP ID"
|
msgstr "Идентификатор устройства ID"
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
msgid "The information in the upper right corner of the device screen"
|
msgid "The information in the upper right corner of the device screen"
|
||||||
|
|
@ -1005,7 +1005,7 @@ msgid "Buttons Configuration"
|
||||||
msgstr "Настройка Кнопок"
|
msgstr "Настройка Кнопок"
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
msgid "Device MAC SEP."
|
msgid "Device MAC."
|
||||||
msgstr "Прямое подключение."
|
msgstr "Прямое подключение."
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
|
|
|
||||||
|
|
@ -679,7 +679,7 @@ msgid "General Device configuration"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
msgid "Device SEP ID.[XXXXXXXXXXXX]=MAC"
|
msgid "Device ID.[XXXXXXXXXXXX]=MAC"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
|
|
@ -707,7 +707,7 @@ msgid "Device Label"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
msgid "Device SEP ID"
|
msgid "Device ID"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
|
|
@ -743,7 +743,7 @@ msgid "Buttons Configuration"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
msgid "Device MAC SEP."
|
msgid "Device MAC."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: views/sccpgeneral.xml:
|
#: views/sccpgeneral.xml:
|
||||||
|
|
|
||||||
1220
install.php
1220
install.php
File diff suppressed because it is too large
Load diff
116
module.xml
116
module.xml
|
|
@ -1,7 +1,7 @@
|
||||||
<module>
|
<module>
|
||||||
<rawname>sccp_manager</rawname>
|
<rawname>sccp_manager</rawname>
|
||||||
<name>SCCP Manager</name>
|
<name>SCCP Manager</name>
|
||||||
<version>14.2.0.11</version>
|
<version>14.5.0.4</version>
|
||||||
<type>setup</type>
|
<type>setup</type>
|
||||||
<category>SCCP Connectivity</category>
|
<category>SCCP Connectivity</category>
|
||||||
<publisher>Steve Lad, Alex GP</publisher>
|
<publisher>Steve Lad, Alex GP</publisher>
|
||||||
|
|
@ -23,13 +23,38 @@
|
||||||
* Version 14.2.0.8 * - Fix uninstaller and create backup
|
* 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.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.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>
|
</changelog>
|
||||||
<location>https://github.com/chan-sccp/sccp_manager</location>
|
<location>https://github.com/chan-sccp/sccp_manager</location>
|
||||||
|
<depends>
|
||||||
|
<version>15</version>
|
||||||
|
<phpversion>7.0</phpversion>
|
||||||
|
<phpcomponent>zip</phpcomponent>
|
||||||
|
</depends>
|
||||||
<supported>
|
<supported>
|
||||||
<version>13.0.0.2M</version>
|
<version>13.0.0.2M</version>
|
||||||
</supported>
|
</supported>
|
||||||
<info>https://github.com/chan-sccp/sccp_manager</info>
|
<info>https://github.com/chan-sccp/sccp_manager</info>
|
||||||
<!--<updateurl>https://raw.githubusercontent.com/chan-sccp/sccp_manager/develop/sccpManagerUpdater.json</updateurl> -->
|
<updateurl>https://raw.githubusercontent.com/chan-sccp/sccp_manager/develop/sccpManagerUpdater.json</updateurl>
|
||||||
<license>GPL</license>
|
<license>GPL</license>
|
||||||
<md5sum></md5sum>
|
<md5sum></md5sum>
|
||||||
<database>
|
<database>
|
||||||
|
|
@ -37,6 +62,7 @@
|
||||||
<field name="name" type="string" length="15" primarykey="true"/>
|
<field name="name" type="string" length="15" primarykey="true"/>
|
||||||
<field name="type" type="string" length="15" notnull="false"/>
|
<field name="type" type="string" length="15" notnull="false"/>
|
||||||
<field name="addon" type="string" length="45" 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="_description" type="string" length="45" notnull="false"/>
|
||||||
<field name="tzoffset" type="string" length="5" notnull="false"/>
|
<field name="tzoffset" type="string" length="5" notnull="false"/>
|
||||||
<field name="imageversion" type="string" length="31" notnull="false"/>
|
<field name="imageversion" type="string" length="31" notnull="false"/>
|
||||||
|
|
@ -70,9 +96,11 @@
|
||||||
<field name="backgroundThumbnail" 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="ringtone" type="string" length="255" notnull="false"/>
|
||||||
<field name="callhistory_answered_elsewhere" type="string" notnull="false"/>
|
<field name="callhistory_answered_elsewhere" type="string" notnull="false"/>
|
||||||
<field name="_hwlang" type="string" length="12" notnull="false"/>
|
<field name="loginname" type="string" length="20" default="NULL" notnull="false"/>
|
||||||
<field name="_loginname" type="string" length="20" notnull="false"/>
|
<field name="_loginname" type="string" length="20" notnull="false"/>
|
||||||
<field name="_profileid" type="integer" default="0"/>
|
<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="_dialrules" type="string" length="255" notnull="false"/>
|
||||||
<field name="useRedialMenu" type="string" length="5" default="no" notnull="false"/>
|
<field name="useRedialMenu" type="string" length="5" default="no" notnull="false"/>
|
||||||
<field name="cfwdnoanswer" type="string" default="on" notnull="false"/>
|
<field name="cfwdnoanswer" type="string" default="on" notnull="false"/>
|
||||||
|
|
@ -80,6 +108,71 @@
|
||||||
<field name="monitor" type="string" notnull="false"/>
|
<field name="monitor" type="string" notnull="false"/>
|
||||||
<field name="transfer_on_hangup" type="string" notnull="false"/>
|
<field name="transfer_on_hangup" type="string" notnull="false"/>
|
||||||
<field name="phonecodepage" type="string" length="50" 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>
|
||||||
<table name="sccpline">
|
<table name="sccpline">
|
||||||
<field name="id" type="integer" autoincrement="true"/>
|
<field name="id" type="integer" autoincrement="true"/>
|
||||||
|
|
@ -121,6 +214,18 @@
|
||||||
<field name="setvar" type="string" length="50" notnull="false"/>
|
<field name="setvar" type="string" length="50" notnull="false"/>
|
||||||
<field name="name" type="string" length="40" primarykey="true"/>
|
<field name="name" type="string" length="40" primarykey="true"/>
|
||||||
<field name="phonecodepage" type="string" length="50" notnull="false"/>
|
<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">
|
<key name="id" type="unique">
|
||||||
<column name="id"/>
|
<column name="id"/>
|
||||||
</key>
|
</key>
|
||||||
|
|
@ -165,9 +270,10 @@
|
||||||
</table>
|
</table>
|
||||||
<table name="sccpsettings">
|
<table name="sccpsettings">
|
||||||
<field name="keyword" type="string" length="50" primarykey="true"/>
|
<field name="keyword" type="string" length="50" primarykey="true"/>
|
||||||
<field name="data" type="string" length="255"/>
|
<field name="data" type="string" length="255" notnull="false"/>
|
||||||
<field name="seq" type="boolean" primarykey="true"/>
|
<field name="seq" type="boolean" primarykey="true"/>
|
||||||
<field name="type" type="boolean" primarykey="true"/>
|
<field name="type" type="boolean" primarykey="true"/>
|
||||||
|
<field name="systemdefault" type="string" length="255" notnull="false"/>
|
||||||
</table>
|
</table>
|
||||||
</database>
|
</database>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
||||||
482
sccpManClasses/Sccp.class.php.v433
Normal file
482
sccpManClasses/Sccp.class.php.v433
Normal 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")),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -100,8 +100,9 @@ class SCCPShowDevice_Event extends Event
|
||||||
// This is a list of tables
|
// This is a list of tables
|
||||||
public function getCapabilities()
|
public function getCapabilities()
|
||||||
{
|
{
|
||||||
|
// TODO unused method - to be deleted?
|
||||||
$ret = array();
|
$ret = array();
|
||||||
$codecs = explode(", ", substr($this->getKey('Capabilities'), 1, -1));
|
$codecs = explode(';', substr($this->getKey('Capabilities'), 1, -1));
|
||||||
foreach ($codecs as $codec) {
|
foreach ($codecs as $codec) {
|
||||||
$codec_parts = explode(" ", $codec);
|
$codec_parts = explode(" ", $codec);
|
||||||
$ret[] = array("name" => $codec_parts[0], "value" => substr($codec_parts[1], 1, -1));
|
$ret[] = array("name" => $codec_parts[0], "value" => substr($codec_parts[1], 1, -1));
|
||||||
|
|
@ -111,8 +112,9 @@ class SCCPShowDevice_Event extends Event
|
||||||
|
|
||||||
public function getCodecsPreference()
|
public function getCodecsPreference()
|
||||||
{
|
{
|
||||||
|
// TODO unused method - to be deleted?
|
||||||
$ret = array();
|
$ret = array();
|
||||||
$codecs = explode(", ", substr($this->getKey('CodecsPreference'), 1, -1));
|
$codecs = explode(';', substr($this->getKey('CodecsPreference'), 1, -1));
|
||||||
foreach ($codecs as $codec) {
|
foreach ($codecs as $codec) {
|
||||||
$codec_parts = explode(" ", $codec);
|
$codec_parts = explode(" ", $codec);
|
||||||
$ret[] = array("name" => $codec_parts[0], "value" => substr($codec_parts[1], 1, -1));
|
$ret[] = array("name" => $codec_parts[0], "value" => substr($codec_parts[1], 1, -1));
|
||||||
|
|
|
||||||
|
|
@ -392,7 +392,7 @@ class aminterface
|
||||||
$result = array();
|
$result = array();
|
||||||
if ($this->_connect_state) {
|
if ($this->_connect_state) {
|
||||||
$_action = new \FreePBX\modules\Sccp_manager\aminterface\SCCPShowDevicesAction();
|
$_action = new \FreePBX\modules\Sccp_manager\aminterface\SCCPShowDevicesAction();
|
||||||
$result = $this->send($_action)->getResult();
|
$result = (array)$this->send($_action)->getResult();
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
@ -431,18 +431,22 @@ class aminterface
|
||||||
}
|
}
|
||||||
return $result;
|
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()
|
function getSCCPVersion()
|
||||||
{
|
{
|
||||||
//Initialise result array
|
//Initialise result array
|
||||||
$result = array( 'RevisionHash' => '', 'vCode' => 0, 'RevisionNum' => 0, 'futures' => '', 'Version' => 0);
|
$result = array( 'RevisionHash' => '', 'vCode' => 0, 'RevisionNum' => 0, 'buildInfo' => '', 'Version' => 0);
|
||||||
if ($this->_connect_state) {
|
$metadata = $this->getSCCPConfigMetaData();
|
||||||
$_action = new \FreePBX\modules\Sccp_manager\aminterface\SCCPConfigMetaDataAction();
|
|
||||||
$metadata = $this->send($_action)->getResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($metadata['Version'])) {
|
if (isset($metadata['Version'])) {
|
||||||
$result['Version'] = $metadata['Version'];
|
$result['Version'] = $metadata['Version'];
|
||||||
$version_parts = explode('.', $metadata['Version']);
|
$version_parts = array_map('intval',explode('.', $metadata['Version']));
|
||||||
if ($version_parts[0] === 4) {
|
if ($version_parts[0] === 4) {
|
||||||
switch ($version_parts[1]) {
|
switch ($version_parts[1]) {
|
||||||
case 1:
|
case 1:
|
||||||
|
|
@ -451,9 +455,9 @@ class aminterface
|
||||||
case 2:
|
case 2:
|
||||||
$result['vCode'] = 420;
|
$result['vCode'] = 420;
|
||||||
break;
|
break;
|
||||||
case 3. . .5:
|
case 3:
|
||||||
$result['vCode'] = 430;
|
$result['vCode'] = 430;
|
||||||
if($version_parts[2] == 3){
|
if($version_parts[2] >= 3){
|
||||||
$result['vCode'] = 433;
|
$result['vCode'] = 433;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -472,7 +476,7 @@ class aminterface
|
||||||
$result['RevisionNum'] = $metadata["RevisionNum"];
|
$result['RevisionNum'] = $metadata["RevisionNum"];
|
||||||
}
|
}
|
||||||
if (isset($metadata['ConfigureEnabled'])) {
|
if (isset($metadata['ConfigureEnabled'])) {
|
||||||
$result['futures'] = implode(';', $metadata['ConfigureEnabled']);
|
$result['buildInfo'] = $metadata['ConfigureEnabled'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
|
@ -483,7 +487,7 @@ class aminterface
|
||||||
// Initialise array with default values to eliminate testing later
|
// Initialise array with default values to eliminate testing later
|
||||||
$result = array();
|
$result = array();
|
||||||
$cmd_res = array();
|
$cmd_res = array();
|
||||||
$cmd_res = ['sccp' => ['message' => 'default value', 'realm' => '', 'status' => 'ERROR']];
|
$cmd_res = ['sccp' => ['message' => 'legacy value', 'realm' => '', 'status' => 'ERROR']];
|
||||||
if ($this->_connect_state) {
|
if ($this->_connect_state) {
|
||||||
$_action = new \FreePBX\modules\Sccp_manager\aminterface\CommandAction('realtime mysql status');
|
$_action = new \FreePBX\modules\Sccp_manager\aminterface\CommandAction('realtime mysql status');
|
||||||
$result = $this->send($_action)->getResult();
|
$result = $this->send($_action)->getResult();
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,12 @@ class dbinterface
|
||||||
public function __construct($parent_class = null)
|
public function __construct($parent_class = null)
|
||||||
{
|
{
|
||||||
$this->paren_class = $parent_class;
|
$this->paren_class = $parent_class;
|
||||||
|
$this->db = \FreePBX::Database();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function info()
|
public function info()
|
||||||
{
|
{
|
||||||
$Ver = '13.0.2'; // This should be updated
|
$Ver = '14.0.0.1'; // This should be updated
|
||||||
return array('Version' => $Ver,
|
return array('Version' => $Ver,
|
||||||
'about' => 'Data access interface ver: ' . $Ver);
|
'about' => 'Data access interface ver: ' . $Ver);
|
||||||
}
|
}
|
||||||
|
|
@ -32,7 +33,7 @@ class dbinterface
|
||||||
public function get_db_SccpTableByID($dataid, $data = array(), $indexField = '')
|
public function get_db_SccpTableByID($dataid, $data = array(), $indexField = '')
|
||||||
{
|
{
|
||||||
$result = array();
|
$result = array();
|
||||||
$raw = $this->HWextension_db_SccpTableData($dataid, $data);
|
$raw = $this->getSccpDeviceTableData($dataid, $data);
|
||||||
if (empty($raw) || empty($indexField)) {
|
if (empty($raw) || empty($indexField)) {
|
||||||
return $raw;
|
return $raw;
|
||||||
}
|
}
|
||||||
|
|
@ -43,27 +44,44 @@ class dbinterface
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function HWextension_db_SccpTableData($dataid, $data = array())
|
public function getSccpDeviceTableData(string $dataid, $data = array())
|
||||||
{
|
{
|
||||||
// $stmt is a single row fetch, $stmts is a fetchAll.
|
// $stmt is a single row fetch, $stmts is a fetchAll while stmtU is fetchAll UNIQUE
|
||||||
$dbh = \FreePBX::Database();
|
|
||||||
$stmt = '';
|
$stmt = '';
|
||||||
$stmts = '';
|
$stmts = '';
|
||||||
if ($dataid == '') {
|
$stmtU = '';
|
||||||
return false;
|
|
||||||
}
|
|
||||||
switch ($dataid) {
|
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':
|
case 'SccpExtension':
|
||||||
if (empty($data['name'])) {
|
if (empty($data['name'])) {
|
||||||
$stmts = $dbh->prepare('SELECT * FROM sccpline ORDER BY name');
|
$stmtU = $this->db->prepare('SELECT name, sccpline.* FROM sccpline ORDER BY name');
|
||||||
} else {
|
} else {
|
||||||
$stmts = $dbh->prepare('SELECT * FROM sccpline WHERE name = :name');
|
$stmts = $this->db->prepare('SELECT * FROM sccpline WHERE name = :name');
|
||||||
$stmts->bindParam(':name', $data['name'],\PDO::PARAM_STR);
|
$stmts->bindParam(':name', $data['name'],\PDO::PARAM_STR);
|
||||||
}
|
}
|
||||||
break;
|
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':
|
case 'SccpDevice':
|
||||||
if (empty($data['fields'])) {
|
if (empty($data['fields'])) {
|
||||||
$fld = 'name, name as mac, type, button, addon, _description as description';
|
$fld = 'name, name as mac, type, button, addon, description';
|
||||||
} else {
|
} else {
|
||||||
switch ($data['fields']) {
|
switch ($data['fields']) {
|
||||||
case "all":
|
case "all":
|
||||||
|
|
@ -78,48 +96,49 @@ class dbinterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($data['name'])) { //either filter by name or by type
|
if (!empty($data['name'])) { //either filter by name or by type
|
||||||
$stmt = $dbh->prepare('SELECT ' . $fld . ' FROM sccpdeviceconfig WHERE name = :name ORDER BY name');
|
$stmt = $this->db->prepare('SELECT ' . $fld . ' FROM sccpdeviceconfig WHERE name = :name ORDER BY name');
|
||||||
$stmt->bindParam(':name', $data['name'],\PDO::PARAM_STR);
|
$stmt->bindParam(':name', $data['name'],\PDO::PARAM_STR);
|
||||||
} elseif (!empty($data['type'])) {
|
} elseif (!empty($data['type'])) {
|
||||||
switch ($data['type']) {
|
switch ($data['type']) {
|
||||||
case "cisco-sip":
|
case "cisco-sip":
|
||||||
$stmts = $dbh->prepare("SELECT {$fld} FROM sccpdeviceconfig WHERE TYPE LIKE '%-sip' ORDER BY name");
|
$stmts = $this->db->prepare("SELECT {$fld} FROM sccpdeviceconfig WHERE TYPE LIKE '%-sip' ORDER BY name");
|
||||||
break;
|
break;
|
||||||
case "cisco": // Fall through to default intentionally
|
case "cisco": // Fall through to default intentionally
|
||||||
default:
|
default:
|
||||||
$stmts = $dbh->prepare("SELECT {$fld} FROM sccpdeviceconfig WHERE TYPE not LIKE '%-sip' ORDER BY name");
|
$stmts = $this->db->prepare("SELECT {$fld} FROM sccpdeviceconfig WHERE TYPE not LIKE '%-sip' ORDER BY name");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else { //no filter and no name provided - return all
|
} else { //no filter and no name provided - return all
|
||||||
$stmts = $dbh->prepare("SELECT {$fld} FROM sccpdeviceconfig ORDER BY name");
|
$stmts = $this->db->prepare("SELECT {$fld} FROM sccpdeviceconfig ORDER BY name");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'HWSipDevice':
|
|
||||||
$raw_settings = $this->getDb_model_info($get = "sipphones", $format_list = "model");
|
|
||||||
break;
|
|
||||||
case 'HWDevice':
|
|
||||||
$raw_settings = $this->getDb_model_info($get = "ciscophones", $format_list = "model");
|
|
||||||
break;
|
|
||||||
case 'HWextension':
|
|
||||||
$raw_settings = $this->getDb_model_info($get = "extension", $format_list = "model");
|
|
||||||
break;
|
|
||||||
case 'get_columns_sccpdevice':
|
case 'get_columns_sccpdevice':
|
||||||
$stmts = $dbh->prepare('DESCRIBE sccpdevice');
|
$stmtU = $this->db->prepare('DESCRIBE sccpdevice');
|
||||||
break;
|
break;
|
||||||
case 'get_columns_sccpuser':
|
case 'get_columns_sccpuser':
|
||||||
$stmts = $dbh->prepare('DESCRIBE sccpuser');
|
$stmts = $this->db->prepare('DESCRIBE sccpuser');
|
||||||
|
break;
|
||||||
|
case 'get_columns_sccpline':
|
||||||
|
$stmtU = $this->db->prepare('DESCRIBE sccpline');
|
||||||
break;
|
break;
|
||||||
case 'get_sccpdevice_byid':
|
case 'get_sccpdevice_byid':
|
||||||
$stmt = $dbh->prepare('SELECT t1.*, types.dns, types.buttons, types.loadimage, types.nametemplate as nametemplate,
|
$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
|
addon.buttons as addon_buttons FROM sccpdevice AS t1
|
||||||
LEFT JOIN sccpdevmodel as types ON t1.type=types.model
|
LEFT JOIN sccpdevmodel as types ON t1.type=types.model
|
||||||
LEFT JOIN sccpdevmodel as addon ON t1.addon=addon.model WHERE name = :name');
|
LEFT JOIN sccpdevmodel as addon ON t1.addon=addon.model WHERE name = :name');
|
||||||
$stmt->bindParam(':name', $data['id'],\PDO::PARAM_STR);
|
$stmt->bindParam(':name', $data['id'],\PDO::PARAM_STR);
|
||||||
break;
|
break;
|
||||||
case 'get_sccpuser':
|
case 'get_sccpuser':
|
||||||
$stmt = $dbh->prepare('SELECT * FROM sccpuser WHERE name = :name');
|
$stmt = $this->db->prepare('SELECT * FROM sccpuser WHERE name = :name');
|
||||||
$stmt->bindParam(':name', $data['id'],\PDO::PARAM_STR);
|
$stmt->bindParam(':name', $data['id'],\PDO::PARAM_STR);
|
||||||
break;
|
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':
|
case 'get_sccpdevice_buttons':
|
||||||
$sql = '';
|
$sql = '';
|
||||||
if (!empty($data['buttontype'])) {
|
if (!empty($data['buttontype'])) {
|
||||||
|
|
@ -129,7 +148,7 @@ class dbinterface
|
||||||
$sql .= (empty($sql)) ? 'ref = :ref' : ' and ref = :ref';
|
$sql .= (empty($sql)) ? 'ref = :ref' : ' and ref = :ref';
|
||||||
}
|
}
|
||||||
if (!empty($sql)) {
|
if (!empty($sql)) {
|
||||||
$stmts = $dbh->prepare("SELECT * FROM sccpbuttonconfig WHERE {$sql} ORDER BY instance");
|
$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.
|
// 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.
|
// can only bind once have prepared, so need to test again.
|
||||||
if (!empty($data['buttontype'])) {
|
if (!empty($data['buttontype'])) {
|
||||||
|
|
@ -142,6 +161,8 @@ class dbinterface
|
||||||
$raw_settings = array();
|
$raw_settings = array();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
// No default case so will give exception of $raw_settings undefined if the
|
||||||
|
// dataid is not in the switch.
|
||||||
}
|
}
|
||||||
if (!empty($stmt)) {
|
if (!empty($stmt)) {
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
|
@ -149,25 +170,25 @@ class dbinterface
|
||||||
} elseif (!empty($stmts)) {
|
} elseif (!empty($stmts)) {
|
||||||
$stmts->execute();
|
$stmts->execute();
|
||||||
$raw_settings = $stmts->fetchAll(\PDO::FETCH_ASSOC);
|
$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;
|
return $raw_settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_db_SccpSetting()
|
public function get_db_SccpSetting()
|
||||||
{
|
{
|
||||||
$dbh = \FreePBX::Database();
|
$stmt = $this->db->prepare('SELECT keyword, sccpsettings.* FROM sccpsettings ORDER BY type, seq');
|
||||||
$stmt = $dbh->prepare('SELECT keyword, data, type, seq FROM sccpsettings ORDER BY type, seq');
|
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
foreach ($stmt->fetchAll() as $var) {
|
$settingsFromDb = $stmt->fetchAll(\PDO::FETCH_ASSOC|\PDO::FETCH_UNIQUE);
|
||||||
$mysccpvalues[$var['keyword']] = array('keyword' => $var['keyword'], 'data' => $var['data'], 'seq' => $var['seq'], 'type' => $var['type']);
|
return $settingsFromDb;
|
||||||
}
|
|
||||||
return $mysccpvalues;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_db_sysvalues()
|
public function get_db_sysvalues()
|
||||||
{
|
{
|
||||||
$dbh = \FreePBX::Database();
|
$stmt = $this->db->prepare('SHOW VARIABLES LIKE \'%group_concat%\'');
|
||||||
$stmt = $dbh->prepare('SHOW VARIABLES LIKE \'%group_concat%\'');
|
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
return $stmt->fetch(\PDO::FETCH_ASSOC);
|
return $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
@ -178,10 +199,9 @@ class dbinterface
|
||||||
|
|
||||||
function getDb_model_info($get = 'all', $format_list = 'all', $filter = array())
|
function getDb_model_info($get = 'all', $format_list = 'all', $filter = array())
|
||||||
{
|
{
|
||||||
$dbh = \FreePBX::Database();
|
|
||||||
$sel_inf = '*, 0 as validate';
|
$sel_inf = '*, 0 as validate';
|
||||||
if ($format_list === 'model') {
|
if ($format_list === 'model') {
|
||||||
$sel_inf = 'model, vendor, dns, buttons, 0 as validate';
|
$sel_inf = "model, vendor, dns, buttons, '-;-' as validate";
|
||||||
}
|
}
|
||||||
switch ($get) {
|
switch ($get) {
|
||||||
case 'byciscoid':
|
case 'byciscoid':
|
||||||
|
|
@ -190,10 +210,10 @@ class dbinterface
|
||||||
if (!strpos($filter['model'], 'loadInformation')) {
|
if (!strpos($filter['model'], 'loadInformation')) {
|
||||||
$filter['model'] = 'loadInformation' . $filter['model'];
|
$filter['model'] = 'loadInformation' . $filter['model'];
|
||||||
}
|
}
|
||||||
$stmt = $dbh->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (loadinformationid = :model ) ORDER BY model");
|
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (loadinformationid = :model ) ORDER BY model");
|
||||||
$stmt->bindParam(':model', $filter['model'], \PDO::PARAM_STR);
|
$stmt->bindParam(':model', $filter['model'], \PDO::PARAM_STR);
|
||||||
} else {
|
} else {
|
||||||
$stmt = $dbh->prepare("SELECT {$sel_inf} FROM sccpdevmodel ORDER BY model");
|
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel ORDER BY model");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -201,32 +221,32 @@ class dbinterface
|
||||||
case 'byid':
|
case 'byid':
|
||||||
if (!empty($filter)) {
|
if (!empty($filter)) {
|
||||||
if (!empty($filter['model'])) {
|
if (!empty($filter['model'])) {
|
||||||
$stmt = $dbh->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE model = :model ORDER BY model");
|
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE model = :model ORDER BY model");
|
||||||
$stmt->bindParam(':model', $filter['model'],\PDO::PARAM_STR);
|
$stmt->bindParam(':model', $filter['model'],\PDO::PARAM_STR);
|
||||||
} else {
|
} else {
|
||||||
$stmt = $dbh->prepare("SELECT {$sel_inf} FROM sccpdevmodel ORDER BY model");
|
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel ORDER BY model");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'extension':
|
case 'extension':
|
||||||
$stmt = $dbh->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns = 0) and (enabled = 1) ORDER BY model");
|
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns = 0) and (enabled = 1) ORDER BY model");
|
||||||
break;
|
break;
|
||||||
case 'enabled':
|
case 'enabled':
|
||||||
//$stmt = $db->prepare('SELECT ' . {$sel_inf} . ' FROM sccpdevmodel WHERE enabled = 1 ORDER BY model'); //previously this fell through to phones.
|
//$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.
|
//break; // above includes expansion modules but was not original behaviour so commented out. Falls through to phones.
|
||||||
case 'phones':
|
case 'phones':
|
||||||
$stmt = $dbh->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns > 0) and (enabled = 1) ORDER BY model");
|
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns != 0) and (enabled = 1) ORDER BY model");
|
||||||
break;
|
break;
|
||||||
case 'ciscophones':
|
case 'ciscophones':
|
||||||
$stmt = $dbh->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns > 0) and (enabled = 1) AND vendor NOT LIKE '%-sip' ORDER BY model");
|
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns > 0) and (enabled = 1) AND vendor NOT LIKE '%-sip' ORDER BY model");
|
||||||
break;
|
break;
|
||||||
case 'sipphones':
|
case 'sipphones':
|
||||||
$stmt = $dbh->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns > 0) and (enabled = 1) AND vendor LIKE '%-sip' ORDER BY model");
|
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (dns > 0) and (enabled = 1) AND vendor LIKE '%-sip' ORDER BY model");
|
||||||
break;
|
break;
|
||||||
case 'all': // Fall through to default
|
case 'all': // Fall through to default
|
||||||
default:
|
default:
|
||||||
$stmt = $dbh->prepare("SELECT {$sel_inf} FROM sccpdevmodel ORDER BY model");
|
$stmt = $this->db->prepare("SELECT {$sel_inf} FROM sccpdevmodel ORDER BY model");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
|
@ -237,26 +257,24 @@ class dbinterface
|
||||||
{
|
{
|
||||||
// mode clear - Empty table before update
|
// mode clear - Empty table before update
|
||||||
// mode update - update / replace record
|
// mode update - update / replace record
|
||||||
$dbh = \FreePBX::Database();
|
|
||||||
$result = false;
|
$result = false;
|
||||||
switch ($table_name) {
|
switch ($table_name) {
|
||||||
case 'sccpsettings':
|
case 'sccpsettings':
|
||||||
if ($mode == 'replace') { // Change mode name to be more transparent
|
if ($mode == 'replace') { // Change mode name to be more transparent
|
||||||
$dbh->prepare('TRUNCATE sccpsettings')->execute();
|
$this->db->prepare('TRUNCATE sccpsettings')->execute();
|
||||||
$stmt = $dbh->prepare('INSERT INTO sccpsettings (keyword, data, seq, type) VALUES (:keyword,:data,:seq,:type)');
|
$stmt = $this->db->prepare('INSERT INTO sccpsettings (keyword, data, seq, type, systemdefault) VALUES (:keyword,:data,:seq,:type,:systemdefault)');
|
||||||
} else {
|
} else {
|
||||||
$stmt = $dbh->prepare('REPLACE INTO sccpsettings (keyword, data, seq, type) VALUES (:keyword,:data,:seq,:type)');
|
$stmt = $this->db->prepare('REPLACE INTO sccpsettings (keyword, seq, type, data, systemdefault) VALUES (:keyword,:seq,:type,:data,:systemdefault)');
|
||||||
}
|
}
|
||||||
foreach ($save_value as $key => $dataArr) {
|
foreach ($save_value as $key => $dataArr) {
|
||||||
if (!empty($dataArr) && isset($dataArr['data'])) {
|
if (empty($dataArr)) {
|
||||||
if (empty($dataArr['data'])) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$stmt->bindParam(':keyword',$dataArr['keyword'],\PDO::PARAM_STR);
|
$stmt->bindParam(':keyword',$dataArr['keyword'],\PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':data',$dataArr['data'],\PDO::PARAM_STR);
|
$stmt->bindParam(':data',$dataArr['data'],\PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':seq',$dataArr['seq'],\PDO::PARAM_INT);
|
$stmt->bindParam(':seq',$dataArr['seq'],\PDO::PARAM_INT);
|
||||||
$stmt->bindParam(':type',$dataArr['type'],\PDO::PARAM_INT);
|
$stmt->bindParam(':type',$dataArr['type'],\PDO::PARAM_INT);
|
||||||
|
$stmt->bindParam(':systemdefault',$dataArr['systemdefault'],\PDO::PARAM_STR);
|
||||||
$result = $stmt->execute();
|
$result = $stmt->execute();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -281,13 +299,13 @@ class dbinterface
|
||||||
if (!empty($sql_var)) {
|
if (!empty($sql_var)) {
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
case 'delete':
|
case 'delete':
|
||||||
$stmt = $dbh->prepare("DELETE FROM {$table_name} WHERE {$sql_key}");
|
$stmt = $this->db->prepare("DELETE FROM {$table_name} WHERE {$sql_key}");
|
||||||
break;
|
break;
|
||||||
case 'update':
|
case 'update':
|
||||||
$stmt = $dbh->prepare("UPDATE {$table_name} SET {$sql_var} WHERE {$sql_key}");
|
$stmt = $this->db->prepare("UPDATE {$table_name} SET {$sql_var} WHERE {$sql_key}");
|
||||||
break;
|
break;
|
||||||
case 'replace':
|
case 'replace':
|
||||||
$stmt = $dbh->prepare("REPLACE INTO {$table_name} SET {$sql_var}");
|
$stmt = $this->db->prepare("REPLACE INTO {$table_name} SET {$sql_var}");
|
||||||
break;
|
break;
|
||||||
// no default mode - must be explicit.
|
// no default mode - must be explicit.
|
||||||
}
|
}
|
||||||
|
|
@ -298,35 +316,37 @@ class dbinterface
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
case 'delete':
|
case 'delete':
|
||||||
$sql = 'DELETE FROM sccpbuttonconfig WHERE ref = :hwid';
|
$sql = 'DELETE FROM sccpbuttonconfig WHERE ref = :hwid';
|
||||||
$stmt = $dbh->prepare($sql);
|
$stmt = $this->db->prepare($sql);
|
||||||
$stmt->bindParam(':hwid', $hwid,\PDO::PARAM_STR);
|
$stmt->bindParam(':hwid', $hwid,\PDO::PARAM_STR);
|
||||||
$result = $stmt->execute();
|
$result = $stmt->execute();
|
||||||
break;
|
break;
|
||||||
case 'replace':
|
case 'replace':
|
||||||
foreach ($save_value as $button_array) {
|
foreach ($save_value as $button_array) {
|
||||||
$stmt = $dbh->prepare('UPDATE sccpbuttonconfig SET name =:name WHERE ref = :ref AND reftype =:reftype AND instance = :instance AND buttontype = :buttontype');
|
$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(':ref', $button_array['ref'],\PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':reftype', $button_array['reftype'],\PDO::PARAM_STR);
|
$stmt->bindParam(':reftype', $button_array['reftype'],\PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':instance', $button_array['instance'],\PDO::PARAM_INT);
|
$stmt->bindParam(':instance', $button_array['instance'],\PDO::PARAM_INT);
|
||||||
$stmt->bindParam(':buttontype', $button_array['type'],\PDO::PARAM_STR);
|
$stmt->bindParam(':buttontype', $button_array['buttontype'],\PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':name', $button_array['name'],\PDO::PARAM_STR);
|
$stmt->bindParam(':name', $button_array['name'],\PDO::PARAM_STR);
|
||||||
|
$stmt->bindParam(':options', $button_array['options'],\PDO::PARAM_STR);
|
||||||
$result= $stmt->execute();
|
$result= $stmt->execute();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'add':
|
case 'add':
|
||||||
foreach ($save_value as $button_array) {
|
foreach ($save_value as $button_array) {
|
||||||
$stmt = $dbh->prepare('INSERT INTO sccpbuttonconfig (ref, reftype, instance, buttontype, name, options) VALUES (:ref, :reftype, :instance, :buttontype, :name, :options)');
|
$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(':ref', $button_array['ref'],\PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':reftype', $button_array['reftype'],\PDO::PARAM_STR);
|
$stmt->bindParam(':reftype', $button_array['reftype'],\PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':instance', $button_array['instance'],\PDO::PARAM_INT);
|
$stmt->bindParam(':instance', $button_array['instance'],\PDO::PARAM_INT);
|
||||||
$stmt->bindParam(':buttontype', $button_array['type'],\PDO::PARAM_STR);
|
$stmt->bindParam(':buttontype', $button_array['buttontype'],\PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':name', $button_array['name'],\PDO::PARAM_STR);
|
$stmt->bindParam(':name', $button_array['name'],\PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':options', $button_array['options'],\PDO::PARAM_STR);
|
$stmt->bindParam(':options', $button_array['options'],\PDO::PARAM_STR);
|
||||||
$result = $stmt->execute();
|
$result = $stmt->execute();
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'clear';
|
case 'clear';
|
||||||
// Clear is equivalent of delete + insert.
|
// Clear is equivalent of delete + insert. Mode is used in order to activate trigger.
|
||||||
$this->write('sccpbuttons', '', $mode = 'delete','', $hwid);
|
$this->write('sccpbuttons', '', $mode = 'delete','', $hwid);
|
||||||
$this->write('sccpbuttons', $save_value, $mode = 'add','', $hwid);
|
$this->write('sccpbuttons', $save_value, $mode = 'add','', $hwid);
|
||||||
break;
|
break;
|
||||||
|
|
@ -335,6 +355,36 @@ class dbinterface
|
||||||
}
|
}
|
||||||
return $result;
|
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 ??!
|
* Maybe Replace by SccpTables ??!
|
||||||
|
|
@ -347,19 +397,22 @@ class dbinterface
|
||||||
return $filename;
|
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
|
* Check Table structure
|
||||||
*/
|
*/
|
||||||
public function validate()
|
public function validate()
|
||||||
{
|
{
|
||||||
$dbh = \FreePBX::Database();
|
|
||||||
$result = 0;
|
$result = 0;
|
||||||
$check_fields = [
|
$check_fields = [
|
||||||
'430' => ['_hwlang' => "varchar(12)"],
|
|
||||||
'431' => ['private'=> "enum('on','off')"],
|
'431' => ['private'=> "enum('on','off')"],
|
||||||
'433' => ['directed_pickup'=>'']
|
'433' => ['directed_pickup'=>'']
|
||||||
];
|
];
|
||||||
$stmt = $dbh->prepare('DESCRIBE sccpdevice');
|
$stmt = $this->db->prepare('DESCRIBE sccpdevice');
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $value) {
|
foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $value) {
|
||||||
$id_result[$value['Field']] = $value['Type'];
|
$id_result[$value['Field']] = $value['Type'];
|
||||||
|
|
@ -379,4 +432,19 @@ class dbinterface
|
||||||
|
|
||||||
return $result;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,32 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace FreePBX\modules\Sccp_manager;
|
namespace FreePBX\modules\Sccp_manager;
|
||||||
|
|
||||||
class extconfigs
|
class extconfigs
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct($parent_class = null)
|
public function __construct($parent_class = null)
|
||||||
{
|
{
|
||||||
$this->paren_class = $parent_class;
|
$this->paren_class = $parent_class;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function info() {
|
public function info() {
|
||||||
$Ver = '13.1.1';
|
$Ver = '13.2.0';
|
||||||
return array('Version' => $Ver,
|
return array('Version' => $Ver,
|
||||||
'about' => 'Default Setings and Enums ver: ' . $Ver);
|
'about' => 'Default Settings and Enums ver: ' . $Ver);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getextConfig($id = '', $index = '') {
|
public function getExtConfig($id = '', $index = '') {
|
||||||
|
$result = array();
|
||||||
switch ($id) {
|
switch ($id) {
|
||||||
case 'keyset':
|
case 'keyset':
|
||||||
$result = $this->keysetdefault;
|
$result = $this->keysetdefault;
|
||||||
break;
|
break;
|
||||||
case 'sccp_lang':
|
case 'sccp_lang':
|
||||||
$result = $this->cisco_language;
|
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;
|
break;
|
||||||
case 'sccpDefaults':
|
case 'sccpDefaults':
|
||||||
$result = $this->sccpDefaults;
|
$result = $this->sccpDefaults;
|
||||||
|
|
@ -96,20 +96,40 @@ class extconfigs
|
||||||
}
|
}
|
||||||
|
|
||||||
private $sccpDefaults = array(
|
private $sccpDefaults = array(
|
||||||
"servername" => 'VPBXSCCP',
|
'servername' => 'VPBXSCCP',
|
||||||
"bindaddr" => '0.0.0.0', "port" => '2000', # chan_sccp also supports ipv6
|
'bindaddr' => '0.0.0.0', "port" => '2000', # chan_sccp also supports ipv6
|
||||||
"deny" => '0.0.0.0/0.0.0.0',
|
'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' => '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',
|
||||||
"dateformat" => 'D.M.Y',
|
'disallow' => 'all', "allow" => 'alaw;ulaw',
|
||||||
"disallow" => 'all', "allow" => 'alaw;ulaw',
|
'hotline_enabled' => 'off',
|
||||||
"hotline_enabled" => 'off',
|
'hotline_context' => 'default', # !TODO!: Should this not be from-internal on FreePBX ?
|
||||||
"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_extension" => '*60', # !TODO!: Is this a good default extension to dial for hotline ?
|
'hotline_label' => 'hotline',
|
||||||
"hotline_label" => 'hotline',
|
'devicetable' => 'sccpdevice',
|
||||||
"devicetable" => 'sccpdevice',
|
'linetable' => 'sccpline',
|
||||||
"linetable" => 'sccpline',
|
'displayconfig' => 'sccpgeneral',
|
||||||
"tftp_path" => '/tftpboot'
|
'_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',
|
private $keysetdefault = array('onhook' => 'redial,newcall,cfwdall,cfwdbusy,cfwdnoanswer,pickup,gpickup,dnd,private',
|
||||||
'connected' => 'hold,endcall,park,vidmode,select,cfwdall,cfwdbusy,idivert,monitor',
|
'connected' => 'hold,endcall,park,vidmode,select,cfwdall,cfwdbusy,idivert,monitor',
|
||||||
|
|
@ -155,7 +175,6 @@ class extconfigs
|
||||||
'pt_BR' => array('code' => 'pt', 'language' => 'Portuguese', 'locale' => 'Portuguese_Brazil', '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'),
|
'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'),
|
'ro_RO' => array('code' => 'ro', 'language' => 'Romanian', 'locale' => 'Romanian_Romania', 'codepage' => 'ISO8859-1'),
|
||||||
'ru_RU' => array('code' => 'ru', 'language' => 'Russian', 'locale' => 'Russian_Russian_Federation', 'codepage' => 'CP1251'),
|
|
||||||
'sk_SK' => array('code' => 'sk', 'language' => 'Slovakian', 'locale' => 'Slovak_Slovakia', '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'),
|
'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_ME' => array('code' => 'sr', 'language' => 'Serbian', 'locale' => 'Serbian_Republic_of_Montenegro', 'codepage' => 'ISO8859-1'),
|
||||||
|
|
@ -216,85 +235,95 @@ class extconfigs
|
||||||
'New Zealand' => array('offset' => '720', 'daylight' => true)
|
'New Zealand' => array('offset' => '720', 'daylight' => true)
|
||||||
);
|
);
|
||||||
|
|
||||||
public function validate_init_path($confDir = '', $db_vars, $sccp_driver_replace = '')
|
public function updateTftpStructure($settingsFromDb) {
|
||||||
{
|
global $amp_conf;
|
||||||
// global $db;
|
$adv_config = array('tftproot' => $settingsFromDb['tftp_path']['data'],
|
||||||
// global $amp_conf;
|
'firmware' => 'firmware',
|
||||||
// *** Setings for Provision Sccp
|
'settings' => 'settings',
|
||||||
$adv_config = array('tftproot' => '', 'firmware' => 'firmware', 'settings' => 'settings',
|
'locales' => 'locales',
|
||||||
'locales' => 'locales', 'languages' => 'languages', 'templates' => 'templates', 'dialplan' => 'dialplan', 'softkey' => 'softkey');
|
'languages' => 'languages',
|
||||||
// 'pro' /tftpboot - root dir
|
'templates' => 'templates',
|
||||||
// /tftpboot/locales/locales/%Languge_name%
|
'dialplan' => 'dialplan',
|
||||||
// /tftpboot/settings/XMLdefault.cnf.xml
|
'softkey' => 'softkey',
|
||||||
// /tftpboot/settings/SEP[MAC].cnf.xml
|
'ringtones' => 'ringtones',
|
||||||
// /tftpboot/firmware/79xx/SCCPxxxx.loads
|
'wallpapers' => 'wallpapers',
|
||||||
$adv_tree['pro'] = array('templates' => 'tftproot', 'settings' => 'tftproot', 'locales' => 'tftproot', 'firmware' => 'tftproot', 'languages' => 'locales', 'dialplan' => 'tftproot', 'softkey' => 'tftproot');
|
'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();
|
||||||
|
|
||||||
// 'def' /tftpboot - root dir
|
if (empty($settingsFromDb['tftp_rewrite_path']['data'])) {
|
||||||
// /tftpboot/languages/%Languge_name%
|
$settingsFromDb['tftp_rewrite_path']['data'] = $settingsFromDb['tftp_path']['data'];
|
||||||
// /tftpboot/XMLdefault.cnf.xml
|
} else {
|
||||||
// /tftpboot/SEP[MAC].cnf.xml
|
// Have a setting in sccpsettings. It should start with $tftp_path
|
||||||
// /tftpboot/SCCPxxxx.loads
|
// If not we will replace it with $tftp_path. Avoids issues with legacy values
|
||||||
$adv_tree['def'] = array('templates' => 'tftproot', 'settings' => '', 'locales' => '', 'firmware' => '', 'languages' => 'tftproot', 'dialplan' => '', 'softkey' => '');
|
if (!strpos($settingsFromDb['tftp_rewrite_path']["data"],$settingsFromDb['tftp_path']['data'])) {
|
||||||
// $adv_tree['def'] = Array('templates' => 'tftproot', 'settings' => '', 'locales' => 'tftproot', 'firmware' => 'tftproot', 'languages' => '');
|
$settingsFromDb['tftp_rewrite_path']['data'] = $settingsFromDb['tftp_path']['data'];
|
||||||
// $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', 'tftp_dialplan' => 'dialplan', 'tftp_softkey' => 'softkey');
|
|
||||||
|
|
||||||
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"])) {
|
$adv_ini = "{$settingsFromDb['tftp_rewrite_path']["data"]}/index.cnf";
|
||||||
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 exist or 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 permission on tftp DIR';
|
|
||||||
}
|
|
||||||
return array('error' => 'No write permission 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';
|
$adv_tree_mode = 'def';
|
||||||
if (empty($db_vars["tftp_rewrite"])) {
|
|
||||||
$db_vars["tftp_rewrite"]["data"] = "off";
|
|
||||||
}
|
|
||||||
|
|
||||||
$adv_config['tftproot'] = $base_config["tftp_path"];
|
switch ($settingsFromDb['tftp_rewrite']['data']) {
|
||||||
if ($db_vars["tftp_rewrite"]["data"] == 'pro') {
|
case 'pro':
|
||||||
$adv_tree_mode = 'pro';
|
$adv_tree_mode = 'pro';
|
||||||
if (!empty($adv_ini)) { // something found in external conflicts
|
if (!empty($adv_ini) && file_exists($adv_ini)) {
|
||||||
$adv_ini .= '/index.cnf';
|
|
||||||
if (file_exists($adv_ini)) {
|
|
||||||
$adv_ini_array = parse_ini_file($adv_ini);
|
$adv_ini_array = parse_ini_file($adv_ini);
|
||||||
$adv_config = array_merge($adv_config, $adv_ini_array);
|
$adv_config = array_merge($adv_config, $adv_ini_array);
|
||||||
}
|
}
|
||||||
}
|
// rewrite adv_ini to reflect the new $adv_config
|
||||||
}
|
if (file_exists($adv_ini)){
|
||||||
if ($db_vars["tftp_rewrite"]["data"] == 'on') {
|
rename($adv_ini, "{$adv_ini}.old");
|
||||||
$adv_tree_mode = 'def';
|
}
|
||||||
|
$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) {
|
foreach ($adv_tree[$adv_tree_mode] as $key => $value) {
|
||||||
if (!empty($adv_config[$key])) {
|
if (!empty($adv_config[$key])) {
|
||||||
if (!empty($value)) {
|
if (!empty($value)) {
|
||||||
|
|
@ -306,66 +335,35 @@ class extconfigs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($base_tree as $key => $value) {
|
foreach ($base_tree as $key => $value) {
|
||||||
$base_config[$key] = $adv_config[$value];
|
$baseConfig[$key] = $adv_config[$value];
|
||||||
if (!file_exists($base_config[$key])) {
|
if (!is_dir($baseConfig[$key])) {
|
||||||
if (!mkdir($base_config[$key], 0777, true)) {
|
if (!mkdir($baseConfig[$key], 0755, true)) {
|
||||||
die('Error creating dir : ' . $base_config[$key]);
|
die_freepbx(_("Error creating dir: $baseConfig[$key]"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print_r($base_config, 1);
|
// Set up tftproot/settings so that can test if mapping is Enabled and configured.
|
||||||
// die(print_r($base_config,1));
|
if (!is_dir("{$settingsFromDb['tftp_path']['data']}/settings")) {
|
||||||
// $base_config['External_ini'] = $adv_config;
|
if (!mkdir("{$settingsFromDb['tftp_path']['data']}/settings", 0755, true)) {
|
||||||
// $base_config['External_mode'] = $adv_tree_mode;
|
die_freepbx(_("Error creating dir: {$settingsFromDb['tftp_path']['data']}/settings"));
|
||||||
|
|
||||||
/*
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
// TODO: Need to add index.cnf, after setting defaults correctly
|
||||||
if (!file_exists($base_config["tftp_templates"] . '/XMLDefault.cnf.xml_template')) {
|
if (!file_exists("{$baseConfig['tftp_templates_path']}/XMLDefault.cnf.xml_template")) {
|
||||||
$src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/';
|
$src_path = $amp_conf['AMPWEBROOT'] . '/admin/modules/sccp_manager/conf/';
|
||||||
$dst_path = $base_config["tftp_templates"] . '/';
|
$dst_path = "{$baseConfig["tftp_templates_path"]}/";
|
||||||
foreach (glob($src_path . '*.*_template') as $filename) {
|
foreach (glob("{$src_path}*.*_template") as $filename) {
|
||||||
copy($filename, $dst_path . basename($filename));
|
copy($filename, $dst_path . basename($filename));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
foreach ($baseConfig as $baseKey => $baseValue) {
|
||||||
$dst = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/core/functions.inc/drivers/Sccp.class.php';
|
$settingsFromDb[$baseKey] = array('keyword' => $baseKey, 'seq' => 20, 'type' => 0, 'data' => $baseValue, 'systemdefault' => '');
|
||||||
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 {
|
|
||||||
// Set new default
|
|
||||||
$src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst) . '.v433';
|
|
||||||
copy($src_path, $dst);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return $settingsFromDb;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
// Type declaration in below function is incompatible with PHP 5
|
|
||||||
public function validate_RealTime( $connector )
|
public function validate_RealTime( $connector )
|
||||||
{
|
{
|
||||||
// This method only checks that asterisk is correctly configured for Realtime
|
// This method only checks that asterisk is correctly configured for Realtime
|
||||||
|
|
@ -381,7 +379,7 @@ class extconfigs
|
||||||
$cnf_read = \FreePBX::LoadConfig();
|
$cnf_read = \FreePBX::LoadConfig();
|
||||||
|
|
||||||
// We are running inside FreePBX so must use the same database
|
// 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'] . ',sccpline');
|
$def_config = array('sccpdevice' => 'mysql,' . $amp_conf['AMPDBNAME'] . ',sccpdeviceconfig', 'sccpline' => 'mysql,' . $amp_conf['AMPDBNAME'] . ',sccplineconfig');
|
||||||
$backup_ext = array('_custom.conf', '.conf', '_additional.conf');
|
$backup_ext = array('_custom.conf', '.conf', '_additional.conf');
|
||||||
$def_bd_config = array('dbhost' => $amp_conf['AMPDBHOST'], 'dbname' => $amp_conf['AMPDBNAME'],
|
$def_bd_config = array('dbhost' => $amp_conf['AMPDBHOST'], 'dbname' => $amp_conf['AMPDBNAME'],
|
||||||
'dbuser' => $amp_conf['AMPDBUSER'], 'dbpass' => $amp_conf['AMPDBPASS'],
|
'dbuser' => $amp_conf['AMPDBUSER'], 'dbpass' => $amp_conf['AMPDBPASS'],
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,163 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace FreePBX\modules\Sccp_manager;
|
|
||||||
|
|
||||||
class sipconfigs
|
|
||||||
{
|
|
||||||
// protected $database;
|
|
||||||
// protected $freepbx;
|
|
||||||
|
|
||||||
public function __construct($parent_class = null)
|
|
||||||
{
|
|
||||||
$this->paren_class = $parent_class;
|
|
||||||
// $freepbx
|
|
||||||
// $this->database = $freepbx->Database;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function info()
|
|
||||||
{
|
|
||||||
$Ver = '13.0.4';
|
|
||||||
return array('Version' => $Ver,
|
|
||||||
'about' => 'Sip Setings ver: ' . $Ver);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function get_db_sip_TableData($dataid, $data = array())
|
|
||||||
{
|
|
||||||
global $db;
|
|
||||||
if ($dataid == '') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
switch ($dataid) {
|
|
||||||
case "Device":
|
|
||||||
$sql = "SELECT * FROM sip ORDER BY `id`";
|
|
||||||
$tech = array();
|
|
||||||
try {
|
|
||||||
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
|
|
||||||
foreach ($raw_settings as $value) {
|
|
||||||
if (empty($tech[$value['id']]['id'])) {
|
|
||||||
$tech[$value['id']]['id']= $value['id'];
|
|
||||||
}
|
|
||||||
$tech[$value['id']][$value['keyword']]=$value['data'];
|
|
||||||
}
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
}
|
|
||||||
return $tech;
|
|
||||||
case "DeviceById":
|
|
||||||
$sql = "SELECT keyword,data FROM sip WHERE id = ?";
|
|
||||||
$sth = $db->prepare($sql);
|
|
||||||
$tech = array();
|
|
||||||
try {
|
|
||||||
$id = $data['id'];
|
|
||||||
$sth->execute(array($id));
|
|
||||||
$tech = $sth->fetchAll(\PDO::FETCH_COLUMN | \PDO::FETCH_GROUP);
|
|
||||||
foreach ($tech as &$value) {
|
|
||||||
$value = $value[0];
|
|
||||||
}
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
}
|
|
||||||
return $tech;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSipConfig()
|
|
||||||
{
|
|
||||||
$result = array();
|
|
||||||
// $def_sip_proto = 'sip';
|
|
||||||
// $def_proto = 'tcp';
|
|
||||||
// $supp_proto = '';
|
|
||||||
|
|
||||||
// $result['sipport'] = \FreePBX::Sipsettings()->getConfig('bindport');
|
|
||||||
// $result['tlsport'] = \FreePBX::Sipsettings()->getConfig('tlsbindport');
|
|
||||||
// $tmp_sipsetigs = \FreePBX::Sipsettings()->getChanSipSettings();
|
|
||||||
$tmp_binds = \FreePBX::Sipsettings()->getBinds();
|
|
||||||
$if_list = $this->paren_class ->getIpInformation('ip4');
|
|
||||||
|
|
||||||
/*
|
|
||||||
$tmp_bind_ip = !empty($tmp_sipsetigs['externhost_val']) ? $tmp_sipsetigs['externhost_val'] : '';
|
|
||||||
$tmp_bind_ip = !empty($tmp_sipsetigs['externip_val']) ? $tmp_sipsetigs['externip_val'] : $tmp_bind_ip;
|
|
||||||
$tmp_bind_ip = !empty($tmp_sipsetigs['bindaddr']) ? $tmp_sipsetigs['bindaddr'] : $tmp_bind_ip;
|
|
||||||
*/
|
|
||||||
$tmp_binds = is_array($tmp_binds) ? $tmp_binds: array();
|
|
||||||
$result = array();
|
|
||||||
foreach ($tmp_binds as $f_protocol => $f_bind) {
|
|
||||||
foreach ($f_bind as $f_ip => $f_port) {
|
|
||||||
if (($f_ip == '0.0.0.0') || ($f_ip == '[::]')) {
|
|
||||||
foreach ($if_list as $f_if => $f_data) {
|
|
||||||
if ($f_data['ip'] == "127.0.0.1") {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (empty($result[$f_protocol][$f_data['ip']])) {
|
|
||||||
$result[$f_protocol][$f_data['ip']]= $f_port;
|
|
||||||
} else {
|
|
||||||
$result[$f_protocol][$f_data['ip']]= array_merge($result[$f_protocol][$f_data['ip']],$f_port);
|
|
||||||
}
|
|
||||||
$result[$f_protocol][$f_data['ip']]['ip']=$f_data['ip'];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$result[$f_protocol][$f_ip]=$f_port;
|
|
||||||
$result[$f_protocol][$f_ip]['ip']=$f_ip;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
/*
|
|
||||||
// $result['sipbind'] = $tmp_bind_ip;
|
|
||||||
if (empty($tmp_sip_binds[$def_sip_proto])){
|
|
||||||
$def_proto = 'pjsip';
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
|
|
||||||
foreach ($tmp_sip_binds[$def_sip_proto] as $key => $value) {
|
|
||||||
if (empty($value[$def_proto])) {
|
|
||||||
$def_proto = 'udp';
|
|
||||||
$supp_proto = 'udp';
|
|
||||||
} else {
|
|
||||||
$supp_proto = !empty($value['udp']) ? 'tcp;udp' : 'tcp';
|
|
||||||
}
|
|
||||||
if (empty($def_key)) {
|
|
||||||
$def_key = $key;
|
|
||||||
}
|
|
||||||
if ($key != '0.0.0.0') {
|
|
||||||
$tmp_bind_ip = $key;
|
|
||||||
}
|
|
||||||
$result['sipbindport'] = $value[$def_proto];
|
|
||||||
}
|
|
||||||
$result['sipbind'] = $tmp_bind_ip;
|
|
||||||
$result['sipsuportproto'] = $supp_proto;
|
|
||||||
|
|
||||||
$binds= array();
|
|
||||||
$driver = \FreePBX::Config()->get_conf_setting('ASTSIPDRIVER');
|
|
||||||
if ($driver == "both" || $driver == "chan_pjsip") {
|
|
||||||
$b = \FreePBX::Sipsettings()->getConfig("binds");
|
|
||||||
$b = is_array($b) ? $b : array();
|
|
||||||
foreach($b as $protocol => $bind) {
|
|
||||||
foreach($bind as $ip => $state) {
|
|
||||||
if($state != "on") {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$p = \FreePBX::Sipsettings()->getConfig($protocol."port-".$ip);
|
|
||||||
$result['nb3'.$protocol] = $p;
|
|
||||||
if ($flatten) {
|
|
||||||
$binds['pjsip']['[::]'][$protocol] = $p;
|
|
||||||
} else {
|
|
||||||
$binds['pjsip'][$ip][$protocol] = $p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$binds['pjsip'] = array("0.0.0.0" => array());
|
|
||||||
}
|
|
||||||
|
|
||||||
$result['nd'] = $driver;
|
|
||||||
|
|
||||||
$result['nb'] = $binds;
|
|
||||||
$result['nb2'] = $b;
|
|
||||||
return $result;
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -15,17 +15,57 @@ namespace FreePBX\modules\Sccp_manager;
|
||||||
|
|
||||||
class xmlinterface
|
class xmlinterface
|
||||||
{
|
{
|
||||||
|
use \FreePBX\modules\Sccp_Manager\sccpManTraits\helperFunctions;
|
||||||
private $val_null = 'NONE'; /// REPLACE to null Field
|
private $val_null = 'NONE'; /// REPLACE to null Field
|
||||||
|
|
||||||
public function __construct($parent_class = null)
|
public function __construct($parent_class = null)
|
||||||
{
|
{
|
||||||
$this->paren_class = $parent_class;
|
$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()
|
public function info()
|
||||||
{
|
{
|
||||||
$Ver = '13.0.5';
|
$Ver = '13.0.6';
|
||||||
return array('Version' => $Ver,
|
return array('Version' => $Ver,
|
||||||
'about' => 'Create XML data interface ver: ' . $Ver);
|
'about' => 'Create XML data interface ver: ' . $Ver);
|
||||||
}
|
}
|
||||||
|
|
@ -112,12 +152,17 @@ class xmlinterface
|
||||||
$node->addAttribute('model', $var['vendor'] . ' ' . $var['model']);
|
$node->addAttribute('model', $var['vendor'] . ' ' . $var['model']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$xml_work->asXml($xml_name); // Save XMLDefault1.cnf.xml
|
$this->saveXml($xml_work, $xml_name); // Save XMLDefault1.cnf.xml
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function create_SEP_XML($store_path = '', $data_values = array(), $dev_config = array(), $dev_id = '', $lang_info = array())
|
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',
|
$var_xml_general_fields = array('authenticationurl' => 'dev_authenticationURL', 'informationurl' => 'dev_informationURL', 'messagesurl' => 'dev_messagesURL',
|
||||||
'servicesurl' => 'dev_servicesURL', 'directoryurl' => 'dev_directoryURL', 'idleurl' => 'dev_idleURL',
|
'servicesurl' => 'dev_servicesURL', 'directoryurl' => 'dev_directoryURL', 'idleurl' => 'dev_idleURL',
|
||||||
'secureauthenticationurl' => 'dev_secureauthenticationURL',
|
'secureauthenticationurl' => 'dev_secureauthenticationURL',
|
||||||
|
|
@ -125,226 +170,227 @@ class xmlinterface
|
||||||
'secureservicesurl'=>'dev_secureservicesURL', 'securedirectoryurl'=>'dev_securedirectoryURL', 'secureidleurl' => 'dev_secureidleURL',
|
'secureservicesurl'=>'dev_secureservicesURL', 'securedirectoryurl'=>'dev_securedirectoryURL', 'secureidleurl' => 'dev_secureidleURL',
|
||||||
'proxyserverurl' => 'dev_proxyServerURL', 'idletimeout' => 'dev_idleTimeout',
|
'proxyserverurl' => 'dev_proxyServerURL', 'idletimeout' => 'dev_idleTimeout',
|
||||||
'sshuserid' => 'dev_sshUserId', 'sshpassword' => 'dev_sshPassword', 'deviceprotocol' => 'dev_deviceProtocol',
|
'sshuserid' => 'dev_sshUserId', 'sshpassword' => 'dev_sshPassword', 'deviceprotocol' => 'dev_deviceProtocol',
|
||||||
'phonepersonalization' => 'phonePersonalization'
|
'phonepersonalization' => 'phonepersonalization'
|
||||||
);
|
);
|
||||||
$var_xml_general_vars = array('capfAuthMode' => 'null', 'capfList' => 'null', 'mobility' => 'null',
|
$var_xml_general_vars = array('capfAuthMode' => 'null', 'capfList' => 'null', 'mobility' => 'null',
|
||||||
'phoneServices' => 'null', 'certHash' => 'null',
|
'phoneServices' => 'null', 'certHash' => 'null',
|
||||||
'deviceSecurityMode' => '1');
|
'deviceSecurityMode' => '1');
|
||||||
|
|
||||||
if (empty($dev_config)) {
|
$data_path = $dev_config['tftp_templates_path'];
|
||||||
return false;
|
if (empty($data_path)) {
|
||||||
|
die('Create_SEP_XML tftp_templates_path not defined');
|
||||||
}
|
}
|
||||||
$data_path = $dev_config['tftp_path'];
|
|
||||||
|
|
||||||
if (empty($store_path) || empty($data_path) || empty($data_values) || empty($dev_id)) {
|
$store_path = $dev_config['tftp_store_path'];
|
||||||
return;
|
if (empty($store_path)) {
|
||||||
|
die('Create_SEP_XML tftp_store_path not defined');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($dev_config['nametemplate'])) {
|
if (!empty($dev_config['nametemplate'])) {
|
||||||
$xml_template = $data_path . '/templates/' . $dev_config['nametemplate'];
|
$xml_template = "{$data_path}/{$dev_config['nametemplate']}";
|
||||||
} else {
|
} else {
|
||||||
$xml_template = $data_path . '/templates/SEP0000000000.cnf.xml_79df_template';
|
$xml_template = "{$data_path}/templates/SEP0000000000.cnf.xml_79df_template";
|
||||||
}
|
}
|
||||||
$xml_name = $store_path . '/' . $dev_id . '.cnf.xml';
|
$xml_name = "{$store_path}/{$dev_id}.cnf.xml";
|
||||||
if (file_exists($xml_template)) {
|
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
|
|
||||||
$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_fld = array('srst_ip' => array('ipAddr', 'port'));
|
|
||||||
foreach ($srst_fld as $srst_pro => $srs_put) {
|
|
||||||
if (empty($data_values[$srst_pro]) || ($data_values['srst_Option'] == 'disable') ) {
|
|
||||||
$srst_data =array();
|
|
||||||
} else {
|
|
||||||
$srst_data = explode(';', $data_values[$srst_pro]);
|
|
||||||
}
|
|
||||||
$si = 1;
|
|
||||||
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 = ((empty($srs_val[1])) ? "2000": $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;
|
|
||||||
$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) {
|
|
||||||
$dkey_l = strtolower($dkey);
|
|
||||||
$vtmp_key = $key_l.'_'.$dkey_l;
|
|
||||||
if (isset($data_values[$vtmp_key])) {
|
|
||||||
$vtmp_data = $data_values[$vtmp_key];
|
|
||||||
if ((!empty($vtmp_data)) || ($vtmp_data == "0")) {
|
|
||||||
$xml_node->$dkey = $vtmp_data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$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':
|
|
||||||
case 'networklocaleinfo':
|
|
||||||
case 'networklocale':
|
|
||||||
$hwlang = '';
|
|
||||||
$lang = '';
|
|
||||||
if (!empty($dev_config["_hwlang"])) {
|
|
||||||
$hwlang = explode(':', $dev_config["_hwlang"]);
|
|
||||||
}
|
|
||||||
if (($key_l == 'networklocaleinfo') || ($key_l == '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_l == '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'];
|
|
||||||
if ($key_l == 'userlocale') {
|
|
||||||
$xml_node->winCharSet = $lang_info[$lang]['codepage'];
|
|
||||||
}
|
|
||||||
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$xml_work->$key = '';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// print_r($xml_work);
|
|
||||||
$xml_work->asXml($xml_name); // Save
|
|
||||||
} else {
|
|
||||||
die('Error Hardware template :' . $xml_template . ' not found');
|
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();
|
return time();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -358,20 +404,11 @@ class xmlinterface
|
||||||
}
|
}
|
||||||
$ip_fill = true;
|
$ip_fill = true;
|
||||||
if (!empty($data_values['ccm_address'])) {
|
if (!empty($data_values['ccm_address'])) {
|
||||||
$ccm_address = $data_values['ccm_address'];
|
// ccm_address is json from sccpsettings
|
||||||
if (strpos($ccm_address, 'internal') === false && strpos($ccm_address, '0.0.0.0') === false) {
|
$ccm_address = $this->convertCsvToArray($data_values['ccm_address'], true);
|
||||||
$tmp_data = explode(';', $ccm_address);
|
// This is a sanitised list of ipaddresses and ports
|
||||||
$ip_fill = false;
|
foreach ($ccm_address as $netValue) {
|
||||||
foreach ($tmp_data as $tmp_row) {
|
$res[$netValue['ip']] = $netValue;
|
||||||
if (strpos($tmp_row, '/') !== false) {
|
|
||||||
$ttmp_r = explode('/', $tmp_row); // IPv6 - ????
|
|
||||||
$rkey = $ttmp_r[0];
|
|
||||||
$res[$rkey] = array('ip' => $rkey, 'port' => $ttmp_r[1]);
|
|
||||||
} else {
|
|
||||||
$rkey = $tmp_row;
|
|
||||||
$res[$rkey] = array('ip' => $rkey, 'port' => $data_values['port']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($ip_fill) {
|
if ($ip_fill) {
|
||||||
|
|
@ -403,11 +440,10 @@ class xmlinterface
|
||||||
|
|
||||||
function create_SEP_SIP_XML($store_path = '', $data_values = array(), $dev_config = array(), $dev_id = '', $lang_info = array())
|
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',
|
$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',
|
'servicesURL' => 'dev_servicesURL', 'directoryURL' => 'dev_directoryURL', 'proxyServerURL' => 'dev_proxyServerURL', 'idleTimeout' => 'dev_idleTimeout',
|
||||||
'idleURL' => 'dev_idleURL', 'sshUserId' => 'dev_sshUserId', 'sshPassword' => 'dev_sshPassword',
|
'idleURL' => 'dev_idleURL', 'sshUserId' => 'dev_sshUserId', 'sshPassword' => 'dev_sshPassword',
|
||||||
'phonePersonalization' => 'phonePersonalization'
|
'phonePersonalization' => 'phonepersonalization'
|
||||||
);
|
);
|
||||||
$var_xml_sipProfile = array('phoneLabel' => 'description',
|
$var_xml_sipProfile = array('phoneLabel' => 'description',
|
||||||
'transferOnhookEnabled' => 'transferOnhookEnabled', 'enableVad' => 'enableVad', 'voipControlPort' => 'sipport'
|
'transferOnhookEnabled' => 'transferOnhookEnabled', 'enableVad' => 'enableVad', 'voipControlPort' => 'sipport'
|
||||||
|
|
@ -418,7 +454,7 @@ class xmlinterface
|
||||||
'phoneServices' => 'null', 'certHash' => 'null', 'deviceProtocol' => 'SIP',
|
'phoneServices' => 'null', 'certHash' => 'null', 'deviceProtocol' => 'SIP',
|
||||||
'deviceSecurityMode' => '1');
|
'deviceSecurityMode' => '1');
|
||||||
|
|
||||||
// $var_hw_config = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_byid", array('id' => $dev_id));
|
// $var_hw_config = $this->dbinterface->getSccpDeviceTableData("get_sccpdevice_byid", array('id' => $dev_id));
|
||||||
|
|
||||||
if (empty($dev_config)) {
|
if (empty($dev_config)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -438,7 +474,6 @@ class xmlinterface
|
||||||
$xml_template = $data_path . '/templates/SEP0000000000.cnf.xml_79df_sip_template';
|
$xml_template = $data_path . '/templates/SEP0000000000.cnf.xml_79df_sip_template';
|
||||||
}
|
}
|
||||||
$xml_name = $store_path . '/' . $dev_id . '.cnf.xml';
|
$xml_name = $store_path . '/' . $dev_id . '.cnf.xml';
|
||||||
//$sip_bind = $this->get_server_sip_bind($data_values);
|
|
||||||
$sip_bind = $data_values['sbind'];
|
$sip_bind = $data_values['sbind'];
|
||||||
$bind_proto = 'tcp';
|
$bind_proto = 'tcp';
|
||||||
$bind_ip_def = '';
|
$bind_ip_def = '';
|
||||||
|
|
@ -578,15 +613,15 @@ class xmlinterface
|
||||||
case 'softKeyFile':
|
case 'softKeyFile':
|
||||||
case 'dialTemplate': // Доработать !
|
case 'dialTemplate': // Доработать !
|
||||||
$xml_ext_file = '';
|
$xml_ext_file = '';
|
||||||
$templet_path = (($dkey == 'softKeyFile') ? $dev_config['tftp_softkey'] : $dev_config['tftp_dialplan']);
|
$template_path = (($dkey == 'softKeyFile') ? $dev_config['tftp_softkey_path'] : $dev_config['tftp_dialplan_path']);
|
||||||
$tmp_key = ($dkey == 'softKeyFile') ? 'softkeyset' : '_dialrules';
|
$tmp_key = ($dkey == 'softKeyFile') ? 'softkeyset' : '_dialrules';
|
||||||
if (!empty($dev_config[$tmp_key])) {
|
if (!empty($dev_config[$tmp_key])) {
|
||||||
$xml_ext_file = (($dkey == 'softKeyFile') ? 'softkey' . $dev_config[$tmp_key] . '.xml' : $dev_config[$tmp_key] . '.xml');
|
$xml_ext_file = (($dkey == 'softKeyFile') ? 'softkey' . $dev_config[$tmp_key] . '.xml' : $dev_config[$tmp_key] . '.xml');
|
||||||
}
|
}
|
||||||
if (empty($xml_ext_file) || !file_exists($templet_path . '/' . $xml_ext_file)) {
|
if (empty($xml_ext_file) || !file_exists($template_path . '/' . $xml_ext_file)) {
|
||||||
$xml_ext_file = (($dkey == 'softKeyFile') ? 'softkeydefault.xml' : 'dialplan.xml');
|
$xml_ext_file = (($dkey == 'softKeyFile') ? 'softkeydefault.xml' : 'dialplan.xml');
|
||||||
}
|
}
|
||||||
if (file_exists($templet_path . '/' . $xml_ext_file)) {
|
if (file_exists($template_path . '/' . $xml_ext_file)) {
|
||||||
$xml_node->$dkey = $xml_ext_file;
|
$xml_node->$dkey = $xml_ext_file;
|
||||||
} else {
|
} else {
|
||||||
$xml_node->$dkey = null;
|
$xml_node->$dkey = null;
|
||||||
|
|
@ -627,33 +662,40 @@ class xmlinterface
|
||||||
$xml_node->backgroundImageAccess = (($data_values['backgroundImageAccess'] == 'on') || ($data_values['backgroundImageAccess'] == 'true') ) ? 'true' : 'false';
|
$xml_node->backgroundImageAccess = (($data_values['backgroundImageAccess'] == 'on') || ($data_values['backgroundImageAccess'] == 'true') ) ? 'true' : 'false';
|
||||||
$xml_node->callLogBlfEnabled = $data_values['callLogBlfEnabled'];
|
$xml_node->callLogBlfEnabled = $data_values['callLogBlfEnabled'];
|
||||||
break;
|
break;
|
||||||
|
case 'userlocale':
|
||||||
case 'userLocale':
|
// Device language
|
||||||
case 'networkLocaleInfo':
|
$lang = $data_values['devlang'];
|
||||||
case 'networkLocale':
|
if (!empty($dev_config['devlang'])) {
|
||||||
$hwlang = '';
|
$lang = $dev_config['devlang'];
|
||||||
$lang = '';
|
|
||||||
if (!empty($dev_config["_hwlang"])) {
|
|
||||||
$hwlang = explode(':', $dev_config["_hwlang"]);
|
|
||||||
}
|
}
|
||||||
if (($key == 'networkLocaleInfo') || ($key == 'networkLocale')) {
|
$xml_node->winCharSet = $dev_config['phonecodepage'];
|
||||||
$lang = (empty($hwlang[0])) ? $data_values['netlang'] : $hwlang[0];
|
$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 {
|
} else {
|
||||||
$lang = (empty($hwlang[1])) ? $data_values['devlang'] : $hwlang[1];
|
$xml_work->$key = '';
|
||||||
}
|
}
|
||||||
if (($lang != 'null') && (!empty($lang))) {
|
break;
|
||||||
if ($key == 'networkLocale') {
|
case 'networklocaleinfo':
|
||||||
$xml_work->$key = $lang;
|
$lang = $data_values['netlang'];
|
||||||
} else {
|
if (!empty($dev_config['netlang'])) {
|
||||||
if (isset($lang_info[$lang])) {
|
$lang = $dev_config['netlang'];
|
||||||
$xml_node->name = $lang_info[$lang]['locale'];
|
}
|
||||||
$xml_node->langCode = $lang_info[$lang]['code'];
|
if (isset($lang)) {
|
||||||
if ($key == 'userLocale') {
|
$xml_node->name = $lang;
|
||||||
$xml_node->winCharSet = $lang_info[$lang]['codepage'];
|
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
|
||||||
}
|
|
||||||
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$xml_work->$key = '';
|
$xml_work->$key = '';
|
||||||
}
|
}
|
||||||
|
|
@ -663,7 +705,7 @@ class xmlinterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$xml_work->asXml($xml_name); // Save
|
$this->saveXml($xml_work, $xml_name); // Save
|
||||||
} else {
|
} else {
|
||||||
die('Error Hardware template :' . $xml_template . ' not found');
|
die('Error Hardware template :' . $xml_template . ' not found');
|
||||||
}
|
}
|
||||||
|
|
@ -710,7 +752,7 @@ class xmlinterface
|
||||||
$put_file = (string) $get_settings['idtemplate'];
|
$put_file = (string) $get_settings['idtemplate'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$errors = array('Fields Dial Plan Name is requered !!');
|
$errors = array('Fields Dial Plan Name is required !!');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($errors)) {
|
if (empty($errors)) {
|
||||||
|
|
@ -726,9 +768,9 @@ class xmlinterface
|
||||||
{
|
{
|
||||||
if (empty($config[$name])) {
|
if (empty($config[$name])) {
|
||||||
if ($name == 'default') {
|
if ($name == 'default') {
|
||||||
$typeSoft = $confDir["tftp_templates"] . '/SIPDefaultSoftKey.xml_template';
|
$typeSoft = $confDir["tftp_templates_path"] . '/SIPDefaultSoftKey.xml_template';
|
||||||
if (file_exists($typeSoft)) {
|
if (file_exists($typeSoft)) {
|
||||||
$file = $confDir["tftp_softkey"] . '/softkey' . $name . '.xml';
|
$file = $confDir["tftp_softkey_path"] . '/softkey' . $name . '.xml';
|
||||||
if (!copy($typeSoft, $file)) {
|
if (!copy($typeSoft, $file)) {
|
||||||
return array('error' => 'Access error' . $name);
|
return array('error' => 'Access error' . $name);
|
||||||
}
|
}
|
||||||
|
|
@ -741,7 +783,7 @@ class xmlinterface
|
||||||
$errors = array();
|
$errors = array();
|
||||||
$xmlstr = "<softKeyCfg>\n";
|
$xmlstr = "<softKeyCfg>\n";
|
||||||
$xmlstr .= "<versionStamp>" . time() . "</versionStamp>\n";
|
$xmlstr .= "<versionStamp>" . time() . "</versionStamp>\n";
|
||||||
$typeSoft = $confDir["tftp_templates"] . '/SIPTypeSoftKey.xml_template';
|
$typeSoft = $confDir["tftp_templates_path"] . '/SIPTypeSoftKey.xml_template';
|
||||||
$read_soft = "";
|
$read_soft = "";
|
||||||
if (file_exists($typeSoft)) {
|
if (file_exists($typeSoft)) {
|
||||||
$f_read = fopen($typeSoft, 'r');
|
$f_read = fopen($typeSoft, 'r');
|
||||||
|
|
@ -763,7 +805,7 @@ class xmlinterface
|
||||||
|
|
||||||
$xmlstr .= '</softKeyCfg>';
|
$xmlstr .= '</softKeyCfg>';
|
||||||
if (empty($errors)) {
|
if (empty($errors)) {
|
||||||
$file = $confDir["tftp_softkey"] . '/softkey' . $name . '.xml';
|
$file = $confDir["tftp_softkey_path"] . '/softkey' . $name . '.xml';
|
||||||
file_put_contents($file, $xmlstr);
|
file_put_contents($file, $xmlstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ trait ajaxHelper {
|
||||||
case 'getUserGrid':
|
case 'getUserGrid':
|
||||||
case 'getSoftKey':
|
case 'getSoftKey':
|
||||||
case 'getDialTemplate':
|
case 'getDialTemplate':
|
||||||
|
case 'get_ext_files':
|
||||||
case 'create_hw_tftp':
|
case 'create_hw_tftp':
|
||||||
case 'reset_dev':
|
case 'reset_dev':
|
||||||
case 'reset_token':
|
case 'reset_token':
|
||||||
|
|
@ -35,6 +36,9 @@ trait ajaxHelper {
|
||||||
case 'delete_dialplan':
|
case 'delete_dialplan':
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
case 'validateMac':
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -47,26 +51,16 @@ trait ajaxHelper {
|
||||||
$cmd_id = $request['command'];
|
$cmd_id = $request['command'];
|
||||||
switch ($cmd_id) {
|
switch ($cmd_id) {
|
||||||
case 'savesettings':
|
case 'savesettings':
|
||||||
$action = isset($request['sccp_createlangdir']) ? $request['sccp_createlangdir'] : '';
|
// Consolidate this into a separate method to improve legibility
|
||||||
if ($action == 'yes') {
|
|
||||||
$this->initializeTFtpLanguagePath();
|
|
||||||
}
|
|
||||||
$this->handleSubmit($request);
|
$this->handleSubmit($request);
|
||||||
// $this->saveSccpSettings();
|
|
||||||
//$this->createDefaultSccpConfig();
|
|
||||||
$this->createDefaultSccpXml();
|
|
||||||
|
|
||||||
|
// TODO: Need to be more specific on reload and only reload if critical settings changed.
|
||||||
$res = $this->aminterface->core_sccp_reload();
|
$res = $this->aminterface->core_sccp_reload();
|
||||||
$msg [] = 'Config Saved: ' . $res['Response'];
|
return array('status' => true, 'message' => 'Data saved', 'reload' => true, 'toastFlag' => 'success', 'search' => '?display=sccpsettings', 'hash' => '');
|
||||||
$msg [] = 'Info :' . $res['data'];
|
|
||||||
// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg)
|
|
||||||
return array('status' => true, 'message' => $msg, 'reload' => true);
|
|
||||||
break;
|
break;
|
||||||
case 'save_sip_device':
|
case 'save_sip_device':
|
||||||
case 'save_device':
|
case 'save_device':
|
||||||
$this->saveSccpDevice($request);
|
return $this->saveSccpDevice($request);
|
||||||
return array('status' => true, 'search' => '?display=sccp_phone', 'hash' => 'sccpdevice');
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'save_ruser':
|
case 'save_ruser':
|
||||||
//$res = $request;
|
//$res = $request;
|
||||||
|
|
@ -117,7 +111,7 @@ trait ajaxHelper {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->deleteSccpDeviceXML('all');
|
$this->deleteSccpDeviceXML('all');
|
||||||
$models = $this->dbinterface->HWextension_db_SccpTableData("SccpDevice");
|
$models = $this->dbinterface->getSccpDeviceTableData("SccpDevice");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->createDefaultSccpXml(); // Default XML
|
$this->createDefaultSccpXml(); // Default XML
|
||||||
|
|
@ -249,7 +243,7 @@ trait ajaxHelper {
|
||||||
if (!empty($request['softkey'])) {
|
if (!empty($request['softkey'])) {
|
||||||
$id_name = $request['softkey'];
|
$id_name = $request['softkey'];
|
||||||
unset($this->sccp_conf_init[$id_name]);
|
unset($this->sccp_conf_init[$id_name]);
|
||||||
$this->createDefaultSccpConfig();
|
$this->createDefaultSccpConfig($this->sccpvalues, $this->sccppath["asterisk"], $this->sccp_conf_init);
|
||||||
$msg = print_r($this->aminterface->core_sccp_reload(), 1);
|
$msg = print_r($this->aminterface->core_sccp_reload(), 1);
|
||||||
return array('status' => true, 'table_reload' => true);
|
return array('status' => true, 'table_reload' => true);
|
||||||
}
|
}
|
||||||
|
|
@ -258,16 +252,16 @@ trait ajaxHelper {
|
||||||
if (!empty($request['id'])) {
|
if (!empty($request['id'])) {
|
||||||
$id_name = preg_replace('/[^A-Za-z0-9]/', '', $request['id']);
|
$id_name = preg_replace('/[^A-Za-z0-9]/', '', $request['id']);
|
||||||
$this->sccp_conf_init[$id_name]['type'] = "softkeyset";
|
$this->sccp_conf_init[$id_name]['type'] = "softkeyset";
|
||||||
foreach ($this->extconfigs->getextConfig('keyset') as $keyl => $vall) {
|
foreach ($this->extconfigs->getExtConfig('keyset') as $keyl => $vall) {
|
||||||
if (!empty($request[$keyl])) {
|
if (!empty($request[$keyl])) {
|
||||||
$this->sccp_conf_init[$id_name][$keyl] = $request[$keyl];
|
$this->sccp_conf_init[$id_name][$keyl] = $request[$keyl];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->createDefaultSccpConfig();
|
$this->createDefaultSccpConfig($this->sccpvalues, $this->sccppath["asterisk"], $this->sccp_conf_init);
|
||||||
|
|
||||||
// !TODO!: -TODO-: Check SIP Support Enabled
|
// !TODO!: -TODO-: Check SIP Support Enabled
|
||||||
$this->createSccpXmlSoftkey();
|
$this->createSccpXmlSoftkey();
|
||||||
$msg = print_r($this->aminterface->core_sccp_reload, 1);
|
$msg = print_r($this->aminterface->core_sccp_reload(), 1);
|
||||||
return array('status' => true, 'table_reload' => true);
|
return array('status' => true, 'table_reload' => true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -278,7 +272,7 @@ trait ajaxHelper {
|
||||||
foreach ($this->aminterface->sccp_list_keysets() as $keyl => $vall) {
|
foreach ($this->aminterface->sccp_list_keysets() as $keyl => $vall) {
|
||||||
$result[$i]['softkeys'] = $keyl;
|
$result[$i]['softkeys'] = $keyl;
|
||||||
if ($keyl == 'default') {
|
if ($keyl == 'default') {
|
||||||
foreach ($this->extconfigs->getextConfig('keyset') as $key => $value) {
|
foreach ($this->extconfigs->getExtConfig('keyset') as $key => $value) {
|
||||||
$result[$i][$key] = str_replace(',', '<br>', $value);
|
$result[$i][$key] = str_replace(',', '<br>', $value);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -292,68 +286,83 @@ trait ajaxHelper {
|
||||||
return $result;
|
return $result;
|
||||||
break;
|
break;
|
||||||
case 'getExtensionGrid':
|
case 'getExtensionGrid':
|
||||||
$result = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
|
$lineList = $this->dbinterface->getSccpDeviceTableData($request['type']);
|
||||||
if (empty($result)) {
|
if (empty($lineList)) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
return $result;
|
$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;
|
break;
|
||||||
case 'getPhoneGrid':
|
case 'getPhoneGrid':
|
||||||
$cmd_type = !empty($request['type']) ? $request['type'] : '';
|
$dbDevices = array();
|
||||||
|
// Find all devices defined in the database.
|
||||||
|
$dbDevices = $this->dbinterface->getSccpDeviceTableData('phoneGrid', array('type' => $request['type']));
|
||||||
|
|
||||||
$result = $this->dbinterface->HWextension_db_SccpTableData('SccpDevice', array('type' => $cmd_type));
|
// Return if only interested in SIP devices
|
||||||
if ($cmd_type == 'cisco-sip') {
|
if ($request['type'] == 'cisco-sip') {
|
||||||
return $result;
|
return $dbDevices; //this may be empty
|
||||||
}
|
}
|
||||||
$staus = $this->aminterface->sccp_get_active_device();
|
// Find all devices currently connected
|
||||||
if (empty($result)) {
|
$activeDevices = $this->aminterface->sccp_get_active_device();
|
||||||
$result = array();
|
|
||||||
} else {
|
foreach ($dbDevices as &$dev_id) {
|
||||||
foreach ($result as &$dev_id) {
|
if (!empty($activeDevices[$dev_id['name']])) {
|
||||||
$id_name = $dev_id['name'];
|
// Device is in db and is connected
|
||||||
if (!empty($staus[$id_name])) {
|
$dev_id['description'] = $activeDevices[$dev_id['name']]['descr'];
|
||||||
$dev_id['description'] = $staus[$id_name]['descr'];
|
$dev_id['status'] = $activeDevices[$dev_id['name']]['status'];
|
||||||
$dev_id['status'] = $staus[$id_name]['status'];
|
$dev_id['address'] = $activeDevices[$dev_id['name']]['address'];
|
||||||
$dev_id['address'] = $staus[$id_name]['address'];
|
$dev_id['new_hw'] = 'N';
|
||||||
$dev_id['new_hw'] = 'N';
|
// No further action required on this active device
|
||||||
$staus[$id_name]['news'] = 'N';
|
unset($activeDevices[$dev_id['name']]);
|
||||||
} else {
|
|
||||||
$dev_id['description'] = '- -';
|
|
||||||
$dev_id['status'] = 'not connected';
|
|
||||||
$dev_id['address'] = '- -';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($staus)) {
|
unset($dev_id); // unset reference.
|
||||||
foreach ($staus as $dev_ids) {
|
|
||||||
|
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'];
|
$id_name = $dev_ids['name'];
|
||||||
if (empty($dev_ids['news'])) {
|
$dev_data = $this->aminterface->sccp_getdevice_info($id_name);
|
||||||
$dev_data = $this->aminterface->sccp_getdevice_info($id_name);
|
if (!empty($dev_data['SCCP_Vendor']['model_id'])) {
|
||||||
if (!empty($dev_data['SCCP_Vendor']['model_id'])) {
|
$dev_addon = $dev_data['SCCP_Vendor']['model_addon'];
|
||||||
$dev_addon = $dev_data['SCCP_Vendor']['model_addon'];
|
if (empty($dev_addon)) {
|
||||||
if (empty($dev_addon)) {
|
$dev_addon = null;
|
||||||
$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";
|
|
||||||
}
|
|
||||||
$result[] = 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
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
$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 $result;
|
return $dbDevices;
|
||||||
break;
|
break;
|
||||||
case 'getDialTemplate':
|
case 'getDialTemplate':
|
||||||
// ------------------------------- Old device support - In the development---
|
// ------------------------------- Old device support - In the development---
|
||||||
|
|
@ -378,8 +387,402 @@ trait ajaxHelper {
|
||||||
// return array('status' => false, 'message' => $result);
|
// return array('status' => false, 'message' => $result);
|
||||||
return $result;
|
return $result;
|
||||||
break;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,12 @@ namespace FreePBX\modules\Sccp_manager\sccpManTraits;
|
||||||
trait bmoFunctions {
|
trait bmoFunctions {
|
||||||
|
|
||||||
//Need to reload freePBX for modifications below to work
|
//Need to reload freePBX for modifications below to work
|
||||||
|
/*
|
||||||
//want to catch extensions
|
//want to catch extensions
|
||||||
public static function myConfigPageInits() {
|
public static function myConfigPageInits() {
|
||||||
return array("extensions");
|
return array("extensions");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
public function doConfigPageInit($page) {
|
public function doConfigPageInit($page) {
|
||||||
if ($page == "extensions") {
|
if ($page == "extensions") {
|
||||||
|
|
@ -18,25 +19,27 @@ trait bmoFunctions {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to change extensions which is part of core
|
// Try to change extensions which is part of core
|
||||||
|
/*
|
||||||
public static function myGuiHooks() {
|
public static function myGuiHooks() {
|
||||||
return array('core');
|
return array('core');
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
/*
|
||||||
public function doGuiHook(&$cc) {
|
public function doGuiHook(&$cc) {
|
||||||
if ($_REQUEST['display'] == "extensions" ) {
|
if ($_REQUEST['display'] == "extensions" ) {
|
||||||
if ($_REQUEST['tech_hardware'] == 'sccp_custom') {
|
if ($_REQUEST['tech_hardware'] == 'sccp_custom') {
|
||||||
/*
|
|
||||||
this is the add extensions form
|
this is the add extensions form
|
||||||
On submit returns to extensions page. Users prefer that it returns
|
On submit returns to extensions page. Users prefer that it returns
|
||||||
To Sccp Phone.
|
To Sccp Phone.
|
||||||
Below adds redirect URL, but it is not followed
|
Below adds redirect URL, but it is not followed
|
||||||
$cc->setRedirectURL("config.php?display=sccp_phone");
|
$cc->setRedirectURL("config.php?display=sccp_phone");
|
||||||
so force redirect at end of addDevice in SccpClass
|
so force redirect at end of addDevice in SccpClass
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/* unused but FPBX API requires it */
|
/* unused but FPBX API requires it */
|
||||||
|
|
||||||
public function install() {
|
public function install() {
|
||||||
|
|
@ -115,6 +118,7 @@ trait bmoFunctions {
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'sccpsettings':
|
case 'sccpsettings':
|
||||||
|
// TODO: Need to change to have save and save and continue
|
||||||
$buttons = array(
|
$buttons = array(
|
||||||
'submit' => array(
|
'submit' => array(
|
||||||
'name' => 'ajaxsubmit',
|
'name' => 'ajaxsubmit',
|
||||||
|
|
@ -134,8 +138,9 @@ trait bmoFunctions {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRightNav($request) {
|
public function getRightNav($request) {
|
||||||
|
global $amp_conf;
|
||||||
if (isset($request['tech_hardware']) && ($request['tech_hardware'] == 'cisco')) {
|
if (isset($request['tech_hardware']) && ($request['tech_hardware'] == 'cisco')) {
|
||||||
return load_view($_SERVER['DOCUMENT_ROOT'] .'/admin/modules/sccp_manager/views/hardware.rnav.php', array('request' => $request));
|
return load_view($amp_conf['AMPWEBROOT'] .'/admin/modules/sccp_manager/views/hardware.rnav.php', array('request' => $request));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,76 @@
|
||||||
namespace FreePBX\modules\Sccp_manager\sccpManTraits;
|
namespace FreePBX\modules\Sccp_manager\sccpManTraits;
|
||||||
|
|
||||||
trait helperfunctions {
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
function getIpInformation($type = '') {
|
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();
|
$interfaces = array();
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'ip4':
|
case 'ip4':
|
||||||
|
|
@ -69,56 +137,387 @@ trait helperfunctions {
|
||||||
}
|
}
|
||||||
return FALSE;
|
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 findAllFiles($dir, $file_mask = null, $mode = 'full') {
|
private function getTableEnums($table, $trim_underscore = true) {
|
||||||
$result = null;
|
$enumFields = array();
|
||||||
if (empty($dir) || (!file_exists($dir))) {
|
$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;
|
return $result;
|
||||||
}
|
}
|
||||||
|
foreach (array_diff(scandir($searchDir),array('.', '..')) as $value) {
|
||||||
$root = scandir($dir);
|
if (is_file("$searchDir/$value")) {
|
||||||
foreach ($root as $value) {
|
$extFound = '';
|
||||||
if ($value === '.' || $value === '..') {
|
$foundFile = true;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (is_file("$dir/$value")) {
|
|
||||||
$filter = false;
|
|
||||||
if (!empty($file_mask)) {
|
if (!empty($file_mask)) {
|
||||||
if (is_array($file_mask)) {
|
$foundFile = false;
|
||||||
foreach ($file_mask as $k) {
|
foreach ($file_mask as $k) {
|
||||||
if (strpos(strtolower($value), strtolower($k)) !== false) {
|
if (strpos($value, $k) !== false) {
|
||||||
$filter = true;
|
$foundFile = true;
|
||||||
}
|
$extFound = $k;
|
||||||
}
|
break;
|
||||||
} else {
|
|
||||||
if (strpos(strtolower($value), strtolower($file_mask)) !== false) {
|
|
||||||
$filter = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$filter = true;
|
|
||||||
}
|
}
|
||||||
if ($filter) {
|
if ($foundFile) {
|
||||||
if ($mode == 'fileonly') {
|
switch ($mode) {
|
||||||
$result[] = "$value";
|
case 'fileonly':
|
||||||
} else {
|
$result[] = $value;
|
||||||
$result[] = "$dir/$value";
|
break;
|
||||||
|
case 'fileBaseName':
|
||||||
|
$result[] = basename("/$value", $extFound);
|
||||||
|
break;
|
||||||
|
case 'dirFileBaseName':
|
||||||
|
$result[] = $searchDir . "/" . basename("/$value", $extFound);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$result[] = "$searchDir/$value";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$result[] = null;
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$sub_fiend = $this->findAllFiles("$dir/$value", $file_mask, $mode);
|
// Now iterate over sub directories
|
||||||
if (!empty($sub_fiend)) {
|
$sub_find = $this->findAllFiles("$searchDir/$value", $file_mask, $mode);
|
||||||
foreach ($sub_fiend as $sub_value) {
|
if (!empty($sub_find)) {
|
||||||
if (!empty($sub_value)) {
|
foreach ($sub_find as $sub_value) {
|
||||||
$result[] = $sub_value;
|
$result[] = $sub_value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $result;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,21 @@
|
||||||
{
|
{
|
||||||
"rawname": "sccp_manager",
|
"rawname": "sccp_manager",
|
||||||
"repo": "extended",
|
"repo": "stable",
|
||||||
"name": "Sccp Manager",
|
"name": "Sccp Manager",
|
||||||
"version": "14.2.0.3",
|
"version": "14.5.0.4",
|
||||||
"publisher": "Steve Lad",
|
"publisher": "Steve Lad",
|
||||||
"license": "GPL",
|
"license": "GPL",
|
||||||
"licenselink": "http://www.gnu.org/licenses/gpl.txt",
|
"licenselink": "http://www.gnu.org/licenses/gpl.txt",
|
||||||
"changelog": "*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",
|
"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",
|
"category": "Sccp Connectivity",
|
||||||
"description": "The Cisco Manager module lets you manage the chan-sccp module.",
|
"description": "The Sccp Manager module lets you manage the chan-sccp driver.",
|
||||||
"depends": {
|
"depends": {
|
||||||
"version": "14.0"
|
"version": "16.0"
|
||||||
},
|
},
|
||||||
"supported": {
|
"supported": {
|
||||||
"version": "13.0"
|
"version": "15.0"
|
||||||
},
|
},
|
||||||
"location": "https://github.com/chan-sccp/sccp_manager/archive/refs/tags/v14.2.0.3.tar.gz",
|
"location": "https://github.com/chan-sccp/sccp_manager/archive/refs/tags/v14.5.0.4.tar.gz",
|
||||||
"md5sum": "9aff57a6553a4a3649e056013fe1758f",
|
"md5sum": "80b454d5cfdd602bffeec350e6e76bac",
|
||||||
"packaged": "1623001021"
|
"packaged": "1643364518"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
$keymultiselect = array('AllRight' =>'>>', 'Right' => '>', 'AllLeft' => '<<', 'Left' => '<');
|
$keymultiselect = array('AllRight' =>'>>', 'Right' => '>', 'AllLeft' => '<<', 'Left' => '<');
|
||||||
|
|
||||||
// ------------------------------------- Key Set Value ---------------------------------------------------------
|
// ------------------------------------- Key Set Value ---------------------------------------------------------
|
||||||
$keysetarray = $this->extconfigs->getextConfig('keyset');
|
$keysetarray = $this->extconfigs->getExtConfig('keyset');
|
||||||
|
|
||||||
/*$keysetarray1 = array('onhook' => array('redial','newcall','cfwdall','dnd','pickup','gpickup','private'),
|
/*$keysetarray1 = array('onhook' => array('redial','newcall','cfwdall','dnd','pickup','gpickup','private'),
|
||||||
'connected' => array('hold','endcall','park','vidmode','select','cfwdall','cfwdbusy','idivert'),
|
'connected' => array('hold','endcall','park','vidmode','select','cfwdall','cfwdbusy','idivert'),
|
||||||
|
|
@ -46,39 +46,37 @@ $keynamearray = array('onhook' => array('sname' => 'ONHOOK', 'name' =>'Displa
|
||||||
<form autocomplete="off" name="frm_keyset" id="frm_keyset" class="fpbx-submit" action="" method="post">
|
<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="category" value="keysetform">
|
||||||
<input type="hidden" name="Submit" value="Submit">
|
<input type="hidden" name="Submit" value="Submit">
|
||||||
|
<div class="fpbx-container container-fluid">
|
||||||
<div class="fpbx-container container-fluid">
|
<div class="row">
|
||||||
<div class="row">
|
<div class="col-sm-12">
|
||||||
<div class="col-sm-12">
|
<div class="display no-border">
|
||||||
<div class="display no-border">
|
<div id="toolbar-all">
|
||||||
<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>
|
||||||
<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>
|
||||||
</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">
|
||||||
<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>
|
||||||
<thead>
|
<tr>
|
||||||
<tr>
|
<th data-sortable="true" data-field="softkeys"><?php echo _('KeySetName')?></th>
|
||||||
<!-- <th data-checkbox="true"></th> -->
|
<?php
|
||||||
<th data-sortable="true" data-field="softkeys"><?php echo _('KeySetName')?></th>
|
$i = 0;
|
||||||
<?php
|
foreach ($keynamearray as $key => $value) {
|
||||||
$i = 0;
|
if ($i < 12) {
|
||||||
foreach ($keynamearray as $key => $value) {
|
echo '<th data-sortable="false" data-field="'.$key.'">'._($value['sname']).'</th>';
|
||||||
if ($i < 9) {
|
|
||||||
echo '<th data-sortable="false" data-field="'.$key.'">'._($value['sname']).'</th>';
|
|
||||||
}
|
|
||||||
$i ++;
|
|
||||||
}
|
}
|
||||||
?>
|
$i ++;
|
||||||
<th data-field="actions" data-formatter="DispayActionsKeyFormatter"><?php echo _('Actions')?></th>
|
}
|
||||||
</tr>
|
?>
|
||||||
</thead>
|
<th data-field="actions" data-formatter="DispayActionsKeyFormatter"><?php echo _('Actions')?></th>
|
||||||
<tbody>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- Begin Form Input New / Edit -->
|
<!-- Begin Form Input New / Edit -->
|
||||||
|
|
@ -90,18 +88,27 @@ $keynamearray = array('onhook' => array('sname' => 'ONHOOK', 'name' =>'Displa
|
||||||
<h4 class="modal-title" id="gridSystemModalLabel">Add New KeySet</h4>
|
<h4 class="modal-title" id="gridSystemModalLabel">Add New KeySet</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
<style type="text/css">
|
||||||
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
|
input:invalid {border: red solid 3px;}
|
||||||
<label class="control-label" for="new_keysetname">Name Keyset</label>
|
</style>
|
||||||
<i class="fa fa-question-circle fpbx-help-icon" data-for="new_devmodel"></i>
|
<div class="element-container">
|
||||||
</div><div class="col-md-9">
|
<div class="row">
|
||||||
<input type="text" maxlength="15" class="form-control" id="new_keySetname" name="new_keySetname" value="SoftKeyset">
|
<div class="form-group">
|
||||||
</div> </div></div>
|
<div class="col-md-3">
|
||||||
<div class="row"><div class="col-md-12">
|
<label class="control-label" for="new_keysetname">Name Keyset</label>
|
||||||
<span id="new_devmodel-help" class="help-block fpbx-help-block">Help. max len = 15</span>
|
<i class="fa fa-question-circle fpbx-help-icon" data-for="new_devmodel"></i>
|
||||||
</div></div></div>
|
</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">
|
<ul class="nav nav-tabs" role="tablist">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
@ -157,8 +164,6 @@ foreach ($keysetarray as $key => $value) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function DispayActionsKeyFormatter(value, row, index) {
|
function DispayActionsKeyFormatter(value, row, index) {
|
||||||
var exp_model = '';
|
var exp_model = '';
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
$requestType = 'firmware';
|
||||||
|
global $amp_conf;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="fpbx-container container-fluid">
|
<div class="fpbx-container container-fluid">
|
||||||
|
|
@ -32,6 +33,8 @@
|
||||||
<li><a class="dropitem" data-id="all" tabindex="-1" href="#"><span><?php echo _('Show All') ?></span></a></li>
|
<li><a class="dropitem" data-id="all" tabindex="-1" href="#"><span><?php echo _('Show All') ?></span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
<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">
|
<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>
|
<thead>
|
||||||
|
|
@ -42,9 +45,9 @@
|
||||||
<th data-sortable="true" data-field="vendor"><?php echo _('Vendor');?></th>
|
<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-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-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-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>
|
<th data-field="actions" data-formatter="DispayActionsModelFormatter"><?php echo _('Actions');?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
@ -61,7 +64,7 @@
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</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>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
|
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
|
||||||
|
|
@ -141,12 +144,34 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo _('Close');?></button>
|
<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 without Enabled');?></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 - Disabled');?></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</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 fade" id="edit_model" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
|
||||||
<div class="modal-dialog modal-lg" role="document">
|
<div class="modal-dialog modal-lg" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
@ -261,18 +286,17 @@
|
||||||
return exp_model;
|
return exp_model;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetColColorFirm(value, row, index) {
|
function SetColFirmNf(value, row, index) {
|
||||||
if (row['validate'].split(';')[0] === 'no') {
|
if (row['validate'].split(';')[0] === 'no') {
|
||||||
return "File not found<br />" + value;
|
return "File not found<br />" + value;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
function SetColColorTempl(value, row, index) {
|
function SetColTemplNf(value, row, index) {
|
||||||
if (row['validate'].split(';')[1] === 'no') {
|
if (row['validate'].split(';')[1] === 'no') {
|
||||||
return "File not found<br /> " + value ;
|
return "File not found<br /> " + value ;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetRowColor(row, index) {
|
function SetRowColor(row, index) {
|
||||||
|
|
|
||||||
|
|
@ -4,119 +4,147 @@
|
||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
$def_val = null;
|
$def_val = array();
|
||||||
$dev_id = null;
|
$dev_id = null;
|
||||||
$dev_new = null;
|
|
||||||
$device_warning= null;
|
$device_warning= null;
|
||||||
// Default value from Server setings
|
// 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['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['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");
|
$def_val['directed_pickup_context'] = array("keyword" => 'directed_pickup_context', "data" => $this->sccpvalues['directed_pickup_context']['data'], "seq" => "99");
|
||||||
|
|
||||||
if (!empty($_REQUEST['new_id'])) {
|
if (!empty($_REQUEST['new_id'])) {
|
||||||
|
// Adding device that is connected but not in database
|
||||||
$dev_id = $_REQUEST['new_id'];
|
$dev_id = $_REQUEST['new_id'];
|
||||||
$val = str_replace(array('SEP','ATA','VG'), '', $dev_id);
|
// Overwrite some specific defaults based on $_REQUEST
|
||||||
$val = implode('.', sscanf($val, '%4s%4s%4s')); // Convert to Cisco display Format
|
$def_val['type'] = array("keyword" => 'type', "data" => $_REQUEST['type'], "seq" => "99");
|
||||||
$def_val['mac'] = array("keyword" => 'mac', "data" => $val, "seq" => "99");
|
|
||||||
$val = $_REQUEST['type'];
|
|
||||||
$def_val['type'] = array("keyword" => 'type', "data" => $val, "seq" => "99");
|
|
||||||
if (!empty($_REQUEST['addon'])) {
|
if (!empty($_REQUEST['addon'])) {
|
||||||
$def_val['addon'] = array("keyword" => 'type', "data" => $_REQUEST['addon'], "seq" => "99");
|
$def_val['addon'] = array("keyword" => 'type', "data" => $_REQUEST['addon'], "seq" => "99");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_REQUEST['id'])) {
|
if (!empty($_REQUEST['id'])) {
|
||||||
|
// Editing an existing Device. Overwrite any defaults that are already set for this device.
|
||||||
$dev_id = $_REQUEST['id'];
|
$dev_id = $_REQUEST['id'];
|
||||||
$dev_new = $dev_id;
|
|
||||||
$db_res = $this->dbinterface->HWextension_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) {
|
foreach ($db_res as $key => $val) {
|
||||||
if (!empty($val)) {
|
if (!empty($val)) {
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'type':
|
case 'phonepersonalization':
|
||||||
$tmp_raw = $this->getSccpModelInformation('byid', true, 'all', array('model'=>$val));
|
$def_val['phonepersonalization'] = array("keyword" => 'phonepersonalization', "data" => $val, "seq" => "99");
|
||||||
if (!empty($tmp_raw[0])) {
|
break;
|
||||||
$tmp_raw = $tmp_raw[0];
|
default:
|
||||||
}
|
// Overwrite existing defaults after checking that data is still valid after schema updates
|
||||||
if (!empty($tmp_raw['validate'])) {
|
// Do not strip underscores as these fields are new in the schema and so should be valid.
|
||||||
$tmpar = explode(";", $tmp_raw['validate']);
|
$enumFields = $this->getTableEnums('sccpdevice', false);
|
||||||
if ($tmpar[0] != 'yes') {
|
if (array_key_exists($key, $enumFields)){
|
||||||
$device_warning['Image'] = array('Device firmware not found : '.$tmp_raw['loadimage']);
|
// This field is (now) an enum. Check the current value is acceptable.
|
||||||
}
|
// Quote value as enum values are quoted.
|
||||||
if ($tmpar[1] != 'yes') {
|
if (in_array("'{$val}'", $enumFields[$key])) {
|
||||||
$device_warning['Template'] = array('Missing device configuration template : '. $tmp_raw['nametemplate']);
|
// 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;
|
break;
|
||||||
case 'name':
|
|
||||||
$key = 'mac';
|
|
||||||
$val = str_replace(array('SEP','ATA','VG'), '', $val);
|
|
||||||
$val = implode('.', sscanf($val, '%4s%4s%4s')); // Convert to Cisco display Format
|
|
||||||
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");
|
|
||||||
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");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//print_r($db_res);
|
|
||||||
|
|
||||||
if (!empty($device_warning)) {
|
if (!empty($def_val['type'])) {
|
||||||
?>
|
$tmp_raw = $this->getSccpModelInformation('byid', true, 'all', array('model'=>$def_val['type']));
|
||||||
<div class="fpbx-container container-fluid">
|
if (!empty($tmp_raw[0])) {
|
||||||
<div class="row">
|
$tmp_raw = $tmp_raw[0];
|
||||||
<div class="container">
|
}
|
||||||
<h2 style="border:2px solid Tomato;color:Tomato;" >Warning in the SCCP Device</h2>
|
if (!empty($tmp_raw['validate'])) {
|
||||||
<div class="table-responsive">
|
$tmpar = explode(";", $tmp_raw['validate']);
|
||||||
<?php
|
if ($tmpar[0] != 'yes') {
|
||||||
foreach ($device_warning as $key => $value) {
|
$device_warning['Image'] = array('Device firmware not found : '.$tmp_raw['loadimage']);
|
||||||
echo '<h3>'.$key.'</h3>';
|
}
|
||||||
if (is_array($value)) {
|
if ($tmpar[1] != 'yes') {
|
||||||
echo '<li>'._(implode('</li><li>', $value)).'</li>';
|
$device_warning['Template'] = array('Missing device configuration template : '. $tmp_raw['nametemplate']);
|
||||||
} else {
|
}
|
||||||
echo '<li>'. _($value).'</li>';
|
if (!empty($device_warning)) {
|
||||||
}
|
?>
|
||||||
}
|
<div class="fpbx-container container-fluid">
|
||||||
?>
|
<div class="row">
|
||||||
</pre>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<br>
|
||||||
</div>
|
<?php }
|
||||||
<br>
|
}
|
||||||
|
} ?>
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<form autocomplete="off" name="frm_adddevice" id="frm_adddevice" class="fpbx-submit" action="" method="post" data-id="hw_edit">
|
<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="category" value="adddevice_form">
|
||||||
<input type="hidden" name="Submit" value="Submit">
|
<input type="hidden" name="Submit" value="Submit">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (empty($dev_new)) {
|
|
||||||
|
if (empty($dev_id)) {
|
||||||
echo '<input type="hidden" name="sccp_deviceid" value="new">';
|
echo '<input type="hidden" name="sccp_deviceid" value="new">';
|
||||||
} else {
|
} 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);
|
if ($_REQUEST['tech_hardware'] == 'cisco') {
|
||||||
} else {
|
echo '<input type="hidden" name="sccp_device_typeid" value="sccpdevice">';
|
||||||
echo $this->showGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val);
|
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); This are line properties and does not exist!
|
|
||||||
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>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ $dev_new = null;
|
||||||
if (!empty($_REQUEST['ru_id'])) {
|
if (!empty($_REQUEST['ru_id'])) {
|
||||||
$dev_id = $_REQUEST['ru_id'];
|
$dev_id = $_REQUEST['ru_id'];
|
||||||
$def_val['id'] = array("keyword" => 'id', "data" => $dev_id, "seq" => "99");
|
$def_val['id'] = array("keyword" => 'id', "data" => $dev_id, "seq" => "99");
|
||||||
$db_res = $this->dbinterface->HWextension_db_SccpTableData('get_sccpuser', array("id" => $dev_id));
|
$db_res = $this->dbinterface->getSccpDeviceTableData('get_sccpuser', array("id" => $dev_id));
|
||||||
if (!empty($db_res)) {
|
if (!empty($db_res)) {
|
||||||
foreach ($db_res as $key => $val) {
|
foreach ($db_res as $key => $val) {
|
||||||
if (!empty($val)) {
|
if (!empty($val)) {
|
||||||
|
|
|
||||||
|
|
@ -1,125 +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.
|
|
||||||
*/
|
|
||||||
$def_val = null;
|
|
||||||
$dev_id = null;
|
|
||||||
$dev_new = null;
|
|
||||||
$device_warning= null;
|
|
||||||
// Default value from Server setings
|
|
||||||
|
|
||||||
$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'])) {
|
|
||||||
$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");
|
|
||||||
if (!empty($_REQUEST['addon'])) {
|
|
||||||
$def_val['addon'] = array("keyword" => 'type', "data" => $_REQUEST['addon'], "seq" => "99");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($_REQUEST['id'])) {
|
|
||||||
$dev_id = $_REQUEST['id'];
|
|
||||||
$dev_new = $dev_id;
|
|
||||||
$db_res = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
|
|
||||||
foreach ($db_res as $key => $val) {
|
|
||||||
if (!empty($val)) {
|
|
||||||
switch ($key) {
|
|
||||||
case 'type':
|
|
||||||
$tmp_raw = $this->getSccpModelInformation('byid', true, 'all', array('model'=>$val));
|
|
||||||
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']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'name':
|
|
||||||
$key = 'mac';
|
|
||||||
$val = str_replace(array('SEP','ATA','VG'), '', $val);
|
|
||||||
$val = implode('.', sscanf($val, '%4s%4s%4s')); // Convert to Cisco display Format
|
|
||||||
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");
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//print_r($db_res);
|
|
||||||
|
|
||||||
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">
|
|
||||||
<?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_sedit">
|
|
||||||
<input type="hidden" name="category" value="adddevice_form">
|
|
||||||
<input type="hidden" name="Submit" value="Submit">
|
|
||||||
<input type="hidden" name="sccp_device_typeid" value="sipdevice">
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
|
||||||
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_dev2', 1, 'sccp_hw', $def_val);
|
|
||||||
echo $this->showGroup('sccp_hw_sip_conf', 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>
|
|
||||||
|
|
@ -6,53 +6,51 @@
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
$forminfo =array(
|
$forminfo =array(
|
||||||
array("name" => "dev_buttons", 'label' =>"Buttons Configuration"),
|
array('name'=>'dev_buttons', 'label'=>'Buttons Configuration'),
|
||||||
array("name" => "button", 'label'=>"Buttons ", 'help' => "help.")
|
array('name'=>'button', 'label'=>'Buttons', 'help'=>'help')
|
||||||
);
|
);
|
||||||
//$buttons_type= array("empty","line","service","feature","speeddial");
|
//$buttons_type= array("empty","line","service","feature","speeddial");
|
||||||
// "feature","service" -- Add leter !
|
// "feature","service" -- Add leter !
|
||||||
$buttons_type= array("empty","line","silent","monitor","speeddial","feature","adv.line");
|
$buttons_type= array("empty","line","silent","monitor","speeddial","feature","adv.line");
|
||||||
$feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'devstate'=> "Change Status");
|
$feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'devstate'=> "Change Status");
|
||||||
/*
|
|
||||||
button = feature,PDefault,ParkingLot,default,RetrieveSingle
|
|
||||||
feature,P.slot,parkinglot,P.slot,
|
|
||||||
|
|
||||||
*/
|
if ($_REQUEST['tech_hardware'] === 'cisco') {
|
||||||
|
$lines_list = $this->dbinterface->getSccpDeviceTableData('SccpExtension');
|
||||||
|
} else {
|
||||||
|
$lines_list = $this->dbinterface->getSipTableData('extensionList');
|
||||||
|
}
|
||||||
|
|
||||||
$lines_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
|
|
||||||
//$hint_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
|
|
||||||
$hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ;
|
$hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ;
|
||||||
|
|
||||||
// print_r($hint_list);
|
|
||||||
$line_id =0;
|
$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;
|
$show_buttons =1;
|
||||||
//print_r($hint_list);
|
|
||||||
if (!empty($_REQUEST['id'])) {
|
if (!empty($_REQUEST['id'])) {
|
||||||
$dev_id = $_REQUEST['id'];
|
$dev_id = $_REQUEST['id'];
|
||||||
$db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id));
|
$db_buttons = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_buttons', array("id" => $dev_id));
|
||||||
$db_device = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
|
$db_device = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array("id" => $dev_id));
|
||||||
$max_buttons = $db_device['buttons'];
|
$show_buttons = $db_device['buttons'];
|
||||||
if (!empty($db_device['addon_buttons'])) {
|
if (!empty($db_device['addon_buttons'])) {
|
||||||
$max_buttons += $db_device['addon_buttons'];
|
$show_buttons += $db_device['addon_buttons'];
|
||||||
}
|
}
|
||||||
$show_buttons = $max_buttons;
|
//$show_buttons = $max_buttons;
|
||||||
}
|
}
|
||||||
if (!empty($_REQUEST['new_id'])) {
|
if (!empty($_REQUEST['new_id'])) {
|
||||||
$val = $_REQUEST['type'];
|
$val = $_REQUEST['type'];
|
||||||
$dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val));
|
$dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val));
|
||||||
// $db_device = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $val));
|
// $db_device = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array("id" => $val));
|
||||||
$max_buttons = $dev_schema[0]['buttons'];
|
$show_buttons = $dev_schema[0]['buttons'];
|
||||||
if (!empty($_REQUEST['addon'])) {
|
if (!empty($_REQUEST['addon'])) {
|
||||||
$val = $_REQUEST['addon'];
|
$val = $_REQUEST['addon'];
|
||||||
$dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val));
|
$dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val));
|
||||||
$max_buttons += $dev_schema[0]['buttons'];
|
$show_buttons += $dev_schema[0]['buttons'];
|
||||||
}
|
}
|
||||||
$show_buttons = $max_buttons;
|
//$show_buttons = $max_buttons;
|
||||||
}
|
}
|
||||||
if (!empty($_REQUEST['ru_id'])) {
|
if (!empty($_REQUEST['ru_id'])) {
|
||||||
$dev_id = $_REQUEST['ru_id'];
|
$dev_id = $_REQUEST['ru_id'];
|
||||||
$db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array("id" => $dev_id));
|
$db_buttons = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_buttons', array("id" => $dev_id));
|
||||||
$show_buttons = $max_buttons;
|
$show_buttons = $max_buttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -61,12 +59,14 @@ if (!empty($_REQUEST['ru_id'])) {
|
||||||
<form autocomplete="off" name="frm_editbuttons" id="frm_editbuttons" class="fpbx-submit" action="" method="post" data-id="hw_edit">
|
<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="category" value="frm_editbuttons">
|
||||||
<input type="hidden" name="Submit" value="Submit">
|
<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'];?>">
|
<div class="section-title" data-for="<?php echo $forminfo[0]['name'];?>">
|
||||||
<h3><i class="fa fa-minus"></i><?php echo _($forminfo[0]['label']) ?></h3>
|
<h3><i class="fa fa-minus"></i><?php echo _($forminfo[0]['label']) ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" data-id="<?php echo $forminfo[0]['name'];?>">
|
<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">
|
<div class="col-sm-2">
|
||||||
<label class="control-label">Help</label>
|
<label class="control-label">Help</label>
|
||||||
<i class="fa fa-question-circle fpbx-help-icon" data-for="frmbuttons"></i>
|
<i class="fa fa-question-circle fpbx-help-icon" data-for="frmbuttons"></i>
|
||||||
|
|
@ -87,11 +87,10 @@ if (!empty($_REQUEST['ru_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>
|
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>
|
</ui></ui>");?></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div></div>
|
</div></div>
|
||||||
<?php
|
<?php
|
||||||
for ($line_id = 0; $line_id <=$max_buttons; $line_id ++) {
|
for ($line_id = 0; $line_id <$max_buttons; $line_id ++) {
|
||||||
// print_r($db_buttons[$line_id]);
|
|
||||||
$show_form_mode = '';
|
$show_form_mode = '';
|
||||||
$defaul_tv = (empty($db_buttons[$line_id])) ? "empty": $db_buttons[$line_id]['buttontype'];
|
$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_btn = (empty($db_buttons[$line_id])) ? "": $db_buttons[$line_id]['name'];
|
||||||
|
|
@ -143,23 +142,19 @@ if (!empty($_REQUEST['ru_id'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// print_r($def_hint_btn);
|
|
||||||
// print_r($defaul_opt);
|
|
||||||
|
|
||||||
echo '<!-- Begin button :'.$line_id.' -->';
|
echo '<!-- Begin button :'.$line_id.' -->';
|
||||||
echo '<div class="line_button element-container" '.(($line_id < $show_buttons)?"":"hidden ").'data-id="'.$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">
|
<div class="row"> <div class="form-group">
|
||||||
<div class="col-sm-2">
|
<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>
|
<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>
|
||||||
<div class="col-sm-5">
|
<div class="col-sm-5">
|
||||||
<div class="col-xs-3">
|
<div class="col-xs-3">
|
||||||
<!-- Line Type Select -->
|
<!-- Line Type Select -->
|
||||||
<select class="form-control buttontype" data-id="<?php echo $line_id;?>" name="<?php echo $forminfo[1]['name'].$line_id.'_type';?>" >
|
<select class="form-control buttontype" data-id="<?php echo $line_id;?>" name="<?php echo $forminfo[1]['name'].$line_id.'_type';?>">
|
||||||
<?php
|
<?php
|
||||||
if ($line_id == 0) {
|
if ($line_id == 0) {
|
||||||
echo '<option value="line" selected >DEF LINE</option>';
|
echo '<option value="line" selected >DEF LINE</option>';
|
||||||
|
|
@ -183,10 +178,10 @@ if (!empty($_REQUEST['ru_id'])) {
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
<!-- if Line Type = line Show SCCP Num -->
|
<!-- if Line Type = line Show SCCP Num -->
|
||||||
<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';?>" >
|
<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
|
<?php
|
||||||
foreach ($lines_list as $data) {
|
foreach ($lines_list as $data) {
|
||||||
$select = (($data['name']==$defaul_btn)?"selected":"");
|
$select = (($data['name']==$defaul_btn)?'selected="selected"':"");
|
||||||
echo '<option value="'.$data['name'].'" '.$select.' >'.$data['name'].' / '.$data['label'].'</option>';
|
echo '<option value="'.$data['name'].'" '.$select.' >'.$data['name'].' / '.$data['label'].'</option>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
@ -212,7 +207,7 @@ if (!empty($_REQUEST['ru_id'])) {
|
||||||
echo '</div><div class="col-xs-5">';
|
echo '</div><div class="col-xs-5">';
|
||||||
|
|
||||||
echo '<select class="form-control" name="'.$forminfo[1]['name'].$line_id.'_hline" >';
|
echo '<select class="form-control" name="'.$forminfo[1]['name'].$line_id.'_hline" >';
|
||||||
|
|
||||||
foreach ($hint_list as $data) {
|
foreach ($hint_list as $data) {
|
||||||
$select = (($data['key']==$def_hint_btn)?"selected":"");
|
$select = (($data['key']==$def_hint_btn)?"selected":"");
|
||||||
echo '<option value="'.$data['key'].'" '.$select.' >'.$data['exten'].' / '.$data['label'].'</option>';
|
echo '<option value="'.$data['key'].'" '.$select.' >'.$data['exten'].' / '.$data['label'].'</option>';
|
||||||
|
|
@ -221,7 +216,7 @@ if (!empty($_REQUEST['ru_id'])) {
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<!-- if Line Type = feature Show Futures Park -->
|
<!-- 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 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">
|
<div class="col-xs-4">
|
||||||
<?php
|
<?php
|
||||||
|
|
@ -248,7 +243,7 @@ if (!empty($_REQUEST['ru_id'])) {
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- if Line Type = feature Show Futures Park -->
|
<!-- 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 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="col-xs-4">
|
||||||
<div class="radioset" data-toggle="buttons">
|
<div class="radioset" data-toggle="buttons">
|
||||||
|
|
@ -267,12 +262,12 @@ if (!empty($_REQUEST['ru_id'])) {
|
||||||
<?php
|
<?php
|
||||||
echo '<!-- End button :'.$line_id.' -->';
|
echo '<!-- End button :'.$line_id.' -->';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="section-butom" data-for="<?php echo $forminfo[0]['name'];?>">
|
<div class="section-butom" data-for="<?php echo $forminfo[0]['name'];?>">
|
||||||
<h3></h3>
|
<h3></h3>
|
||||||
|
|
|
||||||
|
|
@ -1,262 +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.
|
|
||||||
*/
|
|
||||||
$forminfo =array(
|
|
||||||
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");
|
|
||||||
$buttons_type= array('empty','line','speeddial');
|
|
||||||
$feature_list= array('parkinglot'=>'Park Slots','monitor'=> 'Record Calls','devstate'=> 'Change Status');
|
|
||||||
|
|
||||||
//$lines_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
|
|
||||||
$lines_list = $this->sipconfigs->get_db_sip_TableData('Device');
|
|
||||||
//$hint_list = $this->dbinterface->HWextension_db_SccpTableData('SccpExtension');
|
|
||||||
$hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ;
|
|
||||||
|
|
||||||
// print_r($lines_list);
|
|
||||||
$line_id =0;
|
|
||||||
$max_buttons =56;
|
|
||||||
$show_buttons =1;
|
|
||||||
//print_r($hint_list);
|
|
||||||
if (!empty($_REQUEST['id'])) {
|
|
||||||
$dev_id = $_REQUEST['id'];
|
|
||||||
$db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array('id' => $dev_id));
|
|
||||||
$db_device = $this->dbinterface->HWextension_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'];
|
|
||||||
}
|
|
||||||
$show_buttons = $max_buttons;
|
|
||||||
}
|
|
||||||
if (!empty($_REQUEST['new_id'])) {
|
|
||||||
$val = $_REQUEST['type'];
|
|
||||||
$dev_schema = $this-> getSccpModelInformation('byid', false, 'all', array('model' =>$val));
|
|
||||||
// $db_device = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $val));
|
|
||||||
$max_buttons = $dev_schema[0]['buttons'];
|
|
||||||
if (!empty($_REQUEST['addon'])) {
|
|
||||||
$val = $_REQUEST['addon'];
|
|
||||||
$dev_schema = $this-> getSccpModelInformation('byid', false, 'all', array('model' =>$val));
|
|
||||||
$max_buttons += $dev_schema[0]['buttons'];
|
|
||||||
}
|
|
||||||
$show_buttons = $max_buttons;
|
|
||||||
}
|
|
||||||
if (!empty($_REQUEST['ru_id'])) {
|
|
||||||
$dev_id = $_REQUEST['ru_id'];
|
|
||||||
$db_buttons = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_buttons', array('id' => $dev_id));
|
|
||||||
$show_buttons = $max_buttons;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<form autocomplete="off" name="frm_editbuttons" id="frm_editbuttons" class="fpbx-submit" action="" method="post" data-id="hw_sedit">
|
|
||||||
<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?>">
|
|
||||||
<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="col-sm-2">
|
|
||||||
<label class="control-label">Help</label>
|
|
||||||
<i class="fa fa-question-circle fpbx-help-icon" data-for="frmbuttons"></i>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<span id="frmbuttons-help" class="help-block fpbx-help-block"><?php echo _("buttons come in the following flavours: <br>
|
|
||||||
<ul>
|
|
||||||
<li>empty: Empty button (no options)</li>
|
|
||||||
<li>line: Registers the line with identifier specified as [name]</li>
|
|
||||||
<li>silent: buttons equal 'Line' with out ring</li>
|
|
||||||
<li>monitor: buttons mode speeddial + show status</li>
|
|
||||||
<li>speeddial: Adds a speeddial with label [name] and [option1] as number Optionally, [option2] can be used to specify a hint by extension@context as usual.</li>
|
|
||||||
<li>service (not implemented): Adds a service url Feature buttons have an on/off status represented on the device with a tick-box and can be used to set the device in a particular state. Currently Possible [option1],[option2] combinations:</li>
|
|
||||||
<ul>
|
|
||||||
<li>privacy,callpresent = Make a private call, number is suppressed</li><li>privacy,hint = Make a private call, hint is suppressed</li><li>cfwdall,number = Forward all calls </li><li>cfwbusy,number = Forward on busy</li><li>
|
|
||||||
cfwnoaswer,number = Forward on no-answer (not implemented yet)<br> DND,busy = Do-not-disturb, return Busy signal to Caller <br> DND,silent = Do-not-disturb, return nothing to caller <br>
|
|
||||||
monitor = Record Calls using AutoMon (asterisk 1.6.x only)</li><li>devstate,custom_devstate = Device State Feature Button (asterisk 1.6.1 and up). custom_devstate is the name of the custom devicestate to be toggled (How to use devicestate)
|
|
||||||
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]['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_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['id']==$test_btn) {
|
|
||||||
$show_form_mode = 'line';
|
|
||||||
$defaul_tv = 'monitor';
|
|
||||||
$defaul_btn = $test_btn;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// print_r($def_hint_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">
|
|
||||||
<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 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 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 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';?>" >
|
|
||||||
<?php
|
|
||||||
foreach ($lines_list as $data) {
|
|
||||||
$select = (($data['id']==$defaul_btn)?"selected":"");
|
|
||||||
echo '<option value="'.$data['id'].'" '.$select.' >'.$data['id'].' / '.$data['callerid'].'</option>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
<!-- 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>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="col-md-5">
|
|
||||||
<!-- if Line Type = speeddial Show Hint line -->
|
|
||||||
<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['key']==$def_hint_btn)?"selected":"");
|
|
||||||
echo '<option value="'.$data['key'].'" '.$select.' >'.$data['exten'].' / '.$data['label'].'</option>';
|
|
||||||
}
|
|
||||||
echo '</select>';
|
|
||||||
echo '</div>';
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
<!-- 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-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'].'" >';
|
|
||||||
?>
|
|
||||||
</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>
|
|
||||||
</div>
|
|
||||||
<!-- if Line Type = Advanced Show Hint line -->
|
|
||||||
|
|
||||||
<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.'" >';
|
|
||||||
?>
|
|
||||||
</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'].'" >';
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div></div>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
echo '<!-- End button :'.$line_id.' -->';
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<div class="section-butom" data-for="<?php echo $forminfo[0]['name'];?>">
|
|
||||||
<h3></h3>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<div class="element-container"> <div class="row"> <div class="form-group">
|
<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="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>
|
<i class="fa fa-question-circle fpbx-help-icon" data-for="ERROR"></i>
|
||||||
</div></div></div></div>
|
</div></div></div></div>
|
||||||
|
|
||||||
|
|
|
||||||
113
views/formShowSysDefs.php
Normal file
113
views/formShowSysDefs.php
Normal 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
85
views/getFileModal.html
Normal 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">×</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-->
|
||||||
|
|
@ -20,13 +20,13 @@ if (!empty($this->sccpvalues['system_rouminguser'])) {
|
||||||
<div id="toolbar-sccp-extension">
|
<div id="toolbar-sccp-extension">
|
||||||
<a class="btn btn-default" href="config.php?display=extensions&tech_hardware=sccp_custom"><i class="fa fa-plus"> </i><?php echo _("Add Extension") ?></a>
|
<a class="btn btn-default" href="config.php?display=extensions&tech_hardware=sccp_custom"><i class="fa fa-plus"> </i><?php echo _("Add Extension") ?></a>
|
||||||
</div>
|
</div>
|
||||||
<table data-cookie="true" data-cookie-id-table="sccp-extension-table" data-url="ajax.php?module=sccp_manager&command=getExtensionGrid&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>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<!-- <th data-checkbox="true"></th> -->
|
|
||||||
<th data-sortable="true" data-field="name"><?php echo _('Extension') ?></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="label"><?php echo _('Display Name') ?></th>
|
||||||
<th data-sortable="true" data-field="line_statustext"><?php echo _('Status') ?></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>
|
<th data-field="actions" data-formatter="DispayPhoneActionsKeyFormatter"><?php echo _('Actions') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
||||||
|
|
@ -31,12 +31,15 @@
|
||||||
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Reset Token Device') ?></span>
|
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Reset Token Device') ?></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<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="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>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-checkbox="true"></th>
|
<th data-checkbox="true"></th>
|
||||||
<th data-sortable="true" data-field="mac"><?php echo _('Device SEP ID') ?></th>
|
<th data-sortable="true" data-field="name"><?php echo _('Device ID') ?></th>
|
||||||
<th data-sortable="true" data-field="description"><?php echo _('Device Descriptions') ?></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-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="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="status"><?php echo _('Status') ?></th>
|
||||||
|
|
@ -78,8 +81,7 @@
|
||||||
exp_model += '</a> <a class="btn-item-delete" data-for="hardware" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>';
|
exp_model += '</a> <a class="btn-item-delete" data-for="hardware" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>';
|
||||||
}
|
}
|
||||||
return exp_model;
|
return exp_model;
|
||||||
}
|
}
|
||||||
|
|
||||||
function LineFormatter(value, row, index) {
|
function LineFormatter(value, row, index) {
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
return '-- EMPTY --';
|
return '-- EMPTY --';
|
||||||
|
|
@ -87,11 +89,11 @@
|
||||||
var data = value.split(";");
|
var data = value.split(";");
|
||||||
result = '';
|
result = '';
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
var val = data[i].split(',');
|
var val = data[i].split(',');
|
||||||
if (val[0] === 'line') {
|
if (val[0] === 'line') {
|
||||||
result = result + val[1] + '<br>';
|
result = result + val[1] + '<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,17 @@
|
||||||
class="table">
|
class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-sortable="true" data-field="mac"><?php echo _('SEP ID')?></th>
|
<th data-sortable="true" data-field="name"><?php echo _('SEP ID')?></th>
|
||||||
<th data-sortable="true" data-field="description"><?php echo _('Descriptions')?></th>
|
<th data-sortable="true" data-field="description"><?php echo _('Descriptions')?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$("#sccpnavgrid").on('click-row.bs.table',function(e,row,elem){
|
$("#sccpnavgrid").on('click-row.bs.table',function(e,row,elem){
|
||||||
window.location = '?display=sccp_phone&tech_hardware=cisco&id='+row['mac'];
|
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>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
// vim: set ai ts=4 sw=4 ft=phtml:
|
// vim: set ai ts=4 sw=4 ft=phtml:
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="fpbx-container container-fluid">
|
<div class="fpbx-container container-fluid">
|
||||||
|
|
@ -18,19 +17,19 @@
|
||||||
<button id="remove-sccp-sphone" class="btn btn-danger sccp_update btn-tab-select" data-id="delete_hardware" disabled>
|
<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>
|
<i class="glyphicon glyphicon-remove"></i> <span><?php echo _('Delete') ?></span>
|
||||||
</button>
|
</button>
|
||||||
<button name="cr_sccp_sphone_xml" class="btn sccp_update btn-default" data-id="create-cnf">
|
<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>
|
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Create CNF') ?></span>
|
||||||
</button>
|
</button>
|
||||||
<button name="reset_sccp_sphone" class="btn sccp_update btn-default" data-id="reset_dev">
|
|
||||||
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Reset Device') ?></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
</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="mac">
|
<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>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-checkbox="true"></th>
|
<th data-checkbox="true"></th>
|
||||||
<th data-sortable="true" data-field="mac"><?php echo _('Device SEP ID') ?></th>
|
<th data-sortable="true" data-field="name"><?php echo _('Device ID') ?></th>
|
||||||
<th data-sortable="true" data-field="description"><?php echo _('Device Descriptions') ?></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-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="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="status"><?php echo _('Status') ?></th>
|
||||||
|
|
@ -45,6 +44,21 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<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) {
|
function DispayDeviceActionsKeyFormatterS(value, row, index) {
|
||||||
var exp_model = '';
|
var exp_model = '';
|
||||||
if (row['new_hw'] == "Y") {
|
if (row['new_hw'] == "Y") {
|
||||||
|
|
@ -59,33 +73,20 @@
|
||||||
exp_model += '</a> <a class="btn-item-delete" data-for="hardware" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>';
|
exp_model += '</a> <a class="btn-item-delete" data-for="hardware" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>';
|
||||||
}
|
}
|
||||||
return exp_model;
|
return exp_model;
|
||||||
}
|
|
||||||
|
|
||||||
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 LineFormatterS(value, row, index) {
|
function LineFormatter(value, row, index) {
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
return '-- EMPTY --';
|
return '-- EMPTY --';
|
||||||
}
|
}
|
||||||
var data = value.split(";");
|
var data = value.split(";");
|
||||||
result = '';
|
result = '';
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
var val = data[i].split(',');
|
var val = data[i].split(',');
|
||||||
if (val[0] === 'line') {
|
if (val[0] === 'line') {
|
||||||
result = result + val[1] + '<br>';
|
result = result + val[1] + '<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,12 @@
|
||||||
|
|
||||||
<?php
|
<?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_srst', 1);
|
||||||
echo $this->showGroup('sccp_dev_vendor_conf', 1);
|
echo $this->showGroup('sccp_dev_vendor_conf', 1, 'sccpdevice', $defaultVals);
|
||||||
// echo $this->showGroup('sccp_dev_time',1);
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -6,39 +6,19 @@
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$def_val = null;
|
$def_val = null;
|
||||||
$dev_id = null;
|
$dev_id = null;
|
||||||
$sccp_codec = $this->getCodecs('audio', true);
|
$audio_codecs = $this->getCodecs('audio');
|
||||||
$video_codecs = $this->getCodecs('video', true);
|
$video_codecs = $this->getCodecs('video');
|
||||||
$sccp_disalow_def = $this->extconfigs->getextConfig('sccpDefaults', 'disallow');
|
$sccp_disallow_def = $this->sccpvalues['disallow']['data'];
|
||||||
$sccp_disalow = $sccp_disalow_def;
|
$sys_disallow_def = $this->sccpvalues['disallow']['systemdefault'];
|
||||||
|
|
||||||
if (!empty($_REQUEST['id'])) {
|
if (empty($sccp_disallow_def)) {
|
||||||
$dev_id = $_REQUEST['id'];
|
$sccp_disallow_def = $sys_disallow_def;
|
||||||
$db_res = $this->dbinterface->HWextension_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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- TODO: Codec selection has moved to the line level in newer chan-sccp versions and should be moved -->
|
<!-- 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">
|
<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="category" value="codecform">
|
||||||
<input type="hidden" name="Submit" value="Submit">
|
<input type="hidden" name="Submit" value="Submit">
|
||||||
|
|
@ -55,8 +35,8 @@ if (!empty($_REQUEST['id'])) {
|
||||||
<i class="fa fa-question-circle fpbx-help-icon" data-for="sccp_disallow"></i>
|
<i class="fa fa-question-circle fpbx-help-icon" data-for="sccp_disallow"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-9 radioset">
|
<div class="col-md-9 radioset">
|
||||||
<input id="sccp_disallow" type="text" name="sccp_disallow" value="<?php echo $sccp_disalow ?>">
|
<input id="sccp_disallow" type="text" name="sccp_disallow" value="<?php echo $sccp_disallow_def ?>">
|
||||||
<label for="sccp_disallow"><?php echo _("default : " . $sccp_disalow_def) ?></label>
|
<label for="sccp_disallow"><?php echo _("Recomended default: all") ?></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -64,7 +44,7 @@ if (!empty($_REQUEST['id'])) {
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<span id="sccp_disallow-help" class="help-block fpbx-help-block"><?php echo _("Default : all. Please enter format: alaw,ulaw,...") ?></span>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -89,20 +69,25 @@ if (!empty($_REQUEST['id'])) {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<div>
|
<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>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
$seq = 1;
|
$seq = 1;
|
||||||
|
|
||||||
echo '<ul class="sortable">';
|
echo '<ul class="sortable">';
|
||||||
foreach ($codec_list as $codec => $codec_state) {
|
foreach ($audio_codecs as $codec => $codec_state) {
|
||||||
$codec_trans = _($codec);
|
$codec_trans = _($codec);
|
||||||
$codec_checked = $codec_state ? 'checked' : '';
|
$codec_checked = $codec_state ? 'checked' : '';
|
||||||
echo '<li><a href="#">'
|
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" /> '
|
. '<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" '
|
. '<input type="checkbox" '
|
||||||
. ($codec_checked ? 'value="' . $seq++ . '" ' : '')
|
. ($codec_checked ? 'value="' . $seq++ . '" ' : '')
|
||||||
. 'name="voicecodecs[' . $codec . ']" '
|
. 'name="audiocodecs[' . $codec . ']" '
|
||||||
. 'id="' . $codec . '" '
|
. 'id="' . $codec . '" '
|
||||||
. 'class="audio-codecs" '
|
. 'class="audio-codecs" '
|
||||||
. $codec_checked
|
. $codec_checked
|
||||||
|
|
@ -140,12 +125,13 @@ if (!empty($_REQUEST['id'])) {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<div>
|
<div>
|
||||||
<?php echo show_help(_("This is the default Codec setting for SCCP Device.")) ?>
|
<?php echo show_help(_("These are the default video codec settings for this site.")) ?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
$seq = 1;
|
$seq = 1;
|
||||||
|
|
||||||
echo '<ul class="sortable">';
|
echo '<ul class="sortable">';
|
||||||
|
// Although classed as video codecs, all stored under allow so name is audiocodecs.
|
||||||
foreach ($video_codecs as $codec => $codec_state) {
|
foreach ($video_codecs as $codec => $codec_state) {
|
||||||
$codec_trans = _($codec);
|
$codec_trans = _($codec);
|
||||||
$codec_checked = $codec_state ? 'checked' : '';
|
$codec_checked = $codec_state ? 'checked' : '';
|
||||||
|
|
@ -153,9 +139,9 @@ if (!empty($_REQUEST['id'])) {
|
||||||
. '<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" /> '
|
. '<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" '
|
. '<input type="checkbox" '
|
||||||
. ($codec_checked ? 'value="' . $seq++ . '" ' : '')
|
. ($codec_checked ? 'value="' . $seq++ . '" ' : '')
|
||||||
. 'name="voicecodecs[' . $codec . ']" '
|
. 'name="audiocodecs[' . $codec . ']" '
|
||||||
. 'id="' . $codec . '" '
|
. 'id="' . $codec . '" '
|
||||||
. 'class="audio-codecs" '
|
. 'class="video-codecs" '
|
||||||
. $codec_checked
|
. $codec_checked
|
||||||
. ' />'
|
. ' />'
|
||||||
. ' <label for="' . $codec . '"> '
|
. ' <label for="' . $codec . '"> '
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,24 @@
|
||||||
<form autocomplete="off" name="frm_device" id="frm_device" class="fpbx-submit" action="" method="post">
|
<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="category" value="deviceform">
|
||||||
<input type="hidden" name="Submit" value="Submit">
|
<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
|
<?php
|
||||||
|
|
||||||
|
$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_config', 1);
|
||||||
echo $this->showGroup('sccp_dev_group_config', 1);
|
echo $this->showGroup('sccp_dev_group_config', 1);
|
||||||
echo $this->showGroup('sccp_dev_advconfig', 1);
|
echo $this->showGroup('sccp_dev_advconfig', 1);
|
||||||
echo $this->showGroup('sccp_dev_softkey', 1);
|
echo $this->showGroup('sccp_dev_softkey', 1);
|
||||||
echo $this->showGroup('sccp_hotline_config', 1);
|
echo $this->showGroup('sccp_hotline_config', 1);
|
||||||
?>
|
echo $this->showGroup('sccp_qos_config', 1, 'sccpdevice', $def_val_device);
|
||||||
|
?>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
$test_ami = 0;
|
$test_ami = 0;
|
||||||
$test_any = 0;
|
$test_any = 0;
|
||||||
|
global $amp_conf;
|
||||||
|
|
||||||
$driver = $this->FreePBX->Core->getAllDriversInfo();
|
$driver = $this->FreePBX->Core->getAllDriversInfo();
|
||||||
$core = $this->aminterface->getSCCPVersion();
|
$core = $this->aminterface->getSCCPVersion();
|
||||||
|
|
@ -30,35 +31,57 @@ $compatible = $this->aminterface->get_compatible_sccp();
|
||||||
$info = array();
|
$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['extconfigs'] = $this->extconfigs->info();
|
||||||
$info['dbinterface'] = $this->dbinterface->info();
|
$info['dbinterface'] = $this->dbinterface->info();
|
||||||
$info['aminterface'] = $this->aminterface->info();
|
$info['aminterface'] = $this->aminterface->info();
|
||||||
$info['XML'] = $this->xmlinterface->info();
|
$info['XML'] = $this->xmlinterface->info();
|
||||||
$info['sccp_class'] = $driver['sccp'];
|
$info['sccp_class'] = $driver['sccp'];
|
||||||
$info['Core_sccp'] = array('Version' => $core['Version'],
|
$info['Core_sccp'] = array('Version' => $core['Version'],
|
||||||
'about' => 'Sccp ver.' . $core['Version'] .
|
'about' => "Sccp ver: {$core['Version']} r{$core['vCode']} Revision: {$core['RevisionNum']} Hash: {$core['RevisionHash']}");
|
||||||
' r' . $core['vCode'] . ' Revision :' .
|
$capabilityArray = array( "park", "pickup", "realtime", "video", "conference", "dirtrfr", "feature_monitor", "functions", "manager_events",
|
||||||
$core['RevisionNum'] . ' Hash :' .
|
"devicestate", "devstate_feature", "dynamic_speeddial", "dynamic_speeddial_cid", "experimental", "debug");
|
||||||
$core['RevisionHash']);
|
|
||||||
/*
|
|
||||||
if (!$this->srvinterface->useAmiInterface) {
|
|
||||||
$info['aminterface']['about'] .= ' -- Disabled';
|
|
||||||
$info['Core_sccp'] = array('Version' => $core['Version'], 'about' => 'Sccp ver.' . $core['Version'] . ' r' . $core['vCode'] . ' Revision :' . $core['RevisionNum'] . ' Hash :' . $core['RevisionHash'] . ' ----Warning: Upgrade chan_sccp to use full ami functionality');
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
$info['Asterisk'] = array('Version' => FreePBX::Config()->get('ASTVERSION'), 'about' => 'Asterisk.');
|
|
||||||
|
|
||||||
|
$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'])) {
|
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') {
|
exec('in.tftpd -V', $tftpInfo);
|
||||||
$info['Provision_SCCP'] = array('Version' => 'base', 'about' => 'Provision Sccp enabled');
|
$info['TFTP Server'] = array('Version' => 'Not Found', 'about' => 'Mapping not available');
|
||||||
} else {
|
|
||||||
$info['TFTP_Rewrite'] = array('Version' => 'base', 'about' => 'Rewrite Supported');
|
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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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');
|
$info['Сompatible'] = array('Version' => $compatible, 'about' => 'Ok');
|
||||||
if (!empty($this->sccpvalues['SccpDBmodel'])) {
|
if (!empty($this->sccpvalues['SccpDBmodel'])) {
|
||||||
if ($compatible > $this->sccpvalues['SccpDBmodel']['data']) {
|
if ($compatible > $this->sccpvalues['SccpDBmodel']['data']) {
|
||||||
|
|
@ -95,6 +118,8 @@ if (empty($ast_realtime)) {
|
||||||
}
|
}
|
||||||
// There are potential issues with string Type Declarations in PHP 5.
|
// 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');
|
$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)) {
|
if (empty($conf_realtime)) {
|
||||||
$info['ConfigsRealTime'] = array('Version' => 'Error', 'about' => '<div class="alert signature alert-danger"> Realtime configuration was not found</div>');
|
$info['ConfigsRealTime'] = array('Version' => 'Error', 'about' => '<div class="alert signature alert-danger"> Realtime configuration was not found</div>');
|
||||||
|
|
@ -119,7 +144,7 @@ if ($mysql_info['Value'] <= '2000') {
|
||||||
|
|
||||||
// Check Time Zone compatibility
|
// Check Time Zone compatibility
|
||||||
$conf_tz = $this->sccpvalues['ntp_timezone']['data'];
|
$conf_tz = $this->sccpvalues['ntp_timezone']['data'];
|
||||||
$cisco_tz = $this->extconfigs->getextConfig('sccp_timezone', $conf_tz);
|
$cisco_tz = $this->extconfigs->getExtConfig('sccp_timezone', $conf_tz);
|
||||||
if ($cisco_tz['offset'] == 0) {
|
if ($cisco_tz['offset'] == 0) {
|
||||||
if (!empty($conf_tz)) {
|
if (!empty($conf_tz)) {
|
||||||
$tmp_dt = new DateTime(null, new DateTimeZone($conf_tz));
|
$tmp_dt = new DateTime(null, new DateTimeZone($conf_tz));
|
||||||
|
|
@ -180,7 +205,7 @@ if (!empty($this->class_error)) {
|
||||||
<div class="fpbx-container container-fluid">
|
<div class="fpbx-container container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h2>Sccp Manager V.<?php print_r($this->sccp_manager_ver); ?> Info </h2>
|
<h2>Sccp Manager v<?php print_r((string) $moduleXml->version); ?> Info </h2>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
|
||||||
|
|
@ -22,14 +22,14 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
$def_val_device = $this->getTableDefaults('sccpdevice');
|
||||||
|
|
||||||
echo $this->showGroup('sccp_general', 1);
|
echo $this->showGroup('sccp_general', 1);
|
||||||
echo $this->showGroup('sccp_dev_time_s', 1);
|
|
||||||
echo $this->showGroup('sccp_net', 1);
|
echo $this->showGroup('sccp_net', 1);
|
||||||
echo $this->showGroup('sccp_lang', 1);
|
echo $this->showGroup('sccp_lang', 1);
|
||||||
echo $this->showGroup('sccp_qos_config', 1);
|
|
||||||
echo $this->showGroup('sccp_extpath_config', 1);
|
echo $this->showGroup('sccp_extpath_config', 1);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
@ -39,21 +39,20 @@
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title" id="gridSystemModalLabel_Net">Add New Network</h4>
|
<h4 class="modal-title" id="gridSystemModalLabel_Net">Device</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<ul class="nav nav-tabs" role="tablist">
|
<ul class="nav nav-tabs" role="tablist">
|
||||||
<?php
|
<?php
|
||||||
// echo $this->showGroup('add_network_1',0);
|
// echo $this->showGroup('add_network_1',0);
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
<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>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,6 @@
|
||||||
<input type="hidden" name="category" value=" deviceurlform">
|
<input type="hidden" name="category" value=" deviceurlform">
|
||||||
<input type="hidden" name="Submit" value="Submit">
|
<input type="hidden" name="Submit" value="Submit">
|
||||||
<?php
|
<?php
|
||||||
echo $this->showGroup('sccp_dev_url', 1);
|
echo $this->showGroup('sccp_dev_url', 1,);
|
||||||
?>
|
?>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue