public function Run($clicmd)
 {
     if ($this->Socket == null) {
         throw new Exception("Couldn't send query to Asterisk Manager. Null Socket.", constant("AERR_INVALID_SOCKET"));
     }
     $query = new AsteriskManagerMessage();
     $query->SetKey('Action', 'Command');
     $query->SetKey('Command', $clicmd);
     fputs($this->Socket, $query->ToString());
     $chunk_no = 0;
     $resp = "";
     do {
         $chunk = fgets($this->Socket);
         $info = stream_get_meta_data($this->Socket);
         if ($chunk_no > 2) {
             if ($chunk != "--END COMMAND--\r\n") {
                 $resp .= $chunk;
             }
         }
         $chunk_no++;
     } while ($chunk != "\r\n" && $info != "timed_out");
     return $resp;
 }