Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


com.oracle.sft.api
Interface MediaPartner

All Superinterfaces:
MediaParticipant, Participant

public interface MediaPartner
extends MediaParticipant

Represents a MediaPartner.


Nested Class Summary
static class MediaPartner.MediaOperation
           

 

Method Summary
 void attach(UserParticipant up)
          Attach with the specified UserParticipant and acts as each other's partner.
 void detach()
          Detach with its user partner and restore Communication to original state before attach operation was made.
 UserParticipant getUserPartner()
          Return the UserParticipant if the MediaPartner have already attached with a UserParticipant using attach(UserParticipant) method.
 void play(String... uris)
          Start playing from the specified locations.
 void play(URI... uris)
          Start playing from the specified locations.
 void record(String uri)
          Record to specified location.
 void record(URI uri)
          Record to specified location.
 void setExclusive(boolean exclusive)
          Set exclusive flag.
 void stop(MediaPartner.MediaOperation operation)
          Stop specified operation this MediaPartner related and in progress.

 

Methods inherited from interface com.oracle.sft.api.MediaParticipant
stop

 

Methods inherited from interface com.oracle.sft.api.Participant
addAgent, getAgent, getAgents, getExtension, getJoinable, getName, getNickName, removeAgent, setName, setNickName

 

Method Detail

setExclusive

void setExclusive(boolean exclusive)
Set exclusive flag. To take effect, this operation must happen before calling attach(UserParticipant).
Parameters:
exclusive - indicate that if this MediaPartner would be exclusive. To a Communication which user participant member number is limited, such as Conversation, an exclusive MediaPartner will ask Conversation to purge the party when is replaced by this MediaPartner.

attach

void attach(UserParticipant up)
Attach with the specified UserParticipant and acts as each other's partner. Usually attach acts as some preparation for subsequent media operation to its user partner, such as play, record, signal receiving, ivr, etc. The attach operation happens after the MediaPartner has been added into the Communication. The attach operation can have different details in different Communication. Such as, in Conversation case, we can use attach to build up the relationship with one user participant and reserve media resource.
Parameters:
up - The UserParticipant to attach with.

detach

void detach()
Detach with its user partner and restore Communication to original state before attach operation was made.

getUserPartner

UserParticipant getUserPartner()
Return the UserParticipant if the MediaPartner have already attached with a UserParticipant using attach(UserParticipant) method.
Returns:
An instance of UserParticipant.

play

void play(URI... uris)
Start playing from the specified locations. For example, to play a media file, the invocation shall be: Conversation c = ...; MediaPartner p = c.getMediaPartner(); p.play("file:///tmp/music.au"); In this basic way, p.play(uris) can be used only when involved media resource is reserved, that means, bean should call it in CommunicationEvent.Type.ESTABLISHED or MEDIA_RESOURCE_RESERVED or EARLY_MEDIA_RESERVED. Considering method setExclusive(boolean), if exclusive is set to true, method play should be called in CommunicationEvent.ESTABLISHED, otherwise, in CommunicationEvent.Type.MEDIA_RESOURCE_RESERVED. To prepare this MediaPartner, it must be created and added into the Conversation, and then attach with one UserParticipant of the Conversation. For example, in ParticipantEvent.JOINING, Conversation c = ...; c.addParticipant(MediaPartner.class, "theMP"); UserParticipant caller = c.getCaller(); c.getMediaPartner().attach(caller);
Parameters:
uris -

play

void play(String... uris)
Start playing from the specified locations. This is equivalent to calling * play(URI.create(stream));
Parameters:
uris - Each location should be a form acceptable to URI.create.

record

void record(URI uri)
Record to specified location.
Parameters:
uri -

record

void record(String uri)
Record to specified location.
Parameters:
uri -

stop

void stop(MediaPartner.MediaOperation operation)
Stop specified operation this MediaPartner related and in progress.
Parameters:
operation -

Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


Copyright © 2012 Oracle Corporation. All Rights Reserved.