using System;
namespace AsterNET.FastAGI.Command
{
///
/// Returns the status of the specified channel.
/// If no channel name is given the returns the status of the current channel.
/// Return values:
///
/// - 0 Channel is down and available
/// - 1 Channel is down, but reserved
/// - 2 Channel is off hook
/// - 3 Digits (or equivalent) have been dialed
/// - 4 Line is ringing
/// - 5 Remote end is ringing
/// - 6 Line is up
/// - 7 Line is busy
///
///
public class ChannelStatusCommand : AGICommand
{
private string channel;
public string Channel
{
get
{
return channel;
}
set
{
this.channel = value;
}
}
public ChannelStatusCommand()
{
this.channel = null;
}
///
/// Creates a new ChannelStatusCommand that queries the given channel.
///
/// the name of the channel to query.
public ChannelStatusCommand(string channel)
{
this.channel = channel;
}
public override string BuildCommand()
{
return "CHANNEL STATUS" + (channel == null ? "" : " " + EscapeAndQuote(channel));
}
}
}