public class MockOperationSetBasicTelephony extends AbstractOperationSetBasicTelephony<MockProvider> implements CallChangeListener
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 |
---|
MockOperationSetBasicTelephony(MockProvider protocolProvider) |
Modifier and Type | Method and Description |
---|---|
CallPeer |
addNewCallPeer(Call call,
java.lang.String address) |
void |
answerCallPeer(CallPeer peer)
Indicates a user request to answer an incoming call from the specified
CallPeer.
|
void |
callPeerAdded(CallPeerEvent evt)
Indicates that a new call peer has joined the source call.
|
void |
callPeerRemoved(CallPeerEvent evt)
Indicates that a call peer has left the source call.
|
void |
callStateChanged(CallChangeEvent evt)
Indicates that a change has occurred in the state of the source call.
|
Call |
createCall(Contact callee,
ContactResource calleeResource,
CallConference conference)
Creates a new Call and invites a specific CallPeer
given by her Contact to it.
|
Call |
createCall(java.lang.String callee,
CallConference conference)
Creates a new Call and invites a specific CallPeer to
it given by her String URI.
|
java.util.Iterator<Call> |
getActiveCalls()
Returns an iterator over all currently active calls.
|
MockProvider |
getProtocolProvider()
Returns the protocol provider that this operation set belongs to.
|
void |
hangupCallPeer(CallPeer peer)
Indicates a user request to end a call with the specified call
particiapnt.
|
void |
hangupCallPeer(CallPeer peer,
int reasonCode,
java.lang.String reason)
Ends the call with the specified peer.
|
Call |
placeCall(java.lang.String toAddress) |
void |
putOffHold(CallPeer peer)
Resumes communication with a call peer previously put on hold.
|
void |
putOnHold(CallPeer peer)
Puts the specified CallPeer "on hold".
|
Call |
receiveCall(java.lang.String fromAddress) |
addCallListener, createCall, createCall, createCall, createCall, createRecorder, fireCallEvent, fireCallEvent, fireCallEvent, removeCallListener, setMute
public MockOperationSetBasicTelephony(MockProvider protocolProvider)
public void answerCallPeer(CallPeer peer) throws OperationFailedException
answerCallPeer
in interface OperationSetBasicTelephony<MockProvider>
peer
- the call peer that we'd like to answer.OperationFailedException
- with the corresponding code if we
encounter an error while performing this operation.public Call createCall(java.lang.String callee, CallConference conference) throws OperationFailedException, java.text.ParseException
createCall
in interface OperationSetBasicTelephony<MockProvider>
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 calljava.text.ParseException
- if callee is not a valid SIP address
Stringpublic Call createCall(Contact callee, ContactResource calleeResource, CallConference conference) throws OperationFailedException
callee
- the address of the callee who we should invite to a new
callcalleeResource
- the specific resource to which the invite should be
sentconference
- the CallConference in which the newly-created
Call is to participateOperationFailedException
- with the corresponding code if we fail
to create the callpublic java.util.Iterator<Call> getActiveCalls()
getActiveCalls
in interface OperationSetBasicTelephony<MockProvider>
public void hangupCallPeer(CallPeer peer) throws OperationFailedException
hangupCallPeer
in interface OperationSetBasicTelephony<MockProvider>
peer
- the peer that we'd like to hang up on.OperationFailedException
- with the corresponding code if we
encounter an error while performing this operation.public void hangupCallPeer(CallPeer peer, int reasonCode, java.lang.String reason) throws OperationFailedException
hangupCallPeer
in interface OperationSetBasicTelephony<MockProvider>
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.reason
- 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 putOffHold(CallPeer peer)
putOffHold
in interface OperationSetBasicTelephony<MockProvider>
peer
- the call peer to put on hold.public void putOnHold(CallPeer peer) throws OperationFailedException
putOnHold
in interface OperationSetBasicTelephony<MockProvider>
peer
- the peer that we'd like to put on hold.OperationFailedException
- with the corresponding code if we
encounter an error while performing this operation.public Call receiveCall(java.lang.String fromAddress) throws java.lang.Exception
java.lang.Exception
public Call placeCall(java.lang.String toAddress) throws java.lang.Exception
java.lang.Exception
public void callPeerAdded(CallPeerEvent evt)
CallChangeListener
callPeerAdded
in interface CallChangeListener
evt
- the CallPeerEvent containing the source call
and call peer.public void callPeerRemoved(CallPeerEvent evt)
CallChangeListener
callPeerRemoved
in interface CallChangeListener
evt
- the CallPeerEvent containing the source call
and call peer.public void callStateChanged(CallChangeEvent evt)
CallChangeListener
callStateChanged
in interface CallChangeListener
evt
- the CallChangeEvent instance containing the source
calls and its old and new state.public MockProvider getProtocolProvider()
getProtocolProvider
in interface OperationSetBasicTelephony<MockProvider>
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.