Asterisk-Java

org.asteriskjava.fastagi.command
Class WaitForDigitCommand

java.lang.Object
  extended by org.asteriskjava.fastagi.command.AbstractAgiCommand
      extended by org.asteriskjava.fastagi.command.WaitForDigitCommand
All Implemented Interfaces:
java.io.Serializable, AgiCommand

public class WaitForDigitCommand
extends AbstractAgiCommand

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 938 2007-12-31 03:23:38Z srt $
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 org.asteriskjava.fastagi.command.AbstractAgiCommand
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 interface: AgiCommand
Returns a string suitable to be sent to asterisk.

Specified by:
buildCommand in interface AgiCommand
Specified by:
buildCommand in class AbstractAgiCommand
Returns:
a string suitable to be sent to asterisk.

Asterisk-Java

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