Compare commits

..

No commits in common. "develop" and "v14.3.0.29" have entirely different histories.

17 changed files with 613 additions and 1623 deletions

View file

@ -390,10 +390,21 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
// $lines_list = $this->dbinterface->getSccpDeviceTableData('SccpExtension');
$max_btn = (!empty($get_settings['buttonscount']) ? $get_settings['buttonscount'] : 60);
$last_btn = $max_btn;
for ($it = $max_btn; $it >= 0; $it--) {
if (!empty($get_settings['button' . $it . '_type'])) {
$last_btn = $it;
$btn_t = $get_settings['button' . $it . '_type'];
if ($btn_t != 'empty') {
break;
}
}
}
for ($it = 0; $it <= $last_btn; $it++) {
if (!empty($get_settings['button' . $it . '_type'])) {
$btn_t = $get_settings['button' . $it . '_type'];
for ($it = 0; $it < $max_btn; $it++) {
if (!empty($get_settings["button${it}_type"])) {
$btn_t = $get_settings["button${it}_type"];
$btn_n = '';
$btn_opt = '';
if ($it == 0) {
@ -401,9 +412,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
}
switch ($btn_t) {
case 'feature':
$btn_f = $get_settings["button${it}_feature"];
$btn_f = $get_settings['button' . $it . '_feature'];
// $btn_opt = (empty($get_settings['button' . $it . '_fvalue'])) ? '' : $get_settings['button' . $it . '_fvalue'];
$btn_n = (empty($get_settings["button${it}_flabel"])) ? $def_feature[$btn_f]['name'] : $get_settings["button${it}_flabel"];
$btn_n = (empty($get_settings['button' . $it . '_flabel'])) ? $def_feature[$btn_f]['name'] : $get_settings['button' . $it . '_flabel'];
$btn_opt = $btn_f;
if (!empty($def_feature[$btn_f]['value'])) {
if (empty($get_settings['button' . $it . '_fvalue'])) {
@ -421,46 +432,46 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
break;
case 'monitor':
$btn_t = 'speeddial';
$btn_opt = (string) $get_settings["button${it}_line"];
$btn_opt = (string) $get_settings['button' . $it . '_line'];
$db_res = $this->dbinterface->getSccpDeviceTableData('SccpExtension', array('name' => $btn_opt));
$btn_n = $db_res[0]['label'];
$btn_opt .= ',' . $btn_opt . $this->hint_context['default'];
break;
case 'speeddial':
if (!empty($get_settings["button${it}_input"])) {
$btn_n = $get_settings["button${it}_input"];
if (!empty($get_settings['button' . $it . '_input'])) {
$btn_n = $get_settings['button' . $it . '_input'];
}
if (!empty($get_settings["button${it}_phone"])) {
$btn_opt = $get_settings["button${it}_phone"];
if (!empty($get_settings['button' . $it . '_phone'])) {
$btn_opt = $get_settings['button' . $it . '_phone'];
if (empty($btn_n)) {
$btn_n = $btn_opt;
}
}
if (!empty($get_settings["button${it}_hint"])) {
if ($get_settings["button${it}_hint"] == "hint") {
if (!empty($get_settings['button' . $it . '_hint'])) {
if ($get_settings['button' . $it . '_hint'] == "hint") {
if (empty($btn_n)) {
$btn_t = 'line';
$btn_n = $get_settings["button${it}_hline"] . '!silent';
$btn_n = $get_settings['button' . $it . '_hline'] . '!silent';
$btn_opt = '';
} else {
// $btn_opt .= ',' . $get_settings['button' . $it . '_hline'] . $this->hint_context['default'];
$btn_opt .= ',' . $get_settings["button${it}_hline"];
$btn_opt .= ',' . $get_settings['button' . $it . '_hline'];
}
}
}
break;
case 'adv.line':
$btn_t = 'line';
$btn_n = (string) $get_settings["button${it}_line"];
$btn_n .= '@' . (string) $get_settings["button${it}_advline"];
$btn_opt = (string) $get_settings["button${it}_advopt"];
$btn_n = (string) $get_settings['button' . $it . '_line'];
$btn_n .= '@' . (string) $get_settings['button' . $it . '_advline'];
$btn_opt = (string) $get_settings['button' . $it . '_advopt'];
break;
case 'line':
case 'silent':
if (isset($get_settings["button${it}_line"])) {
$btn_n = (string) $get_settings["button${it}_line"];
if (isset($get_settings['button' . $it . '_line'])) {
$btn_n = (string) $get_settings['button' . $it . '_line'];
if ($it > 0) {
if ($btn_t == 'silent') {
$btn_n .= '!silent';
@ -609,7 +620,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$result = array();
if (!file_exists("{$this->sccppath['tftp_path']}/masterFilesStructure.xml")) {
if (!$this->getFileListFromProvisioner($this->sccpvalues['tftp_path']['data'])) {
if (!$this->getFileListFromProvisioner($this->sccppath['tftp_path'])) {
// File does not exist and cannot get from internet.
return $result;
};
@ -664,9 +675,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
*/
private function initializeTFtpLanguagePath() {
//$dir = $this->sccppath["tftp_lang_path"];
$dir = $this->sccppath["tftp_lang_path"];
foreach ($this->extconfigs->getExtConfig('sccp_lang') as $langKey => $langValueArr) {
$localeDir = $this->sccppath["tftp_lang_path"] . DIRECTORY_SEPARATOR . $langValueArr['locale'];
$localeDir = $dir . DIRECTORY_SEPARATOR . $langValueArr['locale'];
if (!is_dir($localeDir)) {
if (!mkdir($localeDir, 0755, true)) {
die("Error creating $localeDir directory");
@ -680,6 +691,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
*/
function initializeSccpPath() {
$this->sccppath = array(
'asterisk' => $this->sccpvalues['asterisk_etc_path']['data'],
'tftp_path' => $this->sccpvalues['tftp_path']['data'],
@ -692,8 +704,15 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
'tftp_countries_path' => $this->sccpvalues['tftp_countries_path']['data']
);
// initialise $sccp_conf_init
$this->sccp_conf_init = $this->initialiseConfInit();
$read_config = $this->cnf_read->getConfig('sccp.conf');
$this->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') {
$this->sccp_conf_init[$key] = $read_config[$key];
}
}
}
$hint = $this->aminterface->core_list_hints();
foreach ($hint as $key => $value) {

View file

@ -86,6 +86,11 @@ $(document).ready(function () {
url: 'ajax.php?module=sccp_manager&command=' + snd_command,
data: vdata,
success: function (data) {
// FreePbx handles first and returns its own values removing data sent
// so ajaxHandler echos data before return, and appends the ";#;" separator
// FreePbx own data is the second json after the separator
// without this this function fails as have 2 json fields.
data = JSON.parse(data.split(';#;')[0]);
if (data.status === true) {
if (data.table_reload === true) {
$('table').bootstrapTable('refresh');
@ -100,13 +105,8 @@ $(document).ready(function () {
// If posting warning, allow time to read
var toastDelay = (data.toastFlag == 'success') ? 500 : 1500;
if (data.reload === true) {
setTimeout(function(){
location.replace(newLocation);
if (data.search == `?display=sccpsettings`) {
location.reload();
}
},
toastDelay);
//Need setTimout or reload will kill Toast
setTimeout(function(){location.replace(newLocation);location.reload()},toastDelay);
}
}
} else {
@ -116,6 +116,10 @@ $(document).ready(function () {
});
});
$(".input-js-add").click(function () {
add_dynamic_input($(this), $(this).data('for'), "", "");
});
$(".table").on('click', '.table-js-add', function (e) {
add_dynamic_table($(this), $(this).data('for'), "", "");
});
@ -916,51 +920,32 @@ 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();
});
$(document).on('click', ".input-js-add" , function () {
// Add new row to networks or ip array
var pcls = $(this).data('for'),
pname = $(this).data('id'),
pmax = $(this).data('max'),
prow = $(this).data('row'),
pcount = $("." + pcls).length;
if (pcount == pmax){
//already reached max elements
return;
}
function add_dynamic_input(pe, pclass, vdefault)
{
// We'd like a new one, please.
pcls = pe.data('for');
pname = pe.data('id');
pmax = pe.data('max');
jdata = JSON.parse(hex2bin(pe.data('json')));
jdata = JSON.parse(hex2bin($(this).data('json')));
var last = $("." + pcls).last(),
ourid = last.data('nextid'),
nextid = ourid + 1,
html = "<div class = '" + pcls + "' id ='" + pname + nextid + "' form-group form-inline' data-nextid=" + nextid + ">";
var last = $("." + pcls + ":last"),
ourid = last.data('nextid'),
nextid = ourid + 1;
var html = "<div class = '" + pcls + " form-group form-inline' data-nextid=" + nextid + ">";
for (var key in jdata) {
html_opt = '';
html_calss = jdata[key]['class'];
for (var skey in jdata[key]['options']) {
html_opt += ' ' + skey + '="' + jdata[key]['options'][skey] + '"';
}
html += "<input type='text' name='" + pname + "[" + nextid + "][" + key + "]' class " + html_opt + "> " + jdata[key]['nameseparator'] + " ";
html += "<input type='text' name='" + pname + "[" + ourid + "][" + key + "]' class='" + html_calss + "' " + html_opt + " value='" + vdefault + "'> " + 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";
last.after(html);
$('#' + pname + prow + '-btn-add').remove();
});
if (pmax >= nextid) {
last.after(html);
}
}
function del_dynamic_table(pe, pclass, vdefault)
{

View file

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

View file

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

View file

@ -166,23 +166,6 @@ and open the template in the editor. Base Version before all crash :-)
<page_group name="sccp_net">
<label>SCCP Networks</label>
<item type="IED" id="2" seq="0">
<label>Deny Networks / Mask</label>
<name>deny</name>
<default>0.0.0.0/0.0.0.0</default>
<input value="NONE" field="net" nameseparator="/">
<options placeholder="0.0.0.0" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"/>
<class></class>
</input>
<input value="NONE" field="mask">
<options placeholder="255.255.255.0" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"/>
<class></class>
</input>
<add_pluss>+</add_pluss>
<max_row>5</max_row>
<addbutton-disabled>Add Deny network</addbutton-disabled>
<help>All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'.</help>
</item>
<item type="IED" id="1" seq="0">
<label>Allow Networks / Mask</label>
<name>permit</name>
@ -195,7 +178,6 @@ and open the template in the editor. Base Version before all crash :-)
<options placeholder="255.255.255.0" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"/>
</input>
<add_pluss>+</add_pluss>
<max_row>5</max_row>
<addbutton-disabled>Add Allow Range</addbutton-disabled>
<help>Allow network settings. Blank fields will be ignored used Network 0.0.0.0/0.0.0.0 to resolve any existing connections. You can use the 'internal' connections only from the networks connected to the server. </help>
</item>
@ -213,13 +195,30 @@ and open the template in the editor. Base Version before all crash :-)
<class></class>
</input>
<add_pluss>+</add_pluss>
<max_row>5</max_row>
<addbutton-disabled>Add Internal Range</addbutton-disabled>
<help>Local network settings. Blank fields will be ignored used Network 0.0.0.0.</help>
</item>
<item type="IED" id="2" seq="0">
<label>Deny Networks / Mask</label>
<name>deny</name>
<default>0.0.0.0/0.0.0.0</default>
<input value="NONE" field="net" nameseparator="/">
<options placeholder="0.0.0.0" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"/>
<class></class>
</input>
<input value="NONE" field="mask">
<options placeholder="255.255.255.0" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"/>
<class></class>
</input>
<add_pluss>+</add_pluss>
<addbutton-disabled>Add Deny network</addbutton-disabled>
<help>All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'.</help>
</item>
<item type="IED" id="1" seq="98">
<label>Device Connect Address / Name </label>
<name>ccm_address</name>
<cbutton field="internal" value="internal">Internal</cbutton>
<default>0.0.0.0:2000</default>
<input value="NONE" field="ip" nameseparator=":">
<options placeholder="0.0.0.0 / pbx.org"/>
<class></class>
@ -229,7 +228,6 @@ and open the template in the editor. Base Version before all crash :-)
<class></class>
</input>
<add_pluss>+</add_pluss>
<max_row>5</max_row>
<addbutton-disabled>Add Address</addbutton-disabled>
<help>This function is useful when the server has many interfaces, but devices must connect only to some interfaces.</help>
</item>
@ -504,7 +502,7 @@ and open the template in the editor. Base Version before all crash :-)
<page_group name="sccp_dev_time">
<label>SCCP Time Service config</label>
<item type="SLD" id="1" seq="0">
<item type="SLD" id="1" seq="1">
<label>Display Day Format</label>
<name>dateformat</name>
<select>
@ -714,7 +712,7 @@ and open the template in the editor. Base Version before all crash :-)
<name>srst_ip</name>
<max_row>3</max_row>
<default>/</default>
<input value="NONE" field="ip" nameseparator=":">
<input value="NONE" field="Addr" nameseparator=":">
<options placeholder="0.0.0.0" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$" />
<class></class>
</input>
@ -952,7 +950,7 @@ and open the template in the editor. Base Version before all crash :-)
</row>
</element>
<element type='p'> </element>
<element type='h3'>Be careful with this function. It is recommended to restrict to internal network use; set the deny/permit to 'internal' by default. This is insecure and should be switched off before going into production. A PLAR phone is still able to ring any other extension by entering the number on the phone before going off-hook. So either setup a secure context for these types of phones or switch off hotline.</element>
<element type='h3'>Be careful with this function. Especially not to the internet. So i would restring the deny/permit to 'internal' by default in that case.</element>
<element type='table'>
<row>
<col>Allow =</col>
@ -980,7 +978,7 @@ and open the template in the editor. Base Version before all crash :-)
<item type="IS" id="1">
<name>hotline_enabled</name>
<label>Hotline</label>
<default>"no"</default>
<default>off</default>
<button value="no">No</button>
<button value="yes">Yes</button>
<help>Hotline Enabled: This allows unregistered extensions to connect to the system and dial the number listed below.</help>
@ -1685,7 +1683,6 @@ and open the template in the editor. Base Version before all crash :-)
<options placeholder="255.255.255.0" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"/>
</input>
<add_pluss>+</add_pluss>
<max_row>5</max_row>
<addbutton-disabled>Add Deny network</addbutton-disabled>
<help>All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'.</help>
</item>
@ -1693,7 +1690,11 @@ and open the template in the editor. Base Version before all crash :-)
<label>Allow Networks / Mask</label>
<name>permit</name>
<default>NONE</default>
<cbutton field="inherit" value="NONE">Inherit
<option_disabled class=".sccp_hw_net_inherit">false</option_disabled>
</cbutton>
<cbutton field="internal" value="internal"><class>sccp_hw-ar_permit-gr</class>internal</cbutton>
<class>sccp_hw_net_inherit</class>
<input value="NONE" field="net" nameseparator="/">
<options placeholder="0.0.0.0" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"/>
@ -1702,7 +1703,6 @@ and open the template in the editor. Base Version before all crash :-)
<options placeholder="255.255.255.0" pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"/>
</input>
<add_pluss>+</add_pluss>
<max_row>5</max_row>
<addbutton-disables>Add Allow network</addbutton-disables>
<help>Allow network settings. Blank fields will be ignored used Network 0.0.0.0.</help>
</item>
@ -2022,7 +2022,6 @@ and open the template in the editor. Base Version before all crash :-)
<class>col-md-9</class>
</input>
<add_pluss>+</add_pluss>
<max_row>3</max_row>
<help></help>
</item>
</page_group>

View file

@ -181,8 +181,8 @@ ri ^\/((.+\-cnf.xml)(\.enc)?(\.sgn)?)$ settings/\1
ri ^\/((SPA504G-cfg.xml)(\.enc)?(\.sgn)?)$ settings/\1
# Keep firmware in a separate directory (optional)
#ri ^(.+\.loads)$ firmware/\1
#ri ^(.+\.sbn)$ firmware/\1
ri ^(.+\.loads)$ firmware/\1
ri ^(.+\.sbn)$ firmware/\1
ri ^(.+)\/(.+-sccp.jar)$ locales/languages/\1/\2
@ -206,9 +206,6 @@ ri ^(.+)(\.raw|\.rwb|\.pcm)(\.sgn)?$ ringtones/\1\2\3
#ri ^Desktops/(.+)/(List\.xml)(\.sgn)?$ wallpapers/\1/\2\3
#ri ^Desktops/(.+)/(.+\.png)(\.sgn)?$ wallpapers/\1/\2\3
# Dialplan
ri ^(dialplan.xml)$ dialplan/\1
ri ^authorized_keys$ settings/authorized_keys
#

View file

@ -10,6 +10,7 @@ global $version;
global $aminterface;
global $extconfigs;
global $mobile_hw;
global $useAmiForSoftKeys;
global $settingsFromDb;
global $thisInstaller;
global $cnf_int;
@ -20,6 +21,7 @@ $mobile_hw = '0';
$autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT" : "AUTO_INCREMENT";
$table_req = array('sccpdevice', 'sccpline', 'sccpsettings');
$sccp_compatible = 0;
$chanSCCPWarning = true;
$db_config = '';
$sccp_version = array();
$cnf_int = \FreePBX::Config();
@ -43,14 +45,16 @@ foreach ($requiredClasses as $className) {
}
CheckAsteriskVersion();
$sccp_compatible = $aminterface->getSCCPVersion()['vCode'];
$sccp_version = CheckChanSCCPCompatible();
$sccp_compatible = $sccp_version[0];
$chanSCCPWarning = $sccp_version[1] ^= 1;
outn("<li>" . _("Sccp model Compatible code : ") . $sccp_compatible . "</li>");
if ($sccp_compatible == 0) {
outn("<br>");
outn("<font color='red'>chan-sccp not found. Install it before continuing !</font>");
outn("<font color='red'>Chan Sccp not Found. Install it before continuing !</font>");
die();
}
// BackUp Old config
createBackUpConfig();
RenameConfig();
@ -64,7 +68,10 @@ InstallDB_createButtonConfigTrigger();
InstallDbCreateViews($sccp_compatible);
installDbPopulateSccpline();
InstallDB_updateDBVer($sccp_compatible);
if ($chanSCCPWarning) {
outn("<br>");
outn("<font color='red'>Error: installed version of chan-sccp is not compatible. Please upgrade chan-sccp</font>");
}
Setup_RealTime();
addDriver($sccp_compatible);
checkTftpServer();
@ -182,7 +189,7 @@ function Get_DB_config($sccp_compatible)
'modify' => "enum('sccpdevice', 'sipdevice', 'sccpuser')" ),
)
);
// Hardware Mobile. Can switch Software to Hardware
// Hardware Mobile. Can switch Softwate to Hardware
$db_config_v4M = array(
'sccpdevmodel' => array(
'loadinformationid' => array('create' => "VARCHAR(30) NULL DEFAULT NULL")
@ -289,7 +296,7 @@ function Get_DB_config($sccp_compatible)
'_description' => array('rename' => 'description'),
'keepalive' => array('create' => "INT(11) DEFAULT '60'", 'modify' => 'INT(11)', 'def_modify' => "60")
),
'sccpline' => array(
'sccpline' => array (
'regcontext' => array('create' => "VARCHAR(20) NULL default 'sccpregistration'", 'modify' => "VARCHAR(20)"),
'transfer_on_hangup' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
'autoselectline_enabled' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
@ -303,13 +310,9 @@ function Get_DB_config($sccp_compatible)
'_backgroundImageAccess' => array('rename' => 'backgroundImageAccess'),
'_callLogBlfEnabled' => array('rename' => 'callLogBlfEnabled')
),
'sccpsettings' => array(
'sccpsettings' => array (
'systemdefault' => array('create' => "VARCHAR(255) NULL default ''")
),
'sccpdevmodel' => array(
'fwfound' => array('create' => "enum('yes','no') NOT NULL default 'no'", 'modify' => "enum('yes','no')"),
'templatefound' => array('create' => "enum('yes','no') NOT NULL default 'no'", 'modify' => "enum('yes','no')")
)
)
);
if ($sccp_compatible >= 433) {
@ -322,7 +325,6 @@ function Get_DB_config($sccp_compatible)
$db_config_v4['sccpdevice'] = array_merge($db_config_v4['sccpdevice'],$db_config_v5['sccpdevice']);
$db_config_v4['sccpline'] = array_merge($db_config_v4['sccpline'],$db_config_v5['sccpline']);
$db_config_v4['sccpsettings'] = $db_config_v5['sccpsettings'];
$db_config_v4['sccpdevmodel'] = $db_config_v5['sccpdevmodel'];
}
return $db_config_v4;
}
@ -367,78 +369,20 @@ function CheckAsteriskVersion()
function CheckChanSCCPCompatible()
{
global $chanSCCPWarning;
global $aminterface;
return $aminterface->getSCCPVersion['vCode'];
// calling with true returns array with compatibility and RevisionNumber
return $aminterface->get_compatible_sccp(true);
}
function InstallDB_updateSchema($db_config)
{
/*
Initially, referred to schema existing and created db from scratch. This required
initialising sccp_manager object which in term required that sccpsettings existed
To overcome this, moved to creation/modification of db via module.xml.
In early version of 14.3, only used initial fields present in older versions, and then
added new required fields. This resulted in new fields being dropped at next install.
Now include all fields in module.xml, and then transfer any data in old fields to new fields
before then deleting old fields, rather than renaming columns which will no longer work as
the new column already exists, and may contain data. This affected 36 fields in sccpdevice
and 5 fields in sccpline which in old db schema used _ prefix to hide from chan-sccp.
*/
global $db;
if (!$db_config) {
die_freepbx("No db_config provided");
}
outn("<li>" . _("Saving legacy data into current column") . "</li>");
$priorSchemaFields = array(
'sccpdevice' => array(
'_description', '_loginname', '_profileid', '_dialrules', '_devlang', '_netlang', '_logserver',
'_daysdisplaynotactive', '_displayontime', '_displayonduration', '_displayidletimeout', '_settingsaccess', '_videocapability',
'_webaccess', '_webadmin', '_pcport', '_spantopcport', '_voicevlanaccess', '_enablecdpswport', '_enablecdppcport',
'_enablelldpswport', '_enablelldppcport', '_firstdigittimeout', '_digittimeout', '_cfwdnoanswer_timeout',
'_autoanswer_ring_time', '_autoanswer_tone', '_remotehangup_tone', '_transfer_tone', '_callwaiting_tone',
'_callanswerorder', '_sccp_tos', '_sccp_cos', '_dev_sshPassword', '_dev_sshUserId', '_phonepersonalization'),
'sccpline' => array(
'_regcontext', '_transfer_on_hangup', '_autoselectline_enabled', '_autocall_select', '_backgroundImageAccess', '_callLogBlfEnabled')
);
foreach ($priorSchemaFields as $table => $fieldsArr) {
// First get any data in columns to be deleted ( _Column)
$sqlMatch = array_reduce($fieldsArr, function($carry, $column) {
return "${carry} ${column} IS NOT NULL OR";
});
unset($column);
$sqlFields = array_reduce($fieldsArr, function($carry, $column) {
return "${carry} ${column} AS " . ltrim($column,"_") .",";
});
$sqlMatch = rtrim($sqlMatch, "OR");
$sqlFields = rtrim($sqlFields, ",");
$stmt = $db->prepare("SELECT name, ${sqlFields} FROM ${table} WHERE ${sqlMatch}");
$stmt->execute();
$dbResult = $stmt->fetchAll(\PDO::FETCH_ASSOC|\PDO::FETCH_UNIQUE);
// Now move any data found from _Column to Column. This is safe as the two should not exist.
if (!empty($dbResult)) {
foreach ($dbResult as $name => $columnArr) {
$sqlVar = array_reduce(array_keys($columnArr), function($carry, $key) use ($columnArr){
$carry .= (isset($columnArr[$key])) ? "${key} = '${columnArr[$key]}'," : "";
return $carry;
});
$sqlVar = rtrim($sqlVar, ",");
$stmt = $db->prepare("UPDATE ${table} SET ${sqlVar} WHERE name = '${name}'");
$stmt->execute();
}
}
// Processed all _Column names; now safe to delete them
$sqlDrop = array_reduce($fieldsArr, function($carry, $column) {
return "${carry} DROP COLUMN ${column},";
});
$sqlDrop = rtrim($sqlDrop, ", ");
$stmt = $db->prepare("ALTER TABLE ${table} ${sqlDrop}");
$stmt->execute();
}
// Now process the column updates as per the legacy installer
$count_modify = 0;
outn("<li>" . _("Modifying Database schema") . "</li>");
outn("<li>" . _("Modify Database schema") . "</li>");
foreach ($db_config as $tabl_name => $tab_modif) {
$sql_create = '';
$sql_modify = '';
@ -455,9 +399,7 @@ function InstallDB_updateSchema($db_config)
foreach ($db_result as $fld_id => $tabl_data) {
if (!empty($tab_modif[$fld_id])) {
// have column in table so potentially something to update
// if dropping column, prepare sql and continue. The drop case will never
// occur as columns that are dropped should no longer be in the module.xml schema
// and so Doctrine will have already dropped them.
// if dropping column, prepare sql and continue
if (!empty($tab_modif[$fld_id]['drop'])) {
$sql_create .= "DROP COLUMN {$row_fld}, ";
unset($tab_modif[$fld_id]['drop']);
@ -496,33 +438,25 @@ function InstallDB_updateSchema($db_config)
$count_modify ++;
}
}
// Now handle rename. Need to be carefull that the newname does not exist. If it does then need to
// ignore or unexpected things may happen.
if (!empty($tab_modif[$fld_id]['rename'])) {
// Field currently exists so need to rename (and keep data). All of legacy _columns have already
// been dropped so will not get here as $fld_id cannot be _column.
// Field currently exists so need to rename (and keep data)
// for backward compatibility use CHANGE - REPLACE is only available in MariaDb > 10.5.
$fld_id_newName = $tab_modif[$fld_id]['rename'];
// Only execute if the newname column does not already exist.
if (empty($db_result[$fld_id_newName])) {
// Trying to rename to an existing column. Ignore this case.
// Does a create exist for newName
if (!empty($tab_modif[$fld_id_newName]['create'])) {
//carry the attributes from the new create to the rename
$sql_rename .= "CHANGE COLUMN {$fld_id} {$fld_id_newName} {$tab_modif[$fld_id_newName]['create']}, ";
// do not create newName as modifying existing
unset($tab_modif[$fld_id_newName]['create']);
} else {
// add current attributes to the new name.
$existingAttrs = strtoupper($tabl_data['Type']).(($tabl_data['Null'] == 'NO') ?' NOT NULL': ' NULL') .
((empty($tabl_data['Default']))?'': ' DEFAULT ' . "'" . $tabl_data['Default']."'");
$sql_rename .= "CHANGE COLUMN {$fld_id} {$fld_id_newName} {$existingAttrs}, ";
}
$count_modify ++;
// Does a create exist for newName
if (!empty($tab_modif[$fld_id_newName]['create'])) {
//carry the attributes from the new create to the rename
$sql_rename .= "CHANGE COLUMN {$fld_id} {$fld_id_newName} {$tab_modif[$fld_id_newName]['create']}, ";
// do not create newName as modifying existing
unset($tab_modif[$fld_id_newName]['create']);
} else {
// add current attributes to the new name.
$existingAttrs = strtoupper($tabl_data['Type']).(($tabl_data['Null'] == 'NO') ?' NOT NULL': ' NULL') .
((empty($tabl_data['Default']))?'': ' DEFAULT ' . "'" . $tabl_data['Default']."'");
$sql_rename .= "CHANGE COLUMN {$fld_id} {$fld_id_newName} {$existingAttrs}, ";
}
// Have treated this rename so unset. If the newname already exists, have done nothing.
unset($tab_modif[$fld_id]['rename']);
$count_modify ++;
}
// is there a create for this field
if (!empty($tab_modif[$fld_id]['create'])) {
@ -568,153 +502,152 @@ function InstallDB_updateSchema($db_config)
}
}
outn("<li>" . _("Total modify count :") . $count_modify . "</li>");
// Now see if sccpdevmodel is populated.
$devModelArr = array( "('12 SP', 'CISCO', 1, 1, '', 'loadInformation3', 0, NULL)",
"('12 SP+', 'CISCO', 1, 1, '', 'loadInformation2', 0, NULL)",
"('30 SP+', 'CISCO', 1, 1, '', 'loadInformation1', 0, NULL)",
"('30 VIP', 'CISCO', 1, 1, '', 'loadInformation5', 0, NULL)",
"('3911', 'CISCO', 1, 1, '', 'loadInformation446', 0, NULL)",
"('3951', 'CISCO', 1, 1, '', 'loadInformation412', 0, '')",
"('6901', 'CISCO', 1, 1, 'SCCP6901.9-2-1-a', 'loadInformation547', 0, NULL)",
"('6911', 'CISCO', 1, 1, 'SCCP6911.9-2-1-a', 'loadInformation548', 0, NULL)",
"('6921', 'CISCO', 1, 1, 'SCCP69xx.9-4-1-3SR3', 'loadInformation496', 0, NULL)",
"('6941', 'CISCO', 1, 1, 'SCCP69xx.9-3-1-3', 'loadInformation495', 0, NULL)",
"('6945', 'CISCO', 1, 1, 'SCCP6945.9-3-1-3', 'loadInformation564', 0, NULL)",
"('6961', 'CISCO', 1, 1, 'SCCP69xx.9-2-1-0', 'loadInformation497', 0, NULL)",
"('7902', 'CISCO', 1, 1, 'CP7902080002SCCP060817A', 'loadInformation30008', 0, NULL)",
"('7905', 'CISCO', 1, 1, 'CP7905080003SCCP070409A', 'loadInformation20000', 0, NULL)",
"('7906', 'CISCO', 1, 1, 'SCCP11.9-4-2SR3-1S', 'loadInformation369', 1, 'SEP0000000000.cnf.xml_791x_template')",
"('7910', 'CISCO', 1, 1, 'P00405000700', 'loadInformation6', 1, 'SEP0000000000.cnf.xml_791x_template')",
"('7911', 'CISCO', 1, 1, 'SCCP11.9-4-2SR3-1S', 'loadInformation307', 1, 'SEP0000000000.cnf.xml_791x_template')",
"('7912', 'CISCO', 1, 1, 'CP7912080004SCCP080108A', 'loadInformation30007', 0, NULL)",
"('7914', 'CISCO', 0, 14, 'S00105000400', 'loadInformation124', 1, NULL)",
"('7914;7914', 'CISCO', 0, 28, 'S00105000400', 'loadInformation124', 1, NULL)",
"('7915', 'CISCO', 0, 24, 'B015-1-0-4-2', 'loadInformation227', 1, NULL)",
"('7915;7915', 'CISCO', 0, 48, 'B015-1-0-4-2', 'loadInformation228', 1, NULL)",
"('7916', 'CISCO', 0, 24, 'B016-1-0-4-2', 'loadInformation229', 1, NULL)",
"('7916;7916', 'CISCO', 0, 48, 'B016-1-0-4-2', 'loadInformation230', 1, NULL)",
"('7920', 'CISCO', 1, 1, 'cmterm_7920.4.0-03-02', 'loadInformation30002', 0, NULL)",
"('7921', 'CISCO', 1, 1, 'CP7921G-1.4.6.3', 'loadInformation365', 0, NULL)",
"('7925', 'CISCO', 1, 6, 'CP7925G-1.4.1SR1', 'loadInformation484', 0, 'SEP0000000000.cnf.xml_7925_template')",
"('7926', 'CISCO', 1, 1, 'CP7926G-1.4.5.3', 'loadInformation577', 0, '')",
"('7931', 'CISCO', 1, 34, 'SCCP31.9-2-1S', 'loadInformation348', 0, NULL)",
"('7935', 'CISCO', 1, 2, 'P00503021900', 'loadInformation9', 0, NULL)",
"('7936', 'CISCO', 1, 1, 'cmterm_7936.3-3-21-0', 'loadInformation30019', 0, NULL)",
"('7937', 'CISCO', 1, 1, 'apps37sccp.1-4-5-7', 'loadInformation431', 0, 'SEP0000000000.cnf.xml_7937_template')",
"('7940', 'CISCO', 1, 2, 'P0030801SR02', 'loadInformation8', 1, 'SEP0000000000.cnf.xml_7940_template')",
"('7941', 'CISCO', 1, 2, 'SCCP41.9-4-2SR3-1S', 'loadInformation115', 0, 'SEP0000000000.cnf.xml_796x_template')",
"('7941G-GE', 'CISCO', 1, 2, 'SCCP41.9-4-2SR3-1S', 'loadInformation309', 0, 'SEP0000000000.cnf.xml_796x_template')",
"('7942', 'CISCO', 1, 2, 'SCCP42.9-4-2SR3-1S', 'loadInformation434', 0, 'SEP0000000000.cnf.xml_796x_template')",
"('7945', 'CISCO', 1, 2, 'SCCP45.9-3-1SR1-1S', 'loadInformation435', 0, 'SEP0000000000.cnf.xml_796x_template')",
"('7960', 'CISCO', 3, 6, 'P0030801SR02', 'loadInformation7', 1, 'SEP0000000000.cnf.xml_7940_template')",
"('7961', 'CISCO', 3, 6, 'SCCP41.9-4-2SR3-1S', 'loadInformation30018', 0, 'SEP0000000000.cnf.xml_796x_template')",
"('7961G-GE', 'CISCO', 3, 6, 'SCCP41.9-4-2SR3-1S', 'loadInformation308', 0, 'SEP0000000000.cnf.xml_796x_template')",
"('7962', 'CISCO', 3, 6, 'SCCP42.9-4-2SR3-1S', 'loadInformation404', 0, 'SEP0000000000.cnf.xml_796x_template')",
"('7965', 'CISCO', 3, 6, 'SCCP45.9-3-1SR1-1S', 'loadInformation436', 0, 'SEP0000000000.cnf.xml_796x_template')",
"('7821', 'CISCO', 1, 1, '', 'loadInformation621', 0, '')",
"('7841', 'CISCO', 1, 1, '', 'loadInformation622', 0, '')",
"('7861', 'CISCO', 1, 1, '', 'loadInformation623', 0, '')",
"('7970', 'CISCO', 3, 8, 'SCCP70.9-4-2SR3-1S', 'loadInformation30006', 0, 'SEP0000000000.cnf.xml_797x_template')",
"('7971', 'CISCO', 1, 2, 'SCCP70.9-4-2SR3-1S', 'loadInformation119', 0, 'SEP0000000000.cnf.xml_797x_template')",
"('7975', 'CISCO', 3, 8, 'SCCP75.9-4-2SR3-1S', 'loadInformation437', 0, 'SEP0000000000.cnf.xml_7975_template')",
"('7985', 'CISCO', 3, 8, 'cmterm_7985.4-1-7-0', 'loadInformation302', 0, NULL)",
"('8831', 'CISCO', 1, 1, '', 'loadInformation659', 0, '')",
"('8841', 'CISCO', 1, 1, '', 'loadInformation683', 0, '')",
"('8851', 'CISCO', 1, 1, '', 'loadInformation684', 0, '')",
"('8861', 'CISCO', 1, 1, '', 'loadInformation685', 0, '')",
"('8941', 'CISCO', 1, 4, 'SCCP894x.9-4-2SR1-2', 'loadInformation586', 0, 'SEP0000000000.cnf.xml_797x_template')",
"('8945', 'CISCO', 1, 4, 'SCCP894x.9-4-2SR1-2', 'loadInformation585', 0, 'SEP0000000000.cnf.xml_7975_template')",
"('ATA 186', 'CISCO', 1, 1, 'ATA030204SCCP090202A', 'loadInformation12', 0, 'SEP0000000000.cnf.xml_ATA_template')",
"('ATA 187', 'CISCO', 1, 1, 'ATA187.9-2-3-1', 'loadInformation550', 0, 'SEP0000000000.cnf.xml_ATA_template')",
"('CN622', 'MOTOROLA', 1, 1, '', 'loadInformation335', 0, NULL)",
"('Digital Access', 'CISCO', 1, 1, 'D001M022', 'loadInformation40', 0, NULL)",
"('Digital Access+', 'CISCO', 1, 1, 'D00303010033', 'loadInformation42', 0, NULL)",
"('E-Series', 'NOKIA', 1, 1, '', '', 0, NULL)",
"('ICC', 'NOKIA', 1, 1, '', '', 0, NULL)",
"('Analog Access', 'CISCO', 1, 1, 'A001C030', 'loadInformation30', 0, '')",
"('WS-X6624', 'CISCO', 1, 1, 'A00204000013', 'loadInformation43', 0, '')",
"('WS-X6608', 'CISCO', 1, 1, 'C00104000003', 'loadInformation51', 0, '')",
"('H.323 Phone', 'CISCO', 1, 1, '', 'loadInformation61', 0, '')",
"('Simulator', 'CISCO', 1, 1, '', 'loadInformation100', 0, '')",
"('MTP', 'CISCO', 1, 1, '', 'loadInformation111', 0, '')",
"('MGCP Station', 'CISCO', 1, 1, '', 'loadInformation120', 0, '')",
"('MGCP Trunk', 'CISCO', 1, 1, '', 'loadInformation121', 0, '')",
"('UPC', 'CISCO', 1, 1, '', 'loadInformation358', 0, '')",
"('TelePresence', 'TELEPRESENCE', 1, 1, '', 'loadInformation375', 0, '')",
"('1000', 'TELEPRESENCE', 1, 1, '', 'loadInformation478', 0, '')",
"('3000', 'TELEPRESENCE', 1, 1, '', 'loadInformation479', 0, '')",
"('3200', 'TELEPRESENCE', 1, 1, '', 'loadInformation480', 0, '')",
"('500-37', 'TELEPRESENCE', 1, 1, '', 'loadInformation481', 0, '')",
"('1300-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation505', 0, '')",
"('1100', 'TELEPRESENCE', 1, 1, '', 'loadInformation520', 0, '')",
"('200', 'TELEPRESENCE', 1, 1, '', 'loadInformation557', 0, '')",
"('400', 'TELEPRESENCE', 1, 1, '', 'loadInformation558', 0, '')",
"('EX90', 'TELEPRESENCE', 1, 1, '', 'loadInformation584', 0, '')",
"('500-32', 'TELEPRESENCE', 1, 1, '', 'loadInformation590', 0, '')",
"('1300-47', 'TELEPRESENCE', 1, 1, '', 'loadInformation591', 0, '')",
"('TX1310-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation596', 0, '')",
"('EX60', 'TELEPRESENCE', 1, 1, '', 'loadInformation604', 0, '')",
"('C90', 'TELEPRESENCE', 1, 1, '', 'loadInformation606', 0, '')",
"('C60', 'TELEPRESENCE', 1, 1, '', 'loadInformation607', 0, '')",
"('C40', 'TELEPRESENCE', 1, 1, '', 'loadInformation608', 0, '')",
"('C20', 'TELEPRESENCE', 1, 1, '', 'loadInformation609', 0, '')",
"('C20-42', 'TELEPRESENCE', 1, 1, '', 'loadInformation610', 0, '')",
"('C60-42', 'TELEPRESENCE', 1, 1, '', 'loadInformation611', 0, '')",
"('C40-52', 'TELEPRESENCE', 1, 1, '', 'loadInformation612', 0, '')",
"('C60-52', 'TELEPRESENCE', 1, 1, '', 'loadInformation613', 0, '')",
"('C60-52D', 'TELEPRESENCE', 1, 1, '', 'loadInformation614', 0, '')",
"('C60-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation615', 0, '')",
"('C90-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation616', 0, '')",
"('MX200', 'TELEPRESENCE', 1, 1, '', 'loadInformation617', 0, '')",
"('TX9000', 'TELEPRESENCE', 1, 1, '', 'loadInformation619', 0, '')",
"('TX9200', 'TELEPRESENCE', 1, 1, '', 'loadInformation620', 0, '')",
"('SX20', 'TELEPRESENCE', 1, 1, '', 'loadInformation626', 0, '')",
"('MX300', 'TELEPRESENCE', 1, 1, '', 'loadInformation627', 0, '')",
"('C40-42', 'TELEPRESENCE', 1, 1, '', 'loadInformation633', 0, '')",
"('Jabber', 'CISCO', 1, 1, '', 'loadInformation652', 0, '')",
"('S60', 'NOKIA', 0, 1, '', 'loadInformation376', 0, '')",
"('9971', 'CISCO', 1, 1, '', 'loadInformation493', 0, '')",
"('9951', 'CISCO', 1, 1, '', 'loadInformation537', 0, '')",
"('8961', 'CISCO', 1, 1, '', 'loadInformation540', 0, '')",
"('Iphone', 'APPLE', 0, 1, '', 'loadInformation562', 0, '')",
"('Android', 'ANDROID', 0, 1, '', 'loadInformation575', 0, '')",
"('VXC 6215', 'CISCO', 1, 1, '', 'loadInformation634', 0, '')",
"('Analog', 'CISCO', 1, 1, '', 'loadInformation30027', 0, '')",
"('ISDN', 'CISCO', 1, 1, '', 'loadInformation30028', 0, '')",
"('SCCP GW', 'CISCO', 1, 1, '', 'loadInformation30032', 0, '')",
"('IP-STE', 'CISCO', 1, 1, '', 'loadInformation30035', 0, '')",
"('SPA 521S', 'CISCO', 1, 1, '', 'loadInformation80000', 0, '')",
"('SPA 502G', 'CISCO', 1, 1, '', 'loadInformation80003', 0, '')",
"('SPA 504G', 'CISCO', 1, 1, '', 'loadInformation80004', 0, '')",
"('SPA 525G', 'CISCO', 1, 1, '', 'loadInformation80005', 0, '')",
"('SPA 525G2', 'CISCO', 1, 1, '', 'loadInformation80009', 0, '')",
"('SPA 303G', 'CISCO', 1, 1, '', 'loadInformation80011', 0, '')",
"('IP Communicator', 'CISCO', 1, 1, '', 'loadInformation30016', 0, NULL)",
"('Nokia E', 'Nokia', 1, 28, '', 'loadInformation275', 0, NULL)",
"('VGC Phone', 'CISCO', 1, 1, '', 'loadInformation10', 0, NULL)",
"('7911-sip', 'CISCO-SIP', 1, 1, 'SIP11.9-2-1S', 'loadInformation307', 1, 'SEP0000000000.cnf.xml_791x_sip_template')",
"('9951-sip', 'CISCO-SIP', 1, 5, 'sip9951.9-2-2SR1-9', 'loadinformation537', 1, 'SEP0000000000.cnf.xml_99xx_sip_template')",
"('VGC Virtual', 'CISCO', 1, 1, '', 'loadInformation11', 0, NULL)"
);
$test = $db->prepare("SELECT count(*) AS modelCount from sccpdevmodel");
$test->execute();
if ($test->fetchAll()[0]['modelCount'] == count($devModelArr)) {
// Appear to have a correctly populated sccpdevmodel table. Do not overwrite
// as may contain user modifications;
outn("<li>" . _("sccpdevmodel appears to be populated; not overwriting") . "</li>");
/*
$stmt = $db->prepare('SELECT CASE WHEN EXISTS(SELECT 1 FROM sccpdevmodel) THEN 0 ELSE 1 END AS IsEmpty;');
$stmt->execute();
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
if (!$result[0]['IsEmpty']) {
return;
};
// Update sccpdevmodel as counts do not match
} else {
*/
// Force update of sccp devmodel to ensure changes are taken into account
outn("Updating sccpdevmodel...");
outn("<li>" . _("Fill sccpdevmodel") . "</li>");
$sql = "REPLACE INTO sccpdevmodel (model, vendor, dns, buttons, loadimage, loadinformationid, enabled, nametemplate) VALUES" . implode(',',$devModelArr);
$sql = "REPLACE INTO sccpdevmodel (model, vendor, dns, buttons, loadimage, loadinformationid, enabled, nametemplate) VALUES
('12 SP', 'CISCO', 1, 1, '', 'loadInformation3', 0, NULL),
('12 SP+', 'CISCO', 1, 1, '', 'loadInformation2', 0, NULL),
('30 SP+', 'CISCO', 1, 1, '', 'loadInformation1', 0, NULL),
('30 VIP', 'CISCO', 1, 1, '', 'loadInformation5', 0, NULL),
('3911', 'CISCO', 1, 1, '', 'loadInformation446', 0, NULL),
('3951', 'CISCO', 1, 1, '', 'loadInformation412', 0, ''),
('6901', 'CISCO', 1, 1, 'SCCP6901.9-2-1-a', 'loadInformation547', 0, NULL),
('6911', 'CISCO', 1, 1, 'SCCP6911.9-2-1-a', 'loadInformation548', 0, NULL),
('6921', 'CISCO', 1, 1, 'SCCP69xx.9-4-1-3SR3', 'loadInformation496', 0, NULL),
('6941', 'CISCO', 1, 1, 'SCCP69xx.9-3-1-3', 'loadInformation495', 0, NULL),
('6945', 'CISCO', 1, 1, 'SCCP6945.9-3-1-3', 'loadInformation564', 0, NULL),
('6961', 'CISCO', 1, 1, 'SCCP69xx.9-2-1-0', 'loadInformation497', 0, NULL),
('7902', 'CISCO', 1, 1, 'CP7902080002SCCP060817A', 'loadInformation30008', 0, NULL),
('7905', 'CISCO', 1, 1, 'CP7905080003SCCP070409A', 'loadInformation20000', 0, NULL),
('7906', 'CISCO', 1, 1, 'SCCP11.9-4-2SR3-1S', 'loadInformation369', 1, 'SEP0000000000.cnf.xml_791x_template'),
('7910', 'CISCO', 1, 1, 'P00405000700', 'loadInformation6', 1, 'SEP0000000000.cnf.xml_791x_template'),
('7911', 'CISCO', 1, 1, 'SCCP11.9-4-2SR3-1S', 'loadInformation307', 1, 'SEP0000000000.cnf.xml_791x_template'),
('7912', 'CISCO', 1, 1, 'CP7912080004SCCP080108A', 'loadInformation30007', 0, NULL),
('7914', 'CISCO', 0, 14, 'S00105000400', 'loadInformation124', 1, NULL),
('7914;7914', 'CISCO', 0, 28, 'S00105000400', 'loadInformation124', 1, NULL),
('7915', 'CISCO', 0, 24, 'B015-1-0-4-2', 'loadInformation227', 1, NULL),
('7915;7915', 'CISCO', 0, 48, 'B015-1-0-4-2', 'loadInformation228', 1, NULL),
('7916', 'CISCO', 0, 24, 'B016-1-0-4-2', 'loadInformation229', 1, NULL),
('7916;7916', 'CISCO', 0, 48, 'B016-1-0-4-2', 'loadInformation230', 1, NULL),
('7920', 'CISCO', 1, 1, 'cmterm_7920.4.0-03-02', 'loadInformation30002', 0, NULL),
('7921', 'CISCO', 1, 1, 'CP7921G-1.4.6.3', 'loadInformation365', 0, NULL),
('7925', 'CISCO', 1, 6, 'CP7925G-1.4.1SR1', 'loadInformation484', 0, 'SEP0000000000.cnf.xml_7925_template'),
('7926', 'CISCO', 1, 1, 'CP7926G-1.4.1SR1', 'loadInformation557', 0, NULL),
('7931', 'CISCO', 1, 34, 'SCCP31.9-2-1S', 'loadInformation348', 0, NULL),
('7935', 'CISCO', 1, 2, 'P00503021900', 'loadInformation9', 0, NULL),
('7936', 'CISCO', 1, 1, 'cmterm_7936.3-3-21-0', 'loadInformation30019', 0, NULL),
('7937', 'CISCO', 1, 1, 'apps37sccp.1-4-5-7', 'loadInformation431', 0, 'SEP0000000000.cnf.xml_7937_template'),
('7940', 'CISCO', 1, 2, 'P0030801SR02', 'loadInformation8', 1, 'SEP0000000000.cnf.xml_7940_template'),
('7941', 'CISCO', 1, 2, 'SCCP41.9-4-2SR3-1S', 'loadInformation115', 0, 'SEP0000000000.cnf.xml_796x_template'),
('7941G-GE', 'CISCO', 1, 2, 'SCCP41.9-4-2SR3-1S', 'loadInformation309', 0, 'SEP0000000000.cnf.xml_796x_template'),
('7942', 'CISCO', 1, 2, 'SCCP42.9-4-2SR3-1S', 'loadInformation434', 0, 'SEP0000000000.cnf.xml_796x_template'),
('7945', 'CISCO', 1, 2, 'SCCP45.9-3-1SR1-1S', 'loadInformation435', 0, 'SEP0000000000.cnf.xml_796x_template'),
('7960', 'CISCO', 3, 6, 'P0030801SR02', 'loadInformation7', 1, 'SEP0000000000.cnf.xml_7940_template'),
('7961', 'CISCO', 3, 6, 'SCCP41.9-4-2SR3-1S', 'loadInformation30018', 0, 'SEP0000000000.cnf.xml_796x_template'),
('7961G-GE', 'CISCO', 3, 6, 'SCCP41.9-4-2SR3-1S', 'loadInformation308', 0, 'SEP0000000000.cnf.xml_796x_template'),
('7962', 'CISCO', 3, 6, 'SCCP42.9-4-2SR3-1S', 'loadInformation404', 0, 'SEP0000000000.cnf.xml_796x_template'),
('7965', 'CISCO', 3, 6, 'SCCP45.9-3-1SR1-1S', 'loadInformation436', 0, 'SEP0000000000.cnf.xml_796x_template'),
('7970', 'CISCO', 3, 8, 'SCCP70.9-4-2SR3-1S', 'loadInformation30006', 0, 'SEP0000000000.cnf.xml_797x_template'),
('7971', 'CISCO', 1, 2, 'SCCP70.9-4-2SR3-1S', 'loadInformation119', 0, 'SEP0000000000.cnf.xml_797x_template'),
('7975', 'CISCO', 3, 8, 'SCCP75.9-4-2SR3-1S', 'loadInformation437', 0, 'SEP0000000000.cnf.xml_7975_template'),
('7985', 'CISCO', 3, 8, 'cmterm_7985.4-1-7-0', 'loadInformation302', 0, NULL),
('8941', 'CISCO', 1, 4, 'SCCP894x.9-4-2SR1-2', 'loadInformation586', 0, 'SEP0000000000.cnf.xml_797x_template'),
('8945', 'CISCO', 1, 4, 'SCCP894x.9-4-2SR1-2', 'loadInformation585', 0, 'SEP0000000000.cnf.xml_7975_template'),
('ATA 186', 'CISCO', 1, 1, 'ATA030204SCCP090202A', 'loadInformation12', 0, 'SEP0000000000.cnf.xml_ATA_template'),
('ATA 187', 'CISCO', 1, 1, 'ATA187.9-2-3-1', 'loadInformation550', 0, 'SEP0000000000.cnf.xml_ATA_template'),
('CN622', 'MOTOROLA', 1, 1, '', 'loadInformation335', 0, NULL),
('Digital Access', 'CISCO', 1, 1, 'D001M022', 'loadInformation40', 0, NULL),
('Digital Access+', 'CISCO', 1, 1, 'D00303010033', 'loadInformation42', 0, NULL),
('E-Series', 'NOKIA', 1, 1, '', '', 0, NULL),
('ICC', 'NOKIA', 1, 1, '', '', 0, NULL),
('Analog Access', 'CISCO', 1, 1, 'A001C030', 'loadInformation30', 0, ''),('WS-X6608', 'CISCO', 1, 1, 'D00404000032', 'loadInformation43', 0, ''),
('WS-X6624', 'CISCO', 1, 1, 'A00204000013', 'loadInformation43', 0, ''),
('WS-X6608', 'CISCO', 1, 1, 'C00104000003', 'loadInformation51', 0, ''),
('H.323 Phone', 'CISCO', 1, 1, '', 'loadInformation61', 0, ''),
('Simulator', 'CISCO', 1, 1, '', 'loadInformation100', 0, ''),
('MTP', 'CISCO', 1, 1, '', 'loadInformation111', 0, ''),
('MGCP Station', 'CISCO', 1, 1, '', 'loadInformation120', 0, ''),
('MGCP Trunk', 'CISCO', 1, 1, '', 'loadInformation121', 0, ''),
('UPC', 'CISCO', 1, 1, '', 'loadInformation358', 0, ''),
('TelePresence', 'TELEPRESENCE', 1, 1, '', 'loadInformation375', 0, ''),
('1000', 'TELEPRESENCE', 1, 1, '', 'loadInformation478', 0, ''),
('3000', 'TELEPRESENCE', 1, 1, '', 'loadInformation479', 0, ''),
('3200', 'TELEPRESENCE', 1, 1, '', 'loadInformation480', 0, ''),
('500-37', 'TELEPRESENCE', 1, 1, '', 'loadInformation481', 0, ''),
('1300-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation505', 0, ''),
('1100', 'TELEPRESENCE', 1, 1, '', 'loadInformation520', 0, ''),
('200', 'TELEPRESENCE', 1, 1, '', 'loadInformation557', 0, ''),
('400', 'TELEPRESENCE', 1, 1, '', 'loadInformation558', 0, ''),
('EX90', 'TELEPRESENCE', 1, 1, '', 'loadInformation584', 0, ''),
('500-32', 'TELEPRESENCE', 1, 1, '', 'loadInformation590', 0, ''),
('1300-47', 'TELEPRESENCE', 1, 1, '', 'loadInformation591', 0, ''),
('TX1310-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation596', 0, ''),
('EX60', 'TELEPRESENCE', 1, 1, '', 'loadInformation604', 0, ''),
('C90', 'TELEPRESENCE', 1, 1, '', 'loadInformation606', 0, ''),
('C60', 'TELEPRESENCE', 1, 1, '', 'loadInformation607', 0, ''),
('C40', 'TELEPRESENCE', 1, 1, '', 'loadInformation608', 0, ''),
('C20', 'TELEPRESENCE', 1, 1, '', 'loadInformation609', 0, ''),
('C20-42', 'TELEPRESENCE', 1, 1, '', 'loadInformation610', 0, ''),
('C60-42', 'TELEPRESENCE', 1, 1, '', 'loadInformation611', 0, ''),
('C40-52', 'TELEPRESENCE', 1, 1, '', 'loadInformation612', 0, ''),
('C60-52', 'TELEPRESENCE', 1, 1, '', 'loadInformation613', 0, ''),
('C60-52D', 'TELEPRESENCE', 1, 1, '', 'loadInformation614', 0, ''),
('C60-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation615', 0, ''),
('C90-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation616', 0, ''),
('MX200', 'TELEPRESENCE', 1, 1, '', 'loadInformation617', 0, ''),
('TX9000', 'TELEPRESENCE', 1, 1, '', 'loadInformation619', 0, ''),
('TX9200', 'TELEPRESENCE', 1, 1, '', 'loadInformation620', 0, ''),
('SX20', 'TELEPRESENCE', 1, 1, '', 'loadInformation626', 0, ''),
('MX300', 'TELEPRESENCE', 1, 1, '', 'loadInformation627', 0, ''),
('C40-42', 'TELEPRESENCE', 1, 1, '', 'loadInformation633', 0, ''),
('Jabber', 'CISCO', 1, 1, '', 'loadInformation652', 0, ''),
('S60', 'NOKIA', 0, 1, '', 'loadInformation376', 0, ''),
('9971', 'CISCO', 1, 1, '', 'loadInformation493', 0, ''),
('9951', 'CISCO', 1, 1, '', 'loadInformation537', 0, ''),
('8961', 'CISCO', 1, 1, '', 'loadInformation540', 0, ''),
('Iphone', 'APPLE', 0, 1, '', 'loadInformation562', 0, ''),
('Android', 'ANDROID', 0, 1, '', 'loadInformation575', 0, ''),
('7926', 'CISCO', 1, 1, 'CP7926G-1.4.5.3', 'loadInformation577', 0, ''),
('7821', 'CISCO', 1, 1, '', 'loadInformation621', 0, ''),
('7841', 'CISCO', 1, 1, '', 'loadInformation622', 0, ''),
('7861', 'CISCO', 1, 1, '', 'loadInformation623', 0, ''),
('VXC 6215', 'CISCO', 1, 1, '', 'loadInformation634', 0, ''),
('8831', 'CISCO', 1, 1, '', 'loadInformation659', 0, ''),
('8841', 'CISCO', 1, 1, '', 'loadInformation683', 0, ''),
('8851', 'CISCO', 1, 1, '', 'loadInformation684', 0, ''),
('8861', 'CISCO', 1, 1, '', 'loadInformation685', 0, ''),
('Analog', 'CISCO', 1, 1, '', 'loadInformation30027', 0, ''),
('ISDN', 'CISCO', 1, 1, '', 'loadInformation30028', 0, ''),
('SCCP GW', 'CISCO', 1, 1, '', 'loadInformation30032', 0, ''),
('IP-STE', 'CISCO', 1, 1, '', 'loadInformation30035', 0, ''),
('SPA 521S', 'CISCO', 1, 1, '', 'loadInformation80000', 0, ''),
('SPA 502G', 'CISCO', 1, 1, '', 'loadInformation80003', 0, ''),
('SPA 504G', 'CISCO', 1, 1, '', 'loadInformation80004', 0, ''),
('SPA 525G', 'CISCO', 1, 1, '', 'loadInformation80005', 0, ''),
('SPA 525G2', 'CISCO', 1, 1, '', 'loadInformation80009', 0, ''),
('SPA 303G', 'CISCO', 1, 1, '', 'loadInformation80011', 0, ''),
('IP Communicator', 'CISCO', 1, 1, '', 'loadInformation30016', 0, NULL),
('Nokia E', 'Nokia', 1, 28, '', 'loadInformation275', 0, NULL),
('VGC Phone', 'CISCO', 1, 1, '', 'loadInformation10', 0, NULL),
('7911-sip', 'CISCO-SIP', 1, 1, 'SIP11.9-2-1S', 'loadInformation307', 1, 'SEP0000000000.cnf.xml_791x_sip_template'),
('9951-sip', 'CISCO-SIP', 1, 5, 'sip9951.9-2-2SR1-9', 'loadinformation537', 1, 'SEP0000000000.cnf.xml_99xx_sip_template'),
('VGC Virtual', 'CISCO', 1, 1, '', 'loadInformation11', 0, NULL);";
$check = $db->query($sql);
if (DB::IsError($check)) {
die_freepbx("Can not create sccpdevmodel table, error:$check\n");
}
//}
return;
}
@ -814,9 +747,9 @@ function InstallDbCreateViews($sccp_compatible)
GROUP BY sccpdevice.name;";
}
$stmt = $db->prepare($sql);
$result = $stmt->execute();
if (!$result) {
die_freepbx(sprintf(_("Error updating sccpdeviceconfig view. Command was: %s"), $sql));
$stmt->execute();
if (DB::IsError($stmt)) {
die_freepbx(sprintf(_("Error updating sccpdeviceconfig view. Command was: %s; error was: %s "), $sql, $results->getMessage()));
}
outn("<li>" . _("(Re)Create sccplineconfig view") . "</li>");
@ -833,9 +766,9 @@ function InstallDbCreateViews($sccp_compatible)
sccpline.namedcallgroup, sccpline.namedpickupgroup, sccpline.phonecodepage, sccpline.videomode
FROM sccpline";
$stmt = $db->prepare($sql);
$result = $stmt->execute();
if (!$result) {
die_freepbx(sprintf(_("Error updating sccplineconfig view. Command was: %s"), $sql));
$stmt->execute();
if (DB::IsError($stmt)) {
die_freepbx(sprintf(_("Error updating sccplineconfig view. Command was: %s; error was: %s "), $sql, $results->getMessage()));
}
return true;
}
@ -1024,6 +957,13 @@ function addDriver($sccp_compatible) {
$file = $amp_conf['AMPWEBROOT'] . '/admin/modules/core/functions.inc/drivers/Sccp.class.php';
$contents = "<?php include '/var/www/html/admin/modules/sccp_manager/sccpManClasses/Sccp.class.php.v{$sccp_compatible}'; ?>";
file_put_contents($file, $contents);
$dir = $cnf_int->get('ASTETCDIR');
if (!file_exists("{$dir}/sccp.conf")) { // System re Config
outn("<li>" . _("Adding default configuration file ...") . "</li>");
$sccpfile = file_get_contents($amp_conf['AMPWEBROOT'] . '/admin/modules/sccp_manager/conf/sccp.conf');
file_put_contents("{$dir}/sccp.conf", $sccpfile);
}
}
function checkTftpServer() {
outn("<li>" . _("Checking TFTP server path and availability ...") . "</li>");
@ -1142,6 +1082,19 @@ function cleanUpSccpSettings() {
outn(_("Found DB Schema : {$settingsFromDb['sccp_compatible']['data']}"));
}
// Check that required settings are initialised and update db and $settingsFromDb if not
/*
foreach ($extconfigs->getExtConfig('sccpDefaults') as $key => $value) {
if (empty($settingsFromDb[$key])) {
$settingsFromDb[$key] = array('keyword' => $key, 'data' => $value, 'type' => 0, 'seq' => 0);
$sql = "REPLACE INTO sccpsettings (keyword, data, seq, type) VALUES ('{$key}', '{$value}', 0, 0)";
$results = $db->query($sql);
if (DB::IsError($results)) {
die_freepbx(_("Error updating sccpsettings: $key"));
}
}
}
*/
// Clean up sccpsettings to remove legacy values.
$xml_vars = $amp_conf['AMPWEBROOT'] . "/admin/modules/sccp_manager/conf/sccpgeneral.xml.v{$sccp_compatible}";
$thisInstaller->xml_data = simplexml_load_file($xml_vars);
@ -1209,8 +1162,6 @@ function cleanUpSccpSettings() {
// Override certain chan-sccp defaults as they are based on a non-FreePbx system
$settingsFromDb['context']['systemdefault'] = 'from-internal';
$settingsFromDb['directed_pickup']['systemdefault'] = 'no';
// Override this chan-sccp default as it is a potential security risk. See Issue 29
$settingsFromDb['hotline_enabled']['systemdefault'] = 'no';
unset($sysConfiguration[$key]);
}
@ -1272,10 +1223,9 @@ function cleanUpSccpSettings() {
)";
$results = $db->query($sql);
}
// Need to load any existing sccp.conf so that retain softkeys section if exists.
$sccp_conf_init = $thisInstaller->initialiseConfInit();
// Now correct sccp.conf to replace any illegal settings passing $sccp_conf_init
$thisInstaller->createDefaultSccpConfig($settingsFromDb, $cnf_int->get('ASTETCDIR'), $sccp_conf_init);
// Now correct sccp.conf to replace any illegal settings
$thisInstaller->createDefaultSccpConfig($settingsFromDb, $cnf_int->get('ASTETCDIR'));
// have to correct prior verion sccpline lists for allow/disallow and deny permit. Prior
// versions used csl, but chan-sccp expects ; separated lists when returned by db.

View file

@ -1,7 +1,7 @@
<module>
<rawname>sccp_manager</rawname>
<name>SCCP Manager</name>
<version>14.5.0.4</version>
<version>14.3.0.29</version>
<type>setup</type>
<category>SCCP Connectivity</category>
<publisher>Steve Lad, Alex GP</publisher>
@ -35,21 +35,8 @@
* Version 14.3.0.27 * - Standardise treatment of SIP and SCCP hardware.
* Version 14.3.0.28 * - Fix issue with RNav which caused exception with new device
* Version 14.3.0.29 * - Fix issue reloading page after saving settings and not restarting devices.
* Version 14.3.0.30 * - Fix reversion in 29. Not returning to correct page when saving device.
* Version 14.3.0.31 * - Fix rewrite rules.
* Version 14.4.0.1 * - Modify installer to avoid data loss on existing 14.3 fields. Bump Minor version to reflect this.
* Version 14.4.0.2 * - Revert error in Installer db calls - IF EXISTS is not valid in MariaDb v5 (package DB)
* Version 14.4.0.3 * - Change method of selecting phonecodepage depending on if is java phone.
* Version 14.4.0.5 * - Fix issue #59.
* Version 14.5.0.2 * - Fix issue #32.
* Version 14.5.0.4 * - Fix issue where values with spaces are truncated. Preserve softkeys accross installs
</changelog>
<location>https://github.com/chan-sccp/sccp_manager</location>
<depends>
<version>15</version>
<phpversion>7.0</phpversion>
<phpcomponent>zip</phpcomponent>
</depends>
<supported>
<version>13.0.0.2M</version>
</supported>
@ -62,7 +49,6 @@
<field name="name" type="string" length="15" primarykey="true"/>
<field name="type" type="string" length="15" notnull="false"/>
<field name="addon" type="string" length="45" notnull="false"/>
<field name="description" type="string" length="45" notnull="false"/>
<field name="_description" type="string" length="45" notnull="false"/>
<field name="tzoffset" type="string" length="5" notnull="false"/>
<field name="imageversion" type="string" length="31" notnull="false"/>
@ -96,11 +82,8 @@
<field name="backgroundThumbnail" type="string" length="255" notnull="false"/>
<field name="ringtone" type="string" length="255" notnull="false"/>
<field name="callhistory_answered_elsewhere" type="string" notnull="false"/>
<field name="loginname" type="string" length="20" default="NULL" notnull="false"/>
<field name="_loginname" type="string" length="20" notnull="false"/>
<field name="profileid" type="integer" default="0"/>
<field name="_profileid" type="integer" notnull="false"/>
<field name="dialrules" type="string" length="255" default="NULL" notnull="false"/>
<field name="_profileid" type="integer" default="0"/>
<field name="_dialrules" type="string" length="255" notnull="false"/>
<field name="useRedialMenu" type="string" length="5" default="no" notnull="false"/>
<field name="cfwdnoanswer" type="string" default="on" notnull="false"/>
@ -108,71 +91,6 @@
<field name="monitor" type="string" notnull="false"/>
<field name="transfer_on_hangup" type="string" notnull="false"/>
<field name="phonecodepage" type="string" length="50" notnull="false"/>
<field name="logserver" type="string" length="100" default="NULL" notnull="false"/>
<field name="_logserver" type="string" length="100" notnull="false"/>
<field name="daysdisplaynotactive" type="string" length="20" default="NULL" notnull="false"/>
<field name="_daysdisplaynotactive" type="string" length="20" notnull="false"/>
<field name="displayontime" type="string" length="20" default="NULL" notnull="false"/>
<field name="_displayontime" type="string" length="20" notnull="false"/>
<field name="displayonduration" type="string" length="20" default="NULL" notnull="false"/>
<field name="_displayonduration" type="string" length="20" notnull="false"/>
<field name="displayidletimeout" type="string" length="20" default="NULL" notnull="false"/>
<field name="_displayidletimeout" type="string" length="20" notnull="false"/>
<field name="settingsaccess" type="string" default="off"/>
<field name="_settingsaccess" type="string" notnull="false"/>
<field name="videocapability" type="string" default="off"/>
<field name="_videocapability" type="string" notnull="false"/>
<field name="webaccess" type="string" default="off"/>
<field name="_webaccess" type="string" notnull="false"/>
<field name="webadmin" type="string" default="off"/>
<field name="_webadmin" type="string" notnull="false"/>
<field name="pcport" type="string" default="on"/>
<field name="_pcport" type="string" notnull="false"/>
<field name="spantopcport" type="string" default="on"/>
<field name="_spantopcport" type="string" notnull="false"/>
<field name="voicevlanaccess" type="string" default="off"/>
<field name="_voicevlanaccess" type="string" notnull="false"/>
<field name="enablecdpswport" type="string" default="off"/>
<field name="_enablecdpswport" type="string" notnull="false"/>
<field name="enablecdppcport" type="string" default="off"/>
<field name="_enablecdppcport" type="string" notnull="false"/>
<field name="enablelldpswport" type="string" default="off"/>
<field name="_enablelldpswport" type="string" notnull="false"/>
<field name="enablelldppcport" type="string" default="off"/>
<field name="_enablelldppcport" type="string" notnull="false"/>
<field name="firstdigittimeout" type="string" length="20" default="NULL" notnull="false"/>
<field name="_firstdigittimeout" type="string" length="20" notnull="false"/>
<field name="digittimeout" type="string" length="20" default="NULL" notnull="false"/>
<field name="_digittimeout" type="string" length="20" notnull="false"/>
<field name="cfwdnoanswer_timeout" type="string" length="20" default="NULL" notnull="false"/>
<field name="_cfwdnoanswer_timeout" type="string" length="20" notnull="false"/>
<field name="autoanswer_ring_time" type="string" length="20" default="NULL" notnull="false"/>
<field name="_autoanswer_ring_time" type="string" length="20" notnull="false"/>
<field name="autoanswer_tone" type="string" length="20" default="NULL" notnull="false"/>
<field name="_autoanswer_tone" type="string" length="20" notnull="false"/>
<field name="remotehangup_tone" type="string" length="20" default="NULL" notnull="false"/>
<field name="_remotehangup_tone" type="string" length="20" notnull="false"/>
<field name="transfer_tone" type="string" length="20" default="NULL" notnull="false"/>
<field name="_transfer_tone" type="string" length="20" notnull="false"/>
<field name="callwaiting_tone" type="string" length="20" default="NULL" notnull="false"/>
<field name="_callwaiting_tone" type="string" length="20" notnull="false"/>
<field name="callanswerorder" type="string" default="latestfirst"/>
<field name="_callanswerorder" type="string" notnull="false"/>
<field name="sccp_tos" type="string" length="11" default="0x68"/>
<field name="_sccp_tos" type="string" length="11" notnull="false"/>
<field name="sccp_cos" type="string" length="11" default="0x4"/>
<field name="_sccp_cos" type="string" length="11" notnull="false"/>
<field name="dev_sshPassword" type="string" length="25" default="cisco"/>
<field name="_dev_sshPassword" type="string" length="25" notnull="false"/>
<field name="dev_sshUserId" type="string" length="25" default="cisco"/>
<field name="_dev_sshUserId" type="string" length="25" notnull="false"/>
<field name="phonepersonalization" type="string" length="25" default="0"/>
<field name="_phonepersonalization" type="string" length="25" notnull="false"/>
<field name="devlang" type="string" length="50" default="NULL" notnull="false"/>
<field name="_devlang" type="string" length="50" notnull="false"/>
<field name="netlang" type="string" length="50" default="NULL" notnull="false"/>
<field name="_netlang" type="string" length="50" notnull="false"/>
<field name="keepalive" type="integer" default="60" notnull="false"/>
</table>
<table name="sccpline">
<field name="id" type="integer" autoincrement="true"/>
@ -214,18 +132,6 @@
<field name="setvar" type="string" length="50" notnull="false"/>
<field name="name" type="string" length="40" primarykey="true"/>
<field name="phonecodepage" type="string" length="50" notnull="false"/>
<field name="regcontext" type="string" length="20" default="sccpregistration" notnull="false"/>
<field name="_regcontext" type="string" length="20" notnull="false"/>
<field name="transfer_on_hangup" type="string" default="off"/>
<field name="_transfer_on_hangup" type="string" notnull="false"/>
<field name="autoselectline_enabled" type="string" default="off"/>
<field name="_autoselectline_enabled" type="string" notnull="false"/>
<field name="autocall_select" type="string" default="off"/>
<field name="_autocall_select" type="string" notnull="false"/>
<field name="backgroundImageAccess" type="string" default="off"/>
<field name="_backgroundImageAccess" type="string" notnull="false"/>
<field name="callLogBlfEnabled" type="string" default="2"/>
<field name="_callLogBlfEnabled" type="string" notnull="false"/>
<key name="id" type="unique">
<column name="id"/>
</key>

View file

@ -264,7 +264,7 @@ class dbinterface
$this->db->prepare('TRUNCATE sccpsettings')->execute();
$stmt = $this->db->prepare('INSERT INTO sccpsettings (keyword, data, seq, type, systemdefault) VALUES (:keyword,:data,:seq,:type,:systemdefault)');
} else {
$stmt = $this->db->prepare('REPLACE INTO sccpsettings (keyword, seq, type, data, systemdefault) VALUES (:keyword,:seq,:type,:data,:systemdefault)');
$stmt = $this->db->prepare('REPLACE INTO sccpsettings (keyword, data, seq, type, systemdefault) VALUES (:keyword,:data,:seq,:type,:systemdefault)');
}
foreach ($save_value as $key => $dataArr) {
if (empty($dataArr)) {
@ -334,7 +334,27 @@ class dbinterface
break;
case 'add':
foreach ($save_value as $button_array) {
$stmt = $this->db->prepare("INSERT INTO sccpbuttonconfig SET ref = :ref, reftype = :reftype, instance = :instance, buttontype = :buttontype, name = :name, options = :options");
$stmt = $this->db->prepare("INSERT INTO sccpbuttonconfig SET ref = :ref, reftype = :reftype, instance = :instance, buttontype = :buttontype, name = :name, options = :options
ON DUPLICATE KEY UPDATE ref = :refU, reftype = :reftypeU, instance = :instanceU, buttontype = :buttontypeU, name = :nameU, options = :optionsU");
$stmt->bindParam(':ref', $button_array['ref'],\PDO::PARAM_STR);
$stmt->bindParam(':reftype', $button_array['reftype'],\PDO::PARAM_STR);
$stmt->bindParam(':instance', $button_array['instance'],\PDO::PARAM_INT);
$stmt->bindParam(':buttontype', $button_array['buttontype'],\PDO::PARAM_STR);
$stmt->bindParam(':name', $button_array['name'],\PDO::PARAM_STR);
$stmt->bindParam(':options', $button_array['options'],\PDO::PARAM_STR);
$stmt->bindParam(':refU', $button_array['ref'],\PDO::PARAM_STR);
$stmt->bindParam(':reftypeU', $button_array['reftype'],\PDO::PARAM_STR);
$stmt->bindParam(':instanceU', $button_array['instance'],\PDO::PARAM_INT);
$stmt->bindParam(':buttontypeU', $button_array['buttontype'],\PDO::PARAM_STR);
$stmt->bindParam(':nameU', $button_array['name'],\PDO::PARAM_STR);
$stmt->bindParam(':optionsU', $button_array['options'],\PDO::PARAM_STR);
$result = $stmt->execute();
}
break;
/*
case 'add':
foreach ($save_value as $button_array) {
$stmt = $this->db->prepare('INSERT INTO sccpbuttonconfig (ref, reftype, instance, buttontype, name, options) VALUES (:ref, :reftype, :instance, :buttontype, :name, :options)');
$stmt->bindParam(':ref', $button_array['ref'],\PDO::PARAM_STR);
$stmt->bindParam(':reftype', $button_array['reftype'],\PDO::PARAM_STR);
$stmt->bindParam(':instance', $button_array['instance'],\PDO::PARAM_INT);
@ -342,9 +362,9 @@ class dbinterface
$stmt->bindParam(':name', $button_array['name'],\PDO::PARAM_STR);
$stmt->bindParam(':options', $button_array['options'],\PDO::PARAM_STR);
$result = $stmt->execute();
}
break;
*/
case 'clear';
// Clear is equivalent of delete + insert. Mode is used in order to activate trigger.
$this->write('sccpbuttons', '', $mode = 'delete','', $hwid);

View file

@ -175,6 +175,7 @@ class extconfigs
'pt_BR' => array('code' => 'pt', 'language' => 'Portuguese', 'locale' => 'Portuguese_Brazil', 'codepage' => 'ISO8859-1'),
'pt_PT' => array('code' => 'pt', 'language' => 'Portuguese', 'locale' => 'Portuguese_Portugal', 'codepage' => 'ISO8859-1'),
'ro_RO' => array('code' => 'ro', 'language' => 'Romanian', 'locale' => 'Romanian_Romania', 'codepage' => 'ISO8859-1'),
'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'),
'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'),

View file

@ -4,8 +4,6 @@ namespace FreePBX\modules\Sccp_manager;
class formcreate
{
use \FreePBX\modules\Sccp_Manager\sccpManTraits\helperFunctions;
public function __construct($parent_class = null) {
$this->buttonDefLabel = 'chan-sccp';
$this->buttonHelpLabel = 'site';
@ -176,8 +174,6 @@ class formcreate
}
function addElementIED($child, $fvalues, $sccp_defaults,$npref, $napref) {
//$Sccp_manager = \FreePBX::create()->Sccp_manager;
// IED fields are arrays of networks and masks, or ip and ports.
$res_input = '';
$res_value = '';
$opt_at = array();
@ -191,27 +187,20 @@ class formcreate
// $res_value
$lnhtm = '';
$res_id = $napref.$child->name;
//$i = 0;
$i = 0;
$max_row = 255;
if (!empty($child->max_row)) {
$max_row = $child->max_row;
}
// fvalues are current settings - the encoding depends on where the data is
// coming from: IED fields in sccpsettings are json, elsewhere they are ; delimited.
if (!empty($fvalues[$res_n])) {
if (!empty($fvalues[$res_n]['data'])) {
$res_value = $this->convertCsvToArray($fvalues[$res_n]['data']);
$res_value = explode(';', $fvalues[$res_n]['data']);
}
}
if ($res_n == 'srst_ip') {
$res_value = $this->convertCsvToArray($sccp_defaults[$res_n]['data']);
}
if (empty($res_value)) {
$res_value = array((string) $child->default);
}
?>
<div class="element-container">
<div class="row">
@ -229,21 +218,15 @@ class formcreate
echo '<div class="form-group form-inline">';
foreach ($child->xpath('cbutton') as $value) {
$res_n = $res_id.'[0]['.$value['field'].']';
// res_vf sets the state of the checkbox internal. This is always
// the first array element in $res_value if set
$res_vf = false;
$res_vf = '';
if ($value['value']=='NONE' && empty($res_value)) {
$res_vf = true;
$res_vf = 'active';
}
if ((isset($res_value[0]['internal'])) || ($res_value[0] == 'internal')) {
$res_vf = true;
// Remove the value from $res_value so that do not add empty row for internal
array_shift($res_value);
// If now have an empty array, add a new empty element
if (count($res_value) == 0) {
// although handle also ip, internal is never set for those arrays
$res_value[0] = array('net'=>"", 'mask' =>"");
}
$ch_key = array_search($value['value'], $res_value);
if ($ch_key !== false) {
unset($res_value[$ch_key]);
$res_vf = 'active';
$res_value = explode(';', implode(';', $res_value));
}
$opt_hide ='';
$opt_class="button-checkbox";
@ -267,9 +250,9 @@ class formcreate
$opt_class .= " ".(string)$value->class;
}
echo '<span class="'.$opt_class.'"'.$opt_hide.'><button type="button" class="btn '.(($res_vf) ? 'active':"").'" data-color="primary">';
echo '<i class="state-icon '. (($res_vf)?'glyphicon glyphicon-check"':'glyphicon glyphicon-uncheck'). '"></i> ';
echo $value.'</button><input type="checkbox" name="'. $res_n.'" class="hidden" '. (($res_vf)?'checked="checked"':'') .'/></span>';
echo '<span class="'.$opt_class.'"'.$opt_hide.'><button type="button" class="btn '.$res_vf.'" data-color="primary">';
echo '<i class="state-icon '. (($res_vf == 'active')?'glyphicon glyphicon-check"':'glyphicon glyphicon-uncheck'). '"></i> ';
echo $value.'</button><input type="checkbox" name="'. $res_n.'" class="hidden" '. (($res_vf == 'active')?'checked="checked"':'') .'/></span>';
}
echo '</div>';
}
@ -278,40 +261,36 @@ class formcreate
$opt_class .= " ".(string)$child->class;
}
echo '<div class = "'.$opt_class.'">';
$i=1;
foreach ($res_value as $addrArr) {
foreach ($res_value as $dat_v) {
?>
<div class = "<?php echo $res_id;?> form-group form-inline" data-nextid=<?php echo $i;?> id= <?php echo $res_id . $i;?>>
<div class = "<?php echo $res_id;?> form-group form-inline" data-nextid=<?php echo $i+1;?> >
<?php
//$res_vf = explode('/', $dat_v);
$i2 = 0;
foreach ($child->xpath('input') as $value) {
$field_id = (string)$value['field'];
$res_n = $res_id.'['.$i.']['.$field_id.']';
$res_n = $res_id.'['.$i.']['.$value['field'].']';
$fields_id = (string)$value['field'];
//$opt_at[$fields_id]['nameseparator']=(string)$value['nameseparator'];
if (!empty($value->class)) {
$opt_at[$field_id]['class']='form-control ' .(string)$value->class;
$opt_at[$fields_id]['class']='form-control ' .(string)$value->class;
}
$defValue = (isset($addrArr[$field_id])) ? $addrArr[$field_id]: "";
echo '<input type="text" name="'. $res_n.'" class="'.$opt_at[$field_id]['class'].'" value="'. $defValue .'"';
//$opt_at[$fields_id]['nameseparator']=(string)$value['nameseparator'];
if (!empty((string)$value['nameseparator'])) {
$res_vf = explode((string)$value['nameseparator'], $dat_v);
}
echo '<input type="text" name="'. $res_n.'" class="'.$opt_at[$fields_id]['class'].'" value="'.$res_vf[$i2].'"';
if (isset($value->options)) {
foreach ($value->options ->attributes() as $optkey => $optval) {
$opt_at[$field_id]['options'][$optkey]=(string)$optval;
$opt_at[$field_id]['nameseparator'] = (null !== (string)$value['nameseparator']) ? (string)$value['nameseparator'] : '';
$opt_at[$fields_id]['options'][$optkey]=(string)$optval;
echo ' '.$optkey.'="'.$optval.'"';
}
}
echo '> '.(string)$value['nameseparator'].' ';
$i2 ++;
}
if (!empty($child->add_pluss)) {
if ($i <= count($res_value)) {
echo '<button type="button" class="btn btn-danger btn-lg input-js-remove" id="'.$res_id.$i.'-btn-del" data-id="'.$res_id.$i.'"><i class="fa fa-minus pull-right"></i></button>';
}
// only add plus button to the last row
if ($i == count($res_value)) {
echo '<button type="button" class="btn btn-primary btn-lg input-js-add" id="'.$res_id.$i.'-btn-add" data-id="'.$res_id.'" data-row="'.$i.'" data-for="'.$res_id.'" data-max="'.$max_row.'"data-json="'.bin2hex(json_encode($opt_at)).'"><i class="fa fa-plus pull-right"></i></button>';
}
echo '<button type="button" class="btn btn-primary btn-lg input-js-add" id="'.$res_id.'-btn" data-id="'.$res_id.'" data-for="'.$res_id.'" data-max="'.$max_row.'"data-json="'.bin2hex(json_encode($opt_at)).'"><i class="fa fa-plus pull-right"></i></button>';
}
echo '</div>';
$i++;
@ -463,7 +442,7 @@ class formcreate
} else {$val_check = "";}
} else {$val_check = "";}
}
echo "<input type=radio name= {$res_id} id=${res_id}_{$i} value='{$value[@value]}' {$val_check} {$opt_hide} {$opt_disabled}>";
echo "<input type=radio name= {$res_id} id=${res_id}_{$i} value={$value[@value]} {$val_check} {$opt_hide} {$opt_disabled}>";
echo "<label for= {$res_id}_{$i}>{$value}</label>";
$i++;
}

View file

@ -15,52 +15,12 @@ namespace FreePBX\modules\Sccp_manager;
class xmlinterface
{
use \FreePBX\modules\Sccp_Manager\sccpManTraits\helperFunctions;
private $val_null = 'NONE'; /// REPLACE to null Field
public function __construct($parent_class = null)
{
$this->paren_class = $parent_class;
$this->langCodeArray = array(
'Arabic_Saudi_Arabia' => 'ar',
'Bulgarian_Bulgaria' => 'bg',
'Czech_Czech_Republic' => 'cz',
'Danish_Denmark' => 'da',
'German_Germany' => 'de',
'Greek_Greece' => 'el',
'AU_English_United_States' => 'en',
'English_United_Kingdom' => 'en',
'English_United_States' => 'en',
'Spanish_Spain' => 'es',
'Estonian_Estonia' => 'et',
'Finnish_Finland' => 'fi',
'French_Canada' => 'fr',
'French_France' => 'fr',
'Hebrew_Israel' => 'he',
'Croatian_Croatia' => 'hr',
'Hungarian_Hungary' => 'hu',
'Italian_Italy' => 'it',
'Japanese_Japan' => 'ja',
'Korean_Korea_Republic' => 'ko',
'Lithuanian_Lithuania' => 'lt',
'Latvian_Latvia' => 'lv',
'Dutch_Netherlands' => 'nl',
'Norwegian_Norway' => 'no',
'Polish_Poland' => 'pl',
'Portuguese_Brazil' => 'pt',
'Portuguese_Portugal' => 'pt',
'Romanian_Romania' => 'ro',
'Russian_Russian_Federation' => 'ru',
'Slovak_Slovakia' => 'sk',
'Slovenian_Slovenia' => 'sl',
'Serbian_Republic_of_Montenegro' => 'sr',
'Serbian_Republic_of_Serbia' => 'rs',
'Swedish_Sweden' => 'sv',
'Thai_Thailand' => 'th',
'Turkish_Turkey' => 'tr',
'Chinese_China' => 'cn',
'Chinese_Taiwan' => 'zh'
);
}
public function info()
@ -152,7 +112,7 @@ class xmlinterface
$node->addAttribute('model', $var['vendor'] . ' ' . $var['model']);
}
}
$this->saveXml($xml_work, $xml_name); // Save XMLDefault1.cnf.xml
\FreePBX::Sccp_manager()->saveXml($xml_work, $xml_name); // Save XMLDefault1.cnf.xml
}
}
@ -160,7 +120,46 @@ class xmlinterface
{
// 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
$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'
);
$data_values = array_merge($data_values, $dev_config);
$var_xml_general_fields = array('authenticationurl' => 'dev_authenticationURL', 'informationurl' => 'dev_informationURL', 'messagesurl' => 'dev_messagesURL',
@ -251,15 +250,29 @@ class xmlinterface
$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'];
$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':
@ -298,18 +311,8 @@ class xmlinterface
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;
}
if ((!empty($vtmp_data)) || ($vtmp_data == "0")) {
$xml_node->$dkey = $vtmp_data;
}
}
}
@ -355,8 +358,8 @@ class xmlinterface
$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']];
if (isset($langCodeArray['devlang'])) {
$xml_node->langCode = $langCodeArray['devlang'];
}
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
break;
@ -389,7 +392,7 @@ class xmlinterface
}
}
$this->saveXml($xml_work, $xml_name); // Save
\FreePBX::Sccp_manager()->saveXml($xml_work, $xml_name); // Save
return time();
}
@ -404,11 +407,20 @@ class xmlinterface
}
$ip_fill = true;
if (!empty($data_values['ccm_address'])) {
// ccm_address is json from sccpsettings
$ccm_address = $this->convertCsvToArray($data_values['ccm_address'], true);
// This is a sanitised list of ipaddresses and ports
foreach ($ccm_address as $netValue) {
$res[$netValue['ip']] = $netValue;
$ccm_address = $data_values['ccm_address'];
if (strpos($ccm_address, 'internal') === false && strpos($ccm_address, '0.0.0.0') === false) {
$tmp_data = explode(';', $ccm_address);
$ip_fill = false;
foreach ($tmp_data as $tmp_row) {
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) {
@ -671,8 +683,8 @@ class xmlinterface
$xml_node->winCharSet = $dev_config['phonecodepage'];
$xml_node->name = $dev_config['devlang'];
$xml_node->langCode = 'en';
if (isset($this->langCodeArray['devlang'])) {
$xml_node->langCode = $this->langCodeArray['devlang'];
if (isset($langCodeArray['devlang'])) {
$xml_node->langCode = $langCodeArray['devlang'];
}
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
break;
@ -705,7 +717,7 @@ class xmlinterface
}
}
$this->saveXml($xml_work, $xml_name); // Save
\FreePBX::Sccp_manager()->saveXml($xml_work, $xml_name); // Save
} else {
die('Error Hardware template :' . $xml_template . ' not found');
}

View file

@ -56,11 +56,12 @@ trait ajaxHelper {
// TODO: Need to be more specific on reload and only reload if critical settings changed.
$res = $this->aminterface->core_sccp_reload();
return array('status' => true, 'message' => 'Data saved', 'reload' => true, 'toastFlag' => 'success', 'search' => '?display=sccpsettings', 'hash' => '');
return true;
break;
case 'save_sip_device':
case 'save_device':
return $this->saveSccpDevice($request);
$this->saveSccpDevice($request);
return array('status' => true, 'search' => '?display=sccp_phone', 'hash' => 'sccpdevice');
break;
case 'save_ruser':
//$res = $request;
@ -243,7 +244,7 @@ trait ajaxHelper {
if (!empty($request['softkey'])) {
$id_name = $request['softkey'];
unset($this->sccp_conf_init[$id_name]);
$this->createDefaultSccpConfig($this->sccpvalues, $this->sccppath["asterisk"], $this->sccp_conf_init);
$this->createDefaultSccpConfig($this->sccpvalues, $this->sccppath["asterisk"]);
$msg = print_r($this->aminterface->core_sccp_reload(), 1);
return array('status' => true, 'table_reload' => true);
}
@ -257,11 +258,11 @@ trait ajaxHelper {
$this->sccp_conf_init[$id_name][$keyl] = $request[$keyl];
}
}
$this->createDefaultSccpConfig($this->sccpvalues, $this->sccppath["asterisk"], $this->sccp_conf_init);
$this->createDefaultSccpConfig($this->sccpvalues, $this->sccppath["asterisk"]);
// !TODO!: -TODO-: Check SIP Support Enabled
$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);
}
break;
@ -440,32 +441,38 @@ trait ajaxHelper {
$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'];
$arr_data = '';
if (!empty($this->sccpvalues[$key])) {
foreach ($value as $valArr) {
foreach ($valArr as $vkey => $vval) {
switch ($vkey) {
case 'inherit':
case 'internal':
if ($vval == 'on') {
$arr_data .= 'internal;';
}
break;
case 'port':
$arr_data .= ":{$vval}";
break;
case 'mask':
$arr_data .= "/{$vval}";
break;
default:
$arr_data .= $vval;
break;
}
}
}
if (!($this->sccpvalues[$key]['data'] == $arr_data)) {
$save_settings[$key] = $this->sccpvalues[$key];
$save_settings[$key]['data'] = $arr_data;
}
}
continue;
}
// Now handle any normal data - arrays will not match as already handled.
@ -494,35 +501,29 @@ trait ajaxHelper {
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->createDefaultSccpConfig($this->sccpvalues, $this->sccppath["asterisk"]);
$this->createDefaultSccpXml();
$toastFlag = 'success';
$msg = 'Data saved';
$search = '?display=sccpsettings';
$hash = '';
echo json_encode(array('status' => true, 'message' => $msg, 'reload' => true, 'toastFlag' => $toastFlag, 'search' => $search, 'hash' => $hash)). ";#;" ;
ob_flush();
flush();
}
public function getMyConfig($var = null, $id = "noid") {
@ -656,9 +657,9 @@ trait ajaxHelper {
$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_id = (empty($get_settings['sccp_deviceid'])) ? 'new' : $get_settings['sccp_deviceid'];
$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
$update_hw = ($hw_id == 'new') ? 'add' : 'clear'; // Clear is delete + add
$hw_prefix = 'SEP';
if (!empty($get_settings[$hdr_prefix . 'type'])) {
$value = $get_settings[$hdr_prefix . 'type'];
@ -686,71 +687,70 @@ trait ajaxHelper {
}
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';
$value = 'CP1251';
break;
default:
$value = (in_array($get_settings['sccp_hw_type'], $nonJavaPhones, true)) ? 'ISO8859-1' : 'utf-8';
$value = 'ISO8859-1';
break;
}
}
break;
default:
// handle vendor prefix
if (!empty($get_settings["${hdr_vendPrefix}${key}"])) {
$value = $get_settings["${hdr_vendPrefix}${key}"];
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
if (!empty($get_settings[$hdr_arprefix . $key])) {
$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
foreach ($get_settings[$hdr_arprefix . $key] as $vkey => $vval) {
$tmp_data = '';
foreach ($vval as $vkey => $vval) {
switch ($vkey) {
case 'inherit':
if ($vval == 'on') {
$arr_clear = true;
// Злобный ХАК ?!TODO!?
if ($key == 'permit') {
$save_settings['deny'] = 'NONE';
}
}
break;
case 'internal':
if ($vval == 'on') {
$tmp_data .= 'internal;';
}
break;
default:
$tmp_data .= $vval . '/';
break;
}
}
if (strlen($tmp_data) > 2) {
while (substr($tmp_data, -1) == '/') {
$tmp_data = substr($tmp_data, 0, -1);
}
$arr_data .= $tmp_data . ';';
}
}
while (substr($arr_data, -1) == ';') {
$arr_data = substr($arr_data, 0, -1);
}
if ($arr_clear) {
$value = 'NONE';
} else {
$value = $arr_data;
}
}
// Now only have normal prefix
if (!empty($get_settings["{$hdr_prefix}{$key}"])) {
$value = $get_settings["{$hdr_prefix}{$key}"];
}
$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;
@ -782,7 +782,12 @@ trait ajaxHelper {
}
}
$search = '?display=sccp_phone';
return array('status' => true, 'message' => $msg, 'reload' => true, 'toastFlag' => $toastFlag, 'search' => $search, 'hash' => $hash);
echo json_encode(array('status' => true, 'message' => $msg, 'reload' => true, 'toastFlag' => $toastFlag, 'search' => $search, 'hash' => $hash)). ";#;" ;
ob_flush();
flush();
return true;
}
}
?>

View file

@ -3,76 +3,8 @@
namespace FreePBX\modules\Sccp_manager\sccpManTraits;
trait helperfunctions {
private function convertCsvToArray($stringToConvert = "") {
// Take a csv string form of net/mask or ip/port and convert to an array
// sub arrays are separated by ";"
$outputArr = array();
if (empty($stringToConvert)) {
return $outputArr;
}
foreach (explode(";", $stringToConvert) as $value) {
//internal is always the first setting if present
if ($value == 'internal') {
$outputArr[] = array('internal' => 'on');
continue;
}
// Now handle rest of value types
$subArr = explode("/", $value);
if (count($subArr) === 2) {
// Have net/mask
$outputArr[] = array('net' => $subArr[0], 'mask' => $subArr[1]);
} else {
// have ip:port
$subArr = explode(":", $value);
$outputArr[] = array('ip' => $subArr[0], 'port' => $subArr[1]);
}
}
return $outputArr;
}
private function convertArrayToCsv(array $arrayToConvert) {
// About to save to db so need to convert to string
// Take an array form of net mask or ip port and convert to a csv
// sub arrays are separated by ";"
if (empty($arrayToConvert)) {
return '';
}
$output = array();
// Internal is always element 0, nets and ips start at element 1.
if ((isset($arrayToConvert[1]['net'])) || (isset($arrayToConvert[0]['internal']))) {
// Have net masks
foreach ($arrayToConvert as $netValue) {
if (isset($netValue['internal'])) {
$output[] = 'internal';
continue;
}
if (empty($netValue['net'])) {
// If network not set, user error, has added empty row so delete
continue;
}
// If the mask has not been set, set to this subnet
$netValue['mask'] = (empty($netValue['mask'])) ? "255.255.255.0" : $netValue['mask'];
$output[] = implode('/', $netValue);
}
} else {
// Have ip addresses
foreach ($arrayToConvert as $ipArr) {
if (isset($ipArr['internal'])) {
// should not be set for an ip address
continue;
}
if (empty($ipArr['ip'])) {
// If ip not set, user error, has added empty row so delete
continue;
}
$ipArr['port'] = (empty($ipArr['port'])) ? "2000" : $ipArr['port'];
$output[] = implode(':', $ipArr);
}
}
return implode(';', $output);
}
private function getIpInformation($type = '') {
function getIpInformation($type = '') {
$interfaces = array();
switch ($type) {
case 'ip4':
@ -275,20 +207,6 @@ trait helperfunctions {
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');
@ -356,18 +274,18 @@ trait helperfunctions {
unset($sysConfig);
}
public function createDefaultSccpConfig(array $sccpvalues, string $asteriskPath, $conf_init) {
public function createDefaultSccpConfig(array $sccpvalues, string $asteriskPath) {
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';
//clear old settings, and initiate with allow/disallow and permit/deny keys in correct order
$this->sccp_conf_init = array();
$this->sccp_conf_init['general']['disallow'] = 'all';
$this->sccp_conf_init['general']['allow'] = '';
$this->sccp_conf_init['general']['deny'] = '0.0.0.0/0.0.0.0';
$this->sccp_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',
@ -389,9 +307,15 @@ trait helperfunctions {
case "allow":
case "disallow":
case "deny":
$this->sccp_conf_init['general'][$key] = explode(';', $value['data']);
break;
case "localnet":
case "permit":
$conf_init['general'][$key] = explode(';', $value['data']);
$content = $value['data'];
if (strpos($content, 'internal') !== false) {
$content = str_replace(';0.0.0.0/0.0.0.0', '', $value['data']);
}
$this->sccp_conf_init['general'][$key] = explode(';', $content);
break;
case "devlang":
/*
@ -408,7 +332,7 @@ trait helperfunctions {
break;
default:
if (!empty($value['data'])) {
$conf_init['general'][$key] = $value['data'];
$this->sccp_conf_init['general'][$key] = $value['data'];
}
}
}
@ -418,7 +342,7 @@ trait helperfunctions {
// This will complicate solving problems caused by unexpected solutions from users.
//
if (file_exists($asteriskPath . "/sccp_custom.conf")) {
$conf_init['HEADER'] = array(
$this->sccp_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 ;",
@ -427,7 +351,8 @@ trait helperfunctions {
"#include sccp_custom.conf"
);
}
$cnf_wr->WriteConfig('sccp.conf', $conf_init);
$cnf_wr->WriteConfig('sccp.conf', $this->sccp_conf_init);
//$this->$cnf_wr->writeConfig('sccp.conf', $this->sccp_conf_init);
}
public function initVarfromXml() {

View file

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

View file

@ -46,37 +46,39 @@ $keynamearray = array('onhook' => array('sname' => 'ONHOOK', 'name' =>'Displa
<form autocomplete="off" name="frm_keyset" id="frm_keyset" class="fpbx-submit" action="" method="post">
<input type="hidden" name="category" value="keysetform">
<input type="hidden" name="Submit" value="Submit">
<div class="fpbx-container container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="display no-border">
<div id="toolbar-all">
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" onclick="load_oncliсk(this,'*new*')" data-target=".edit_new_keyset"><i class="fa fa-bolt"></i> <?php echo _("Add Keyset"); ?></button>
</div>
<table data-cookie="true" data-cookie-id-table="sccp_keyset-all" data-url="ajax.php?module=sccp_manager&command=getSoftKey&type=active" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-all" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list" id="softkey-all" data-unique-id="softkeys">
<thead>
<tr>
<th data-sortable="true" data-field="softkeys"><?php echo _('KeySetName')?></th>
<?php
$i = 0;
foreach ($keynamearray as $key => $value) {
if ($i < 12) {
echo '<th data-sortable="false" data-field="'.$key.'">'._($value['sname']).'</th>';
}
$i ++;
}
?>
<th data-field="actions" data-formatter="DispayActionsKeyFormatter"><?php echo _('Actions')?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="fpbx-container container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="display no-border">
<div id="toolbar-all">
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" onclick="load_oncliсk(this,'*new*')" data-target=".edit_new_keyset"><i class="fa fa-bolt"></i> <?php echo _("Add Keyset"); ?></button>
</div>
<table data-cookie="true" data-cookie-id-table="sccp_keyset-all" data-url="ajax.php?module=sccp_manager&command=getSoftKey&type=active" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-all" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list" id="softkey-all" data-unique-id="softkeys">
<thead>
<tr>
<!-- <th data-checkbox="true"></th> -->
<th data-sortable="true" data-field="softkeys"><?php echo _('KeySetName')?></th>
<?php
$i = 0;
foreach ($keynamearray as $key => $value) {
if ($i < 9) {
echo '<th data-sortable="false" data-field="'.$key.'">'._($value['sname']).'</th>';
}
$i ++;
}
?>
<th data-field="actions" data-formatter="DispayActionsKeyFormatter"><?php echo _('Actions')?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</form>
<!-- Begin Form Input New / Edit -->
@ -88,27 +90,18 @@ $keynamearray = array('onhook' => array('sname' => 'ONHOOK', 'name' =>'Displa
<h4 class="modal-title" id="gridSystemModalLabel">Add New KeySet</h4>
</div>
<div class="modal-body">
<style type="text/css">
input:invalid {border: red solid 3px;}
</style>
<div class="element-container">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="new_keysetname">Name Keyset</label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="new_devmodel"></i>
</div>
<div class="col-md-9">
<input type="text" maxlength="15" pattern="[a-zA-Z0-9]{4,15}" class="form-control" id="new_keySetname" name="new_keySetname" value="SoftKeyset">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="new_devmodel-help" class="help-block fpbx-help-block">Max length 15 letters or numbers without spaces</span>
</div>
</div>
</div>
<div class="element-container"><div class="row"> <div class="form-group"><div class="col-md-3">
<label class="control-label" for="new_keysetname">Name Keyset</label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="new_devmodel"></i>
</div><div class="col-md-9">
<input type="text" maxlength="15" class="form-control" id="new_keySetname" name="new_keySetname" value="SoftKeyset">
</div> </div></div>
<div class="row"><div class="col-md-12">
<span id="new_devmodel-help" class="help-block fpbx-help-block">Help. max len = 15</span>
</div></div></div>
<ul class="nav nav-tabs" role="tablist">
<?php
@ -164,6 +157,8 @@ foreach ($keysetarray as $key => $value) {
</div>
</div>
<script>
function DispayActionsKeyFormatter(value, row, index) {
var exp_model = '';

View file

@ -13,7 +13,7 @@
<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>
<h2 style="border:2px solid Tomato;color:Tomato;" ><?php echo _("Warning : Any changes to the device configuration can cause all phones to restart"); ?></h2>
</div>
</div>
</div>