public class GetDataCommand extends AbstractAgiCommand
Returns the digits recieved from the channel at the other end.
Input ends when the timeout is reached, the maximum number of digits is read or the user presses #.
| Constructor and Description |
|---|
GetDataCommand(String file)
Creates a new GetDataCommand with default timeout and maxDigits set to
1024.
|
GetDataCommand(String file,
long timeout)
Creates a new GetDataCommand with the given timeout and maxDigits set to
1024.
|
GetDataCommand(String file,
long timeout,
int maxDigits)
Creates a new GetDataCommand with the given timeout and maxDigits.
|
| Modifier and Type | Method and Description |
|---|---|
String |
buildCommand()
Returns a string suitable to be sent to asterisk.
|
String |
getFile()
Returns the name of the file to stream.
|
int |
getMaxDigits()
Returns the maximum number of digits to read.
|
long |
getTimeout()
Returns the timeout to wait for data.
|
void |
setFile(String file)
Sets the name of the file to stream.
|
void |
setMaxDigits(int maxDigits)
Sets the maximum number of digits to read.
|
void |
setTimeout(long timeout)
Sets the timeout to wait for data.
|
escapeAndQuote, escapeAndQuote, setAsteriskVersion, toStringpublic GetDataCommand(String file)
file - the name of the file to stream, must not include extension.public GetDataCommand(String file, long timeout)
file - the name of the file to stream, must not include extension.timeout - the timeout in milliseconds to wait for data.
0 means standard timeout value, -1 means "ludicrous time" (essentially never times out).
public GetDataCommand(String file, long timeout, int maxDigits) throws IllegalArgumentException
file - the name of the file to stream, must not include extension.timeout - the timeout in milliseconds to wait for data.
0 means standard timeout value, -1 means "ludicrous time" (essentially never times out).
maxDigits - the maximum number of digits to read.
Must be in [1..1024].
IllegalArgumentException - if maxDigits is not in [1..1024]public String getFile()
public void setFile(String file)
This attribute is mandatory.
file - the name of the file to stream, must not include extension.public long getTimeout()
public void setTimeout(long timeout)
timeout - the timeout in milliseconds to wait for data.
0 means standard timeout value, -1 means "ludicrous time" (essentially never times out).
public int getMaxDigits()
public void setMaxDigits(int maxDigits)
throws IllegalArgumentException
maxDigits - the maximum number of digits to read.
Must be in [1..1024].
IllegalArgumentException - if maxDigits is not in [1..1024]public String buildCommand()
AgiCommandbuildCommand in interface AgiCommandbuildCommand in class AbstractAgiCommandCopyright © 2004–2022. All rights reserved.