public class GetOptionCommand extends AbstractAgiCommand
Returns 0 if no digit being pressed, or the ASCII numerical value of the
digit if one was pressed, or -1 on error or if the channel was disconnected.
Remember, the file extension must not be included in the filename.
StreamFileCommand,
Serialized Form| Constructor and Description |
|---|
GetOptionCommand(String file,
String escapeDigits)
Creates a new GetOptionCommand with a default timeout of 5 seconds.
|
GetOptionCommand(String file,
String escapeDigits,
long timeout)
Creates a new GetOptionCommand with the given timeout.
|
| Modifier and Type | Method and Description |
|---|---|
String |
buildCommand()
Returns a string suitable to be sent to asterisk.
|
String |
getEscapeDigits()
Returns the digits that the user is expected to press.
|
String |
getFile()
Returns the name of the file to stream.
|
long |
getTimeout()
Returns the timeout to wait if none of the defined esacpe digits was
presses while streaming.
|
void |
setEscapeDigits(String escapeDigits)
Sets the digits that the user is expected to press.
|
void |
setFile(String file)
Sets the name of the file to stream.
|
void |
setTimeout(long timeout)
Sets the timeout to wait if none of the defined esacpe digits was presses
while streaming.
|
escapeAndQuote, escapeAndQuote, setAsteriskVersion, toStringpublic GetOptionCommand(String file, String escapeDigits)
file - the name of the file to stream, must not include extension.escapeDigits - contains the digits that the user is expected to
press.public GetOptionCommand(String file, String escapeDigits, long timeout)
file - the name of the file to stream, must not include extension.escapeDigits - contains the digits that the user is expected to
press.timeout - the timeout in milliseconds to wait if none of the defined
esacpe digits was presses while streaming.public String getFile()
public void setFile(String file)
file - the name of the file to stream, must not include extension.public String getEscapeDigits()
public void setEscapeDigits(String escapeDigits)
escapeDigits - the digits that the user is expected to press.public long getTimeout()
public void setTimeout(long timeout)
timeout - the timeout in milliks,seconds.public String buildCommand()
AgiCommandbuildCommand in interface AgiCommandbuildCommand in class AbstractAgiCommandCopyright © 2004–2022. All rights reserved.