public function close()
{
$this->logger->debug('Closing connection to asterisk.');
@stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
}
/** * Disconnect from the Asterisk Manager Interface. * * @return $this */ public function disconnect() { $results = $this->getEventManager()->trigger(__FUNCTION__ . '.pre', $this); if ($results->stopped()) { return $this; } $this->connection->close(); $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this); return $this; }