namespace AsterNET.FastAGI.Command { /// /// Waits up to 'timeout' milliseconds for channel to receive a DTMF digit.
/// Returns -1 on channel failure, 0 if no digit is received in the timeout, or /// the numerical value of the ascii of the digit if one is received. Use -1 for /// the timeout value if you desire the call to block indefinitely. ///
public class WaitForDigitCommand : AGICommand { /// The milliseconds to wait for the channel to receive a DTMF digit. private long timeout; /// /// Get/Set the milliseconds to wait for the channel to receive a DTMF digit. /// public long Timeout { get { return timeout; } set { this.timeout = value; } } /// /// Creates a new WaitForDigitCommand with a default timeout of -1 which blocks the channel indefinitely. /// public WaitForDigitCommand() { this.timeout = - 1; } /// /// Creates a new WaitForDigitCommand. /// /// the milliseconds to wait for the channel to receive a DTMF digit. public WaitForDigitCommand(int timeout) { this.timeout = timeout; } public override string BuildCommand() { return "WAIT FOR DIGIT " + timeout.ToString(); } } }