public class ControlStreamFileCommand extends AbstractAgiCommand
Send the given file, allowing playback to be controlled by the given digits, if any. Use double quotes for the digits if you wish none to be permitted. If offsetms is provided then the audio will seek to offsetms 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. Returns the position where playback was terminated as endpos.
| Constructor and Description |
|---|
ControlStreamFileCommand(String file)
Creates a new ControlStreamFileCommand, streaming from the beginning.
|
ControlStreamFileCommand(String file,
String escapeDigits)
Creates a new ControlStreamFileCommand, streaming from the beginning.
|
ControlStreamFileCommand(String file,
String escapeDigits,
int offset)
Creates a new ControlStreamFileCommand, streaming from the given offset.
|
ControlStreamFileCommand(String file,
String escapeDigits,
int offset,
String forwardDigit,
String rewindDigit,
String pauseDigit)
Creates a new ControlStreamFileCommand, 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.
|
String |
getForwardDigit()
Returns the digit for fast-forward.
|
int |
getOffset()
Returns the offset samples to skip before streaming.
|
String |
getPauseDigit()
Retruns the digit for pause and unpause.
|
String |
getRewindDigit()
Returns the digit for rewind.
|
void |
setControlDigits(String forwardDigit,
String rewindDigit)
Sets the control digits for fast-forward and rewind.
|
void |
setControlDigits(String forwardDigit,
String rewindDigit,
String pauseDigit)
Sets the control digits for fast-forward, rewind and pause.
|
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 ControlStreamFileCommand(String file)
file - the name of the file to stream, must not include extension.public ControlStreamFileCommand(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 ControlStreamFileCommand(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.
May be null if you don't want the user to interrupt.offset - the offset samples to skip before streaming.public ControlStreamFileCommand(String file, String escapeDigits, int offset, String forwardDigit, String rewindDigit, String pauseDigit)
file - the name of the file to stream, must not include extension.escapeDigits - contains the digits that allow the user to interrupt this command.
May be null if you don't want the user to interrupt.offset - the offset samples to skip before streaming.forwardDigit - the digit for fast-forward.rewindDigit - the digit for rewind.pauseDigit - the digit for pause and unpause.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 getForwardDigit()
public String getRewindDigit()
public String getPauseDigit()
public void setControlDigits(String forwardDigit, String rewindDigit)
forwardDigit - the digit for fast-forward.rewindDigit - the digit for rewind.public void setControlDigits(String forwardDigit, String rewindDigit, String pauseDigit)
forwardDigit - the digit for fast-forward.rewindDigit - the digit for rewind.pauseDigit - the digit for pause and unpause.public String buildCommand()
AgiCommandbuildCommand in interface AgiCommandbuildCommand in class AbstractAgiCommandCopyright © 2004–2022. All rights reserved.