Bug fix Reported by @MarcusRobichon
This commit is contained in:
parent
28a051e01a
commit
f457ce8259
|
@ -96,15 +96,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
private $tftpLang = array();
|
||||
// private $hint_context = '@ext-local'; /// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Get it from Config !!!
|
||||
private $hint_context = array('default' => '@ext-local'); /// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Get it from Config !!!
|
||||
|
||||
private $val_null = 'NONE'; /// REPLACE to null Field
|
||||
public $sccp_model_list = array();
|
||||
public $sccp_model_list = array();
|
||||
private $cnf_wr = null;
|
||||
public $sccppath = array();
|
||||
public $sccpvalues = array();
|
||||
public $sccp_conf_init = array();
|
||||
public $xml_data;
|
||||
|
||||
public $class_error; //error construct
|
||||
|
||||
public function __construct($freepbx = null) {
|
||||
|
@ -145,14 +143,14 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
|
||||
if (!empty($this->sccpvalues['SccpDBmodel'])) {
|
||||
if ($this->sccpvalues['sccp_compatible']['data'] > $this->sccpvalues['SccpDBmodel']['data']) {
|
||||
$this->sccpvalues['sccp_compatible']['data'] = $this->sccpvalues['SccpDBmodel']['data'] ;
|
||||
$this->sccpvalues['sccp_compatible']['data'] = $this->sccpvalues['SccpDBmodel']['data'];
|
||||
}
|
||||
}
|
||||
// Load Advanced Form Constuctor Data
|
||||
if (empty($this->sccpvalues['displayconfig'])) {
|
||||
$xml_vars = __DIR__ . '/conf/sccpgeneral.xml.v' . $this->sccpvalues['sccp_compatible']['data'];
|
||||
} else {
|
||||
$xml_vars = __DIR__ . '/conf/'.$this->sccpvalues['displayconfig']['data'].'.xml.v'.$this->sccpvalues['sccp_compatible']['data'];
|
||||
$xml_vars = __DIR__ . '/conf/' . $this->sccpvalues['displayconfig']['data'] . '.xml.v' . $this->sccpvalues['sccp_compatible']['data'];
|
||||
}
|
||||
if (!file_exists($xml_vars)) {
|
||||
$xml_vars = __DIR__ . '/conf/sccpgeneral.xml';
|
||||
|
@ -369,22 +367,21 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
|
||||
if (!empty($this->sccpvalues['displayconfig'])) {
|
||||
if (!empty($this->sccpvalues['displayconfig']['data']) && ($this->sccpvalues['displayconfig']['data'] == 'sccpsimple')) {
|
||||
$this->pagedata = array(
|
||||
"general" => array(
|
||||
"name" => _("General SCCP Settings"),
|
||||
"page" => 'views/server.setting.php'
|
||||
),
|
||||
"sccpdevice" => array(
|
||||
"name" => _("SCCP Device"),
|
||||
"page" => 'views/server.device.php'
|
||||
),
|
||||
"sccpinfo" => array(
|
||||
"name" => _("SCCP info"),
|
||||
"page" => 'views/server.info.php'
|
||||
),
|
||||
);
|
||||
$this->pagedata = array(
|
||||
"general" => array(
|
||||
"name" => _("General SCCP Settings"),
|
||||
"page" => 'views/server.setting.php'
|
||||
),
|
||||
"sccpdevice" => array(
|
||||
"name" => _("SCCP Device"),
|
||||
"page" => 'views/server.device.php'
|
||||
),
|
||||
"sccpinfo" => array(
|
||||
"name" => _("SCCP info"),
|
||||
"page" => 'views/server.info.php'
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (empty($this->pagedata)) {
|
||||
|
@ -415,7 +412,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
"page" => 'views/server.info.php'
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
if (!empty($this->pagedata)) {
|
||||
foreach ($this->pagedata as &$page) {
|
||||
|
@ -432,22 +428,20 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
$request = $_REQUEST;
|
||||
$action = !empty($request['action']) ? $request['action'] : '';
|
||||
$this->pagedata = array(
|
||||
"general" => array(
|
||||
"name" => _("General SCCP Settings"),
|
||||
"page" => 'views/server.info.php'
|
||||
),
|
||||
"general" => array(
|
||||
"name" => _("General SCCP Settings"),
|
||||
"page" => 'views/server.info.php'
|
||||
),
|
||||
);
|
||||
|
||||
);
|
||||
|
||||
foreach ($this->pagedata as &$page) {
|
||||
ob_start();
|
||||
include($page['page']);
|
||||
$page['content'] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
}
|
||||
foreach ($this->pagedata as &$page) {
|
||||
ob_start();
|
||||
include($page['page']);
|
||||
$page['content'] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
return $this->pagedata;
|
||||
|
||||
}
|
||||
|
||||
public function AdvServerShowPage() {
|
||||
|
@ -898,21 +892,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
break;
|
||||
// ------------------------------- Old deviece suport - In the development---
|
||||
case 'backupsettings':
|
||||
global $amp_conf;
|
||||
$backup_files = array( $amp_conf['ASTETCDIR'].'/sccp.conf', $amp_conf['ASTETCDIR'].'/extensions_additional.conf', $amp_conf['ASTETCDIR'].'/extconfig.conf');
|
||||
|
||||
$result = $this->dbinterface->dump_sccp_tables($this->sccppath["tftp_path"],$amp_conf['AMPDBNAME'], $amp_conf['AMPDBUSER'], $amp_conf['AMPDBPASS']);
|
||||
$backup_files[] = $result;
|
||||
|
||||
$zip = new \ZipArchive();
|
||||
$filename = $result.".zip";
|
||||
if ($zip->open($filename, \ZIPARCHIVE::CREATE)) {
|
||||
foreach ($backup_files as $file) {
|
||||
$zip->addFile($file);
|
||||
}
|
||||
$zip->close();
|
||||
}
|
||||
|
||||
$filename = $this->sccp_create_sccp_backup();
|
||||
$file_name = basename($filename);
|
||||
|
||||
header("Content-Type: application/zip");
|
||||
|
@ -920,12 +900,11 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
header("Content-Length: " . filesize($filename));
|
||||
|
||||
readfile($filename);
|
||||
unlink($result);
|
||||
unlink($filename);
|
||||
// return array('status' => false, 'message' => $result);
|
||||
// return $result;
|
||||
break;
|
||||
|
||||
// return array('status' => false, 'message' => $result);
|
||||
// return $result;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -976,12 +955,11 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
$value = strtoupper(str_replace(array('.', '-', ':'), '', $value)); // Delete mac Seporated from string
|
||||
$value = sprintf("%012s", $value);
|
||||
if ($hw_prefix == 'VG') {
|
||||
$value = $hw_prefix . $value.'0';
|
||||
$value = $hw_prefix . $value . '0';
|
||||
} else {
|
||||
$value = $hw_prefix . $value;
|
||||
}
|
||||
$name_dev = $value;
|
||||
|
||||
}
|
||||
break;
|
||||
case 'disallow':
|
||||
|
@ -1015,7 +993,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
foreach ($vval as $vkey => $vval) {
|
||||
switch ($vkey) {
|
||||
case 'inherit':
|
||||
if ($vval=='on') {
|
||||
if ($vval == 'on') {
|
||||
$arr_clear = TRUE;
|
||||
// Злобный ХАК
|
||||
if ($key == 'permit') {
|
||||
|
@ -1024,7 +1002,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
}
|
||||
break;
|
||||
case 'internal':
|
||||
if ($vval=='on') {
|
||||
if ($vval == 'on') {
|
||||
$tmp_data .= 'internal;';
|
||||
}
|
||||
break;
|
||||
|
@ -1034,13 +1012,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
}
|
||||
}
|
||||
if (strlen($tmp_data) > 2) {
|
||||
while (substr($tmp_data,-1)=='/') {
|
||||
while (substr($tmp_data, -1) == '/') {
|
||||
$tmp_data = substr($tmp_data, 0, -1);
|
||||
}
|
||||
$arr_data .= $tmp_data . ';';
|
||||
}
|
||||
}
|
||||
while (substr($arr_data,-1)==';') {
|
||||
while (substr($arr_data, -1) == ';') {
|
||||
$arr_data = substr($arr_data, 0, -1);
|
||||
}
|
||||
if ($arr_clear) {
|
||||
|
@ -1202,23 +1180,23 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
switch ($vkey) {
|
||||
case 'inherit':
|
||||
case 'internal':
|
||||
if ($vval=='on') {
|
||||
if ($vval == 'on') {
|
||||
$tmp_data .= 'internal;';
|
||||
}
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
$tmp_data .= $vval . '/';
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (strlen($tmp_data) > 2) {
|
||||
while (substr($tmp_data,-1)=='/') {
|
||||
while (substr($tmp_data, -1) == '/') {
|
||||
$tmp_data = substr($tmp_data, 0, -1);
|
||||
}
|
||||
$arr_data .= $tmp_data. ';';
|
||||
$arr_data .= $tmp_data . ';';
|
||||
}
|
||||
}
|
||||
while (substr($arr_data,-1)==';') {
|
||||
while (substr($arr_data, -1) == ';') {
|
||||
$arr_data = substr($arr_data, 0, -1);
|
||||
}
|
||||
if (!($this->sccpvalues[$key1]['data'] == $arr_data)) {
|
||||
|
@ -1270,7 +1248,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
public function getMyConfig($var = null, $id = "noid") {
|
||||
// $final = false;
|
||||
switch ($var) {
|
||||
|
@ -1419,25 +1396,27 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
function Sccp_manager_get_config($engine) {
|
||||
$this->debugdata($engine);
|
||||
}
|
||||
/*
|
||||
function soundlang_hookGet_config($engine) {
|
||||
|
||||
global $core_conf;
|
||||
$this->debugdata($engine);
|
||||
/*
|
||||
function soundlang_hookGet_config($engine) {
|
||||
|
||||
global $core_conf;
|
||||
$this->debugdata($engine);
|
||||
|
||||
switch ($engine) {
|
||||
case "asterisk":
|
||||
// if (isset($core_conf) && is_a($core_conf, "core_conf")) {
|
||||
// $language = FreePBX::Soundlang()->getLanguage();
|
||||
// if ($language != "") {
|
||||
// $core_conf->addSipGeneral('language', $language);
|
||||
// $core_conf->addIaxGeneral('language', $language);
|
||||
// }
|
||||
// }
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
switch ($engine) {
|
||||
case "asterisk":
|
||||
// if (isset($core_conf) && is_a($core_conf, "core_conf")) {
|
||||
// $language = FreePBX::Soundlang()->getLanguage();
|
||||
// if ($language != "") {
|
||||
// $core_conf->addSipGeneral('language', $language);
|
||||
// $core_conf->addIaxGeneral('language', $language);
|
||||
// }
|
||||
// }
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* Retrieve Active Codecs
|
||||
* return fiends Lag pack
|
||||
|
@ -1449,7 +1428,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
|
||||
private function initTftpLang() {
|
||||
$result = array();
|
||||
if (empty($this->sccppath["tftp_path"]) || empty($this->sccppath["tftp_lang_path"]) ) {
|
||||
if (empty($this->sccppath["tftp_path"]) || empty($this->sccppath["tftp_lang_path"])) {
|
||||
return;
|
||||
}
|
||||
$dir = $this->sccppath["tftp_lang_path"];
|
||||
|
@ -1499,7 +1478,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
function init_sccp_path() {
|
||||
global $db;
|
||||
global $amp_conf;
|
||||
$driver_revision = array('0' => '', '430' => '.v431', '431' => '.v432', '432' => '.v432', '433' => '.v433');
|
||||
$driver_revision = array('0' => '', '430' => '.v431', '431' => '.v432', '432' => '.v432', '433' => '.v433');
|
||||
|
||||
|
||||
$confDir = $amp_conf["ASTETCDIR"];
|
||||
|
@ -1512,18 +1491,18 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
}
|
||||
$ver_id = $this->srvinterface->get_compatible_sccp();
|
||||
if (!empty($this->sccpvalues['SccpDBmodel'])) {
|
||||
$ver_id =$this->sccpvalues['SccpDBmodel']['data'];
|
||||
$ver_id = $this->sccpvalues['SccpDBmodel']['data'];
|
||||
}
|
||||
|
||||
$driver = $this->FreePBX->Core->getAllDriversInfo();
|
||||
$sccp_driver_replace= '';
|
||||
$sccp_driver_replace = '';
|
||||
if (empty($driver['sccp'])) {
|
||||
$sccp_driver_replace = 'yes';
|
||||
} else {
|
||||
if (empty($driver['sccp']['Version'])) {
|
||||
$sccp_driver_replace = 'yes';
|
||||
} else {
|
||||
if ($driver['sccp']['Version'] != $this->sccp_driver_ver.$driver_revision[$ver_id]) {
|
||||
if ($driver['sccp']['Version'] != $this->sccp_driver_ver . $driver_revision[$ver_id]) {
|
||||
$sccp_driver_replace = 'yes';
|
||||
}
|
||||
}
|
||||
|
@ -1548,9 +1527,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
|
||||
$hint = $this->srvinterface->sccp_list_hints();
|
||||
foreach ($hint as $key => $value) {
|
||||
if ($this->hint_context['default'] != $value) {
|
||||
if ($this->hint_context['default'] != $value) {
|
||||
$this->hint_context[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1689,7 +1668,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
$data_value['tftp_path'] = $this->sccppath["tftp_path"];
|
||||
|
||||
$this->xmlinterface->create_default_XML($this->sccppath["tftp_path_store"], $data_value, $model_information, $lang_data);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1711,23 +1689,23 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
$data_value['server_if_list'] = $this->getIP_information();
|
||||
$dev_config['tftp_path'] = $this->sccppath["tftp_path"];
|
||||
$dev_config['tftp_firmware'] = '';
|
||||
/* if (!empty($this->sccpvalues['tftp_rewrite'])) {
|
||||
if ( $this->sccpvalues['tftp_rewrite']['data'] == 'internal' ) {
|
||||
$dir_list = $this->find_all_files($dev_config['tftp_path'], $dev_config['loadimage']);
|
||||
foreach ($dir_list as $filek){
|
||||
if (!empty($filek)) {
|
||||
$fnd_path= '';
|
||||
$fnd_path = str_replace($dev_config['tftp_path'],'',$filek);
|
||||
$fnd_path = substr($fnd_path,1,strpos($fnd_path, $dev_config['loadimage'])-1);
|
||||
if (!empty($fnd_path)) {
|
||||
$dev_config['tftp_firmware'] = $fnd_path;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
/* if (!empty($this->sccpvalues['tftp_rewrite'])) {
|
||||
if ( $this->sccpvalues['tftp_rewrite']['data'] == 'internal' ) {
|
||||
$dir_list = $this->find_all_files($dev_config['tftp_path'], $dev_config['loadimage']);
|
||||
foreach ($dir_list as $filek){
|
||||
if (!empty($filek)) {
|
||||
$fnd_path= '';
|
||||
$fnd_path = str_replace($dev_config['tftp_path'],'',$filek);
|
||||
$fnd_path = substr($fnd_path,1,strpos($fnd_path, $dev_config['loadimage'])-1);
|
||||
if (!empty($fnd_path)) {
|
||||
$dev_config['tftp_firmware'] = $fnd_path;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
$dev_config['addon_info'] = array();
|
||||
if (!empty($dev_config['addon'])) {
|
||||
$hw_addon = explode(',', $dev_config['addon']);
|
||||
|
@ -1740,7 +1718,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
// return $this->sccppath["tftp_path_store"];
|
||||
|
||||
return $this->xmlinterface->create_SEP_XML($this->sccppath["tftp_path_store"], $data_value, $dev_config, $dev_id, $lang_data);
|
||||
|
||||
}
|
||||
|
||||
function sccp_delete_device_XML($dev_id = '') {
|
||||
|
@ -1765,6 +1742,31 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
}
|
||||
}
|
||||
|
||||
private function sccp_create_sccp_backup() {
|
||||
global $amp_conf;
|
||||
$backup_files = array($amp_conf['ASTETCDIR'] . '/sccp', $amp_conf['ASTETCDIR'] . '/extensions', $amp_conf['ASTETCDIR'] . '/extconfig',
|
||||
$amp_conf['ASTETCDIR'] . '/res_config_mysql', $amp_conf['ASTETCDIR'] . '/res_mysql');
|
||||
$backup_ext = array('.conf', '_additional.conf', '_custom.conf');
|
||||
|
||||
$result = $this->dbinterface->dump_sccp_tables($this->sccppath["tftp_path"], $amp_conf['AMPDBNAME'], $amp_conf['AMPDBUSER'], $amp_conf['AMPDBPASS']);
|
||||
|
||||
$zip = new \ZipArchive();
|
||||
$filename = $result . ".zip";
|
||||
if ($zip->open($filename, \ZIPARCHIVE::CREATE)) {
|
||||
$zip->addFile($result);
|
||||
foreach ($backup_files as $file) {
|
||||
foreach ($backup_ext as $b_ext) {
|
||||
if (file_exists($file . $b_ext)) {
|
||||
$zip->addFile($file . $b_ext);
|
||||
}
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
}
|
||||
unlink($result);
|
||||
return $filename;
|
||||
}
|
||||
|
||||
function sccp_create_sccp_init() {
|
||||
// Make sccp.conf data
|
||||
// [general]
|
||||
|
@ -1805,7 +1807,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
$search_mode = '';
|
||||
if (!empty($this->sccpvalues['tftp_rewrite'])) {
|
||||
$search_mode = $this->sccpvalues['tftp_rewrite']['data'];
|
||||
if ( $search_mode == 'pro' ) {
|
||||
if ($search_mode == 'pro') {
|
||||
$dir_list = $this->find_all_files($dir, $file_ext, 'fileonly');
|
||||
} else {
|
||||
$dir_list = $this->find_all_files($dir, $file_ext);
|
||||
|
@ -1821,8 +1823,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
$raw_settings[$i]['validate'] = '-;-';
|
||||
if (!empty($raw_settings[$i]['loadimage'])) {
|
||||
$raw_settings[$i]['validate'] = 'no;';
|
||||
if ((strtolower($raw_settings[$i]['vendor'] == 'cisco')) || !empty($dir_list)) {
|
||||
foreach ($dir_list as $filek){
|
||||
if ((strtolower($raw_settings[$i]['vendor'] == 'cisco')) || !empty($dir_list)) {
|
||||
foreach ($dir_list as $filek) {
|
||||
switch ($search_mode) {
|
||||
case 'pro':
|
||||
case 'on':
|
||||
|
@ -1837,7 +1839,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
case 'off':
|
||||
default: // Place in root TFTP dir
|
||||
// $raw_settings[$i]['buttons'] = $dir.'/'.$raw_settings[$i]['loadimage'];
|
||||
if (strpos(strtolower($filek), strtolower($dir.'/'.$raw_settings[$i]['loadimage'])) !== false) {
|
||||
if (strpos(strtolower($filek), strtolower($dir . '/' . $raw_settings[$i]['loadimage'])) !== false) {
|
||||
// if (strpos(strtolower($filek), strtolower($raw_settings[$i]['loadimage'])) !== false) {
|
||||
$raw_settings[$i]['validate'] = 'yes;';
|
||||
}
|
||||
|
@ -1845,26 +1847,26 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
}
|
||||
}
|
||||
}
|
||||
/* OLD search
|
||||
$file = $dir . '/' . $raw_settings[$i]['loadimage'];
|
||||
if (is_dir($file)) {
|
||||
$file .= '/' . $raw_settings[$i]['loadimage'];
|
||||
}
|
||||
$raw_settings[$i]['validate'] = 'no;';
|
||||
if (strtolower($raw_settings[$i]['vendor']) == 'cisco') {
|
||||
foreach ($file_ext as $value) {
|
||||
if (file_exists($file . $value)) {
|
||||
$raw_settings[$i]['validate'] = 'yes;';
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (file_exists($file)) {
|
||||
$raw_settings[$i]['validate'] = 'yes;';
|
||||
}
|
||||
}
|
||||
*
|
||||
*/
|
||||
/* OLD search
|
||||
$file = $dir . '/' . $raw_settings[$i]['loadimage'];
|
||||
if (is_dir($file)) {
|
||||
$file .= '/' . $raw_settings[$i]['loadimage'];
|
||||
}
|
||||
$raw_settings[$i]['validate'] = 'no;';
|
||||
if (strtolower($raw_settings[$i]['vendor']) == 'cisco') {
|
||||
foreach ($file_ext as $value) {
|
||||
if (file_exists($file . $value)) {
|
||||
$raw_settings[$i]['validate'] = 'yes;';
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (file_exists($file)) {
|
||||
$raw_settings[$i]['validate'] = 'yes;';
|
||||
}
|
||||
}
|
||||
*
|
||||
*/
|
||||
} else {
|
||||
$raw_settings[$i]['validate'] = '-;';
|
||||
}
|
||||
|
@ -1887,25 +1889,24 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
$res = array();
|
||||
$default_hint = '@ext-local';
|
||||
// get all hints [101@ext-local] => 101@ext-local
|
||||
$tmp_data = $this->srvinterface->sccp_list_all_hints();
|
||||
$tmp_data = $this->srvinterface->sccp_list_all_hints();
|
||||
foreach ($tmp_data as $value) {
|
||||
/* !TODO!: Add Hint Filtred List */
|
||||
$res[$value] = array('hint' => $value, 'name' => before('@', $value), 'label' => $value );
|
||||
/* !TODO!: Add Hint Filtred List */
|
||||
$res[$value] = array('hint' => $value, 'name' => before('@', $value), 'label' => $value);
|
||||
}
|
||||
// Update info from sccp_db
|
||||
$tmp_data = $this->dbinterface->get_db_SccpTableData('SccpExtension');
|
||||
$tmp_data = $this->dbinterface->get_db_SccpTableData('SccpExtension');
|
||||
foreach ($tmp_data as $value) {
|
||||
$name_l = $value['name'];
|
||||
if (!empty($res[$name_l.$default_hint])) {
|
||||
$res[$name_l.$default_hint]['name'] = $name_l;
|
||||
$res[$name_l.$default_hint]['label'] = $value['label'];
|
||||
if (!empty($res[$name_l . $default_hint])) {
|
||||
$res[$name_l . $default_hint]['name'] = $name_l;
|
||||
$res[$name_l . $default_hint]['label'] = $value['label'];
|
||||
} else { // if not exist in system hints ..... ???????
|
||||
$res[$name_l.$default_hint] = array('hint' => $name_l.$default_hint, 'name' => $name_l, 'label' => $value['label'] );
|
||||
$res[$name_l . $default_hint] = array('hint' => $name_l . $default_hint, 'name' => $name_l, 'label' => $value['label']);
|
||||
}
|
||||
|
||||
}
|
||||
// Update info from sip DB
|
||||
/* !TODO!: Update Hint info from sip DB ??? */
|
||||
/* !TODO!: Update Hint info from sip DB ??? */
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
@ -1968,64 +1969,74 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
// $dom = dom_import_simplexml($node);
|
||||
// $dom->parentNode->removeChild($dom);
|
||||
// }
|
||||
private function strpos_array($haystack, $needles) {
|
||||
if (is_array($needles)) {
|
||||
foreach ($needles as $str) {
|
||||
if (is_array($str)) {
|
||||
$pos = strpos_array($haystack, $str);
|
||||
} else {
|
||||
$pos = strpos($haystack, $str);
|
||||
private function strpos_array($haystack, $needles) {
|
||||
if (is_array($needles)) {
|
||||
foreach ($needles as $str) {
|
||||
if (is_array($str)) {
|
||||
$pos = strpos_array($haystack, $str);
|
||||
} else {
|
||||
$pos = strpos($haystack, $str);
|
||||
}
|
||||
if ($pos !== FALSE) {
|
||||
return $pos;
|
||||
}
|
||||
}
|
||||
if ($pos !== FALSE) {
|
||||
return $pos;
|
||||
} else {
|
||||
return strpos($haystack, $needles);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
private function find_all_files($dir, $file_mask = null, $mode = 'full') {
|
||||
|
||||
$result = NULL;
|
||||
if (empty($dir) || (!file_exists($dir))) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
$root = scandir($dir);
|
||||
foreach ($root as $value) {
|
||||
if ($value === '.' || $value === '..') {
|
||||
continue;
|
||||
}
|
||||
if (is_file("$dir/$value")) {
|
||||
$filter = false;
|
||||
if (!empty($file_mask)) {
|
||||
if (is_array($file_mask)) {
|
||||
foreach ($file_mask as $k) {
|
||||
if (strpos(strtolower($value), strtolower($k)) !== false) {
|
||||
$filter = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (strpos(strtolower($value), strtolower($file_mask)) !== false) {
|
||||
$filter = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$filter = true;
|
||||
}
|
||||
if ($filter) {
|
||||
if ($mode == 'fileonly') {
|
||||
$result[] = "$value";
|
||||
} else {
|
||||
$result[] = "$dir/$value";
|
||||
}
|
||||
} else {
|
||||
$result[] = null;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$sub_fiend = $this->find_all_files("$dir/$value", $file_mask, $mode);
|
||||
if (!empty($sub_fiend)) {
|
||||
foreach ($sub_fiend as $sub_value) {
|
||||
if (!empty($sub_value)) {
|
||||
$result[] = $sub_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return strpos($haystack, $needles);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
private function find_all_files($dir, $file_mask=null, $mode='full'){
|
||||
|
||||
$result = NULL;
|
||||
if (empty($dir) || (!file_exists($dir))) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
$root = scandir($dir);
|
||||
foreach($root as $value) {
|
||||
if($value === '.' || $value === '..') {continue;}
|
||||
if(is_file("$dir/$value")) {
|
||||
$filter = false;
|
||||
if (!empty($file_mask)) {
|
||||
if (is_array($file_mask)) {
|
||||
foreach ($file_mask as $k){
|
||||
if (strpos(strtolower($value), strtolower($k)) !== false) {$filter = true;}
|
||||
}
|
||||
} else {
|
||||
if (strpos(strtolower($value), strtolower($file_mask)) !== false) {$filter = true;}
|
||||
}
|
||||
} else {$filter = true;}
|
||||
if ($filter) {
|
||||
if ($mode=='fileonly'){
|
||||
$result[]="$value";
|
||||
} else {
|
||||
$result[]="$dir/$value";
|
||||
}
|
||||
} else {$result[]=null;}
|
||||
continue;
|
||||
}
|
||||
$sub_fiend = $this->find_all_files("$dir/$value",$file_mask,$mode);
|
||||
if (!empty($sub_fiend)) {
|
||||
foreach($sub_fiend as $sub_value) {
|
||||
if (!empty($sub_value)) {
|
||||
$result[]=$sub_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,8 +9,7 @@ namespace FreePBX\modules\Sccp_manager;
|
|||
class extconfigs {
|
||||
|
||||
public function __construct($parent_class = null) {
|
||||
$this->paren_class = $parent_class;
|
||||
|
||||
$this->paren_class = $parent_class;
|
||||
}
|
||||
|
||||
public function info() {
|
||||
|
@ -212,30 +211,29 @@ class extconfigs {
|
|||
'New Zealand' => array('offset' => '720', 'daylight' => 'Daylight')
|
||||
);
|
||||
|
||||
|
||||
public function validate_init_path($confDir = '', $db_vars, $sccp_driver_replace='') {
|
||||
public function validate_init_path($confDir = '', $db_vars, $sccp_driver_replace = '') {
|
||||
// global $db;
|
||||
// global $amp_conf;
|
||||
// *** Setings for Provision Sccp
|
||||
$adv_config = Array('tftproot' => '', 'firmware' => 'firmware', 'settings' => 'settings',
|
||||
'locales' => 'locales', 'languages' => 'languages', 'templates' => 'templates');
|
||||
$adv_tree['pro'] = Array('templates' => 'tftproot', 'settings' => 'tftproot', 'locales' => 'tftproot', 'firmware' => 'tftproot', 'languages' => 'locales');
|
||||
'locales' => 'locales', 'languages' => 'languages', 'templates' => 'templates');
|
||||
$adv_tree['pro'] = Array('templates' => 'tftproot', 'settings' => 'tftproot', 'locales' => 'tftproot', 'firmware' => 'tftproot', 'languages' => 'locales');
|
||||
|
||||
// $adv_tree['def'] = Array('templates' => 'tftproot', 'settings' => '', 'locales' => 'tftproot', 'firmware' => 'tftproot', 'languages' => '');
|
||||
$adv_tree['def'] = Array('templates' => 'tftproot', 'settings' => '', 'locales' => 'tftproot', 'firmware' => 'tftproot', 'languages' => 'tftproot');
|
||||
$adv_tree['def'] = Array('templates' => 'tftproot', 'settings' => '', 'locales' => 'tftproot', 'firmware' => 'tftproot', 'languages' => 'tftproot');
|
||||
//* **************------ ****
|
||||
$base_tree = Array('tftp_templates' => 'templates', 'tftp_path_store' => 'settings', 'tftp_lang_path' => 'languages', 'tftp_firmware_path'=>'firmware');
|
||||
$base_tree = Array('tftp_templates' => 'templates', 'tftp_path_store' => 'settings', 'tftp_lang_path' => 'languages', 'tftp_firmware_path' => 'firmware');
|
||||
|
||||
if (empty($confDir)) {
|
||||
return array('error' => 'empty СonfDir' );
|
||||
return array('error' => 'empty СonfDir');
|
||||
}
|
||||
|
||||
$base_config = Array( 'asterisk' => $confDir, 'sccp_conf' => $confDir . '/sccp.conf', 'tftp_path' => '');
|
||||
$base_config = Array('asterisk' => $confDir, 'sccp_conf' => $confDir . '/sccp.conf', 'tftp_path' => '');
|
||||
|
||||
// Test Base dir (/tftproot)
|
||||
if (!empty($db_vars["tftp_path"])) {
|
||||
if (file_exists($db_vars["tftp_path"]["data"])) {
|
||||
$base_config["tftp_path"] = $db_vars["tftp_path"]["data"];
|
||||
$base_config["tftp_path"] = $db_vars["tftp_path"]["data"];
|
||||
}
|
||||
}
|
||||
if (empty($base_config["tftp_path"])) {
|
||||
|
@ -247,14 +245,14 @@ class extconfigs {
|
|||
if (!empty($this->paren_class)) {
|
||||
$this->paren_class->class_error['tftp_path'] = 'Tftp path not defined';
|
||||
}
|
||||
return array('error' => 'empty tftp_path' );
|
||||
return array('error' => 'empty tftp_path');
|
||||
}
|
||||
if (!is_writeable($base_config["tftp_path"])) {
|
||||
if (!is_writeable($base_config["tftp_path"])) {
|
||||
if (!empty($this->paren_class)) {
|
||||
$this->paren_class->class_error['tftp_path'] = 'No write permision on tftp DIR';
|
||||
}
|
||||
return array('error' => 'No write permision on tftp DIR' );
|
||||
}
|
||||
return array('error' => 'No write permision on tftp DIR');
|
||||
}
|
||||
// END Test Base dir (/tftproot)
|
||||
|
||||
if (!empty($db_vars['tftp_rewrite_path'])) {
|
||||
|
@ -283,8 +281,8 @@ class extconfigs {
|
|||
foreach ($adv_tree[$adv_tree_mode] as $key => $value) {
|
||||
if (!empty($adv_config[$key])) {
|
||||
if (!empty($value)) {
|
||||
if (substr($adv_config[$key],0,1) != "/") {
|
||||
$adv_config[$key] = $adv_config[$value].'/'.$adv_config[$key];
|
||||
if (substr($adv_config[$key], 0, 1) != "/") {
|
||||
$adv_config[$key] = $adv_config[$value] . '/' . $adv_config[$key];
|
||||
}
|
||||
} else {
|
||||
$adv_config[$key] = $adv_config['tftproot'];
|
||||
|
@ -295,7 +293,7 @@ class extconfigs {
|
|||
$base_config[$key] = $adv_config[$value];
|
||||
if (!file_exists($base_config[$key])) {
|
||||
if (!mkdir($base_config[$key], 0777, true)) {
|
||||
die('Error creating dir : '. $base_config[$key]);
|
||||
die('Error creating dir : ' . $base_config[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -303,17 +301,17 @@ class extconfigs {
|
|||
// $base_config['External_ini'] = $adv_config;
|
||||
// $base_config['External_mode'] = $adv_tree_mode;
|
||||
|
||||
/*
|
||||
if (!empty($this->sccppath["tftp_path"])) {
|
||||
$this->sccppath["tftp_DP"] = $this->sccppath["tftp_path"] . '/Dialplan';
|
||||
if (!file_exists($this->sccppath["tftp_DP"])) {
|
||||
if (!mkdir($this->sccppath["tftp_DP"], 0777, true)) {
|
||||
die('Error creating DialPlan template dir');
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
// TFTP -REWrite double model
|
||||
/*
|
||||
if (!empty($this->sccppath["tftp_path"])) {
|
||||
$this->sccppath["tftp_DP"] = $this->sccppath["tftp_path"] . '/Dialplan';
|
||||
if (!file_exists($this->sccppath["tftp_DP"])) {
|
||||
if (!mkdir($this->sccppath["tftp_DP"], 0777, true)) {
|
||||
die('Error creating DialPlan template dir');
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
// TFTP -REWrite double model
|
||||
if (empty($_SERVER['DOCUMENT_ROOT'])) {
|
||||
if (!empty($this->paren_class)) {
|
||||
$this->paren_class->class_error['DOCUMENT_ROOT'] = 'Empty DOCUMENT_ROOT';
|
||||
|
@ -352,12 +350,13 @@ class extconfigs {
|
|||
|
||||
public function validate_RealTime() {
|
||||
global $amp_conf;
|
||||
$res = Array();
|
||||
$res = Array();
|
||||
|
||||
$cnf_int = \FreePBX::Config();
|
||||
$cnf_wr = \FreePBX::WriteConfig();
|
||||
$cnf_read = \FreePBX::LoadConfig();
|
||||
$def_config = array('sccpdevice' => 'mysql,sccp,sccpdeviceconfig', 'sccpline' => ' mysql,sccp,sccpline');
|
||||
$def_config = array('sccpdevice' => 'mysql,sccp,sccpdeviceconfig', 'sccpline' => 'mysql,sccp,sccpline');
|
||||
$backup_ext = array('_custom.conf', '.conf', '_additional.conf');
|
||||
$def_bd_config = array('dbhost' => $amp_conf['AMPDBHOST'], 'dbname' => $amp_conf['AMPDBNAME'],
|
||||
'dbuser' => $amp_conf['AMPDBUSER'], 'dbpass' => $amp_conf['AMPDBPASS'],
|
||||
'dbport' => '3306', 'dbsock' => '/var/lib/mysql/mysql.sock');
|
||||
|
@ -369,21 +368,33 @@ class extconfigs {
|
|||
$res_conf = '';
|
||||
$ext_conf = '';
|
||||
|
||||
if (file_exists($dir . '/extconfig.conf')) {
|
||||
$ext_conf = $cnf_read->getConfig('extconfig.conf');
|
||||
if (empty($ext_conf['settings']['sccpdevice'])) {
|
||||
$res['extconfig'] = ' Options "Sccpdevice" not config ';
|
||||
foreach ($backup_ext as $fext) {
|
||||
if (file_exists($dir . '/extconfig' . $fext)) {
|
||||
$ext_conf = $cnf_read->getConfig('extconfig' . $fext);
|
||||
if (!empty($ext_conf['settings']['sccpdevice'])) {
|
||||
$res['sccpdevice'] = 'OK';
|
||||
$res['extconfigfile'] = 'extconfigfile'. $fext;
|
||||
}
|
||||
if (empty($ext_conf['settings']['sccpline'])) {
|
||||
$res['sccpline'] = 'OK';
|
||||
}
|
||||
}
|
||||
if (empty($ext_conf['settings']['sccpline'])) {
|
||||
$res['extconfig'] .= ' Options "Sccpline" not config ';
|
||||
}
|
||||
if (empty($res['extconfig'])) {
|
||||
$res['extconfig'] = 'OK';
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
$res['extconfig'] = 'OK';
|
||||
|
||||
if (empty($res['sccpdevice'])) {
|
||||
$res['extconfig'] = ' Options "Sccpdevice" not config ';
|
||||
}
|
||||
if (empty($res['sccpline'])) {
|
||||
$res['extconfig'] = ' Options "Sccpline" not config ';
|
||||
}
|
||||
|
||||
if (empty($res['extconfigfile'])) {
|
||||
$res['extconfig'] = 'File extconfig.conf not exist';
|
||||
}
|
||||
|
||||
|
||||
if (!empty($res_conf_sql)) {
|
||||
if (file_exists($res_conf_sql)) {
|
||||
$def_bd_config['dbsock'] = $res_conf_sql;
|
||||
|
@ -394,7 +405,7 @@ class extconfigs {
|
|||
if (empty($res_conf[$def_bd_sec])) {
|
||||
$res['mysqlconfig'] = 'Not Config in file: res_mysql.conf';
|
||||
} else {
|
||||
if ($res_conf[$def_bd_sec]['dbsock'] != $def_bd_config['dbsock']) {
|
||||
if ($res_conf[$def_bd_sec]['dbsock'] != $def_bd_config['dbsock']) {
|
||||
$res['mysqlconfig'] = 'Mysql Soket Error in file: res_mysql.conf';
|
||||
}
|
||||
}
|
||||
|
@ -407,21 +418,18 @@ class extconfigs {
|
|||
if (empty($res_conf[$def_bd_sec])) {
|
||||
$res['mysqlconfig'] = 'Not Config in file: res_config_mysql.conf';
|
||||
} else {
|
||||
if ($res_conf[$def_bd_sec]['dbsock'] != $def_bd_config['dbsock']) {
|
||||
if ($res_conf[$def_bd_sec]['dbsock'] != $def_bd_config['dbsock']) {
|
||||
$res['mysqlconfig'] = 'Mysql Soket Error in file: res_config_mysql.conf';
|
||||
}
|
||||
}
|
||||
if (empty($res['mysqlconfig'])) {
|
||||
$res['mysqlconfig'] = 'OK';
|
||||
}
|
||||
|
||||
}
|
||||
if (empty($res['mysqlconfig'])) {
|
||||
$res['mysqlconfig'] = 'Realtime Error: not found res_config_mysql.conf or res_mysql.conf configutation on the path :'. $dir ;
|
||||
$res['mysqlconfig'] = 'Realtime Error: not found res_config_mysql.conf or res_mysql.conf configutation on the path :' . $dir;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -587,7 +587,7 @@ class srvinterface {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
return $result;
|
||||
return $result;
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
@ -608,8 +608,10 @@ class srvinterface {
|
|||
fputs ($fp,"Events: on\r\n\r\n");
|
||||
|
||||
fputs ($fp,"Action: SCCPShowDevices\r\n");
|
||||
fputs ($fp,"ResultFormat: command\r\n");
|
||||
// $params = array('Segment' => 'device', 'ResultFormat'=>'command' );
|
||||
|
||||
// fputs ($fp,"Action: SCCPConfigMetaData\r\n");
|
||||
// fputs ($fp,"Segment: device\r\n");
|
||||
// fputs ($fp,"ResultFormat: command\r\n");
|
||||
fputs ($fp,"\r\n");
|
||||
|
||||
/*
|
||||
|
|
|
@ -138,7 +138,7 @@ and open the template in the editor. Base Version before all crash :-)
|
|||
<button value="all">All</button>
|
||||
<help>Debug: Enable debugging level in SCCP module.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="20">
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>displayconfig</name>
|
||||
<label>SCCP Config Mode </label>
|
||||
<default>sccpgeneral</default>
|
||||
|
|
|
@ -139,7 +139,7 @@ and open the template in the editor. Base Version before all crash :-)
|
|||
<button value="all">All</button>
|
||||
<help>Debug: Enable debugging level in SCCP module.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="20">
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>displayconfig</name>
|
||||
<label>SCCP Config Mode </label>
|
||||
<default>sccpgeneral</default>
|
||||
|
|
|
@ -256,7 +256,7 @@ and open the template in the editor. Base Version before all crash :-)
|
|||
<button value="all">All</button>
|
||||
<help>Debug: Enable debugging level in SCCP module.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="20">
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>displayconfig</name>
|
||||
<label>SCCP Config Mode </label>
|
||||
<default>sccpgeneral</default>
|
||||
|
|
|
@ -258,7 +258,7 @@ and open the template in the editor. Base Version before all crash :-)
|
|||
<button value="all">All</button>
|
||||
<help>Debug: Enable debugging level in SCCP module.</help>
|
||||
</item>
|
||||
<item type="IS" id="6" seq="20">
|
||||
<item type="IS" id="6" seq="98">
|
||||
<name>displayconfig</name>
|
||||
<label>SCCP Config Mode </label>
|
||||
<default>sccpgeneral</default>
|
||||
|
|
17
install.php
17
install.php
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
/*
|
||||
* Hand DB Change :
|
||||
ALTER TABLE `sccpline` CHANGE COLUMN `transfer` `transfer` ENUM('on','off') NULL DEFAULT NULL ;
|
||||
ALTER TABLE `sccpdevice` CHANGE COLUMN `transfer` `transfer` ENUM('on','off') NULL DEFAULT NULL;
|
||||
ALTER TABLE `asterisk`.`sccpline` CHANGE COLUMN `transfer` `transfer` ENUM('on','off') NULL DEFAULT NULL ;
|
||||
ALTER TABLE `asterisk`.`sccpdevice` CHANGE COLUMN `transfer` `transfer` ENUM('on','off') NULL DEFAULT NULL;
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
@ -654,6 +654,8 @@ function Setup_RealTime() {
|
|||
$cnf_int = \FreePBX::Config();
|
||||
$cnf_wr = \FreePBX::WriteConfig();
|
||||
$cnf_read = \FreePBX::LoadConfig();
|
||||
$backup_ext = array('_custom.conf', '.conf');
|
||||
|
||||
$def_config = array('sccpdevice' => 'mysql,sccp,sccpdeviceconfig', 'sccpline' => ' mysql,sccp,sccpline');
|
||||
$def_bd_config = array('dbhost' => $amp_conf['AMPDBHOST'], 'dbname' => $amp_conf['AMPDBNAME'],
|
||||
'dbuser' => $amp_conf['AMPDBUSER'], 'dbpass' => $amp_conf['AMPDBPASS'],
|
||||
|
@ -664,8 +666,13 @@ function Setup_RealTime() {
|
|||
$res_conf_sql = ini_get('pdo_mysql.default_socket');
|
||||
$res_conf = '';
|
||||
$ext_conf = '';
|
||||
if (file_exists($dir . '/extconfig.conf')) {
|
||||
$ext_conf = $cnf_read->getConfig('extconfig.conf');
|
||||
$ext_conf_file = 'extconfig.conf';
|
||||
foreach ($backup_ext as $value) {
|
||||
if (file_exists($dir . '/extconfig' . $value)) {
|
||||
$ext_conf_file = 'extconfig' . $value;
|
||||
$ext_conf = $cnf_read->getConfig($ext_conf_file);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!empty($res_conf_sql)) {
|
||||
if (file_exists($res_conf_sql)) {
|
||||
|
@ -713,7 +720,7 @@ function Setup_RealTime() {
|
|||
// $res_conf['general']['dbsock'] = $def_bd_config['dbsock'];
|
||||
$cnf_wr->writeConfig('res_config_mysql.conf', $res_conf, false);
|
||||
}
|
||||
$cnf_wr->writeConfig('extconfig.conf', $ext_conf, false);
|
||||
$cnf_wr->writeConfig($ext_conf_file, $ext_conf, false);
|
||||
}
|
||||
|
||||
CheckSCCPManagerDBTables($table_req);
|
||||
|
|
|
@ -27,9 +27,6 @@ ksort($data_sort);
|
|||
foreach ($data_sort as $key => $value) {
|
||||
$hint_list[$value] = $hint_list1[$value];
|
||||
}
|
||||
|
||||
|
||||
|
||||
//print_r($hint_list);
|
||||
//ksort($hint_list);
|
||||
//natsort($hint_list);
|
||||
|
@ -100,9 +97,9 @@ if (!empty($_REQUEST['new_id'])) {
|
|||
$defaul_tv = (empty($db_buttons[$line_id])) ? "empty": $db_buttons[$line_id]['type'];
|
||||
$defaul_btn = (empty($db_buttons[$line_id])) ? "": $db_buttons[$line_id]['name'];
|
||||
$defaul_opt = (empty($db_buttons[$line_id])) ? array(''): explode(',',$db_buttons[$line_id]['options']);
|
||||
// print_r($defaul_btn);
|
||||
// print_r($defaul_opt);
|
||||
|
||||
|
||||
$show_form_mode = $defaul_tv;
|
||||
$def_hint = '';
|
||||
$def_silent = '';
|
||||
|
@ -127,19 +124,18 @@ if (!empty($_REQUEST['new_id'])) {
|
|||
// print_r($defaul_fcod);
|
||||
}
|
||||
foreach ($defaul_opt as $data_i) {
|
||||
if (strpos($data_i,'@') >0) {
|
||||
$defaul_btn = strtok($data_i,'@');
|
||||
if (strpos($data_i,'@')>0) {
|
||||
$test_btn = strtok($data_i,'@');
|
||||
$def_hint = 'checked';
|
||||
if ($defaul_btn == $defaul_opt[0]) {
|
||||
$defaul_btn = $data_i;
|
||||
if ($test_btn == $defaul_opt[0]) {
|
||||
foreach ($lines_list as $data){
|
||||
if ($data['name']==$defaul_btn) {
|
||||
if ($data['name']==$test_btn) {
|
||||
$show_form_mode = 'line';
|
||||
$defaul_tv = 'monitor';
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$defaul_btn = $data_i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ if (empty($conf_realtime)) {
|
|||
} else {
|
||||
$rt_info = '';
|
||||
foreach ($conf_realtime as $key => $value) {
|
||||
if ($value != 'OK') {
|
||||
if (($value != 'OK') && ($key != 'extconfigfile')) {
|
||||
$rt_info .= '<div> Found error in section '.$key.' :'. $value. '</div>';
|
||||
}
|
||||
}
|
||||
|
@ -71,20 +71,19 @@ if (empty($conf_realtime)) {
|
|||
}
|
||||
}
|
||||
/*
|
||||
global $amp_conf;
|
||||
//global $amp_conf;
|
||||
print_r("<br> Request:<br><pre>");
|
||||
$json = '';
|
||||
print_r("<br>");
|
||||
//print_r($conf_realtime);
|
||||
print_r("<br>");
|
||||
print_r("<br>");
|
||||
print_r($amp_conf);
|
||||
print_r("DIRECT START");
|
||||
//print_r($amp_conf);
|
||||
// print_r("DIRECT START");
|
||||
print_r("<br>");
|
||||
// print_r($this->srvinterface->t_get_meta_data());
|
||||
//print_r($this->extconfigs->validate_RealTime());
|
||||
print("</pre>");
|
||||
print("</pre>");
|
||||
*/
|
||||
|
||||
// $lang_arr = $this->extconfigs->getextConfig('sccp_lang','sk_SK');
|
||||
// print_r('<br>');
|
||||
// print_r(timezone_identifiers_list());
|
||||
|
|
Loading…
Reference in a new issue