public interface MediaService
The Call.enableMediaBeforeAnswer()
is deprecated and no longer required for the call intercepted scenario where the media
operation is not invoked in the callIntercepted method.
Use the Call.getMediaPolicies().setMediaServerInclusion()
to set the Media Server Inclusion policy to AS_NEEDED which is the
default or INCLUDED. The media server stays on the call when the policy is set to INCLUDED
Otherwise, the media server is removed from the call when
A service obtains an instance of this class by invoking the MediaFactory
.createMediaService method.
Starting 3.1, this interface allows sending digits (DTMF tones) to a participant on a call. It also allows to perform some action on
completion of the send digits operation through the MediaListener
interface.
Usage:
//Obtain a participant
Participant participant = ... ;
//The digits to be sent
String digits = "D19175";
//create an instance of MediaListener
MediaListener listener = new MediaListenerAbstract()
{
public void sendDigitsCompleted(final UUID requestId, final SendDigitsOperationCause cause)
{
//it's invoked when send digits operation gets completed
}
});
...
//obtain an instance of MediaService
MediaService mediaService = MediaFactory.createMediaService();
//Perform send digits operation
mediaService.sendDigits(participant, digits,listener);
...
Modifier and Type | Method and Description |
---|---|
UUID |
collect(Participant participant,
DigitOptions digitOptions,
MediaListener mediaListener)
Collects a pattern of digits from a participant on a call.
|
UUID |
play(Call call,
PlayItem playItem,
MediaListener mediaListener)
Play a list of audio sources to all the connected participants on a call, including a participant that connects while the source is
playing.
|
UUID |
play(Participant participant,
PlayItem playItem,
MediaListener mediaListener)
Play a list of audio sources to a connected participant on a call.
|
UUID |
promptAndCollect(Participant participant,
PlayItem playItem,
DigitOptions digitOptions,
MediaListener mediaListener)
Plays a list of prompt resources to a participant on a call and then collects digits from the same participant.
|
UUID |
record(Participant participant,
RecordItem recordItem,
MediaListener mediaListener)
Records the audio from a connected participant on a call.
|
UUID |
sendDigits(Participant participant,
String digits,
MediaListener mediaListener)
Sends digits (DTMF tones) to a participant on a call.
|
void |
stop(Call call,
UUID requestId)
Stops a current play operation that was started on the call.
|
void |
stop(Participant participant,
UUID requestId)
Stops a current media operation for the participant.
|
UUID play(Call call, PlayItem playItem, MediaListener mediaListener)
call
- the audio sources will be played to all the participants on the callplayItem
- the list of audio sources and their attributesmediaListener
- the listener that receives media eventsUUID play(Participant participant, PlayItem playItem, MediaListener mediaListener)
participant
- the audio sources will be played to this participant on the callplayItem
- the list of audio sources and their attributesmediaListener
- the listener that receives media eventsUUID collect(Participant participant, DigitOptions digitOptions, MediaListener mediaListener)
participant
- the digits will be collected from this participant on the calldigitOptions
- attributes for digit collectionmediaListener
- the listener that receives media eventsUUID promptAndCollect(Participant participant, PlayItem playItem, DigitOptions digitOptions, MediaListener mediaListener)
participant
- the prompt resources will be played to this participant on the callplayItem
- attribute for the resource to play before digit collectiondigitOptions
- attributes for digit collectionmediaListener
- the listener that receives media eventsvoid stop(Participant participant, UUID requestId)
participant
- the media operation to stop is associated with this participant on the callrequestId
- universal unique identifier used to identify a media operationvoid stop(Call call, UUID requestId)
call
- the play operation to stop is associated with this callrequestId
- universal unique identifier used to identify the play operationUUID sendDigits(Participant participant, String digits, MediaListener mediaListener)
participant
- the digits will be sent to this participant on the calldigits
- the digits to be sent. The supported digits are from the set {0-9, A, B, C, D, *, #}.mediaListener
- the MediaListener
that receives media events on completion of the operation.UUID record(Participant participant, RecordItem recordItem, MediaListener mediaListener)
The recording starts immediately after the media server is inserted into the call, for the calling party and after the call is answered for the called party.
The record operation completes when the service invokes MediaService.stop(Participant, UUID)
, a non-recoverable error occurs, the maximum
duration interval is exceeded or the participant presses the termination key.
participant
- the source of the audio that will be recordedrecordItem
- the recording attributes including the recorded file URImediaListener
- the listener that receives media eventsCopyright © 2016 Avaya. All Rights Reserved.