public class OperationSetBasicTelephonyJabberImpl extends AbstractOperationSetBasicTelephony<ProtocolProviderServiceJabberImpl> implements RegistrationStateChangeListener, org.jivesoftware.smack.PacketListener, org.jivesoftware.smack.filter.PacketFilter, OperationSetSecureSDesTelephony, OperationSetSecureZrtpTelephony, OperationSetAdvancedTelephony<ProtocolProviderServiceJabberImpl>
HANGUP_REASON_BUSY_HERE, HANGUP_REASON_ENCRYPTION_REQUIRED, HANGUP_REASON_NORMAL_CLEARING, HANGUP_REASON_TIMEOUT, MAX_AUDIO_PORT_NUMBER_PROPERTY_NAME, MAX_DATA_CHANNEL_PORT_NUMBER_PROPERTY_NAME, MAX_MEDIA_PORT_NUMBER_PROPERTY_NAME, MAX_VIDEO_PORT_NUMBER_PROPERTY_NAME, MIN_AUDIO_PORT_NUMBER_PROPERTY_NAME, MIN_DATA_CHANNEL_PORT_NUMBER_PROPERTY_NAME, MIN_MEDIA_PORT_NUMBER_PROPERTY_NAME, MIN_VIDEO_PORT_NUMBER_PROPERTY_NAME
Constructor and Description |
---|
OperationSetBasicTelephonyJabberImpl(ProtocolProviderServiceJabberImpl protocolProvider)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(org.jivesoftware.smack.packet.Packet packet)
Tests whether or not the specified packet should be handled by this
operation set.
|
void |
answerCallPeer(CallPeer peer)
Implements method answerCallPeer
from OperationSetBasicTelephony.
|
CallJabberImpl |
createCall(ConferenceDescription cd,
ChatRoom chatRoom)
Creates a new Call and sends an invite to the conference
described in cd.
|
Call |
createCall(java.lang.String callee,
CallConference conference)
Creates a new Call and invites a specific CallPeer to
it given by her String URI.
|
(package private) AbstractCallPeer<?,?> |
createOutgoingCall(CallJabberImpl call,
java.lang.String calleeAddress)
Init and establish the specified call.
|
(package private) AbstractCallPeer<?,?> |
createOutgoingCall(CallJabberImpl call,
java.lang.String calleeAddress,
java.lang.Iterable<org.jivesoftware.smack.packet.PacketExtension> sessionInitiateExtensions)
Init and establish the specified call.
|
(package private) AbstractCallPeer<?,?> |
createOutgoingCall(CallJabberImpl call,
java.lang.String calleeAddress,
java.lang.String fullCalleeURI,
java.lang.Iterable<org.jivesoftware.smack.packet.PacketExtension> sessionInitiateExtensions)
Init and establish the specified call.
|
CallPeerJabberImpl |
getActiveCallPeer(java.lang.String sid)
Returns the active call peer corresponding to the given sid.
|
java.util.Iterator<CallJabberImpl> |
getActiveCalls()
Returns an iterator over all currently active calls.
|
protected ActiveCallsRepositoryJabberGTalkImpl<CallJabberImpl,CallPeerJabberImpl> |
getActiveCallsRepository()
Returns a reference to the
ActiveCallsRepositoryJabberGTalkImpl
that we are currently using. |
(package private) java.lang.String |
getFullCalleeURI(java.lang.String calleeAddress)
Gets the full callee URI for a specific callee address.
|
ProtocolProviderServiceJabberImpl |
getProtocolProvider()
Returns the protocol provider that this operation set belongs to.
|
void |
hangupCallPeer(CallPeer peer)
Ends the call with the specified peer.
|
void |
hangupCallPeer(CallPeer peer,
int reasonCode,
java.lang.String reasonText)
Ends the call with the specified peer.
|
boolean |
isSecure(CallPeer peer)
Gets the secure state of the call session in which a specific peer
is involved
|
void |
processPacket(org.jivesoftware.smack.packet.Packet packet)
Handles incoming jingle packets and passes them to the corresponding
method based on their action.
|
void |
putOffHold(CallPeer peer)
Resumes communication with a call peer previously put on hold.
|
void |
putOnHold(CallPeer peer)
Puts the specified CallPeer "on hold".
|
void |
registrationStateChanged(RegistrationStateChangeEvent evt)
Implementation of method registrationStateChange from
interface RegistrationStateChangeListener for setting up (or down)
our JingleManager when an XMPPConnection is available
|
void |
setTransferAuthority(TransferAuthority authority)
Transfer authority used for interacting with user for unknown calls
and the requests for transfer.
|
void |
shutdown()
Closes all active calls.
|
void |
transfer(CallPeer peer,
CallPeer target)
Transfers (in the sense of call transfer) a specific CallPeer to
a specific callee address which already participates in an active
Call.
|
void |
transfer(CallPeer peer,
java.lang.String target)
Transfers (in the sense of call transfer) a specific CallPeer to
a specific callee address which may or may not already be participating
in an active Call.
|
addCallListener, createCall, createCall, createCall, createRecorder, fireCallEvent, fireCallEvent, fireCallEvent, removeCallListener, setMute
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addCallListener, createCall, createCall, createCall, createRecorder, removeCallListener, setMute
public OperationSetBasicTelephonyJabberImpl(ProtocolProviderServiceJabberImpl protocolProvider)
protocolProvider
- a reference to the
ProtocolProviderServiceJabberImpl instance that created us.public void registrationStateChanged(RegistrationStateChangeEvent evt)
registrationStateChanged
in interface RegistrationStateChangeListener
evt
- the event receivedpublic Call createCall(java.lang.String callee, CallConference conference) throws OperationFailedException
createCall
in interface OperationSetBasicTelephony<ProtocolProviderServiceJabberImpl>
callee
- the address of the callee who we should invite to a new
Callconference
- the CallConference in which the newly-created
Call is to participateOperationFailedException
- with the corresponding code if we fail
to create the callOperationSetBasicTelephony.createCall(String)
public CallJabberImpl createCall(ConferenceDescription cd, ChatRoom chatRoom) throws OperationFailedException
createCall
in interface OperationSetBasicTelephony<ProtocolProviderServiceJabberImpl>
createCall
in class AbstractOperationSetBasicTelephony<ProtocolProviderServiceJabberImpl>
cd
- the conference to send an invite tochatRoom
- the chat room associated with the call.OperationFailedException
AbstractCallPeer<?,?> createOutgoingCall(CallJabberImpl call, java.lang.String calleeAddress) throws OperationFailedException
call
- the CallJabberImpl that will be used
to initiate the callcalleeAddress
- the address of the callee that we'd like to connect
with.OperationFailedException
- with the corresponding code if we fail
to create the call.AbstractCallPeer<?,?> createOutgoingCall(CallJabberImpl call, java.lang.String calleeAddress, java.lang.Iterable<org.jivesoftware.smack.packet.PacketExtension> sessionInitiateExtensions) throws OperationFailedException
call
- the CallJabberImpl that will be used
to initiate the callcalleeAddress
- the address of the callee that we'd like to connect
with.sessionInitiateExtensions
- a collection of additional and optional
PacketExtensions to be added to the session-initiate
JingleIQ
which is to init the specified callOperationFailedException
- with the corresponding code if we fail
to create the call.AbstractCallPeer<?,?> createOutgoingCall(CallJabberImpl call, java.lang.String calleeAddress, java.lang.String fullCalleeURI, java.lang.Iterable<org.jivesoftware.smack.packet.PacketExtension> sessionInitiateExtensions) throws OperationFailedException
call
- the CallJabberImpl that will be used
to initiate the callcalleeAddress
- the address of the callee that we'd like to connect
with.fullCalleeURI
- the full Jid address, which if specified would
explicitly initiate a call to this full addresssessionInitiateExtensions
- a collection of additional and optional
PacketExtensions to be added to the session-initiate
JingleIQ
which is to init the specified callOperationFailedException
- with the corresponding code if we fail
to create the call.java.lang.String getFullCalleeURI(java.lang.String calleeAddress)
calleeAddress
- the callee address to get the full callee URI forpublic java.util.Iterator<CallJabberImpl> getActiveCalls()
getActiveCalls
in interface OperationSetBasicTelephony<ProtocolProviderServiceJabberImpl>
public CallPeerJabberImpl getActiveCallPeer(java.lang.String sid)
sid
- 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 transferpublic void putOffHold(CallPeer peer) throws OperationFailedException
putOffHold
in interface OperationSetBasicTelephony<ProtocolProviderServiceJabberImpl>
peer
- the call peer to put on hold.OperationFailedException
- if we fail to send the "hold" message.public void putOnHold(CallPeer peer) throws OperationFailedException
putOnHold
in interface OperationSetBasicTelephony<ProtocolProviderServiceJabberImpl>
peer
- the peer that we'd like to put on hold.OperationFailedException
- if we fail to send the "hold" message.public void hangupCallPeer(CallPeer peer) throws java.lang.ClassCastException, OperationFailedException
hangupCallPeer
in interface OperationSetBasicTelephony<ProtocolProviderServiceJabberImpl>
peer
- the peer that we'd like to hang up on.java.lang.ClassCastException
- if peer is not an instance of this
CallPeerSipImpl.OperationFailedException
- if we fail to terminate the call.public void hangupCallPeer(CallPeer peer, int reasonCode, java.lang.String reasonText)
hangupCallPeer
in interface OperationSetBasicTelephony<ProtocolProviderServiceJabberImpl>
peer
- the peer that we'd like to hang up on.reasonCode
- indicates if the hangup is following to a call failure
or simply a disconnect indicate by the reason.reasonText
- the reason of the hangup. If the hangup is due to a
call failure, then this string could indicate the reason of the failureOperationFailedException
- if we fail to terminate the call.public void answerCallPeer(CallPeer peer) throws OperationFailedException
answerCallPeer
in interface OperationSetBasicTelephony<ProtocolProviderServiceJabberImpl>
peer
- the call peer that we want to answerOperationFailedException
- if we fails to answerpublic void shutdown()
public boolean accept(org.jivesoftware.smack.packet.Packet packet)
accept
in interface org.jivesoftware.smack.filter.PacketFilter
packet
- the packet to test.public void processPacket(org.jivesoftware.smack.packet.Packet packet)
processPacket
in interface org.jivesoftware.smack.PacketListener
packet
- the packet to process.protected ActiveCallsRepositoryJabberGTalkImpl<CallJabberImpl,CallPeerJabberImpl> getActiveCallsRepository()
ActiveCallsRepositoryJabberGTalkImpl
that we are currently using.ActiveCallsRepositoryJabberGTalkImpl
that we are currently using.public ProtocolProviderServiceJabberImpl getProtocolProvider()
getProtocolProvider
in interface OperationSetBasicTelephony<ProtocolProviderServiceJabberImpl>
public boolean isSecure(CallPeer peer)
isSecure
in interface OperationSetSecureTelephony
peer
- the peer for who the call state is requiredpublic void transfer(CallPeer peer, CallPeer target) throws OperationFailedException
The method is suitable for providing the implementation of attended call transfer (though no such requirement is imposed).
transfer
in interface OperationSetAdvancedTelephony<ProtocolProviderServiceJabberImpl>
peer
- the CallPeer to be transfered to the specified
callee addresstarget
- the address in the form of CallPeer of the callee
to transfer peer toOperationFailedException
- if something goes wrongOperationSetAdvancedTelephony.transfer(CallPeer, CallPeer)
public void transfer(CallPeer peer, java.lang.String target) throws OperationFailedException
The method is suitable for providing the implementation of unattended call transfer (though no such requirement is imposed).
transfer
in interface OperationSetAdvancedTelephony<ProtocolProviderServiceJabberImpl>
peer
- the CallPeer to be transfered to the specified
callee addresstarget
- the address of the callee to transfer peer toOperationFailedException
- if something goes wrongOperationSetAdvancedTelephony.transfer(CallPeer, String)
public void setTransferAuthority(TransferAuthority authority)
setTransferAuthority
in interface OperationSetAdvancedTelephony<ProtocolProviderServiceJabberImpl>
authority
- transfer authority.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.