JSR-043: JTAPI-1.4

javax.telephony.media
Class BasicMediaService

java.lang.Object
  |
  +--javax.telephony.media.provider.Base_Owner
        |
        +--javax.telephony.media.provider.Base_MediaService
              |
              +--javax.telephony.media.BasicMediaService
All Implemented Interfaces:
Async_Delegation, Async_Player, Async_Recorder, Async_SignalDetector, Async_SignalGenerator, Async_TTSPlayer, Async.MediaService, CoderConstants, Delegation, DelegationConstants, MediaConstants, MediaService, MediaServiceConstants, MPI.Owner, Player, PlayerConstants, Recorder, RecorderConstants, Resource, ResourceConstants, SignalConstants, SignalDetector, SignalDetectorConstants, SignalGenerator, SignalGeneratorConstants, TTSPlayer

public class BasicMediaService
extends Base_MediaService
implements MediaService, TTSPlayer, Recorder, SignalDetector, SignalGenerator, Async.MediaService, Async_TTSPlayer, Async_Recorder, Async_SignalDetector, Async_SignalGenerator

Implements MediaService and the basic Resource interfaces. Resource methods are delegated to the bound MediaGroup.

This class understands about binding and configuration, and knows how to delegate resource methods to whatever object or objects are bound to this one. And conversely understand how to register Listeners for each resource, and dispatch events from any of the resources to all of the Resource.Listeners.

The Resource methods in BasicMediaService are documented in the associated Resource interface definition.

Note: This class is documented as extending Base_MediaService. However, actual implementations may extend some other vendor specific class. In all cases, this class (or one of its super-classes) implements MediaService and the defined Resource interfaces.

Since:
JTAPI-1.3

Fields inherited from interface javax.telephony.media.MediaServiceConstants
ev_BindAndConnect, ev_BindToCall, ev_BindToServiceName, ev_BindToTerminal, ev_BindToTerminalName, ev_Configure, ev_Connected, ev_DelegateToService, ev_Disconnected, ev_GetConfigSpec, ev_GetConfiguration, ev_GetParameters, ev_GetTerminal, ev_GetTerminalName, ev_GetUserValues, ev_GroupStop, ev_Release, ev_ReleaseDelegated, ev_ReleaseToDestroy, ev_ReleaseToService, ev_ReleaseToTag, ev_Retrieve, ev_Retrieved, ev_SetParameters, ev_SetUserDictionary, ev_SetUserValues, ev_TerminalIdle, ev_TriggerRTC
 
Fields inherited from interface javax.telephony.media.MediaConstants
e_OK, q_Duration, q_Standard, q_Stop
 
Fields inherited from interface javax.telephony.media.ResourceConstants
e_Disconnected, FOREVER, q_Disconnected, q_RTC, rtcc_Disconnected, rtcc_TriggerRTC, v_Forever
 
Fields inherited from interface javax.telephony.media.PlayerConstants
a_Coder, a_DictionaryList, a_Jump, a_LoadedDictionary, a_Pause, a_SapiOptions, a_Speed, a_Volume, e_Busy, ev_ActivateDictionary, ev_AdjustSpeed, ev_AdjustVolume, ev_Jump, ev_LoadDictionary, ev_Marker, ev_Pause, ev_Play, ev_Resume, ev_Speed, ev_Stop, ev_UnloadDictionary, ev_Volume, p_CoderTypes, p_EnabledEvents, p_IfBusy, p_JumpMDO, p_JumpMDOIncrement, p_JumpMSCIncrement, p_JumpSentence, p_JumpTime, p_JumpWord, p_MaxDuration, p_SpeedChange, p_StartPaused, p_VolumeChange, q_Duration, q_EndOfData, rtca_JumpBackwardMDOs, rtca_JumpBackwardMSCs, rtca_JumpBackwardSentences, rtca_JumpBackwardTime, rtca_JumpBackwardWords, rtca_JumpEndMDO, rtca_JumpEndMDOList, rtca_JumpEndMSC, rtca_JumpEndMSCList, rtca_JumpEndSentence, rtca_JumpForwardMDOs, rtca_JumpForwardMSCs, rtca_JumpForwardSentences, rtca_JumpForwardTime, rtca_JumpForwardWords, rtca_JumpStartMDO, rtca_JumpStartMDOList, rtca_JumpStartMSC, rtca_JumpStartMSCList, rtca_JumpStartSentence, rtca_NormalSpeed, rtca_NormalVolume, rtca_Pause, rtca_Resume, rtca_SpeedDown, rtca_SpeedUp, rtca_Stop, rtca_ToggleSpeed, rtca_ToggleVolume, rtca_VolumeDown, rtca_VolumeUp, rtcc_PlayComplete, rtcc_PlayStarted, v_Class, v_Fail, v_Queue, v_Stop
 
Fields inherited from interface javax.telephony.media.CoderConstants
v_24kADPCM, v_32kADPCM, v_44kADPCM, v_48k8BitLinear, v_48kALawPCM, v_48kMuLawPCM, v_64k8BitLinear, v_64kALawPCM, v_64kMuLawPCM, v_88k8BitLinear, v_88kALawPCM, v_88kMuLawPCM, v_ADPCM_24k, v_ADPCM_32k, v_ADPCM_44k, v_ADSI, v_ALawPCM_48k, v_ALawPCM_64k, v_ALawPCM_88k, v_ASCII, v_Linear8Bit_48k, v_Linear8Bit_64k, v_Linear8Bit_88k, v_MuLawPCM_48k, v_MuLawPCM_64k, v_MuLawPCM_88k, v_TDD
 
Fields inherited from interface javax.telephony.media.RecorderConstants
a_Beep, a_CoderTypes, a_FixedBeep, a_Pause, e_Coder, ev_Pause, ev_Record, ev_Resume, ev_Stop, p_Append, p_BeepFrequency, p_BeepLength, p_Coder, p_CoderTypes, p_EnabledEvents, p_MaxDuration, p_MinDuration, p_SilenceTerminationOn, p_SilenceTerminationThreshold, p_SilenceTruncationOn, p_SilenceTruncationThreshold, p_StartBeep, p_StartPaused, q_Silence, rtca_Pause, rtca_Resume, rtca_Stop, rtcc_RecordComplete, v_Class
 
Fields inherited from interface javax.telephony.media.SignalDetectorConstants
a_Buffering, a_BufferSize, a_DiscardOldest, a_PatternCount, ev_FlushBuffer, ev_Overflow, ev_Pattern, ev_RetrieveSignals, ev_SignalDetected, p_Buffering, p_BufferSize, p_DiscardOldest, p_Duration, p_EnabledEvents, p_Filter, p_InitialTimeout, p_InterSigTimeout, p_Mode, p_Pattern, p_PatternCount, q_Duration, q_InitialTimeout, q_InterSigTimeout, q_NumSignals, q_Pattern, rtca_FlushBuffer, rtca_Stop, rtcc_FlushBuffer, rtcc_Pattern, rtcc_RetrieveSignals, rtcc_SignalDetected, v_Class, v_Detecting, v_Idle
 
Fields inherited from interface javax.telephony.media.SignalConstants
p_SymbolChar, v_CED, v_CNG, v_DTMF0, v_DTMF1, v_DTMF2, v_DTMF3, v_DTMF4, v_DTMF5, v_DTMF6, v_DTMF7, v_DTMF8, v_DTMF9, v_DTMFA, v_DTMFB, v_DTMFC, v_DTMFD, v_DTMFHash, v_DTMFStar, v_Unknown
 
Fields inherited from interface javax.telephony.media.SignalGeneratorConstants
ev_SendSignals, v_Class
 
Fields inherited from interface javax.telephony.media.DelegationConstants
ev_Delegated, q_Released, q_Removed, q_Retrieved, q_Returned, tag_CatchAll, tag_CatchNone, tag_DestroyRequest, tag_NeverReturn, tag_NormalReturn, tag_RemoveSession, tag_SessionDeath, v_Released
 
Constructor Summary
BasicMediaService()
          Create an unbound MediaService, using the installation default MediaProvider.
BasicMediaService(MediaProvider provider)
          Create an unbound MediaService, using the given MediaProvider object.
BasicMediaService(java.lang.String peerName, java.lang.String providerString)
          Create an unbound MediaService, using a MediaProvider identified by the two String arguments.
 
Method Summary
 PlayerEvent activateTTSDictionary(java.lang.String[] string0, java.util.Dictionary dictionary1)
          Activates a collection of TTS dictionaries.
 PlayerEvent adjustPlayerSpeed(Symbol symbol0)
          Adjusts the speed of the current play function.
 PlayerEvent adjustPlayerVolume(Symbol symbol0)
          Adjusts the volume the current play function.
 Async_PlayerEvent async_activateTTSDictionary(java.lang.String[] string0, java.util.Dictionary dictionary1)
          Non-blocking version of activateTTSDictionary();
 Async_PlayerEvent async_adjustPlayerSpeed(Symbol symbol0)
          Non-blocking version of Player.adjustPlayerSpeed.
 Async_PlayerEvent async_adjustPlayerVolume(Symbol symbol0)
          Non-blocking version of Player.adjustPlayerVolume.
 Async_PlayerEvent async_deactivateTTSDictionary(java.lang.String[] string0, java.util.Dictionary dictionary1)
          Non-blocking version of deactivateTTSDictionary();
 Async_SignalDetectorEvent async_flushBuffer()
          Non-blocking version of flushBuffer(); Discard any Signals currently in the SignalDetector's internal Buffer.
 Async_PlayerEvent async_jumpPlayer(Symbol symbol0)
          Non-blocking version of Player.jumpPlayer.
 Async_PlayerEvent async_loadTTSDictionary(java.lang.String[] string0, java.util.Dictionary dictionary1)
          Non-blocking version of loadTTSDictionary();
 Async_PlayerEvent async_pausePlayer()
          Non-blocking version of Player.pausePlayer.
 Async_RecorderEvent async_pauseRecorder()
          Non-blocking version of Recorder.pauseRecorder.
 Async_PlayerEvent async_play(java.lang.String[] string0, int int1, RTC[] rtc2, java.util.Dictionary dictionary3)
          Non-blocking version of Play(); Play an array of MDOs named by Strings.
 Async_PlayerEvent async_play(java.lang.String string0, int int1, RTC[] rtc2, java.util.Dictionary dictionary3)
          Play a single MDO (Media Data Object) named by streamID.
 Async_RecorderEvent async_record(java.lang.String string0, RTC[] rtc1, java.util.Dictionary dictionary2)
          Non-blocking verions of record();
 Async_PlayerEvent async_resumePlayer()
          Non-blocking version of Player.resumePlayer.
 Async_RecorderEvent async_resumeRecorder()
          Non-blocking version of Recorder.resumeRecorder.
 Async_SignalDetectorEvent async_retrieveSignals(int int0, Symbol[] symbol1, RTC[] rtc2, java.util.Dictionary dictionary3)
          Non-blocking verions of retrieveSignals(); Retrieve some signals from the signal buffer.
 Async_SignalGeneratorEvent async_sendSignals(java.lang.String string0, RTC[] rtc1, java.util.Dictionary dictionary2)
          Non-blocking version of sendSignals; Transmit a series of signals.
 Async_SignalGeneratorEvent async_sendSignals(Symbol[] symbol0, RTC[] rtc1, java.util.Dictionary dictionary2)
          Non-blocking version of sendSignals(); Transmit a series of signals.
 Async_PlayerEvent async_stopPlayer()
          Non-blocking version of Player.stopPlayer.
 Async_RecorderEvent async_stopRecorder()
          Non-blocking version of Recorder.stopRecorder.
 Async_PlayerEvent async_unloadTTSDictionary(java.lang.String[] string0, java.util.Dictionary dictionary1)
          Non-blocking version of unloadTTSDictionary();
 PlayerEvent deactivateTTSDictionary(java.lang.String[] string0, java.util.Dictionary dictionary1)
          Deactivates a collection of loaded TTS dictionaries.
static MediaProvider findMediaProvider(java.lang.String peerName, java.lang.String providerString)
          Get a MediaProvider from the given Strings.
 SignalDetectorEvent flushBuffer()
          Remove all signals from the signal buffer.
 PlayerEvent jumpPlayer(Symbol symbol0)
          Jump forward or backward within a sequence of MDOs during a play.
 PlayerEvent loadTTSDictionary(java.lang.String[] string0, java.util.Dictionary dictionary1)
          Load a collection of TTS dictionaries into a Player.
 PlayerEvent pausePlayer()
          Pause the current play.
 RecorderEvent pauseRecorder()
          Pause the current record.
 PlayerEvent play(java.lang.String[] string0, int int1, RTC[] rtc2, java.util.Dictionary dictionary3)
          Play a sequence of MDOs (Media Data Objects) identified by the streamIDs.
 PlayerEvent play(java.lang.String string0, int int1, RTC[] rtc2, java.util.Dictionary dictionary3)
          Play a single MDO (Media Data Object) named by streamID.
 RecorderEvent record(java.lang.String string0, RTC[] rtc1, java.util.Dictionary dictionary2)
          Record data from the Terminal into the named Media Data Object (MDO).
 PlayerEvent resumePlayer()
          Resume the current play.
 RecorderEvent resumeRecorder()
          Resume the current record.
 SignalDetectorEvent retrieveSignals(int int0, Symbol[] symbol1, RTC[] rtc2, java.util.Dictionary dictionary3)
          Retrieve some signals from the signal buffer.
 SignalGeneratorEvent sendSignals(java.lang.String string0, RTC[] rtc1, java.util.Dictionary dictionary2)
          Transmit a series of signals out the Terminal to the network.
 SignalGeneratorEvent sendSignals(Symbol[] symbol0, RTC[] rtc1, java.util.Dictionary dictionary2)
          Transmit a series of signals out the Terminal to the network.
 PlayerEvent stopPlayer()
          Stop the current play.
 RecorderEvent stopRecorder()
          Stop the current record.
 PlayerEvent unloadTTSDictionary(java.lang.String[] string0, java.util.Dictionary dictionary1)
          Unloads a collection of TTS dictionaries from a Player.
 
Methods inherited from class javax.telephony.media.provider.Base_MediaService
addMediaListener, async_bindAndConnect, async_bindToCall, async_bindToServiceName, async_bindToTerminal, async_bindToTerminalName, async_cancelBindRequest, async_configure, async_delegateToService, async_getConfiguration, async_getParameters, async_getTerminal, async_getTerminalName, async_getUserValues, async_release, async_releaseDelegated, async_releaseToDestroy, async_releaseToService, async_releaseToTag, async_retrieve, async_setParameters, async_setUserDictionary, async_setUserValues, async_stop, async_triggerRTC, bindAndConnect, bindToCall, bindToServiceName, bindToTerminal, bindToTerminalName, cancelBindRequest, configure, delegateToService, getConfiguration, getMediaProvider, getParameters, getTerminal, getTerminalName, getUserValues, isBinding, isBound, isDelegated, isOwner, onEventDone, release, releaseDelegated, releaseToDestroy, releaseToService, releaseToTag, removeMediaListener, retrieve, setParameters, setUserDictionary, setUserValues, stop, toString, triggerRTC
 
Methods inherited from class javax.telephony.media.provider.Base_Owner
addListener, removeListener, setExceptionHandler
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.telephony.media.MediaService
addListener, addMediaListener, bindAndConnect, bindToCall, bindToServiceName, bindToTerminal, bindToTerminalName, cancelBindRequest, configure, getConfiguration, getMediaProvider, getParameters, getTerminal, getTerminalName, getUserValues, isBound, release, releaseToDestroy, releaseToService, releaseToTag, removeListener, removeMediaListener, setParameters, setUserDictionary, setUserValues, stop, triggerRTC
 
Methods inherited from interface javax.telephony.media.async.Async.MediaService
async_bindAndConnect, async_bindToCall, async_bindToServiceName, async_bindToTerminal, async_bindToTerminalName, async_cancelBindRequest, async_configure, async_getConfiguration, async_getParameters, async_getTerminal, async_getTerminalName, async_getUserValues, async_release, async_releaseToDestroy, async_releaseToService, async_releaseToTag, async_setParameters, async_setUserDictionary, async_setUserValues, async_stop, async_triggerRTC
 

Constructor Detail

BasicMediaService

public BasicMediaService()
Create an unbound MediaService, using the installation default MediaProvider.

BasicMediaService

public BasicMediaService(MediaProvider provider)
Create an unbound MediaService, using the given MediaProvider object. The MediaProvider object may be obtained from:
Parameters:
provider - a MediaProvider instance

BasicMediaService

public BasicMediaService(java.lang.String peerName,
                         java.lang.String providerString)
                  throws java.lang.ClassNotFoundException,
                         java.lang.InstantiationException,
                         java.lang.IllegalAccessException,
                         ProviderUnavailableException
Create an unbound MediaService, using a MediaProvider identified by the two String arguments.

peerName names a Class that implements MediaPeer. If peerName is null, several alternatives are tried:

  1. Check System.getProperty("Jtapi.MediaPeer"). If that is non-null, instantate that MediaPeer.
  2. Check System.getProperty("Jtapi.Peer", "DefaultJtapiPeer"), See if that JtapiPeer.getProvider() produces a MediaPeer.
    Note: This step may be elided if Jtapi integration is not expected.
  3. Check "javax.telephony.media.provider.NullMediaPeer". That may produce NullMediaProvider.

The format of a providerString as used to obtain a MediaProvider from the MediaPeer is vendor specific.

The format of a providerString as used to obtain a Jtapi [core/Call] Provider is documented in JtapiPeer.getProvider(String).

Parameters:
peerName - the name of a Class that implements MediaPeer.
providerString - a "login" string for that MediaPeer.
Throws:
java.lang.ClassNotFoundException - if MediaPeer class is not found
java.lang.IllegalAccessException - if MediaPeer class is not accessible
java.lang.InstantiationException - if MediaPeer class does not instantiate
ProviderUnavailableException - if Provider is not available
ClassCastException - if Provider instance is not a MediaProvider
Method Detail

findMediaProvider

public static MediaProvider findMediaProvider(java.lang.String peerName,
                                              java.lang.String providerString)
                                       throws java.lang.ClassNotFoundException,
                                              java.lang.InstantiationException,
                                              java.lang.IllegalAccessException,
                                              ProviderUnavailableException
Get a MediaProvider from the given Strings.

If the given peerName is null:

  1. Check System.getProperty("Jtapi.MediaPeer").
    If that is non-null, instantiate that MediaPeer.
  2. Check System.getProperty("Jtapi.Peer", "DefaultJtapiPeer"),
    See if that JtapiPeer.getProvider() produces a MediaPeer.
    [this step may be elided if Jtapi integration is not expected]
  3. Check "javax.telephony.media.provider.NullMediaPeer".
    That should produce NullMediaProvider.

Note: This method can be used as a MediaProvider Factory. For example:
MediaProvider mp = BasicMediaService.findMediaProvider(...);

Parameters:
peerName - name of the MediaPeer Class
providerString - a String that identifies the (MediaPeer-specific) MediaProvider and other information.
Returns:
a MediaProvider
Throws:
java.lang.ClassNotFoundException - if MediaPeer class is not found
java.lang.IllegalAccessException - if MediaPeer class is not accessible
java.lang.InstantiationException - if MediaPeer class does not instantiate
ProviderUnavailableException - if Provider is not available
ClassCastException - if Provider instance is not a MediaProvider

play

public PlayerEvent play(java.lang.String string0,
                        int int1,
                        RTC[] rtc2,
                        java.util.Dictionary dictionary3)
                 throws MediaResourceException
Description copied from interface: Player
Play a single MDO (Media Data Object) named by streamID. Equivalent to play() with a String[] of length one, containing the given streamID.
Specified by:
play in interface Player
Following copied from interface: javax.telephony.media.Player
Parameters:
streamID - a String naming the MDO to be played.
offset - int number milliseconds into the MDO at which play is to start.
rtc - Array of RTC that effect this play.
optargs - a Dictionary of optional arguments.
Returns:
a PlayerEvent when the operation is complete (or queued).
Throws:
MediaResourceException - if requested operation fails.
DisconnectedException - if Terminal is disconnected.

play

public PlayerEvent play(java.lang.String[] string0,
                        int int1,
                        RTC[] rtc2,
                        java.util.Dictionary dictionary3)
                 throws MediaResourceException
Description copied from interface: Player
Play a sequence of MDOs (Media Data Objects) identified by the streamIDs. This sequence of MDOs is called the "MDO list".

This method returns when the MDO list is completely played, or when the playing has been stopped. (Player Pause does not cause this method to return.) Play returns a PlayerEvent. The condition that caused the play to stop is included in the completion event. RTC actions can alter the course of the play without the intervention of the application. Optional arguments can alter the characteristics of the play.

Exceptions are thrown if pre- or post- conditions are not satisfied

Pre-conditions:

  1. a Player resource is configured
  2. all MDOs are playable

Post-conditions:

  1. As indicated by getQualifier():
    • q_EndOfData: All MDOs named in this MDO list have been played.
    • q_Stop: play was stopped by the stop() method or because (p_IfBusy=v_Stop)
    • q_RTC: play was stopped by Player.rtca_Stop

Specified by:
play in interface Player
Following copied from interface: javax.telephony.media.Player
Parameters:
streamIDs - a String[] naming the MDO list to be played.
offset - number of milliseconds into the MDO list at which play is to start, offset may span several items in streamIDs.
rtc - Array of RTC that effect this play.
optargs - a Dictionary of optional arguments.
Returns:
a PlayerEvent when the operation is complete (or queued).
Throws:
MediaResourceException - if requested operation fails.
DisconnectedException - if Terminal is disconnected.

adjustPlayerSpeed

public PlayerEvent adjustPlayerSpeed(Symbol symbol0)
                              throws MediaResourceException
Description copied from interface: Player
Adjusts the speed of the current play function.

Parameter adjustment specifies the type of speed adjustment desired.

This is functionally equivalent to the RTC actions.

Note: the value of p_SpeedChange is in units of percent deviation from normal.

Note: this is functionally equivalent to the RTC actions, except that it generates a Completion Event instead of a non-transactional Event.

Specified by:
adjustPlayerSpeed in interface Player
Following copied from interface: javax.telephony.media.Player
Parameters:
adjustment - an RTC Symbol specifying the type of change.
Returns:
a PlayerEvent when the operation completes
Throws:
MediaResourceException - if speed cannot be adjusted

adjustPlayerVolume

public PlayerEvent adjustPlayerVolume(Symbol symbol0)
                               throws MediaResourceException
Description copied from interface: Player
Adjusts the volume the current play function.

Parameter adjustment specifies the type of volume adjustment desired.

This is functionally equivalent to the RTC actions.

Note: the value of p_VolumeChange in in units of dB from the normal volume.

Note: this is functionally equivalent to the RTC actions, except that it generates a Completion Event instead of a non-transactional Event.

Specified by:
adjustPlayerVolume in interface Player
Following copied from interface: javax.telephony.media.Player
Parameters:
adjustment - an RTC Symbol specifying the type of change.
Returns:
a PlayerEvent when the operation completes
Throws:
MediaResourceException - if volume cannot be adjusted

jumpPlayer

public PlayerEvent jumpPlayer(Symbol symbol0)
                       throws MediaResourceException
Description copied from interface: Player
Jump forward or backward within a sequence of MDOs during a play.

Parameter jump specifies the type of jump desired. It is one of the rtca_Jump<Type><Units> Symbols.

For example: rtca_JumpForwardTime.

This is functionally equivalent to the Jump RTC actions, except that it generates a Completion Event instead of a non-transactional Event.

Specified by:
jumpPlayer in interface Player
Following copied from interface: javax.telephony.media.Player
Parameters:
jump - a Symbol specifying the type of jump.
Returns:
a PlayerEvent when the operation completes
Throws:
MediaResourceException - if the jump cannot be done

pausePlayer

public PlayerEvent pausePlayer()
                        throws MediaResourceException
Description copied from interface: Player
Pause the current play.

This is functionally equivalent to rtca_Pause, except that it generates a Completion Event instead of a non-transactional Event.

Specified by:
pausePlayer in interface Player
Following copied from interface: javax.telephony.media.Player
Returns:
a PlayerEvent when the operation completes
Throws:
MediaResourceException - if pause cannot be done

resumePlayer

public PlayerEvent resumePlayer()
                         throws MediaResourceException
Description copied from interface: Player
Resume the current play.

This is functionally equivalent to rtca_Resume, except that it generates a Completion Event instead of a non-transactional Event.

Specified by:
resumePlayer in interface Player
Following copied from interface: javax.telephony.media.Player
Returns:
a PlayerEvent when the operation completes
Throws:
MediaResourceException - if resume cannot be done

stopPlayer

public PlayerEvent stopPlayer()
                       throws MediaResourceException
Description copied from interface: Player
Stop the current play.

This is functionally equivalent to rtca_Stop, except that it generates a Completion Event instead of a non-transactional Event.

Specified by:
stopPlayer in interface Player
Following copied from interface: javax.telephony.media.Player
Returns:
a PlayerEvent when the operation completes
Throws:
MediaResourceException - if stop cannot be done

loadTTSDictionary

public PlayerEvent loadTTSDictionary(java.lang.String[] string0,
                                     java.util.Dictionary dictionary1)
                              throws MediaResourceException
Description copied from interface: TTSPlayer
Load a collection of TTS dictionaries into a Player. The dictionary is placed at the top of the dictionary stack, and is deactivated.
Specified by:
loadTTSDictionary in interface TTSPlayer
Following copied from interface: javax.telephony.media.TTSPlayer
Parameters:
dictNames - a String[] of DataObject fullNames.
optargs - a Dictionary of optional args.
Returns:
a PlayerEvent when the operation is complete.
Throws:
MediaResourceException - if requested operation fails.

activateTTSDictionary

public PlayerEvent activateTTSDictionary(java.lang.String[] string0,
                                         java.util.Dictionary dictionary1)
                                  throws MediaResourceException
Description copied from interface: TTSPlayer
Activates a collection of TTS dictionaries. The dictionaries must already be loaded.
Specified by:
activateTTSDictionary in interface TTSPlayer
Following copied from interface: javax.telephony.media.TTSPlayer
Parameters:
dictNames - a String[] of DataObject fullNames.
optargs - a Dictionary of optional args.
Returns:
a PlayerEvent when the operation is complete.
Throws:
MediaResourceException - if requested operation fails.

deactivateTTSDictionary

public PlayerEvent deactivateTTSDictionary(java.lang.String[] string0,
                                           java.util.Dictionary dictionary1)
                                    throws MediaResourceException
Description copied from interface: TTSPlayer
Deactivates a collection of loaded TTS dictionaries.
Specified by:
deactivateTTSDictionary in interface TTSPlayer
Following copied from interface: javax.telephony.media.TTSPlayer
Parameters:
dictNames - a String[] of DataObject fullNames.
optargs - a Dictionary of optional args.
Returns:
a PlayerEvent when the operation is complete.
Throws:
MediaResourceException - if requested operation fails.

unloadTTSDictionary

public PlayerEvent unloadTTSDictionary(java.lang.String[] string0,
                                       java.util.Dictionary dictionary1)
                                throws MediaResourceException
Description copied from interface: TTSPlayer
Unloads a collection of TTS dictionaries from a Player.
Specified by:
unloadTTSDictionary in interface TTSPlayer
Following copied from interface: javax.telephony.media.TTSPlayer
Parameters:
dictNames - a String[] of DataObject fullNames.
optargs - a Dictionary of optional args.
Returns:
a PlayerEvent when the operation is complete.
Throws:
MediaResourceException - if requested operation fails.

record

public RecorderEvent record(java.lang.String string0,
                            RTC[] rtc1,
                            java.util.Dictionary dictionary2)
                     throws MediaResourceException
Description copied from interface: Recorder
Record data from the Terminal into the named Media Data Object (MDO). Encode and store data from the telephony network. record() encodes the media stream from the bound Terminal, and stores the result in the Media Stream Container identified by the given streamID.

If the MDO does not exist, it is created and associated with the coder type specified by parameter p_Coder. If the MDO does exist, the recording is made using the coder type associated with that DSD. If the Recorder does not support the indicated Coder, record() throws a MediaResourceException, indicating e_Coder.

This method returns when the recording stops because of timeout or an RTC action. (Pause/Resume does not cause this method to return.) The condition that caused recording to stop is available from the completion event using getQualifier.

The optargs argument specifies values for Recorder parameters for the duration of this record operation. For example, p_Coder or p_BeepStart can be overridden for a single method invocation.

Exceptions are thrown if pre- or post- conditions are not satisfied
Pre-conditions:

  1. Recorder is configured into this MediaService
  2. The SDR exists or can be created
  3. The SDR is not locked (that is, is not in use)
  4. Recorder is Idle
  5. Recorder has the required/requested coder

Post-conditions: Record completes normally due to one of:
  1. Duration time reached
  2. a silence exceeding p_SilenceThreshold detected
  3. stop() method invoked
  4. rtca_Stop triggered

Specified by:
record in interface Recorder
Following copied from interface: javax.telephony.media.Recorder
Parameters:
streamID - the String name of the MDO where data is to be stored.
rtc - an Array of RTC (Run-Time-Control) objects
optargs - a Dictionary of optional arguments
Returns:
a RecorderEvent with additional information.
Throws:
MediaResourceException - if requested operation fails.
DisconnectedException - if Terminal is disconnected.

pauseRecorder

public RecorderEvent pauseRecorder()
                            throws MediaResourceException
Description copied from interface: Recorder
Pause the current record.

This is functionally equivalent to rtca_Pause, except that it generates a Completion Event instead of a non-transactional Event.

Specified by:
pauseRecorder in interface Recorder
Following copied from interface: javax.telephony.media.Recorder
Returns:
a RecorderEvent object
Throws:
MediaResourceException -  

resumeRecorder

public RecorderEvent resumeRecorder()
                             throws MediaResourceException
Description copied from interface: Recorder
Resume the current record.

This is functionally equivalent to rtca_Resume, except that it generates a Completion Event instead of a non-transactional Event.

Specified by:
resumeRecorder in interface Recorder
Following copied from interface: javax.telephony.media.Recorder
Returns:
a RecorderEvent object
Throws:
MediaResourceException -  

stopRecorder

public RecorderEvent stopRecorder()
                           throws MediaResourceException
Description copied from interface: Recorder
Stop the current record.

This is functionally equivalent to rtca_Stop, except that it generates a Completion Event instead of a non-transactional Event.

Specified by:
stopRecorder in interface Recorder
Following copied from interface: javax.telephony.media.Recorder
Returns:
a RecorderEvent object
Throws:
MediaResourceException -  

flushBuffer

public SignalDetectorEvent flushBuffer()
                                throws MediaResourceException
Description copied from interface: SignalDetector
Remove all signals from the signal buffer.

This prevents buffer overflow, and synchronizes the pattern matchers.

The signals flushed may be accessed using Event.getSignalBuffer() or Event.getSignalString(). If the flushed signals are not available, then these methods return null.

This is conceptually equivalent to: retrieveSignals((p_BufferSize), null, null, {p_Duration=0});
but flushBuffer() also resets all the pattern matchers.

Note: flushBuffer is also available using rtca_FlushBuffer.

Specified by:
flushBuffer in interface SignalDetector
Following copied from interface: javax.telephony.media.SignalDetector
Returns:
a SignalDetectorEvent containing any signals flushed.
Throws:
MediaResourceException - if requested operation fails.

retrieveSignals

public SignalDetectorEvent retrieveSignals(int int0,
                                           Symbol[] symbol1,
                                           RTC[] rtc2,
                                           java.util.Dictionary dictionary3)
                                    throws MediaResourceException
Description copied from interface: SignalDetector
Retrieve some signals from the signal buffer. This method returns when numSignals signals are in the signal buffer (and removes them). May return with fewer than numSignals when some other terminating condition occurs (rtca_Stop, a Pattern is detected, or timeout). In that case, the method returns and removes all the signals from the signal buffer. If (numSignals == -1), then this method returns only when some other termination condition occurs.

The terminating conditions are controlled by the arguments patterns and rtc, and various timeout parameters.

patterns is an array of Symbols, with an entry for each Pattern to enable. If the patterns array contains a pattern Symbol then recognition of that pattern is treated as a terminating condition for retrieveSignals(). If patterns is null, then pattern recognition is not considered as a terminating condition.

retrieveSignals also terminates if any of the p_InitialTimeout, p_InterSigTimeout, p_Duration timeouts are exceeded. These times are relative to the start of the retrieveSignals operation. These parameters can be set with setParameters or in the optargs argument.

To get the retrieved signals, invoke getSignalBuffer() on the SignalDetectorEvent returned from retrieveSignals. If retrieveSignals can not return a signal buffer, it throws an Exception, so retrieveSignals(...).getSignalBuffer() is safe. The Signals are accessed as elements of the Symbol[] returned by getSignalBuffer or char elements of the String returned by getSignalString.

Example:
String nextDTMF = retrieveSignals(1,null,null,null).getSignalBuffer();

Note: Due to the effects of overflow and typeahead synchronization, the more reliable way to get the signals that matched a pattern is from the ev_PatternMatched event in the onPatternMatched method.

Specified by:
retrieveSignals in interface SignalDetector
Following copied from interface: javax.telephony.media.SignalDetector
Parameters:
numSignals - the int number of signals to be retrieved.
patterns - indicates which Patterns should terminate retrieval.
rtc - an Array of RTC (Run Time Control) objects. The RTC actions may be rtca_Stop or rtca_FlushBuffer.
optargs - a Dictionary of optional arguments. p_Pattern[i] may be set as transient parameters.
Returns:
a SignalDetectorEvent, suitable for for getSignalBuffer().
Throws:
MediaResourceException - if requested operation fails.

sendSignals

public SignalGeneratorEvent sendSignals(Symbol[] symbol0,
                                        RTC[] rtc1,
                                        java.util.Dictionary dictionary2)
                                 throws MediaResourceException
Description copied from interface: SignalGenerator
Transmit a series of signals out the Terminal to the network.

Each signal is defined by a Symbol in the Symbol[].

Note: This method may be less efficient than using the String form of sendSignals.

Specified by:
sendSignals in interface SignalGenerator
Following copied from interface: javax.telephony.media.SignalGenerator
Parameters:
signals - an array of Symbols that defines a signal.
rtc - an array of RTC objects that controls this transactions.
optargs - a Dictionary of optional arguments
Returns:
a SignalGeneratorEvent
Throws:
MediaResourceException - if this request fails.
DisconnectedException - if Terminal is disconnected.

sendSignals

public SignalGeneratorEvent sendSignals(java.lang.String string0,
                                        RTC[] rtc1,
                                        java.util.Dictionary dictionary2)
                                 throws MediaResourceException
Description copied from interface: SignalGenerator
Transmit a series of signals out the Terminal to the network.

Each signal is defined by a single char in the String.

Note: The AIA inserts spaces for presentation at the S.200/S.300 layers

Specified by:
sendSignals in interface SignalGenerator
Following copied from interface: javax.telephony.media.SignalGenerator
Parameters:
signals - an String containing chars representing each signal.
rtc - an array of RTC objects that controls this transactions.
optargs - a Dictionary of optional arguments
Returns:
a SignalGeneratorEvent.
Throws:
MediaResourceException - if this request fails.
DisconnectedException - if Terminal is disconnected.

async_play

public Async_PlayerEvent async_play(java.lang.String string0,
                                    int int1,
                                    RTC[] rtc2,
                                    java.util.Dictionary dictionary3)
Description copied from interface: Async_Player
Play a single MDO (Media Data Object) named by streamID. Equivalent to async_play() with a String[] of length one, containing the given streamID.
Specified by:
async_play in interface Async_Player
Following copied from interface: javax.telephony.media.async.Async_Player
Parameters:
streamID - a String naming the MDO to be played.
offset - int number milliseconds into the MDO at which play is to start.
rtc - Array of RTC that effect this play.
optargs - a Dictionary of optional arguments.
Returns:
a Player.Event when the operation is complete (or queued).
See Also:
Player.play(String, int, RTC[], Dictionary)

async_play

public Async_PlayerEvent async_play(java.lang.String[] string0,
                                    int int1,
                                    RTC[] rtc2,
                                    java.util.Dictionary dictionary3)
Description copied from interface: Async_Player
Non-blocking version of Play(); Play an array of MDOs named by Strings.

Completion event is sent to Async_PlayerListener.

Specified by:
async_play in interface Async_Player
Following copied from interface: javax.telephony.media.async.Async_Player
Parameters:
streamIDs - a String[] naming the MDO list to be played.
offset - number of milliseconds into the MDO list at which play is to start, offset may span several items in streamIDs.
rtc - Array of RTC that effect this play.
optargs - a Dictionary of optional arguments.
Returns:
an Async_PlayerEvent
See Also:
Player.play(String[], int, RTC[], Dictionary)

async_adjustPlayerSpeed

public Async_PlayerEvent async_adjustPlayerSpeed(Symbol symbol0)
Description copied from interface: Async_Player
Non-blocking version of Player.adjustPlayerSpeed.
Specified by:
async_adjustPlayerSpeed in interface Async_Player
Following copied from interface: javax.telephony.media.async.Async_Player
Parameters:
adjustment - a Symbol specifying the type of adjustment
Returns:
Async_PlayerEvent
See Also:
Player.adjustPlayerSpeed(javax.telephony.media.Symbol)

async_adjustPlayerVolume

public Async_PlayerEvent async_adjustPlayerVolume(Symbol symbol0)
Description copied from interface: Async_Player
Non-blocking version of Player.adjustPlayerVolume.
Specified by:
async_adjustPlayerVolume in interface Async_Player
Following copied from interface: javax.telephony.media.async.Async_Player
Parameters:
adjustment - a Symbol specifying the type of adjustment
Returns:
Async_PlayerEvent
See Also:
Player.adjustPlayerVolume(javax.telephony.media.Symbol)

async_jumpPlayer

public Async_PlayerEvent async_jumpPlayer(Symbol symbol0)
Description copied from interface: Async_Player
Non-blocking version of Player.jumpPlayer.
Specified by:
async_jumpPlayer in interface Async_Player
Following copied from interface: javax.telephony.media.async.Async_Player
Parameters:
jump - a Symbol specifying the type of jump
Returns:
Async_PlayerEvent
See Also:
Player.jumpPlayer(javax.telephony.media.Symbol)

async_pausePlayer

public Async_PlayerEvent async_pausePlayer()
Description copied from interface: Async_Player
Non-blocking version of Player.pausePlayer.
Specified by:
async_pausePlayer in interface Async_Player
Following copied from interface: javax.telephony.media.async.Async_Player
Returns:
Async_PlayerEvent
See Also:
Player.pausePlayer()

async_resumePlayer

public Async_PlayerEvent async_resumePlayer()
Description copied from interface: Async_Player
Non-blocking version of Player.resumePlayer.
Specified by:
async_resumePlayer in interface Async_Player
Following copied from interface: javax.telephony.media.async.Async_Player
Returns:
Async_PlayerEvent
See Also:
Player.resumePlayer()

async_stopPlayer

public Async_PlayerEvent async_stopPlayer()
Description copied from interface: Async_Player
Non-blocking version of Player.stopPlayer.
Specified by:
async_stopPlayer in interface Async_Player
Following copied from interface: javax.telephony.media.async.Async_Player
Returns:
Async_PlayerEvent
See Also:
Player.stopPlayer()

async_loadTTSDictionary

public Async_PlayerEvent async_loadTTSDictionary(java.lang.String[] string0,
                                                 java.util.Dictionary dictionary1)
Description copied from interface: Async_TTSPlayer
Non-blocking version of loadTTSDictionary();

Load a collection of TTS dictionaries into a Player. The dictionary is placed at the top of the dictionary stack, and is deactivated.

Specified by:
async_loadTTSDictionary in interface Async_TTSPlayer
Following copied from interface: javax.telephony.media.async.Async_TTSPlayer
Parameters:
dictNames - a String[] of DataObject fullNames.
optargs - a Dictionary of optional args.
Returns:
a Async_PlayerEvent

async_activateTTSDictionary

public Async_PlayerEvent async_activateTTSDictionary(java.lang.String[] string0,
                                                     java.util.Dictionary dictionary1)
Description copied from interface: Async_TTSPlayer
Non-blocking version of activateTTSDictionary();

Activates a collection of TTS dictionaries. The dictionaries must already be loaded.

Specified by:
async_activateTTSDictionary in interface Async_TTSPlayer
Following copied from interface: javax.telephony.media.async.Async_TTSPlayer
Parameters:
dictNames - a String[] of DataObject fullNames.
optargs - a Dictionary of optional args.
Returns:
a Async_PlayerEvent

async_deactivateTTSDictionary

public Async_PlayerEvent async_deactivateTTSDictionary(java.lang.String[] string0,
                                                       java.util.Dictionary dictionary1)
Description copied from interface: Async_TTSPlayer
Non-blocking version of deactivateTTSDictionary();

Deactivates a collection of loaded TTS dictionaries.

Specified by:
async_deactivateTTSDictionary in interface Async_TTSPlayer
Following copied from interface: javax.telephony.media.async.Async_TTSPlayer
Parameters:
dictNames - a String[] of DataObject fullNames.
optargs - a Dictionary of optional args.
Returns:
a Async_PlayerEvent

async_unloadTTSDictionary

public Async_PlayerEvent async_unloadTTSDictionary(java.lang.String[] string0,
                                                   java.util.Dictionary dictionary1)
Description copied from interface: Async_TTSPlayer
Non-blocking version of unloadTTSDictionary();

Unloads a collection of TTS dictionaries from a Player.

Specified by:
async_unloadTTSDictionary in interface Async_TTSPlayer
Following copied from interface: javax.telephony.media.async.Async_TTSPlayer
Parameters:
dictNames - a String[] of DataObject fullNames.
optargs - a Dictionary of optional args.
Returns:
a Async_PlayerEvent

async_record

public Async_RecorderEvent async_record(java.lang.String string0,
                                        RTC[] rtc1,
                                        java.util.Dictionary dictionary2)
Description copied from interface: Async_Recorder
Non-blocking verions of record();

Record data from the Terminal into the named Media Data Object (MDO). Encode and store data from the telephony network. record() encodes the media stream from the bound Terminal, and stores the result in the Media Stream Container identified by the given streamID.

Specified by:
async_record in interface Async_Recorder
Following copied from interface: javax.telephony.media.async.Async_Recorder
Parameters:
streamID - the String name of a MDO where recording is to be stored
rtc - an Array of RTC (Run-Time-Control) objects
optargs, - a Dictionary of optional arguments
Returns:
an Async_RecorderEvent with additional information.
See Also:
Recorder.record(java.lang.String, javax.telephony.media.RTC[], java.util.Dictionary)

async_pauseRecorder

public Async_RecorderEvent async_pauseRecorder()
Description copied from interface: Async_Recorder
Non-blocking version of Recorder.pauseRecorder.
Specified by:
async_pauseRecorder in interface Async_Recorder
Following copied from interface: javax.telephony.media.async.Async_Recorder
Returns:
an Async_RecorderEvent
See Also:
Recorder.pauseRecorder()

async_resumeRecorder

public Async_RecorderEvent async_resumeRecorder()
Description copied from interface: Async_Recorder
Non-blocking version of Recorder.resumeRecorder.
Specified by:
async_resumeRecorder in interface Async_Recorder
Following copied from interface: javax.telephony.media.async.Async_Recorder
Returns:
an Async_RecorderEvent
See Also:
Recorder.resumeRecorder()

async_stopRecorder

public Async_RecorderEvent async_stopRecorder()
Description copied from interface: Async_Recorder
Non-blocking version of Recorder.stopRecorder.
Specified by:
async_stopRecorder in interface Async_Recorder
Following copied from interface: javax.telephony.media.async.Async_Recorder
Returns:
an Async_RecorderEvent
See Also:
Recorder.stopRecorder()

async_retrieveSignals

public Async_SignalDetectorEvent async_retrieveSignals(int int0,
                                                       Symbol[] symbol1,
                                                       RTC[] rtc2,
                                                       java.util.Dictionary dictionary3)
Description copied from interface: Async_SignalDetector
Non-blocking verions of retrieveSignals(); Retrieve some signals from the signal buffer.
Specified by:
async_retrieveSignals in interface Async_SignalDetector
Following copied from interface: javax.telephony.media.async.Async_SignalDetector
Parameters:
numSignals - the int number of signals to be retrieved.
patterns - indicates which Patterns should terminate retrieval.
rtc - an Array of RTC (Run Time Control) objects. The RTC actions may be rtca_Stop or rtca_FlushBuffer.
optargs - a Dictionary of optional arguments. p_Pattern[i] may be set here as temporary parameters.
Returns:
an Async_SignalDetectorEvent

async_flushBuffer

public Async_SignalDetectorEvent async_flushBuffer()
Description copied from interface: Async_SignalDetector
Non-blocking version of flushBuffer(); Discard any Signals currently in the SignalDetector's internal Buffer.

Specified by:
async_flushBuffer in interface Async_SignalDetector
Following copied from interface: javax.telephony.media.async.Async_SignalDetector
Returns:
a Async_SignalDetectorEvent

async_sendSignals

public Async_SignalGeneratorEvent async_sendSignals(java.lang.String string0,
                                                    RTC[] rtc1,
                                                    java.util.Dictionary dictionary2)
Description copied from interface: Async_SignalGenerator
Non-blocking version of sendSignals; Transmit a series of signals.

Each signal is defined by a char in the String.

Specified by:
async_sendSignals in interface Async_SignalGenerator
Following copied from interface: javax.telephony.media.async.Async_SignalGenerator
Parameters:
signals - an array of Symbols that defines a signal.
rtc - an array of RTC objects that controls this transactions.
optargs - a Dictionary of optional arguments
Returns:
an Async_SignalGeneratorEvent

async_sendSignals

public Async_SignalGeneratorEvent async_sendSignals(Symbol[] symbol0,
                                                    RTC[] rtc1,
                                                    java.util.Dictionary dictionary2)
Description copied from interface: Async_SignalGenerator
Non-blocking version of sendSignals(); Transmit a series of signals.

Each signal is defined by a Symbol in the Symbol[].

Specified by:
async_sendSignals in interface Async_SignalGenerator
Following copied from interface: javax.telephony.media.async.Async_SignalGenerator
Parameters:
signals - an array of Symbols that defines a signal.
rtc - an array of RTC objects that controls this transactions.
optargs - a Dictionary of optional arguments
Returns:
an Async_SignalGeneratorEvent

JSR-043: JTAPI-1.4

Send comments to: JSR-43@ectf.org