public void SendCommand(Command.AGICommand command) { string buffer = command.BuildCommand() + "\n"; try { socket.Write(buffer); } catch (IOException e) { throw new AGINetworkException("Unable to send command to Asterisk: " + e.Message, e); } }
/// <summary> /// Sends the given command to the channel attached to the current thread. /// </summary> /// <param name="command">the command to send to Asterisk</param> /// <returns> the reply received from Asterisk</returns> /// <throws> AGIException if the command could not be processed properly </throws> private AGIReply SendCommand(Command.AGICommand command) { return(this.Channel.SendCommand(command)); }