Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber
Class CallGTalkImpl

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.Call
      extended by net.java.sip.communicator.service.protocol.AbstractCall<T,V>
          extended by net.java.sip.communicator.service.protocol.media.MediaAwareCall<CallPeerGTalkImpl,OperationSetBasicTelephonyJabberImpl,ProtocolProviderServiceJabberImpl>
              extended by net.java.sip.communicator.impl.protocol.jabber.CallGTalkImpl
All Implemented Interfaces:
PropertyChangeListener, EventListener, CallChangeListener, CallGroupListener, CallPeerListener

public class CallGTalkImpl
extends MediaAwareCall<CallPeerGTalkImpl,OperationSetBasicTelephonyJabberImpl,ProtocolProviderServiceJabberImpl>

A Google Talk implementation of the Call abstract class encapsulating Google Talk sessions.

Author:
Sebastien Vincent

Field Summary
 
Fields inherited from class net.java.sip.communicator.service.protocol.media.MediaAwareCall
DEFAULT_DEVICE, localVideoAllowed, mediaUseCase, parentOpSet
 
Fields inherited from class net.java.sip.communicator.service.protocol.AbstractCall
callGroup
 
Constructor Summary
protected CallGTalkImpl(OperationSetBasicTelephonyJabberImpl parentOpSet)
          Initializes a new CallGTalkImpl instance belonging to sourceProvider and associated with the jingle session with the specified sessionID.
 
Method Summary
 boolean containsSessionID(String sid)
          Determines if this call contains a peer whose corresponding session has the specified sid.
 CallPeerGTalkImpl getPeer(String sid)
          Returns the peer whose corresponding session has the specified sid.
 CallPeerGTalkImpl getPeerBySessInitPacketID(String id)
          Returns the peer whose corresponding session-init ID has the specified id.
 CallPeerGTalkImpl initiateGTalkSession(String calleeJID, Iterable<org.jivesoftware.smack.packet.PacketExtension> sessionInitiateExtensions)
          Creates a CallPeerGTalkImpl from calleeJID and sends them initiate IQ request.
 CallPeerGTalkImpl processGTalkInitiate(SessionIQ sessionIQ)
          Creates a new Google Talk call peer and sends a RINGING response.
 
Methods inherited from class net.java.sip.communicator.service.protocol.media.MediaAwareCall
addCallPeer, addLocalUserSoundLevelListener, addPropertyChangeListener, addVideoPropertyChangeListener, callAdded, callPeerAdded, callPeerRemoved, callRemoved, callStateChanged, createRecorder, getDefaultDevice, getMediaUseCase, getParentOperationSet, getRTPTranslator, isConferenceFocus, isLocalVideoAllowed, isLocalVideoStreaming, isMute, peerAddressChanged, peerDisplayNameChanged, peerImageChanged, peerStateChanged, peerTransportAddressChanged, propertyChange, removeLocalUserSoundLevelListener, removePropertyChangeListener, removeVideoPropertyChangeListener, setAudioDevice, setCallState, setConferenceFocus, setLocalVideoAllowed, setMute, setVideoDevice
 
Methods inherited from class net.java.sip.communicator.service.protocol.AbstractCall
getCallGroup, getCallPeerCount, getCallPeers, getCallPeersVector, getCrossProtocolCallPeerCount, getCrossProtocolCallPeers, getCrossProtocolCallPeersVector, getProtocolProvider, setCallGroup
 
Methods inherited from class net.java.sip.communicator.service.protocol.Call
addCallChangeListener, equals, fireCallChangeEvent, fireCallChangeEvent, fireCallPeerEvent, getCallID, getCallState, hashCode, isDefaultEncrypted, isSipZrtpAttribute, removeCallChangeListener, setCallState, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CallGTalkImpl

protected CallGTalkImpl(OperationSetBasicTelephonyJabberImpl parentOpSet)
Initializes a new CallGTalkImpl instance belonging to sourceProvider and associated with the jingle session with the specified sessionID. If the new instance corresponds to an incoming Google Talk session, then the sessionID would come from there. Otherwise, one could generate one using SessionIQ.generateSID().

Parameters:
parentOpSet - the OperationSetBasicTelephonyJabberImpl instance in the context of which this call has been created.
Method Detail

containsSessionID

public boolean containsSessionID(String sid)
Determines if this call contains a peer whose corresponding session has the specified sid.

Parameters:
sid - the ID of the session whose peer we are looking for.
Returns:
true if this call contains a peer with the specified Google Talk sid and false otherwise.

getPeer

public CallPeerGTalkImpl getPeer(String sid)
Returns the peer whose corresponding session has the specified sid.

Parameters:
sid - the ID of the session whose peer we are looking for.
Returns:
the CallPeerGTalkImpl with the specified Google Talk sid and null if no such peer exists in this call.

getPeerBySessInitPacketID

public CallPeerGTalkImpl getPeerBySessInitPacketID(String id)
Returns the peer whose corresponding session-init ID has the specified id.

Parameters:
id - the ID of the session-init IQ whose peer we are looking for.
Returns:
the CallPeerGTalkImpl with the specified IQ id and null if no such peer exists in this call.

processGTalkInitiate

public CallPeerGTalkImpl processGTalkInitiate(SessionIQ sessionIQ)
Creates a new Google Talk call peer and sends a RINGING response.

Parameters:
sessionIQ - the SessionIQ that created the session.
Returns:
the newly created CallPeerGTalkImpl (the one that sent the INVITE).

initiateGTalkSession

public CallPeerGTalkImpl initiateGTalkSession(String calleeJID,
                                              Iterable<org.jivesoftware.smack.packet.PacketExtension> sessionInitiateExtensions)
                                       throws OperationFailedException
Creates a CallPeerGTalkImpl from calleeJID and sends them initiate IQ request.

Parameters:
calleeJID - the party that we would like to invite to this call.
sessionInitiateExtensions - a collection of additional and optional PacketExtensions to be added to the initiate SessionIQ which is to init this CallJabberImpl
Returns:
the newly created Call corresponding to calleeJID. All following state change events will be delivered through this call peer.
Throws:
OperationFailedException - with the corresponding code if we fail to create the call.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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