using System; namespace AsterNET.FastAGI.Command { /// /// Hangs up the specified channel. If no channel name is given, hangs up the current channel. /// public class HangupCommand : AGICommand { /// /// The name of the channel to hangup or null for the current channel. /// private string channel; /// /// Returns the name of the channel to hangup. /// /// the name of the channel to hangup or null for the current channel. /// Sets the name of the channel to hangup. /// the name of the channel to hangup or null for the current channel. public string Channel { get { return channel; } set { this.channel = value; } } /// Creates a new HangupCommand that hangs up the current channel. public HangupCommand() { this.channel = null; } /// /// Creates a new HangupCommand that hangs up the given channel. /// /// the name of the channel to hangup. public HangupCommand(string channel) { this.channel = channel; } public override string BuildCommand() { return "HANGUP" + (channel == null ? "" : " " + EscapeAndQuote(channel)); } } }