Asterisk-Java

org.asteriskjava.fastagi.command
Class ReceiveCharCommand

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

public class ReceiveCharCommand
extends AbstractAgiCommand

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 938 2007-12-31 03:23:38Z srt $
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 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

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 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.