net.sf.asterisk.fastagi.command
Class ReceiveCharCommand

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

public class ReceiveCharCommand
extends AGICommand

Receives a character of text on a channel.
Specify timeout to be the maximum time to wait for input in milliseconds, or 0 for infinite.
Most channels do not support the reception of text.
Returns the decimal value of the character if one is received, or 0 if the channel does not support text reception. Returns -1 only on error/hangup.

Version:
$Id: ReceiveCharCommand.java,v 1.2 2005/03/08 16:48:34 srt Exp $
Author:
srt
See Also:
Serialized Form

Constructor Summary
ReceiveCharCommand()
          Creates a new ReceiveCharCommand with a default timeout of 0 meaning to wait for ever.
ReceiveCharCommand(int timeout)
          Creates a new ReceiveCharCommand.
 
Method Summary
 java.lang.String buildCommand()
          Returns a string suitable to be sent to asterisk.
 int getTimeout()
          Returns the milliseconds to wait for the channel to receive a character.
 void setTimeout(int timeout)
          Sets the milliseconds to wait for the channel to receive a character.
 
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

ReceiveCharCommand

public ReceiveCharCommand()
Creates a new ReceiveCharCommand with a default timeout of 0 meaning to wait for ever.


ReceiveCharCommand

public ReceiveCharCommand(int timeout)
Creates a new ReceiveCharCommand.

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

getTimeout

public int getTimeout()
Returns the milliseconds to wait for the channel to receive a character.

Returns:
the milliseconds to wait for the channel to receive a character.

setTimeout

public void setTimeout(int timeout)
Sets the milliseconds to wait for the channel to receive a character.

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

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.