Remove unused variables
Close socket if not using
This commit is contained in:
steve-lad 2021-03-12 14:40:31 +01:00
parent d5290f18cf
commit 0f9ebb8cd1
3 changed files with 8 additions and 4 deletions

View file

@ -23,7 +23,6 @@ abstract class Response extends IncomingMessage
{ {
parent::__construct($rawContent); parent::__construct($rawContent);
$this->_events = array(); $this->_events = array();
$this->_eventsCount = 0;
$this->_completed = $this->isSuccess(); $this->_completed = $this->isSuccess();
} }

View file

@ -52,11 +52,17 @@ class srvinterface {
} }
} }
if ($this->aminterface->status()) { 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()) { if ($this->aminterface->open()) {
// Can open a connection. Now check compatibility with chan-sccp. // Can open a connection. Now check compatibility with chan-sccp.
// will return true if compatible. // 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;
}
} }
} }
} }

View file

@ -18,7 +18,6 @@ global $version;
global $srvinterface; global $srvinterface;
global $mobile_hw; global $mobile_hw;
$mobile_hw = '0'; $mobile_hw = '0';
global $useAmiInterface;
$class = "\\FreePBX\\Modules\\Sccp_manager\\srvinterface"; $class = "\\FreePBX\\Modules\\Sccp_manager\\srvinterface";
if (!class_exists($class, false)) { if (!class_exists($class, false)) {