Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip
Class ActiveCallsRepositorySipImpl

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.event.CallChangeAdapter
      extended by net.java.sip.communicator.service.protocol.ActiveCallsRepository<CallSipImpl,OperationSetBasicTelephonySipImpl>
          extended by net.java.sip.communicator.impl.protocol.sip.ActiveCallsRepositorySipImpl
All Implemented Interfaces:
EventListener, CallChangeListener

public class ActiveCallsRepositorySipImpl
extends ActiveCallsRepository<CallSipImpl,OperationSetBasicTelephonySipImpl>

Keeps a list of all calls currently active and maintained by this protocol povider. Offers methods for finding a call by its ID, peer dialog and others.

Author:
Emil Ivov

Field Summary
 
Fields inherited from class net.java.sip.communicator.service.protocol.ActiveCallsRepository
parentOperationSet
 
Constructor Summary
ActiveCallsRepositorySipImpl(OperationSetBasicTelephonySipImpl opSet)
          Creates a new instance of this repository.
 
Method Summary
 CallSipImpl findCall(javax.sip.Dialog dialog)
          Returns the call that contains the specified dialog (i.e.
 CallSipImpl findCall(String callID, String localTag, String remoteTag)
          Returns the CallSipImpl instance with a Dialog matching the specified Call-ID, local and remote tags.
 CallPeerSipImpl findCallPeer(javax.sip.Dialog dialog)
          Returns the call peer whose associated jain sip dialog matches dialog.
 CallPeerSipImpl findCallPeer(String branchID, javax.sip.header.Header cidHeader)
          Returns the CallPeerSipImpl whose INVITE transaction has the specified branchID and whose corresponding INVITE request contains the specified callID.
 CallPeerSipImpl findCallPeer(String branchID, String callID)
          Returns the CallPeerSipImpl whose INVITE transaction has the specified branchID and whose corresponding INVITE request contains the specified callID.
 CallPeerSipImpl findCallPeer(String callID, String localTag, String remoteTag)
          Returns the CallPeerSipImpl instance with a Dialog matching CallID, local and remote tags.
protected  void fireCallEvent(int eventID, Call sourceCall)
          Creates and dispatches a CallEvent notifying registered listeners that an event with id eventID has occurred on sourceCall.
 
Methods inherited from class net.java.sip.communicator.service.protocol.ActiveCallsRepository
addCall, callStateChanged, getActiveCallCount, getActiveCalls
 
Methods inherited from class net.java.sip.communicator.service.protocol.event.CallChangeAdapter
callPeerAdded, callPeerRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActiveCallsRepositorySipImpl

public ActiveCallsRepositorySipImpl(OperationSetBasicTelephonySipImpl opSet)
Creates a new instance of this repository.

Parameters:
opSet - a reference to the OperationSetBasicTelephonySipImpl that craeted us.
Method Detail

findCall

public CallSipImpl findCall(javax.sip.Dialog dialog)
Returns the call that contains the specified dialog (i.e. it is established between us and one of the other call peers).

Parameters:
dialog - the jain sip Dialog whose containing call we're looking for.
Returns:
the CallSipImpl containing dialog or null if no call contains the specified dialog.

findCallPeer

public CallPeerSipImpl findCallPeer(javax.sip.Dialog dialog)
Returns the call peer whose associated jain sip dialog matches dialog.

Parameters:
dialog - the jain sip dialog whose corresponding peer we're looking for.
Returns:
the call peer whose jain sip dialog is the same as the specified or null if no such call peer was found.

findCallPeer

public CallPeerSipImpl findCallPeer(String callID,
                                    String localTag,
                                    String remoteTag)
Returns the CallPeerSipImpl instance with a Dialog matching CallID, local and remote tags.

Parameters:
callID - the Call-ID of the dialog we are looking for.
localTag - the local tag of the dialog we are looking for.
remoteTag - the remote tag of the dialog we are looking for.
Returns:
the CallPeerSipImpl matching specified dialog ID or null if no such peer is known to this repository.

findCallPeer

public CallPeerSipImpl findCallPeer(String branchID,
                                    String callID)
Returns the CallPeerSipImpl whose INVITE transaction has the specified branchID and whose corresponding INVITE request contains the specified callID.

Parameters:
callID - the Call-ID of the dialog we are looking for.
branchID - a String corresponding to the branch id of the latest INVITE transaction that was associated with the peer we are looking for.
Returns:
the CallPeerSipImpl matching specified call and branch id-s or null if no such peer is known to this repository.

findCallPeer

public CallPeerSipImpl findCallPeer(String branchID,
                                    javax.sip.header.Header cidHeader)
Returns the CallPeerSipImpl whose INVITE transaction has the specified branchID and whose corresponding INVITE request contains the specified callID.

Parameters:
cidHeader - the Call-ID of the dialog we are looking for.
branchID - a String corresponding to the branch id of the latest INVITE transaction that was associated with the peer we are looking for.
Returns:
the CallPeerSipImpl matching specified call and branch id-s or null if no such peer is known to this repository.

findCall

public CallSipImpl findCall(String callID,
                            String localTag,
                            String remoteTag)
Returns the CallSipImpl instance with a Dialog matching the specified Call-ID, local and remote tags.

Parameters:
callID - the Call-ID of the dialog we are looking for.
localTag - the local tag of the dialog we are looking for.
remoteTag - the remote tag of the dialog we are looking for.
Returns:
the CallSipImpl responsible for handling the Dialog with the matching ID or null if no such call was found.

fireCallEvent

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

Specified by:
fireCallEvent in class ActiveCallsRepository<CallSipImpl,OperationSetBasicTelephonySipImpl>
Parameters:
eventID - the ID of the event to dispatch
sourceCall - the call on which the event has occurred
See Also:
ActiveCallsRepository.fireCallEvent(int, Call)

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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