Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol.media
Class AbstractOperationSetBasicTelephony<T extends ProtocolProviderService>

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.media.AbstractOperationSetBasicTelephony<T>
Type Parameters:
T - the implementation specific provider class like for example ProtocolProviderServiceSipImpl.
All Implemented Interfaces:
OperationSet, OperationSetBasicTelephony<T>
Direct Known Subclasses:
MockOperationSetBasicTelephony, OperationSetBasicTelephonyGibberishImpl, OperationSetBasicTelephonyJabberImpl, OperationSetBasicTelephonySipImpl

public abstract class AbstractOperationSetBasicTelephony<T extends ProtocolProviderService>
extends Object
implements OperationSetBasicTelephony<T>

Represents a default implementation of OperationSetBasicTelephony in order to make it easier for implementers to provide complete solutions while focusing on implementation-specific details.

Author:
Lyubomir Marinov, Emil Ivov, Dmitri Melnikov

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.protocol.OperationSetBasicTelephony
HANGUP_REASON_ENCRYPTION_REQUIRED, HANGUP_REASON_NORMAL_CLEARING, HANGUP_REASON_TIMEOUT, MAX_MEDIA_PORT_NUMBER_PROPERTY_NAME, MIN_MEDIA_PORT_NUMBER_PROPERTY_NAME
 
Constructor Summary
AbstractOperationSetBasicTelephony()
           
 
Method Summary
 void addCallListener(CallListener listener)
          Registers listener with this provider so that it could be notified when incoming calls are received.
 Recorder createRecorder(Call call)
          Creates a new Recorder which is to record the specified Call (into a file which is to be specified when starting the returned Recorder).
 void fireCallEvent(int eventID, Call sourceCall)
          Creates and dispatches a CallEvent notifying registered listeners that an event with id eventID has occurred on sourceCall.
 void fireCallEvent(int eventID, Call sourceCall, Map<MediaType,MediaDirection> mediaDirections)
          Creates and dispatches a CallEvent notifying registered listeners that an event with id eventID has occurred on sourceCall.
 void removeCallListener(CallListener listener)
          Removes the listener from the list of call listeners.
 void setMute(Call call, boolean mute)
          Sets the mute state of the Call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.protocol.OperationSetBasicTelephony
answerCallPeer, createCall, createCall, createCall, createCall, getActiveCalls, getProtocolProvider, hangupCallPeer, hangupCallPeer, putOffHold, putOnHold
 

Constructor Detail

AbstractOperationSetBasicTelephony

public AbstractOperationSetBasicTelephony()
Method Detail

addCallListener

public void addCallListener(CallListener listener)
Registers listener with this provider so that it could be notified when incoming calls are received.

Specified by:
addCallListener in interface OperationSetBasicTelephony<T extends ProtocolProviderService>
Parameters:
listener - the listener to register with this provider.

fireCallEvent

public void fireCallEvent(int eventID,
                          Call sourceCall)
Creates and dispatches a CallEvent notifying registered listeners that an event with id eventID has occurred on sourceCall.

Parameters:
eventID - the ID of the event to dispatch
sourceCall - the call on which the event has occurred.

fireCallEvent

public void fireCallEvent(int eventID,
                          Call sourceCall,
                          Map<MediaType,MediaDirection> mediaDirections)
Creates and dispatches a CallEvent notifying registered listeners that an event with id eventID has occurred on sourceCall.

Parameters:
eventID - the ID of the event to dispatch
sourceCall - the call on which the event has occurred.
mediaDirections - direction map for media types

removeCallListener

public void removeCallListener(CallListener listener)
Removes the listener from the list of call listeners.

Specified by:
removeCallListener in interface OperationSetBasicTelephony<T extends ProtocolProviderService>
Parameters:
listener - the listener to unregister.

setMute

public void setMute(Call call,
                    boolean mute)
Sets the mute state of the Call.

Muting audio streams sent from the call is implementation specific and one of the possible approaches to it is sending silence.

Specified by:
setMute in interface OperationSetBasicTelephony<T extends ProtocolProviderService>
Parameters:
call - the Call whose mute state is to be set
mute - true to mute the call streams being sent to peers; otherwise, false

createRecorder

public Recorder createRecorder(Call call)
                        throws OperationFailedException
Creates a new Recorder which is to record the specified Call (into a file which is to be specified when starting the returned Recorder).

AbstractOperationSetBasicTelephony implements the described functionality for MediaAwareCall only; otherwise, does nothing and just returns null.

Specified by:
createRecorder in interface OperationSetBasicTelephony<T extends ProtocolProviderService>
Parameters:
call - the Call which is to be recorded by the returned Recorder when the latter is started
Returns:
a new Recorder which is to record the specified call (into a file which is to be specified when starting the returned Recorder)
Throws:
OperationFailedException - if anything goes wrong while creating the new Recorder for the specified call
See Also:
OperationSetBasicTelephony.createRecorder(Call)

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.