using System;
namespace AsterNET.FastAGI.Command
{
///
/// Say a given number, returning early if any of the given DTMF number are received on the channel.
/// Returns 0 if playback completes without a digit being pressed, or the ASCII
/// numerical value of the digit if one was pressed or -1 on error/hangup.
///
public class SayNumberCommand : AGICommand
{
/// The number to say.
private string number;
/// When one of these number is pressed while streaming the command returns.
private string escapeDigits;
///
/// Get/Set the number to say.
///
public string Number
{
get { return number; }
set { this.number = value; }
}
///
/// Get/Set the number that allow the user to interrupt this command.
///
public string EscapeDigits
{
get { return escapeDigits; }
set { this.escapeDigits = value; }
}
///
/// Creates a new SayNumberCommand.
///
/// the number to say.
public SayNumberCommand(string number)
{
this.number = number;
this.escapeDigits = null;
}
///
/// Creates a new SayNumberCommand.
///
/// the number to say.
/// contains the number that allow the user to interrupt this command.
public SayNumberCommand(string number, string escapeDigits)
{
this.number = number;
this.escapeDigits = escapeDigits;
}
public override string BuildCommand()
{
return "SAY NUMBER " + EscapeAndQuote(number) + " " + EscapeAndQuote(escapeDigits);
}
}
}