net.sf.asterisk.fastagi.command
Class WaitForDigitCommand

java.lang.Object
  extended by net.sf.asterisk.fastagi.command.AGICommand
      extended by net.sf.asterisk.fastagi.command.WaitForDigitCommand
All Implemented Interfaces:
java.io.Serializable

public class WaitForDigitCommand
extends AGICommand

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.

Version:
$Id: WaitForDigitCommand.java,v 1.3 2005/11/17 17:41:35 srt Exp $
Author:
srt
See Also:
Serialized Form

Constructor Summary
WaitForDigitCommand()
          Creates a new WaitForDigitCommand with a default timeout of -1 which blocks the channel indefinitely.
WaitForDigitCommand(long timeout)
          Creates a new WaitForDigitCommand.
 
Method Summary
 java.lang.String buildCommand()
          Returns a string suitable to be sent to asterisk.
 long getTimeout()
          Returns the milliseconds to wait for the channel to receive a DTMF digit.
 void setTimeout(long timeout)
          Sets the milliseconds to wait for the channel to receive a DTMF digit.
 
Methods inherited from class net.sf.asterisk.fastagi.command.AGICommand
escapeAndQuote, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WaitForDigitCommand

public WaitForDigitCommand()
Creates a new WaitForDigitCommand with a default timeout of -1 which blocks the channel indefinitely.


WaitForDigitCommand

public WaitForDigitCommand(long timeout)
Creates a new WaitForDigitCommand.

Parameters:
timeout - the milliseconds to wait for the channel to receive a DTMF digit.
Method Detail

getTimeout

public long getTimeout()
Returns the milliseconds to wait for the channel to receive a DTMF digit.

Returns:
the milliseconds to wait for the channel to receive a DTMF digit.

setTimeout

public void setTimeout(long timeout)
Sets the milliseconds to wait for the channel to receive a DTMF digit.

Parameters:
timeout - the milliseconds to wait for the channel to receive a DTMF digit.

buildCommand

public java.lang.String buildCommand()
Description copied from class: AGICommand
Returns a string suitable to be sent to asterisk.

Specified by:
buildCommand in class AGICommand
Returns:
a string suitable to be sent to asterisk.


Copyright © 2004-2005 Stefan Reuter. All Rights Reserved.