public class CallPeerJabberImpl extends AbstractCallPeerJabberGTalkImpl<CallJabberImpl,CallPeerMediaHandlerJabberImpl,JingleIQ>
initiator, peerJID, sessionInitIQ
callPeerConferenceListeners, callPeerListeners, callPeerSecurityListeners, NO_CONFERENCE_MEMBERS
ERROR, INFORMATION, SEVERE, WARNING
MAX_LEVEL, MIN_LEVEL
CALL_DURATION_START_TIME_UNKNOWN, MUTE_PROPERTY_NAME
Constructor and Description |
---|
CallPeerJabberImpl(java.lang.String peerAddress,
CallJabberImpl owningCall)
Creates a new call peer with address peerAddress.
|
CallPeerJabberImpl(java.lang.String peerAddress,
CallJabberImpl owningCall,
JingleIQ sessionIQ)
Creates a new call peer with address peerAddress.
|
Modifier and Type | Method and Description |
---|---|
void |
answer()
Send a session-accept JingleIQ to this CallPeer
|
org.jitsi.service.neomedia.MediaDirection |
getDirection(org.jitsi.service.neomedia.MediaType mediaType)
Returns the direction of the session for media of type mediaType
that we have with this CallPeer.
|
java.lang.String |
getEntity()
Gets the String to be used for this CallPeer when
we describe it in a ConferenceInfoDocument (e.g.
|
org.jitsi.service.neomedia.MediaType |
getMediaType(ContentPacketExtension content)
Gets the MediaType of content.
|
ContentPacketExtension.SendersEnum |
getSenders(org.jitsi.service.neomedia.MediaType mediaType)
Gets the current value of the senders field of the content with
name mediaType in the Jingle session with this
CallPeer.
|
JingleIQ |
getSessionIQ()
Returns the IQ ID of the Jingle session-initiate packet associated with
this call.
|
java.lang.String |
getSID()
Returns the session ID of the Jingle session associated with this call.
|
void |
hangup(boolean failed,
java.lang.String reasonText,
org.jivesoftware.smack.packet.PacketExtension reasonOtherExtension)
Ends the call with this CallPeer.
|
protected void |
initiateSession(java.lang.Iterable<org.jivesoftware.smack.packet.PacketExtension> sessionInitiateExtensions)
Creates and sends a session-initiate
JingleIQ . |
(package private) void |
processColibriConferenceIQ(ColibriConferenceIQ conferenceIQ)
Notifies this instance that a specific ColibriConferenceIQ has
been received.
|
void |
processContentAccept(JingleIQ content)
Processes the content-accept
JingleIQ . |
void |
processContentAdd(JingleIQ content)
Processes the content-add
JingleIQ . |
void |
processContentModify(JingleIQ content)
Processes the content-modify
JingleIQ . |
void |
processContentReject(JingleIQ content)
Processes the content-reject
JingleIQ . |
void |
processContentRemove(JingleIQ content)
Processes the content-remove
JingleIQ . |
void |
processSessionAccept(JingleIQ sessionInitIQ)
Processes a session-accept
JingleIQ . |
void |
processSessionInfo(SessionInfoPacketExtension info)
Handles the specified session info packet according to its
content.
|
protected void |
processSessionInitiate(JingleIQ sessionInitIQ)
Processes the session initiation
JingleIQ that we were created
with, passing its content to the media handler and then sends either a
"session-info/ringing" or a "session-terminate" response. |
void |
processSessionTerminate(JingleIQ jingleIQ)
Puts this peer into a
CallPeerState.DISCONNECTED , indicating a
reason to the user, if there is one. |
void |
processSourceAdd(JingleIQ content)
Processes the source-add
JingleIQ action used in Jitsi-Meet. |
void |
processSourceRemove(JingleIQ content)
Processes the source-remove
JingleIQ action used in Jitsi-Meet. |
void |
processTransfer(TransferPacketExtension transfer)
Processes a specific "XEP-0251: Jingle Session Transfer"
transfer packet (extension).
|
void |
processTransportInfo(JingleIQ jingleIQ)
Processes the transport-info
JingleIQ . |
void |
putOnHold(boolean onHold)
Puts the CallPeer represented by this instance on or off hold.
|
void |
sendCoinSessionInfo()
Sends a content message to reflect changes in the setup such as
the local peer/user becoming a conference focus.
|
boolean |
sendModifyVideoContent()
Send, if necessary, a jingle content message to reflect change
in video setup.
|
void |
sendModifyVideoResolutionContent()
Send a content message to reflect change in video setup (start
or stop).
|
protected void |
sendTransportInfo(java.lang.Iterable<ContentPacketExtension> contents)
Sends local candidate addresses from the local peer to the remote peer
using the transport-info
JingleIQ . |
void |
setSenders(org.jitsi.service.neomedia.MediaType mediaType,
ContentPacketExtension.SendersEnum senders)
Set the current value of the senders field of the content with
name mediaType in the Jingle session with this CallPeer
|
void |
setState(CallPeerState newState,
java.lang.String reason,
int reasonCode)
Overrides the parent set state method in order to make sure that we
close our media handler whenever we enter a disconnected state.
|
protected void |
transfer(java.lang.String to,
java.lang.String sid)
Transfer (in the sense of call transfer) this CallPeer to a
specific callee address which may optionally be participating in an
active Call.
|
getAddress, getContact, getDiscoveryInfo, getDisplayName, getSessInitID, getURI, isInitiator, retrieveDiscoveryInfo, setAddress, setDiscoveryInfo
addConferenceMembersSoundLevelListener, addStreamSoundLevelListener, addVideoPropertyChangeListener, audioLevelChanged, audioLevelsReceived, callPeerAdded, callPeerRemoved, conferenceFocusChanged, conferenceMemberAdded, conferenceMemberErrorReceived, conferenceMemberRemoved, getCall, getImage, getLastConferenceInfoReceived, getLastConferenceInfoReceivedVersion, getLastConferenceInfoSent, getLastConferenceInfoSentTimestamp, getMediaHandler, getPeerID, getProtocolProvider, isConfInfoScheduled, isJitsiVideobridge, isLocalVideoStreaming, isMute, logAndFail, reevalLocalHoldStatus, reevalRemoteHoldStatus, removeConferenceMember, removeConferenceMembersSoundLevelListener, removeStreamSoundLevelListener, removeVideoPropertyChangeListener, securityMessageReceived, securityNegotiationStarted, securityTimeout, securityTurnedOff, securityTurnedOn, setCall, setConfInfoScheduled, setImage, setLastConferenceInfoReceived, setLastConferenceInfoSent, setLastConferenceInfoSentTimestamp, setLocalVideoAllowed, setMediaHandler, setMute, setPeerID
addCallPeerConferenceListener, addCallPeerListener, addCallPeerSecurityListener, addConferenceMember, findConferenceMember, fireCallPeerChangeEvent, fireCallPeerChangeEvent, fireCallPeerChangeEvent, fireCallPeerConferenceEvent, fireCallPeerSecurityMessageEvent, fireCallPeerSecurityNegotiationStartedEvent, fireCallPeerSecurityOffEvent, fireCallPeerSecurityOnEvent, fireCallPeerSecurityTimeoutEvent, fireConferenceMemberErrorEvent, getAlternativeIMPPAddress, getCallDurationStartTime, getCallInfoURL, getConferenceMemberCount, getConferenceMembers, getCurrentSecuritySettings, getState, isConferenceFocus, removeCallPeerConferenceListener, removeCallPeerListener, removeCallPeerSecurityListener, setAlternativeIMPPAddress, setConferenceFocus, setState, setState, toString
addPropertyChangeListener, firePropertyChange, getPropertyChangeSource, removePropertyChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, removePropertyChangeListener
public CallPeerJabberImpl(java.lang.String peerAddress, CallJabberImpl owningCall)
peerAddress
- the Jabber address of the new call peer.owningCall
- the call that contains this call peer.public CallPeerJabberImpl(java.lang.String peerAddress, CallJabberImpl owningCall, JingleIQ sessionIQ)
peerAddress
- the Jabber address of the new call peer.owningCall
- the call that contains this call peer.sessionIQ
- The session-initiate JingleIQ which was
received from peerAddress and caused the creation of this
CallPeerJabberImplpublic void answer() throws OperationFailedException
OperationFailedException
- if we fail to create or send the
response.public java.lang.String getSID()
getSID
in class AbstractCallPeerJabberGTalkImpl<CallJabberImpl,CallPeerMediaHandlerJabberImpl,JingleIQ>
public JingleIQ getSessionIQ()
public void hangup(boolean failed, java.lang.String reasonText, org.jivesoftware.smack.packet.PacketExtension reasonOtherExtension)
failed
- indicates if the hangup is following to a call failure or
simply a disconnectreasonText
- the text, if any, to be set on the
ReasonPacketExtension as the value of itsreasonOtherExtension
- the PacketExtension, if any, to be
set on the ReasonPacketExtension as the value of its
otherExtension propertyprotected void initiateSession(java.lang.Iterable<org.jivesoftware.smack.packet.PacketExtension> sessionInitiateExtensions) throws OperationFailedException
JingleIQ
.sessionInitiateExtensions
- a collection of additional and optional
PacketExtensions to be added to the session-initiate
JingleIQ
which is to initiate the session with this
CallPeerJabberImplOperationFailedException
- exceptionvoid processColibriConferenceIQ(ColibriConferenceIQ conferenceIQ)
conferenceIQ
- the ColibriConferenceIQ which has been
receivedpublic void processContentAccept(JingleIQ content)
JingleIQ
.content
- The JingleIQ
that contains content that remote
peer has acceptedpublic void processContentAdd(JingleIQ content)
JingleIQ
.content
- The JingleIQ
that contains content that remote
peer wants to be addedpublic void processContentModify(JingleIQ content)
JingleIQ
.content
- The JingleIQ
that contains content that remote
peer wants to be modifiedpublic void processContentReject(JingleIQ content)
JingleIQ
.content
- The JingleIQ
public void processContentRemove(JingleIQ content)
JingleIQ
.content
- The JingleIQ
that contains content that remote
peer wants to be removedpublic void processSessionAccept(JingleIQ sessionInitIQ)
JingleIQ
.sessionInitIQ
- The session-accept JingleIQ
to process.public void processSessionInfo(SessionInfoPacketExtension info)
info
- the SessionInfoPacketExtension
that we just received.protected void processSessionInitiate(JingleIQ sessionInitIQ)
JingleIQ
that we were created
with, passing its content to the media handler and then sends either a
"session-info/ringing" or a "session-terminate" response.sessionInitIQ
- The JingleIQ
that created the session that
we are handling here.public void processSessionTerminate(JingleIQ jingleIQ)
CallPeerState.DISCONNECTED
, indicating a
reason to the user, if there is one.jingleIQ
- the JingleIQ
that's terminating our session.public void processTransfer(TransferPacketExtension transfer) throws OperationFailedException
transfer
- the "XEP-0251: Jingle Session Transfer" transfer packet
(extension) to processOperationFailedException
- if anything goes wrong while processing
the specified transfer packet (extension)public void processTransportInfo(JingleIQ jingleIQ)
JingleIQ
.jingleIQ
- the transport-info JingleIQ
to processpublic void putOnHold(boolean onHold) throws OperationFailedException
onHold
- true to have the CallPeer put on hold;
false, otherwiseOperationFailedException
- if we fail to construct or send the
INVITE request putting the remote side on/off hold.public void sendCoinSessionInfo()
public boolean sendModifyVideoContent()
public void sendModifyVideoResolutionContent()
protected void sendTransportInfo(java.lang.Iterable<ContentPacketExtension> contents)
JingleIQ
.contents
- the local candidate addresses to be sent from the local
peer to the remote peer using the transport-info
JingleIQ
public void setState(CallPeerState newState, java.lang.String reason, int reasonCode)
MediaAwareCallPeer
setState
in class MediaAwareCallPeer<CallJabberImpl,CallPeerMediaHandlerJabberImpl,ProtocolProviderServiceJabberImpl>
newState
- the CallPeerState that we are about to enter and
that we pass to our predecessor.reason
- a reason phrase explaining the state (e.g. if newState
indicates a failure) and that we pass to our predecessor.reasonCode
- the code for the reason of the state change.protected void transfer(java.lang.String to, java.lang.String sid) throws OperationFailedException
to
- the address of the callee to transfer this CallPeer tosid
- the Jingle session ID of the active Call between the
local peer and the callee in the case of attended transfer; null
in the case of unattended transferOperationFailedException
- if something goes wrongpublic java.lang.String getEntity()
getEntity
in class MediaAwareCallPeer<CallJabberImpl,CallPeerMediaHandlerJabberImpl,ProtocolProviderServiceJabberImpl>
public org.jitsi.service.neomedia.MediaDirection getDirection(org.jitsi.service.neomedia.MediaType mediaType)
getDirection
in class MediaAwareCallPeer<CallJabberImpl,CallPeerMediaHandlerJabberImpl,ProtocolProviderServiceJabberImpl>
mediaType
- the MediaType to usepublic ContentPacketExtension.SendersEnum getSenders(org.jitsi.service.neomedia.MediaType mediaType)
mediaType
- the MediaType for which to get the current
value of the senders field.public void setSenders(org.jitsi.service.neomedia.MediaType mediaType, ContentPacketExtension.SendersEnum senders)
mediaType
- the MediaType for which to get the current
value of the senders field.senders
- the value to setpublic org.jitsi.service.neomedia.MediaType getMediaType(ContentPacketExtension content)
content
- the ContentPacketExtention for which to get the
MediaTypepublic void processSourceAdd(JingleIQ content)
JingleIQ
action used in Jitsi-Meet.
For now processing only audio, as we use single ssrc for audio and
using multiple ssrcs for video. ConferenceMember currently support single
ssrc for audio and video and adding multiple ssrcs will need a large
refactor.content
- The JingleIQ
that contains content that remote
peer wants to be addedpublic void processSourceRemove(JingleIQ content)
JingleIQ
action used in Jitsi-Meet.
For now processing only audio, as we use single ssrc for audio and
using multiple ssrcs for video. ConferenceMember currently support single
ssrc for audio and video and adding multiple ssrcs will need a large
refactor.content
- The JingleIQ
that contains content that remote
peer wants to be removed
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.