diff --git a/Sccp_manager.inc/aminterface/Response.class.php b/Sccp_manager.inc/aminterface/Response.class.php index f7e30ed..6ec86d4 100644 --- a/Sccp_manager.inc/aminterface/Response.class.php +++ b/Sccp_manager.inc/aminterface/Response.class.php @@ -23,7 +23,6 @@ abstract class Response extends IncomingMessage { parent::__construct($rawContent); $this->_events = array(); - $this->_eventsCount = 0; $this->_completed = $this->isSuccess(); } diff --git a/Sccp_manager.inc/srvinterface.class.php b/Sccp_manager.inc/srvinterface.class.php index 84302ee..982ecb1 100644 --- a/Sccp_manager.inc/srvinterface.class.php +++ b/Sccp_manager.inc/srvinterface.class.php @@ -52,11 +52,17 @@ class srvinterface { } } if ($this->aminterface->status()) { - // Ami is not hard disabled in Amiinterface __construct 54. + // Ami is not hard disabled in Amiinterface __construct line 54. if ($this->aminterface->open()) { // Can open a connection. Now check compatibility with chan-sccp. // will return true if compatible. - $this->ami_mode = $this->get_compatible_sccp(true)[1]; + if (!$this->get_compatible_sccp(true)[1]) { + // Close the open socket as will not use + $this->aminterface->close(); + } else { + // is compatible so enable AMI mode + $this->ami_mode = true; + } } } } diff --git a/install.php b/install.php index 72e3f1d..88f3b74 100644 --- a/install.php +++ b/install.php @@ -18,7 +18,6 @@ global $version; global $srvinterface; global $mobile_hw; $mobile_hw = '0'; -global $useAmiInterface; $class = "\\FreePBX\\Modules\\Sccp_manager\\srvinterface"; if (!class_exists($class, false)) {