public class StreamFileCommand extends AbstractAgiCommand
If offset is provided then the audio will seek to sample offset before play starts.
Returns 0 if playback completes without a 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, filename follows the same conventions and uses the same file path as dialplan applications like Playback or Background. The file extension must not be included in the filename.
| Constructor and Description |
|---|
StreamFileCommand(String file)
Creates a new StreamFileCommand, streaming from the beginning.
|
StreamFileCommand(String file,
String escapeDigits)
Creates a new StreamFileCommand, streaming from the beginning.
|
StreamFileCommand(String file,
String escapeDigits,
int offset)
Creates a new StreamFileCommand, streaming from the given offset.
|
| Modifier and Type | Method and Description |
|---|---|
String |
buildCommand()
Returns a string suitable to be sent to asterisk.
|
String |
getEscapeDigits()
Returns the digits that allow the user to interrupt this command.
|
String |
getFile()
Returns the name of the file to stream.
|
int |
getOffset()
Returns the offset samples to skip before streaming.
|
void |
setEscapeDigits(String escapeDigits)
Sets the digits that allow the user to interrupt this command.
|
void |
setFile(String file)
Sets the name of the file to stream.
|
void |
setOffset(int offset)
Sets the offset samples to skip before streaming.
|
escapeAndQuote, escapeAndQuote, setAsteriskVersion, toStringpublic StreamFileCommand(String file)
file - the name of the file to stream, must not include extension.public StreamFileCommand(String file, String escapeDigits)
file - the name of the file to stream, must not include extension.escapeDigits - contains the digits that allow the user to interrupt
this command.public StreamFileCommand(String file, String escapeDigits, int offset)
file - the name of the file to stream, must not include extension.escapeDigits - contains the digits that allow the user to interrupt
this command. Maybe null if you don't want the
user to interrupt.offset - the offset samples to skip before 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 allow the user to interrupt this
command or null for none.public int getOffset()
public void setOffset(int offset)
offset - the offset samples to skip before streaming.public String buildCommand()
AgiCommandbuildCommand in interface AgiCommandbuildCommand in class AbstractAgiCommandCopyright © 2004–2020. All rights reserved.