Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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<CallPeerJabberImpl,OperationSetBasicTelephonyJabberImpl,ProtocolProviderServiceJabberImpl>
              extended by net.java.sip.communicator.impl.protocol.jabber.CallJabberImpl
All Implemented Interfaces:
PropertyChangeListener, EventListener, CallChangeListener, CallGroupListener, CallPeerListener

public class CallJabberImpl
extends MediaAwareCall<CallPeerJabberImpl,OperationSetBasicTelephonyJabberImpl,ProtocolProviderServiceJabberImpl>

A Jabber implementation of the Call abstract class encapsulating Jabber jingle sessions.

Author:
Emil Ivov

Field Summary
 
Fields inherited from class net.java.sip.communicator.service.protocol.media.MediaAwareCall
localVideoAllowed, mediaUseCase, parentOpSet
 
Fields inherited from class net.java.sip.communicator.service.protocol.AbstractCall
callGroup
 
Constructor Summary
protected CallJabberImpl(OperationSetBasicTelephonyJabberImpl parentOpSet)
          Initializes a new CallJabberImpl instance belonging to sourceProvider and associated with the jingle session with the specified jingleSID.
 
Method Summary
 void callAdded(CallGroupEvent evt)
          Notified when a call are added to a CallGroup.
 boolean containsJingleSID(String sid)
          Determines if this call contains a peer whose corresponding session has the specified sid.
 boolean getLocalInputEvtAware()
          Returns if the call support inputevt (remote control).
 CallPeerJabberImpl getPeer(String sid)
          Returns the peer whose corresponding session has the specified sid.
 CallPeerJabberImpl getPeerBySessInitPacketID(String id)
          Returns the peer whose corresponding session-init ID has the specified id.
 CallPeerJabberImpl initiateSession(String calleeJID, org.jivesoftware.smackx.packet.DiscoverInfo discoverInfo, Iterable<org.jivesoftware.smack.packet.PacketExtension> sessionInitiateExtensions)
          Creates a CallPeerJabberImpl from calleeJID and sends them session-initiate IQ request.
 void modifyVideoContent(boolean allowed)
          Send a content-modify message for all current CallPeer to reflect possible video change in media setup.
 CallPeerJabberImpl processSessionInitiate(JingleIQ jingleIQ)
          Creates a new call peer and sends a RINGING response.
 void setLocalInputEvtAware(boolean enable)
          Enable or disable inputevt support (remote control).
 
Methods inherited from class net.java.sip.communicator.service.protocol.media.MediaAwareCall
addCallPeer, addLocalUserSoundLevelListener, addVideoPropertyChangeListener, callPeerAdded, callPeerRemoved, callRemoved, callStateChanged, createRecorder, getDefaultDevice, getMediaUseCase, getParentOperationSet, getRTPTranslator, isConferenceFocus, isLocalVideoAllowed, isLocalVideoStreaming, isMute, peerAddressChanged, peerDisplayNameChanged, peerImageChanged, peerStateChanged, peerTransportAddressChanged, propertyChange, removeLocalUserSoundLevelListener, removeVideoPropertyChangeListener, setAudioDevice, 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, setCallState, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CallJabberImpl

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

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

setLocalInputEvtAware

public void setLocalInputEvtAware(boolean enable)
Enable or disable inputevt support (remote control).

Parameters:
enable - new state of inputevt support

getLocalInputEvtAware

public boolean getLocalInputEvtAware()
Returns if the call support inputevt (remote control).

Returns:
true if the call support inputevt, false otherwise

processSessionInitiate

public CallPeerJabberImpl processSessionInitiate(JingleIQ jingleIQ)
Creates a new call peer and sends a RINGING response.

Parameters:
jingleIQ - the JingleIQ that created the session.
Returns:
the newly created CallPeerJabberImpl (the one that sent the INVITE).

initiateSession

public CallPeerJabberImpl initiateSession(String calleeJID,
                                          org.jivesoftware.smackx.packet.DiscoverInfo discoverInfo,
                                          Iterable<org.jivesoftware.smack.packet.PacketExtension> sessionInitiateExtensions)
                                   throws OperationFailedException
Creates a CallPeerJabberImpl from calleeJID and sends them session-initiate IQ request.

Parameters:
calleeJID - the party that we would like to invite to this call.
discoverInfo - any discovery information that we have for the jid we are trying to reach and that we are passing in order to avoid having to ask for it again.
sessionInitiateExtensions - a collection of additional and optional PacketExtensions to be added to the session-initiate JingleIQ 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.

modifyVideoContent

public void modifyVideoContent(boolean allowed)
                        throws OperationFailedException
Send a content-modify message for all current CallPeer to reflect possible video change in media setup.

Parameters:
allowed - if the local video is allowed or not
Throws:
OperationFailedException - if problem occurred during message generation or network problem

containsJingleSID

public boolean containsJingleSID(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 jingle sid and false otherwise.

getPeer

public CallPeerJabberImpl 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 CallPeerJabberImpl with the specified jingle sid and null if no such peer exists in this call.

getPeerBySessInitPacketID

public CallPeerJabberImpl 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 CallPeerJabberImpl with the specified IQ id and null if no such peer exists in this call.

callAdded

public void callAdded(CallGroupEvent evt)
Notified when a call are added to a CallGroup.

Specified by:
callAdded in interface CallGroupListener
Overrides:
callAdded in class MediaAwareCall<CallPeerJabberImpl,OperationSetBasicTelephonyJabberImpl,ProtocolProviderServiceJabberImpl>
Parameters:
evt - event

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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