diff --git a/Sccp_manager.inc/aminterface.class.php b/Sccp_manager.inc/aminterface.class.php
index 8d8b053..54aa095 100644
--- a/Sccp_manager.inc/aminterface.class.php
+++ b/Sccp_manager.inc/aminterface.class.php
@@ -30,7 +30,10 @@ class aminterface
{
$driverNamespace = "\\FreePBX\\Modules\\Sccp_manager\\aminterface";
- $drivers = array('Message' => 'Message.class.php', 'Response' => 'Response.class.php', 'Event' => 'Event.class.php');
+ $drivers = array('Message' => 'Message.class.php',
+ 'Response' => 'Response.class.php',
+ 'Event' => 'Event.class.php'
+ );
foreach ($drivers as $key => $value) {
$class = $driverNamespace . "\\" . $key;
$driver = __DIR__ . "/aminterface/" . $value;
@@ -51,7 +54,14 @@ class aminterface
$this->_socket = false;
$this->_connect_state = false;
$this->_error = array();
- $this->_config = array('host' => 'localhost', 'user' => '', 'pass' => '', 'port' => '5038', 'tsoket' => 'tcp://', 'timeout' => 30, 'enabled' => true);
+ $this->_config = array('host' => 'localhost',
+ 'user' => '',
+ 'pass' => '',
+ 'port' => '5038',
+ 'tsoket' => 'tcp://',
+ 'timeout' => 30,
+ 'enabled' => true
+ );
$this->_eventListeners = array();
$this->_incomingMsgObjectList = array();
$this->_lastActionId = false;
@@ -70,31 +80,19 @@ class aminterface
$this->load_subspace();
}
- if ($this->status()) {
- // Ami is not hard disabled in Amiinterface __construct line 54.
+ if ($this->_config['enabled'] {
+ // Ami is not hard disabled in __construct line 63.
if ($this->open()) {
// Can open a connection. Now check compatibility with chan-sccp.
// will return true if compatible.
if (!$this->get_compatible_sccp(true)[1]) {
// Close the open socket as will not use
$this->close();
- } else {
- // is compatible so enable AMI mode
- $this->ami_mode = true;
}
}
}
}
- public function status()
- {
- if ($this->_config['enabled']) {
- return true;
- } else {
- return false;
- }
- }
-
public function info()
{
$Ver = '13.0.4';
diff --git a/install.php b/install.php
index 966848d..3238bfa 100644
--- a/install.php
+++ b/install.php
@@ -1149,7 +1149,7 @@ InstallDB_CreateSccpDeviceConfigView($sccp_compatible);
InstallDB_updateDBVer($sccp_compatible);
if ($chanSCCPWarning) {
outn("
");
- outn("Warning: Upgrade chan_sccp_b to use full ami functionality");
+ outn("Error: installed version of chan-sccp is not compatible. Please upgrade chan-sccp");
}
if (!$sccp_db_ver) {
Setup_RealTime();
diff --git a/views/server.info.php b/views/server.info.php
index 0f80e2e..c338ed2 100644
--- a/views/server.info.php
+++ b/views/server.info.php
@@ -35,7 +35,11 @@ $info['dbinterface'] = $this->dbinterface->info();
$info['aminterface'] = $this->aminterface->info();
$info['XML'] = $this->xmlinterface->info();
$info['sccp_class'] = $driver['sccp'];
-$info['Core_sccp'] = array('Version' => $core['Version'], 'about' => 'Sccp ver.' . $core['Version'] . ' r' . $core['vCode'] . ' Revision :' . $core['RevisionNum'] . ' Hash :' . $core['RevisionHash']);
+$info['Core_sccp'] = array('Version' => $core['Version'],
+ 'about' => 'Sccp ver.' . $core['Version'] .
+ ' r' . $core['vCode'] . ' Revision :' .
+ $core['RevisionNum'] . ' Hash :' .
+ $core['RevisionHash']);
/*
if (!$this->srvinterface->useAmiInterface) {
$info['aminterface']['about'] .= ' -- Disabled';
@@ -125,12 +129,6 @@ if ($cisco_tz['offset'] == 0) {
}
}
}
-/* Test Ok
- *
- *
- *
- *
- */
if (!empty($this->info_warning)) {
?>