Subversion Repositories general

Compare Revisions

Regard whitespace Rev 1390 → Rev 1391

/asterisk-stats/trunk/includes/AsteriskManager/AsteriskManager.php
135,10 → 135,11
* its reponse. Any failure in writing or reading will raise an exception.
*
* @param string $command The command to send
* @param int $wait_timeout Number of seconds to wait for some response, default 5 seconds
*
* @return string
*/
private function _sendCommand($command)
private function _sendCommand($command, $wait_timeout = 5)
{
if (!fwrite($this->_socket, $command)) {
throw new Net_AsteriskManagerException(
146,7 → 147,9
);
}
 
for($count = 0; !$response && $count < $wait_timeout; ++$count, sleep(1)) {
$response = stream_get_contents($this->_socket);
}
 
if ($response == false) {
throw new Net_AsteriskManagerException(