using System; namespace AsterNET.FastAGI.Command { /// /// Say a given digit string, returning early if any of the given DTMF digits 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 SayDigitsCommand : AGICommand { #region Variables /// The digits string to say. private string digits; /// When one of these digits is pressed while saying the digits the command returns. private string escapeDigits; #endregion #region Digits /// /// Get/Set the digits string to say. /// public string Digits { get { return digits; } set { this.digits = value; } } #endregion #region EscapeDigits /// /// Get/Set the digits that allow the user to interrupt this command. /// public string EscapeDigits { get { return escapeDigits; } set { this.escapeDigits = value; } } #endregion #region Constructor - SayDigitsCommand(string digits) /// /// Creates a new SayDigitsCommand. /// /// the digits to say. public SayDigitsCommand(string digits) { this.digits = digits; this.escapeDigits = null; } #endregion #region Constructor - SayDigitsCommand(string digits, string escapeDigits) /// /// Creates a new SayDigitsCommand. /// /// the digits to say. /// the digits that allow the user to interrupt this command. public SayDigitsCommand(string digits, string escapeDigits) { this.digits = digits; this.escapeDigits = escapeDigits; } #endregion #region BuildCommand() public override string BuildCommand() { return "SAY DIGITS " + EscapeAndQuote(digits) + " " + EscapeAndQuote(escapeDigits); } #endregion } }