/** * (non-PHPdoc) * @see ClientImpl::send() */ protected function send($text) { if ($this->_logger->isDebugEnabled()) { $this->_logger->debug('Sending: ' . $text); } $this->_lastCommandId = uniqid(__CLASS__); $action = new \PAMI\Message\Action\AGIAction($this->_channel, $text, $this->_lastCommandId); $this->_lastAgiResult = false; $this->_pamiClient->send($action); while ($this->_lastAgiResult === false) { $this->_pamiClient->process(); usleep(1000); } return $this->getResultFromResultString($this->_lastAgiResult); }
/** * (non-PHPdoc) * @see ClientImpl::send() */ protected function send($text) { $this->logger->debug('Sending: ' . $text); $this->lastCommandId = uniqid(__CLASS__); $action = new \PAMI\Message\Action\AGIAction($this->channel, $text, $this->lastCommandId); $this->lastAgiResult = false; $response = $this->pamiClient->send($action); if (!$response->isSuccess()) { throw new \PAGI\Exception\ChannelDownException($response->getMessage()); } while ($this->lastAgiResult === false) { $this->pamiClient->process(); usleep(1000); } return $this->getResultFromResultString($this->lastAgiResult); }