diff --git a/page.sccpsettings.php b/page.sccpsettings.php
index ae96814..2d969c6 100644
--- a/page.sccpsettings.php
+++ b/page.sccpsettings.php
@@ -1,10 +1,12 @@
Sccp_manager;
?>
-
-
-
-
-
-
-
-
-
-
- myShowPage() as $key => $page) { ?>
-
-
-
-
-
-
- myShowPage() as $key => $page) { ?>
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ myShowPage() as $key => $page) { ?>
+
+
+
+
+
+
+ myShowPage() as $key => $page) { ?>
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/uninstall.php b/uninstall.php
index e43b4be..7dae24a 100644
--- a/uninstall.php
+++ b/uninstall.php
@@ -30,45 +30,45 @@ function CreateBackUpConfig() {
outn("
" . _("Create Config BackUp: ") . $filename ." ");
}
*/
-if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
+if (!defined('FREEPBX_IS_AUTH')) {
+ die('No direct script access allowed');
+}
global $db;
$version = FreePBX::Config()->get('ASTVERSION');
out('Remove all SCCP tables');
$tables = array('sccpdevmodel', 'sccpsettings');
- foreach ($tables as $table) {
- $sql = "DROP TABLE IF EXISTS {$table}";
- $result = $db->query($sql);
- if (DB::IsError($result)) {
- die_freepbx($result->getDebugInfo());
- }
- unset($result);
+foreach ($tables as $table) {
+ $sql = "DROP TABLE IF EXISTS {$table}";
+ $result = $db->query($sql);
+ if (DB::IsError($result)) {
+ die_freepbx($result->getDebugInfo());
+ }
+ unset($result);
+}
+if (!empty($version)) {
+ // Woo, we have a version
+ $check = $db->getRow("SELECT 1 FROM `kvstore` LIMIT 0", DB_FETCHMODE_ASSOC);
+ if (!(DB::IsError($check))) {
+ //print_r("none, creating table :". $value);
+ echo "Deleting key FROM kvstore..";
+ sql("DELETE FROM kvstore WHERE module = 'sccpsettings'");
+ sql("DELETE FROM kvstore WHERE module = 'Sccp_manager'");
}
- if (!empty($version)) {
- // Woo, we have a version
- $check = $db->getRow("SELECT 1 FROM `kvstore` LIMIT 0", DB_FETCHMODE_ASSOC);
- if (!(DB::IsError($check))) {
- //print_r("none, creating table :". $value);
- echo "Deleting key FROM kvstore..";
- sql("DELETE FROM kvstore WHERE module = 'sccpsettings'");
- sql("DELETE FROM kvstore WHERE module = 'Sccp_manager'");
- }
/* Comment: Maybe save in sccpsettings, if the chan_sccp tables already existed in the database or if they were created by install.php */
/* So that you know if it is save to drop/delete them */
/* DROP VIEW IF EXISTS`sccpdeviceconfig`;
- DROP TABLE IF EXISTS `sccpbuttonconfig`;
- DROP TABLE IF EXISTS `sccpdevice`;
- DROP TABLE IF EXISTS `sccpdevmodel`;
- DROP TABLE IF EXISTS `sccpline`;
- DROP TABLE IF EXISTS `sccpsettings`;
- DROP TABLE IF EXISTS `sccpuser`;
- *
+ DROP TABLE IF EXISTS `sccpbuttonconfig`;
+ DROP TABLE IF EXISTS `sccpdevice`;
+ DROP TABLE IF EXISTS `sccpdevmodel`;
+ DROP TABLE IF EXISTS `sccpline`;
+ DROP TABLE IF EXISTS `sccpsettings`;
+ DROP TABLE IF EXISTS `sccpuser`;
+ *
*/
- }
+}
echo "done
\n";
-
-?>
diff --git a/views/advserver.keyset.php b/views/advserver.keyset.php
index c5fa57c..7beba8c 100644
--- a/views/advserver.keyset.php
+++ b/views/advserver.keyset.php
@@ -1,6 +1,6 @@
array(sname => 'ONHOOK', name =>'Display On
- $value) {
- if ($i < 9 ){
+ if ($i < 9) {
echo ''._($value['sname']).' ';
}
$i ++;
}
-?>
+ ?>
-
+
-
+
@@ -104,48 +104,47 @@ $keynamearray = array('onhook' => array(sname => 'ONHOOK', name =>'Display On
- $value) {
- if ($i == 0) {
- echo '
';
- } else {
- echo '
';
- }
- echo '
';
+ echo ''._($keynamearray[$key]['help']).' ';
+ echo '
';
+ $i ++;
+}
?>
diff --git a/views/advserver.model.php b/views/advserver.model.php
index 55f1372..0f4806c 100644
--- a/views/advserver.model.php
+++ b/views/advserver.model.php
@@ -87,7 +87,7 @@
-
+
Phone - no sidecars.
Phone - one sidecar.
Phone - two sidecars.
@@ -204,8 +204,8 @@
diff --git a/views/hardware.sphone.php b/views/hardware.sphone.php
index f13476d..3ac35f8 100644
--- a/views/hardware.sphone.php
+++ b/views/hardware.sphone.php
@@ -80,7 +80,7 @@
if (val[0] === 'line') {
result = result + val[1] + ' ';
}
- }
+ }
return result;
}
diff --git a/views/server.advanced.php b/views/server.advanced.php
index ff276ab..2c578c8 100644
--- a/views/server.advanced.php
+++ b/views/server.advanced.php
@@ -1,6 +1,6 @@
ShowGroup('sccp_srst',1);
+ echo $this->ShowGroup('sccp_srst', 1);
// echo $this->ShowGroup('sccp_dev_time',1);
?>
diff --git a/views/server.codec.php b/views/server.codec.php
index c634921..fe1476c 100644
--- a/views/server.codec.php
+++ b/views/server.codec.php
@@ -1,6 +1,6 @@
getCodecs('audio', true);
$video_codecs = $this->getCodecs('video', true);
-$sccp_disalow_def = $this->extconfigs->getextConfig('sccpDefaults','disallow');
+$sccp_disalow_def = $this->extconfigs->getextConfig('sccpDefaults', 'disallow');
$sccp_disalow = $sccp_disalow_def;
if (!empty($_REQUEST['id'])) {
@@ -19,7 +19,7 @@ if (!empty($_REQUEST['id'])) {
$db_res = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
if (!empty($db_res['allow'])) {
$i = 1;
- foreach(explode(';', $db_res['allow']) as $c){
+ foreach (explode(';', $db_res['allow']) as $c) {
$codec_list[$c] = $i;
$i ++;
}
@@ -29,10 +29,9 @@ if (!empty($_REQUEST['id'])) {
}
}
}
- if (!empty($db_res['disallow'])) {
- $sccp_disalow = $db_res['disallow'];
- }
-
+ if (!empty($db_res['disallow'])) {
+ $sccp_disalow = $db_res['disallow'];
+ }
} else {
$codec_list = $sccp_codec;
}
diff --git a/views/server.datetime.php b/views/server.datetime.php
index 74ce58a..01288a7 100644
--- a/views/server.datetime.php
+++ b/views/server.datetime.php
@@ -1,6 +1,6 @@
ShowGroup('sccp_dev_ntp',1);
- echo $this->ShowGroup('sccp_dev_time',1);
+ echo $this->ShowGroup('sccp_dev_ntp', 1);
+ echo $this->ShowGroup('sccp_dev_time', 1);
?>
diff --git a/views/server.device.php b/views/server.device.php
index 67ea866..c305aa4 100644
--- a/views/server.device.php
+++ b/views/server.device.php
@@ -1,6 +1,6 @@
get_DialPlanList() as $value) {
$data .= $value['id'].';';
-}
+}
if (strlen($data) >0 ){
$data = substr ($data,0,-1);
}
$this->sccpvalues['dial_template'] = array('keyword' => 'dial_template', 'data' => $data, 'type' => '10', 'seq' => '90');
- *
+ *
*/
?>
diff --git a/views/server.info.php b/views/server.info.php
index bc22036..1d9c757 100644
--- a/views/server.info.php
+++ b/views/server.info.php
@@ -74,7 +74,7 @@ if (empty($ast_realtime)) {
$rt_sccp = 'SCCP ERROR';
$rt_info .= ' Error : ' . $value['message'] . '
';
}
- } else if ($value['status'] == 'ERROR') {
+ } elseif ($value['status'] == 'ERROR') {
$rt_info .= ' Found error in realtime sectoin [' . $key . '] : ' . $value['message'] . '
';
}
}
@@ -94,15 +94,15 @@ if (empty($conf_realtime)) {
$info['ConfigsRealTime'] = array('Version' => 'Error', 'about' => $rt_info);
}
}
-// $mysql_info
+// $mysql_info
if ($mysql_info['Value'] <= '2000') {
- $this->info_warning['MySql'] = Array('Increase Mysql Group Concat Max. Length', 'Step 1: Go to mysql path nano /etc/my.cnf',
+ $this->info_warning['MySql'] = array('Increase Mysql Group Concat Max. Length', 'Step 1: Go to mysql path nano /etc/my.cnf',
'Step 2: And add the following line below [mysqld] as shown below [mysqld] group_concat_max_len = 4096 or more',
'Step 3: Save and restart systemctl restart mariadb.service Or service mysqld restart');
}
-// Check Time Zone comatable
+// Check Time Zone comatable
$conf_tz = $this->sccpvalues['ntp_timezone']['data'];
$cisco_tz = $this->extconfigs->getextConfig('sccp_timezone', $conf_tz);
if ($cisco_tz['offset'] == 0) {
@@ -110,7 +110,7 @@ if ($cisco_tz['offset'] == 0) {
$tmp_dt = new DateTime(null, new DateTimeZone($conf_tz));
$tmp_ofset = $tmp_dt->getOffset();
if (($cisco_tz['offset'] != ($tmp_ofset / 60) )) {
- $this->info_warning['NTP'] = Array('The selected NTP time zone is not supported by cisco devices.', 'We will use the Greenwich Time zone');
+ $this->info_warning['NTP'] = array('The selected NTP time zone is not supported by cisco devices.', 'We will use the Greenwich Time zone');
}
}
}
@@ -121,59 +121,59 @@ global $amp_conf;
if ($test_any == 1) {
# Output option list, HTML.
-$timezone_identifiers = DateTimeZone::listIdentifiers();
-$timezone_abbreviations = DateTimeZone::listAbbreviations();
-$a = DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC );
+ $timezone_identifiers = DateTimeZone::listIdentifiers();
+ $timezone_abbreviations = DateTimeZone::listAbbreviations();
+ $a = DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC);
-$Ts_set = $a[200];
+ $Ts_set = $a[200];
// ************************************************************************************
-print_r(" Help Info:");
-print_r(" ");
+ print_r(" Help Info:");
+ print_r(" ");
//print_r(array_column($timezone_abbreviations, 'timezone_id'));
-print_r($Ts_set);
-$tz_tmp = array();
+ print_r($Ts_set);
+ $tz_tmp = array();
-foreach ($timezone_abbreviations as $subArray) {
- $dddd = array_search($Ts_set ,array_column($subArray, 'timezone_id'));
- if (!empty($dddd)) {
- $tz_tmp[] = $subArray[$dddd];
- }
-}
-
-if (empty($tz_tmp)) {
- print_r('erroe');
-}
-if (count($tz_tmp)==1) {
- $time_set = $tz_tmp[0];
-} else {
- $tmp_dt = new DateTime(null, new DateTimeZone($Ts_set));
- $tmp_ofset = $tmp_dt->getOffset();
- foreach ($tz_tmp as $subArray) {
- if ($subArray['offset'] == $tmp_ofset) {
- $time_set = $subArray;
- }
+ foreach ($timezone_abbreviations as $subArray) {
+ $dddd = array_search($Ts_set, array_column($subArray, 'timezone_id'));
+ if (!empty($dddd)) {
+ $tz_tmp[] = $subArray[$dddd];
+ }
}
-}
-
-print_r(" ");
-//print_r($time_set);
-print_r($this->sccpvalues['ntp_timezone']);
-//print_r($tz_tmp);
-print_r(" ");
-print_r(" ");
-print_r(" ");
+ if (empty($tz_tmp)) {
+ print_r('erroe');
+ }
+ if (count($tz_tmp)==1) {
+ $time_set = $tz_tmp[0];
+ } else {
+ $tmp_dt = new DateTime(null, new DateTimeZone($Ts_set));
+ $tmp_ofset = $tmp_dt->getOffset();
+ foreach ($tz_tmp as $subArray) {
+ if ($subArray['offset'] == $tmp_ofset) {
+ $time_set = $subArray;
+ }
+ }
+ }
+
+ print_r(" ");
+//print_r($time_set);
+ print_r($this->sccpvalues['ntp_timezone']);
+//print_r($tz_tmp);
+ print_r(" ");
+ print_r(" ");
+
+ print_r(" ");
//print_r($timezone_abbreviations);
//print_r($timezone_identifiers);
//print_r($timezone);
//print_r($transitions);
-print_r(" ");
-print_r(" ");
+ print_r(" ");
+ print_r(" ");
// print_r("DIRECT START");
// print_r($this->sccpvalues['ccm_address']);
//print_r($this->get_php_classes('\\FreePBX\\modules'));
@@ -211,24 +211,24 @@ print_r("");
// $a = new \FreePBX\modules\Sccp_manager\aminterface\SCCPConfigMetaDataAction();
// $response = $this->aminterface->send($a);
//
-// $response = $this->aminterface->getRealTimeStatus();
+// $response = $this->aminterface->getRealTimeStatus();
// $time_get_a = microtime_float();
// print_r($response);
// $tmp_data = $this->aminterface->core_sccp_reload();
// print_r($tmp_data);
// print_r($response -> getResult());
-// $events = $response->getEvents();
+// $events = $response->getEvents();
// $events = $response->Events2Array();
-//
+//
// print_r($events);
-// print_r('--- RESULT A -----------------');
+// print_r('--- RESULT A -----------------');
// $b = $this->oldinterface->sccp_realtime_status();
// print_r($b);
// $b = $this->srvinterface->sccp_realtime_status();
// print_r($response->getMessage());
// print_r($a);
// $events = $response ->getTableNames();
-// $events = $response->getEvents();
+// $events = $response->getEvents();
// print_r($events);
// $b = $response->Table2Array($events[0]);
// $b = $response->getResult();
@@ -245,9 +245,9 @@ print_r("");
/* Test Ok
*
- *
*
- *
+ *
+ *
*/
if ($test_ami == 1) {
$time_ami = 0;
@@ -402,7 +402,7 @@ if ($test_ami == 1) {
// print_r($events);
//$b = $response->Table2Array($events[0]);
//$b = $response->getResult();
-// print_r('--- RESULT 2 ----------------- ');
+// print_r('--- RESULT 2 ----------------- ');
//print_r($events);
// print_r($b);
// $ser = serialize($response);
@@ -414,14 +414,14 @@ if ($test_ami == 1) {
$this->assertEquals($events[0]->getName(), 'CoreShowChannelsComplete');
$this->assertEquals($events[0]->getListItems(), 0);
*/
-// print_r('--- RESULT 3 -----------------');
+// print_r('--- RESULT 3 -----------------');
// print_r($a);
-// print_r('--- С RESULT -----------------');
+// print_r('--- С RESULT -----------------');
// print_r($this->aminterface::SCCPShowDevicesAction());
-//
+//
// print_r($this->aminterface->close());
-//
-//
+//
+//
//print_r($this->dbinterface->get_db_SccpTableData('SccpExtension'));
// print_r($this->srvinterface->getеtestChanSCC());
// $test_data = $this->srvinterface-> astman_GetRaw('ExtensionStateList');
@@ -436,7 +436,7 @@ if ($test_ami == 1) {
print(" ");
/* */
// ************************************************************************************
-// $lang_arr = $this->extconfigs->getextConfig('sccp_lang','sk_SK');
+// $lang_arr = $this->extconfigs->getextConfig('sccp_lang','sk_SK');
// print_r(' ');
// print_r(timezone_identifiers_list());
// print_r(' ');
@@ -468,7 +468,7 @@ if (!empty($this->info_warning)) {
-class_error)) {
@@ -488,7 +488,7 @@ if (!empty($this->class_error)) {