using System; namespace AsterNET.FastAGI.Command { /// Say a given character 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 SayAlphaCommand : AGICommand { /// The text to say. private string text; /// When one of these digits is pressed the command returns. private string escapeDigits; /// /// Get/Set Returns the text to say. /// public string Text { get { return text; } set { this.text = value; } } /// /// Get/Set the digits that allow the user to interrupt this command. /// public string EscapeDigits { get { return escapeDigits; } set { this.escapeDigits = value; } } /// /// Creates a new SayAlphaCommand. /// /// the text to say. public SayAlphaCommand(string text) { this.text = text; this.escapeDigits = null; } /// /// Creates a new SayAlphaCommand. /// /// the text to say. /// contains the digits that allow the user to interrupt this command. public SayAlphaCommand(string text, string escapeDigits) { this.text = text; this.escapeDigits = escapeDigits; } public override string BuildCommand() { return "SAY ALPHA " + EscapeAndQuote(text) + " " + EscapeAndQuote(escapeDigits); } } }