$cString = $this->scheme . $this->host . ":" . $this->port;
$this->context = stream_context_create();
$errno = 0;
$errstr = "";
$this->socket = @stream_socket_client(
$cString,
$errno,
$errstr,
$this->cTimeout,
STREAM_CLIENT_CONNECT,
$this->context
);
if ($this->socket === false) {
throw new PHPAMIClientException("Error connecting to ami: " . $errstr, $errno);
}
$msg = new LoginAction($this->username, $this->password, $this->eventMask);
$asteriskId = @stream_get_line($this->socket, 1024, Message::EOL);
if (strstr($asteriskId, "Asterisk") === false) {
throw new PHPAMIClientException(
"Unknown peer. Is this an ami?: $asteriskId"
);
}
$response = $this->send($msg);
if (!$response->isSuccess()) {
throw new PHPAMIClientException(
"Could not connect: " . $response->getMessage()
);
}
@stream_set_blocking($this->socket, 0);
$this->currentProcessingMessage = "";
$this->logger->debug("Logged in successfully to ami.");
Получаю ошибку
Ошибка: Error connecting to ami: No route to host
Код: 113
С чем это связано?