public interface Telephony extends ExternalResource
Objects that implement this interface are able to support making a third party connection through a communications network, such as the telephone.
In fact this is a bridge to use speech synthesis (via
SynthesizedOutput and spoken input (via SpokenInput on a
client, which may be a PBX. Hence, it is able to handle the communication
between the client and the JVoiceXML server. The architecture is kept open at
this point so that it is also possible to hook other clients, like the
console or a PDA.
It is guaranteed that the session remains the same between the calls to
RemoteConnectable.connect(org.jvoicexml.ConnectionInformation)
and
RemoteConnectable.disconnect(org.jvoicexml.ConnectionInformation).
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(TelephonyListener listener)
Adds the given listener to the list of known listeners.
|
javax.sound.sampled.AudioFormat |
getRecordingAudioFormat()
Retrieves the audio format that should be used for file recording.
|
void |
hangup()
Hangs up the current call.
|
boolean |
isActive()
Checks if this instance can actively be used to play back output or
record input.
|
void |
play(SynthesizedOutput output,
CallControlProperties props)
Plays a stream from the given output device.
|
void |
record(SpokenInput input,
CallControlProperties props)
Starts recording to the given input device.
|
void |
removeListener(TelephonyListener listener)
Removes the given listener from the list of known listeners.
|
void |
startRecording(SpokenInput input,
java.io.OutputStream stream,
CallControlProperties props)
Starts recording to the given output stream.
|
void |
stopPlay()
Stops a previously started play.
|
void |
stopRecording()
Stops a previously started recording, e.g. after a recognition process
has been stopped.
|
void |
transfer(java.lang.String dest)
Transfers the current call.
|
activate, close, getType, isBusy, open, passivateconnect, disconnectvoid play(SynthesizedOutput output, CallControlProperties props) throws NoresourceError, java.io.IOException
SystemOutput.queueSpeakable(org.jvoicexml.SpeakableText, String, org.jvoicexml.DocumentServer)
to prepare streaming from the synthesizer. Implementations may use this,
method, e.g., to propagate OutputStreams to the
SystemOutput implementation.
The play method is expected to run asynchronously.
output - the output device delivering the output.props - parameters to use for playing.NoresourceError - Error accessing the terminaljava.io.IOException - Error accessing the given URI.void stopPlay()
throws NoresourceError
NoresourceError - Error accessing the terminalvoid record(SpokenInput input, CallControlProperties props) throws NoresourceError, java.io.IOException
InputDevice.startRecognition(org.jvoicexml.interpreter.datamodel.DataModel, org.jvoicexml.SpeechRecognizerProperties, org.jvoicexml.DtmfRecognizerProperties)
to prepare streaming to the recognizer. Implementations may use this,
method, e.g., to propagate InputStreams to the
SpokenInput implementation.input - input device to use for recording.props - parameters to use for the recording.NoresourceError - Error accessing the terminaljava.io.IOException - Error accessing the given URI.javax.sound.sampled.AudioFormat getRecordingAudioFormat()
void startRecording(SpokenInput input, java.io.OutputStream stream, CallControlProperties props) throws NoresourceError, java.io.IOException
input - input device that can be used in parallel to recognize the
input.stream - the stream where to send the recorded audio to.props - parameters to use for the recording.NoresourceError - Error accessing the terminaljava.io.IOException - Error accessing the given URI.void stopRecording()
throws NoresourceError
NoresourceError - Error accessing the terminalvoid transfer(java.lang.String dest)
throws NoresourceError
dest - Platform specific destination addressNoresourceError - Error transferring the call.boolean isActive()
true if this instance is activevoid hangup()
void addListener(TelephonyListener listener)
listener - TelephonyListenervoid removeListener(TelephonyListener listener)
listener - TelephonyListener