Renames CallParticipant to CallPeer so that it would better reflect our new Call architecture that also includes conferencing and ConferenceMembers

cusax-fix
Emil Ivov 17 years ago
parent 54d5fa8ac1
commit 39f039f526

@ -346,7 +346,7 @@ private CallRecord convertHistoryRecordToCallRecord(HistoryRecord hr)
List<String> callParticipantIDs = null;
List<String> callParticipantStart = null;
List<String> callParticipantEnd = null;
List<CallParticipantState> callParticipantStates = null;
List<CallPeerState> callParticipantStates = null;
// History structure
// 0 - callStart
@ -418,10 +418,10 @@ private List<String> getCSVs(String str)
* @param str String delimited string states
* @return LinkedList the converted values list
*/
private List<CallParticipantState> getStates(String str)
private List<CallPeerState> getStates(String str)
{
List<CallParticipantState> result =
new LinkedList<CallParticipantState>();
List<CallPeerState> result =
new LinkedList<CallPeerState>();
Collection<String> stateStrs = getCSVs(str);
for (String item : stateStrs)
@ -437,31 +437,31 @@ private List<CallParticipantState> getStates(String str)
* @param state String the string
* @return CallParticipantState the state
*/
private CallParticipantState convertStateStringToState(String state)
private CallPeerState convertStateStringToState(String state)
{
if(state.equals(CallParticipantState._CONNECTED))
return CallParticipantState.CONNECTED;
else if(state.equals(CallParticipantState._BUSY))
return CallParticipantState.BUSY;
else if(state.equals(CallParticipantState._FAILED))
return CallParticipantState.FAILED;
else if(state.equals(CallParticipantState._DISCONNECTED))
return CallParticipantState.DISCONNECTED;
else if(state.equals(CallParticipantState._ALERTING_REMOTE_SIDE))
return CallParticipantState.ALERTING_REMOTE_SIDE;
else if(state.equals(CallParticipantState._CONNECTING))
return CallParticipantState.CONNECTING;
else if(state.equals(CallParticipantState._ON_HOLD_LOCALLY))
return CallParticipantState.ON_HOLD_LOCALLY;
else if(state.equals(CallParticipantState._ON_HOLD_MUTUALLY))
return CallParticipantState.ON_HOLD_MUTUALLY;
else if(state.equals(CallParticipantState._ON_HOLD_REMOTELY))
return CallParticipantState.ON_HOLD_REMOTELY;
else if(state.equals(CallParticipantState._INITIATING_CALL))
return CallParticipantState.INITIATING_CALL;
else if(state.equals(CallParticipantState._INCOMING_CALL))
return CallParticipantState.INCOMING_CALL;
else return CallParticipantState.UNKNOWN;
if(state.equals(CallPeerState._CONNECTED))
return CallPeerState.CONNECTED;
else if(state.equals(CallPeerState._BUSY))
return CallPeerState.BUSY;
else if(state.equals(CallPeerState._FAILED))
return CallPeerState.FAILED;
else if(state.equals(CallPeerState._DISCONNECTED))
return CallPeerState.DISCONNECTED;
else if(state.equals(CallPeerState._ALERTING_REMOTE_SIDE))
return CallPeerState.ALERTING_REMOTE_SIDE;
else if(state.equals(CallPeerState._CONNECTING))
return CallPeerState.CONNECTING;
else if(state.equals(CallPeerState._ON_HOLD_LOCALLY))
return CallPeerState.ON_HOLD_LOCALLY;
else if(state.equals(CallPeerState._ON_HOLD_MUTUALLY))
return CallPeerState.ON_HOLD_MUTUALLY;
else if(state.equals(CallPeerState._ON_HOLD_REMOTELY))
return CallPeerState.ON_HOLD_REMOTELY;
else if(state.equals(CallPeerState._INITIATING_CALL))
return CallPeerState.INITIATING_CALL;
else if(state.equals(CallPeerState._INCOMING_CALL))
return CallPeerState.INCOMING_CALL;
else return CallPeerState.UNKNOWN;
}
/**
@ -858,7 +858,7 @@ private void handleParticipantAdded(CallPeer callParticipant)
{
public void participantStateChanged(CallPeerChangeEvent evt)
{
if(evt.getNewValue().equals(CallParticipantState.DISCONNECTED))
if(evt.getNewValue().equals(CallPeerState.DISCONNECTED))
return;
else
{
@ -868,11 +868,11 @@ public void participantStateChanged(CallPeerChangeEvent evt)
if(participantRecord == null)
return;
CallParticipantState newState =
(CallParticipantState) evt.getNewValue();
CallPeerState newState =
(CallPeerState) evt.getNewValue();
if (newState.equals(CallParticipantState.CONNECTED)
&& !CallParticipantState.isOnHold((CallParticipantState)
if (newState.equals(CallPeerState.CONNECTED)
&& !CallPeerState.isOnHold((CallPeerState)
evt.getOldValue()))
participantRecord.setStartTime(new Date());
@ -912,13 +912,13 @@ private void handleParticipantRemoved(CallPeer callParticipant,
if(cpRecord == null)
return;
if(!callParticipant.getState().equals(CallParticipantState.DISCONNECTED))
if(!callParticipant.getState().equals(CallPeerState.DISCONNECTED))
cpRecord.setState(callParticipant.getState());
CallParticipantState cpRecordState = cpRecord.getState();
CallPeerState cpRecordState = cpRecord.getState();
if (cpRecordState.equals(CallParticipantState.CONNECTED)
|| CallParticipantState.isOnHold(cpRecordState))
if (cpRecordState.equals(CallPeerState.CONNECTED)
|| CallPeerState.isOnHold(cpRecordState))
{
cpRecord.setEndTime(new Date());
}

@ -63,7 +63,7 @@ public void setEndTime(Date endTime)
* Sets the participant state
* @param state CallParticipantState
*/
public void setState(CallParticipantState state)
public void setState(CallPeerState state)
{
this.state = state;
}

@ -159,7 +159,7 @@ public void callParticipantRemoved(CallPeerEvent evt)
if (participantPanel != null)
{
CallParticipantState state = participant.getState();
CallPeerState state = participant.getState();
participantPanel.setState(state.getStateString(), null);
@ -204,20 +204,20 @@ public void participantStateChanged(CallPeerChangeEvent evt)
String newStateString = sourceParticipant.getState().getStateString();
Icon newStateIcon = null;
if (newState == CallParticipantState.ALERTING_REMOTE_SIDE)
if (newState == CallPeerState.ALERTING_REMOTE_SIDE)
{
NotificationManager
.fireNotification(NotificationManager.OUTGOING_CALL);
}
else if (newState == CallParticipantState.BUSY)
else if (newState == CallPeerState.BUSY)
{
NotificationManager.stopSound(NotificationManager.OUTGOING_CALL);
NotificationManager.fireNotification(NotificationManager.BUSY_CALL);
}
else if (newState == CallParticipantState.CONNECTED)
else if (newState == CallPeerState.CONNECTED)
{
if (!CallParticipantState.isOnHold((CallParticipantState) evt
if (!CallPeerState.isOnHold((CallPeerState) evt
.getOldValue()))
{
// start the timer that takes care of refreshing the time label
@ -230,25 +230,25 @@ else if (newState == CallParticipantState.CONNECTED)
participantPanel.startCallTimer();
}
}
else if (newState == CallParticipantState.DISCONNECTED)
else if (newState == CallPeerState.DISCONNECTED)
{
// The call participant should be already removed from the call
// see callParticipantRemoved
}
else if (newState == CallParticipantState.FAILED)
else if (newState == CallPeerState.FAILED)
{
// The call participant should be already removed from the call
// see callParticipantRemoved
}
else if (CallParticipantState.isOnHold((CallParticipantState) newState))
else if (CallPeerState.isOnHold((CallPeerState) newState))
{
newStateIcon = new ImageIcon(
ImageLoader.getImage(ImageLoader.HOLD_STATUS_ICON));
// If we have clicked the hold button in a full screen mode
// we need to update the state of the call dialog hold button.
if ((newState.equals(CallParticipantState.ON_HOLD_LOCALLY)
|| newState.equals(CallParticipantState.ON_HOLD_MUTUALLY))
if ((newState.equals(CallPeerState.ON_HOLD_LOCALLY)
|| newState.equals(CallPeerState.ON_HOLD_MUTUALLY))
&& !callDialog.isHoldButtonSelected())
{
callDialog.setHoldButtonSelected(true);

@ -913,14 +913,14 @@ public void actionPerformed(ActionEvent event)
private Component createFullScreenButtonBar()
{
CallParticipantState participantState
CallPeerState participantState
= callParticipant.getState();
Component[] buttons =
new Component[]
{ new HoldButton( callParticipant.getCall(),
true,
CallParticipantState.isOnHold(participantState)),
CallPeerState.isOnHold(participantState)),
new MuteButton( callParticipant.getCall(),
true,
callParticipant.isMute()),

@ -1206,10 +1206,10 @@ private String processSdpStr(CallPeer participant,
else
{
//create the SDP answer.
CallParticipantState participantState = participant.getState();
CallPeerState participantState = participant.getState();
if (CallParticipantState.CONNECTED.equals(participantState)
|| CallParticipantState.isOnHold(participantState))
if (CallPeerState.CONNECTED.equals(participantState)
|| CallPeerState.isOnHold(participantState))
{
//if the call is already connected then this is a
//reinitialization (e.g. placing the call on/off hold)
@ -1263,10 +1263,10 @@ private String processSdpStr(CallPeer participant,
if (answer)
{
CallParticipantState participantState = participant.getState();
CallPeerState participantState = participant.getState();
if (CallParticipantState.CONNECTED.equals(participantState)
|| CallParticipantState.isOnHold(participantState))
if (CallPeerState.CONNECTED.equals(participantState)
|| CallPeerState.isOnHold(participantState))
startStreamingAndProcessingMedia();
}

@ -318,11 +318,11 @@ private void putOnHold(Call call)
call.getCallParticipants(); participantIter.hasNext();)
{
CallPeer participant = participantIter.next();
CallParticipantState participantState = participant.getState();
CallPeerState participantState = participant.getState();
if (!CallParticipantState.DISCONNECTED.equals(participantState)
&& !CallParticipantState.FAILED.equals(participantState)
&& !CallParticipantState.isOnHold(participantState))
if (!CallPeerState.DISCONNECTED.equals(participantState)
&& !CallPeerState.FAILED.equals(participantState)
&& !CallPeerState.isOnHold(participantState))
{
try
{

@ -160,16 +160,16 @@ public void participantDisplayNameChanged(CallPeerChangeEvent evt)
*/
public void participantStateChanged(CallPeerChangeEvent evt)
{
if(((CallParticipantState)evt.getNewValue())
== CallParticipantState.DISCONNECTED
|| ((CallParticipantState)evt.getNewValue())
== CallParticipantState.FAILED)
if(((CallPeerState)evt.getNewValue())
== CallPeerState.DISCONNECTED
|| ((CallPeerState)evt.getNewValue())
== CallPeerState.FAILED)
{
removeCallParticipant(
(CallPeerJabberImpl)evt.getSourceCallParticipant());
}
else if (((CallParticipantState)evt.getNewValue())
== CallParticipantState.CONNECTED
else if (((CallPeerState)evt.getNewValue())
== CallPeerState.CONNECTED
&& getCallState().equals(CallState.CALL_INITIALIZATION))
{
setCallState(CallState.CALL_IN_PROGRESS);

@ -262,7 +262,7 @@ private CallJabberImpl createOutgoingCall(String calleeAddress)
new CallPeerJabberImpl(calleeAddress, call);
callParticipant.setJingleSession(outJS);
callParticipant.setState(CallParticipantState.INITIATING_CALL);
callParticipant.setState(CallPeerState.INITIATING_CALL);
fireCallEvent(CallEvent.CALL_INITIATED, call);
@ -335,7 +335,7 @@ public void hangupCallParticipant(CallPeer participant)
}
finally
{
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
}
}
@ -436,7 +436,7 @@ public void sessionRequested(JingleSessionRequest jingleSessionRequest)
= new CallPeerJabberImpl(from, call);
callParticipant.setJingleSession(inJS);
callParticipant.setState(CallParticipantState.INCOMING_CALL);
callParticipant.setState(CallPeerState.INCOMING_CALL);
activeCallsRepository.addCall(call);
@ -536,7 +536,7 @@ public void beforeChange(JingleNegotiator.State oldState
{
return;
}
callParticipant.setState(CallParticipantState.CONNECTED);
callParticipant.setState(CallPeerState.CONNECTED);
}
else if (newState instanceof OutgoingJingleSession.Inviting)
{
@ -548,7 +548,7 @@ else if (newState instanceof OutgoingJingleSession.Inviting)
{
return;
}
callParticipant.setState(CallParticipantState.CONNECTING);
callParticipant.setState(CallPeerState.CONNECTING);
}
else if (newState instanceof OutgoingJingleSession.Pending)
{
@ -560,7 +560,7 @@ else if (newState instanceof OutgoingJingleSession.Pending)
{
return;
}
callParticipant.setState(CallParticipantState.ALERTING_REMOTE_SIDE);
callParticipant.setState(CallPeerState.ALERTING_REMOTE_SIDE);
}
else if (newState instanceof OutgoingJingleSession.Active)
{
@ -572,7 +572,7 @@ else if (newState instanceof OutgoingJingleSession.Active)
{
return;
}
callParticipant.setState(CallParticipantState.CONNECTED);
callParticipant.setState(CallPeerState.CONNECTED);
}
if ((newState == null) && (oldState != null))

@ -100,16 +100,16 @@ public void removeCallParticipant(MockCallParticipant callParticipant)
public void participantStateChanged(CallPeerChangeEvent evt)
{
if ( ( (CallParticipantState) evt.getNewValue())
== CallParticipantState.DISCONNECTED
|| ( (CallParticipantState) evt.getNewValue())
== CallParticipantState.FAILED)
if ( ( (CallPeerState) evt.getNewValue())
== CallPeerState.DISCONNECTED
|| ( (CallPeerState) evt.getNewValue())
== CallPeerState.FAILED)
{
removeCallParticipant(
(MockCallParticipant) evt.getSourceCallParticipant());
}
else if ( ( (CallParticipantState) evt.getNewValue())
== CallParticipantState.CONNECTED
else if ( ( (CallPeerState) evt.getNewValue())
== CallPeerState.CONNECTED
&& getCallState().equals(CallState.CALL_INITIALIZATION))
{
setCallState(CallState.CALL_IN_PROGRESS);

@ -49,14 +49,14 @@ public void answerCallParticipant(CallPeer participant) throws
{
MockCallParticipant callParticipant
= (MockCallParticipant)participant;
if(participant.getState().equals(CallParticipantState.CONNECTED))
if(participant.getState().equals(CallPeerState.CONNECTED))
{
logger.info("Ignoring user request to answer a CallParticipant "
+ "that is already connected. CP:" + participant);
return;
}
callParticipant.setState(CallParticipantState.CONNECTED, null);
callParticipant.setState(CallPeerState.CONNECTED, null);
}
/**
@ -132,7 +132,7 @@ public void hangupCallParticipant(CallPeer participant) throws
OperationFailedException
{
//do nothing if the call is already ended
if (participant.getState().equals(CallParticipantState.DISCONNECTED))
if (participant.getState().equals(CallPeerState.DISCONNECTED))
{
logger.debug("Ignoring a request to hangup a call participant "
+"that is already DISCONNECTED");
@ -143,7 +143,7 @@ public void hangupCallParticipant(CallPeer participant) throws
= (MockCallParticipant)participant;
logger.info("hangupCallParticipant");
callParticipant.setState(CallParticipantState.DISCONNECTED, null);
callParticipant.setState(CallPeerState.DISCONNECTED, null);
}
/**
@ -193,8 +193,8 @@ public Call placeCall(String toAddress)
MockCallParticipant callPArt =
(MockCallParticipant)newCall.getCallParticipants().next();
callPArt.setState(CallParticipantState.ALERTING_REMOTE_SIDE, "no reason");
callPArt.setState(CallParticipantState.CONNECTED, "no reason");
callPArt.setState(CallPeerState.ALERTING_REMOTE_SIDE, "no reason");
callPArt.setState(CallPeerState.CONNECTED, "no reason");
return newCall;
}
@ -203,8 +203,8 @@ public CallPeer addNewCallParticipant(Call call, String address)
{
MockCallParticipant callPArt = new MockCallParticipant(address, (MockCall)call);
callPArt.setState(CallParticipantState.ALERTING_REMOTE_SIDE, "no reason");
callPArt.setState(CallParticipantState.CONNECTED, "no reason");
callPArt.setState(CallPeerState.ALERTING_REMOTE_SIDE, "no reason");
callPArt.setState(CallPeerState.CONNECTED, "no reason");
return callPArt;
}

@ -173,16 +173,16 @@ public void participantDisplayNameChanged(CallPeerChangeEvent evt)
*/
public void participantStateChanged(CallPeerChangeEvent evt)
{
CallParticipantState newState =
(CallParticipantState) evt.getNewValue();
if (newState == CallParticipantState.DISCONNECTED
|| newState == CallParticipantState.FAILED)
CallPeerState newState =
(CallPeerState) evt.getNewValue();
if (newState == CallPeerState.DISCONNECTED
|| newState == CallPeerState.FAILED)
{
removeCallParticipant((CallPeerSipImpl) evt
.getSourceCallParticipant());
}
else if ((newState == CallParticipantState.CONNECTED
|| newState == CallParticipantState.CONNECTING_WITH_EARLY_MEDIA))
else if ((newState == CallPeerState.CONNECTED
|| newState == CallPeerState.CONNECTING_WITH_EARLY_MEDIA))
{
setCallState(CallState.CALL_IN_PROGRESS);
}

@ -421,25 +421,25 @@ private void putOnHold(CallPeer participant, boolean on)
*/
callSession.putOnHold(on, true);
CallParticipantState state = sipParticipant.getState();
if (CallParticipantState.ON_HOLD_LOCALLY.equals(state))
CallPeerState state = sipParticipant.getState();
if (CallPeerState.ON_HOLD_LOCALLY.equals(state))
{
if (!on)
sipParticipant.setState(CallParticipantState.CONNECTED);
sipParticipant.setState(CallPeerState.CONNECTED);
}
else if (CallParticipantState.ON_HOLD_MUTUALLY.equals(state))
else if (CallPeerState.ON_HOLD_MUTUALLY.equals(state))
{
if (!on)
sipParticipant.setState(CallParticipantState.ON_HOLD_REMOTELY);
sipParticipant.setState(CallPeerState.ON_HOLD_REMOTELY);
}
else if (CallParticipantState.ON_HOLD_REMOTELY.equals(state))
else if (CallPeerState.ON_HOLD_REMOTELY.equals(state))
{
if (on)
sipParticipant.setState(CallParticipantState.ON_HOLD_MUTUALLY);
sipParticipant.setState(CallPeerState.ON_HOLD_MUTUALLY);
}
else if (on)
{
sipParticipant.setState(CallParticipantState.ON_HOLD_LOCALLY);
sipParticipant.setState(CallPeerState.ON_HOLD_LOCALLY);
}
}
@ -756,7 +756,7 @@ public boolean processResponse(ResponseEvent responseEvent)
+ " " + response.getReasonPhrase());
if (callParticipant != null)
callParticipant.setState(CallParticipantState.FAILED);
callParticipant.setState(CallPeerState.FAILED);
processed = true;
}
@ -812,10 +812,10 @@ private void processTrying(ClientTransaction clientTransaction,
}
// change status
CallParticipantState callParticipantState = callParticipant.getState();
if (!CallParticipantState.CONNECTED.equals(callParticipantState)
&& !CallParticipantState.isOnHold(callParticipantState))
callParticipant.setState(CallParticipantState.CONNECTING);
CallPeerState callParticipantState = callParticipant.getState();
if (!CallPeerState.CONNECTED.equals(callParticipantState)
&& !CallPeerState.isOnHold(callParticipantState))
callParticipant.setState(CallPeerState.CONNECTING);
}
/**
@ -858,7 +858,7 @@ private void processRinging(ClientTransaction clientTransaction,
}
// change status.
callParticipant.setState(CallParticipantState.ALERTING_REMOTE_SIDE);
callParticipant.setState(CallPeerState.ALERTING_REMOTE_SIDE);
}
/**
@ -880,7 +880,7 @@ private void processSessionProgress(ClientTransaction clientTransaction,
activeCallsRepository.findCallParticipant(dialog);
if (callParticipant.getState()
== CallParticipantState.CONNECTING_WITH_EARLY_MEDIA)
== CallPeerState.CONNECTING_WITH_EARLY_MEDIA)
{
// This can happen if we are receiving early media for a second time.
logger.warn("Ignoring invite 183 since call participant is "
@ -955,7 +955,7 @@ private void processSessionProgress(ClientTransaction clientTransaction,
// change status
callParticipant
.setState(CallParticipantState.CONNECTING_WITH_EARLY_MEDIA);
.setState(CallPeerState.CONNECTING_WITH_EARLY_MEDIA);
}
/**
@ -1071,7 +1071,7 @@ private void processInviteOK(ClientTransaction clientTransaction,
// !!! set sdp content before setting call state as that is where
// listeners get alerted and they need the sdp
// ignore sdp if we have already received one in early media
if(!CallParticipantState.CONNECTING_WITH_EARLY_MEDIA
if(!CallPeerState.CONNECTING_WITH_EARLY_MEDIA
.equals(callParticipant.getState()))
callParticipant.setSdpDescription(new String(ok.getRawContent()));
@ -1134,9 +1134,9 @@ private void processInviteOK(ClientTransaction clientTransaction,
* the SDP (e.g. because of re-negotiating the media after toggling
* the streaming of local video).
*/
CallParticipantState callParticipantState =
CallPeerState callParticipantState =
callParticipant.getState();
if (!CallParticipantState.CONNECTING_WITH_EARLY_MEDIA
if (!CallPeerState.CONNECTING_WITH_EARLY_MEDIA
.equals(callParticipantState))
{
callSession.processSdpAnswer(
@ -1163,29 +1163,29 @@ private void processInviteOK(ClientTransaction clientTransaction,
//we are connected from a SIP point of view (cause we sent our
//ack) so make sure we set the state accordingly or the hangup
//method won't know how to end the call.
callParticipant.setState(CallParticipantState.CONNECTED);
callParticipant.setState(CallPeerState.CONNECTED);
hangupCallParticipant(callParticipant);
}
catch (Exception e)
{
//I don't see what more we could do.
logger.error(e);
callParticipant.setState(CallParticipantState.FAILED,
callParticipant.setState(CallPeerState.FAILED,
e.getMessage());
}
return;
}
// change status
if (!CallParticipantState.isOnHold(callParticipant.getState()))
callParticipant.setState(CallParticipantState.CONNECTED);
if (!CallPeerState.isOnHold(callParticipant.getState()))
callParticipant.setState(CallPeerState.CONNECTED);
}
private void logErrorAndFailCallParticipant(String message,
Throwable throwable, CallPeerSipImpl participant)
{
logger.error(message, throwable);
participant.setState(CallParticipantState.FAILED, message);
participant.setState(CallPeerState.FAILED, message);
}
/**
@ -1210,7 +1210,7 @@ private void processBusyHere(ClientTransaction clientTransaction,
}
// change status
callParticipant.setState(CallParticipantState.BUSY);
callParticipant.setState(CallPeerState.BUSY);
}
/**
@ -1313,7 +1313,7 @@ public boolean processTimeout(TimeoutEvent timeoutEvent)
}
// change status
callParticipant.setState(CallParticipantState.FAILED,
callParticipant.setState(CallPeerState.FAILED,
"The remote party has not replied!"
+ "The call will be disconnected");
return true;
@ -1362,7 +1362,7 @@ public boolean processDialogTerminated(
}
// change status
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
return true;
}
@ -1598,7 +1598,7 @@ private void processInvite(SipProvider sourceProvider,
if (!isInviteProperlyAddressed(dialog))
{
callParticipant.setState(CallParticipantState.FAILED,
callParticipant.setState(CallPeerState.FAILED,
"A call was received here while it appeared "
+ "destined to someone else. The call was rejected.");
@ -1636,7 +1636,7 @@ private void processInvite(SipProvider sourceProvider,
logger.error("Failed to hangup the referer "
+ callParticipantToReplace, ex);
callParticipantToReplace.setState(
CallParticipantState.FAILED, "Internal Error: " + ex);
CallPeerState.FAILED, "Internal Error: " + ex);
}
}
// Even if there was a failure, we cannot just send Response.OK.
@ -1693,7 +1693,7 @@ private void processInvite(SipProvider sourceProvider,
{
logger.error("Error while trying to send response "
+ response, ex);
callParticipant.setState(CallParticipantState.FAILED,
callParticipant.setState(CallPeerState.FAILED,
"Internal Error: " + ex.getMessage());
return;
}
@ -1703,7 +1703,7 @@ private void processInvite(SipProvider sourceProvider,
catch (ParseException ex)
{
logger.error("Error while trying to send a response", ex);
callParticipant.setState(CallParticipantState.FAILED,
callParticipant.setState(CallPeerState.FAILED,
"Internal Error: " + ex.getMessage());
return;
}
@ -1717,7 +1717,7 @@ private void processInvite(SipProvider sourceProvider,
catch (Exception ex)
{
logger.error("Error while trying to send a request", ex);
callParticipant.setState(CallParticipantState.FAILED,
callParticipant.setState(CallPeerState.FAILED,
"Internal Error: " + ex.getMessage());
return;
}
@ -1864,25 +1864,25 @@ private void processInviteSentResponse(CallPeer participant,
callSession.putOnHold(on, false);
CallParticipantState state = sipParticipant.getState();
if (CallParticipantState.ON_HOLD_LOCALLY.equals(state))
CallPeerState state = sipParticipant.getState();
if (CallPeerState.ON_HOLD_LOCALLY.equals(state))
{
if (on)
sipParticipant.setState(CallParticipantState.ON_HOLD_MUTUALLY);
sipParticipant.setState(CallPeerState.ON_HOLD_MUTUALLY);
}
else if (CallParticipantState.ON_HOLD_MUTUALLY.equals(state))
else if (CallPeerState.ON_HOLD_MUTUALLY.equals(state))
{
if (!on)
sipParticipant.setState(CallParticipantState.ON_HOLD_LOCALLY);
sipParticipant.setState(CallPeerState.ON_HOLD_LOCALLY);
}
else if (CallParticipantState.ON_HOLD_REMOTELY.equals(state))
else if (CallPeerState.ON_HOLD_REMOTELY.equals(state))
{
if (!on)
sipParticipant.setState(CallParticipantState.CONNECTED);
sipParticipant.setState(CallPeerState.CONNECTED);
}
else if (on)
{
sipParticipant.setState(CallParticipantState.ON_HOLD_REMOTELY);
sipParticipant.setState(CallPeerState.ON_HOLD_REMOTELY);
}
/*
@ -1963,7 +1963,7 @@ private void processBye(ServerTransaction serverTransaction,
}
else
{
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
}
}
@ -1997,10 +1997,10 @@ private void processAck(ServerTransaction serverTransaction,
}
// change status
CallParticipantState participantState = participant.getState();
if (!CallParticipantState.isOnHold(participantState))
CallPeerState participantState = participant.getState();
if (!CallPeerState.isOnHold(participantState))
{
if (CallParticipantState.CONNECTED.equals(participantState))
if (CallPeerState.CONNECTED.equals(participantState))
{
try
{
@ -2017,7 +2017,7 @@ private void processAck(ServerTransaction serverTransaction,
}
}
else
participant.setState(CallParticipantState.CONNECTED);
participant.setState(CallPeerState.CONNECTED);
}
}
@ -2103,7 +2103,7 @@ private void processCancel(ServerTransaction serverTransaction,
}
// change status
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
}
/**
@ -2337,7 +2337,7 @@ private boolean processNotify(ServerTransaction serverTransaction,
"Failed to create OK response to refer NOTIFY request.";
logger.error(message, ex);
participant.setState(CallParticipantState.DISCONNECTED, message);
participant.setState(CallPeerState.DISCONNECTED, message);
return false;
}
try
@ -2350,7 +2350,7 @@ private boolean processNotify(ServerTransaction serverTransaction,
"Failed to send OK response to refer NOTIFY request.";
logger.error(message, ex);
participant.setState(CallParticipantState.DISCONNECTED, message);
participant.setState(CallPeerState.DISCONNECTED, message);
return false;
}
@ -2358,10 +2358,10 @@ private boolean processNotify(ServerTransaction serverTransaction,
&& !DialogUtils
.removeSubscriptionThenIsDialogAlive(dialog, "refer"))
{
participant.setState(CallParticipantState.DISCONNECTED);
participant.setState(CallPeerState.DISCONNECTED);
}
if (!CallParticipantState.DISCONNECTED.equals(participant.getState())
if (!CallPeerState.DISCONNECTED.equals(participant.getState())
&& !DialogUtils.isByeProcessed(dialog))
{
boolean dialogIsAlive;
@ -2378,7 +2378,7 @@ private boolean processNotify(ServerTransaction serverTransaction,
}
if (!dialogIsAlive)
{
participant.setState(CallParticipantState.DISCONNECTED);
participant.setState(CallPeerState.DISCONNECTED);
}
}
@ -2457,7 +2457,7 @@ private boolean referToCallStateChanged(Call referToCall,
activeCallsRepository.findCallParticipant(dialog);
if (callParticipant != null)
{
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
}
}
return true;
@ -2617,8 +2617,8 @@ public synchronized void hangupCallParticipant(CallPeer participant)
OperationFailedException
{
// do nothing if the call is already ended
if (participant.getState().equals(CallParticipantState.DISCONNECTED)
|| participant.getState().equals(CallParticipantState.FAILED))
if (participant.getState().equals(CallPeerState.DISCONNECTED)
|| participant.getState().equals(CallPeerState.FAILED))
{
logger.debug("Ignoring a request to hangup a call participant "
+ "that is already DISCONNECTED");
@ -2628,19 +2628,19 @@ public synchronized void hangupCallParticipant(CallPeer participant)
CallPeerSipImpl callParticipant =
(CallPeerSipImpl) participant;
CallParticipantState participantState = callParticipant.getState();
if (participantState.equals(CallParticipantState.CONNECTED)
|| CallParticipantState.isOnHold(participantState))
CallPeerState participantState = callParticipant.getState();
if (participantState.equals(CallPeerState.CONNECTED)
|| CallPeerState.isOnHold(participantState))
{
sayBye(callParticipant);
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
}
else if (callParticipant.getState().equals(
CallParticipantState.CONNECTING)
CallPeerState.CONNECTING)
|| callParticipant.getState().equals(
CallParticipantState.CONNECTING_WITH_EARLY_MEDIA)
CallPeerState.CONNECTING_WITH_EARLY_MEDIA)
|| callParticipant.getState().equals(
CallParticipantState.ALERTING_REMOTE_SIDE))
CallPeerState.ALERTING_REMOTE_SIDE))
{
if (callParticipant.getFirstTransaction() != null)
{
@ -2648,25 +2648,25 @@ else if (callParticipant.getState().equals(
// leaving
sayCancel(callParticipant);
}
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
}
else if (participantState.equals(CallParticipantState.INCOMING_CALL))
else if (participantState.equals(CallPeerState.INCOMING_CALL))
{
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
sayBusyHere(callParticipant);
}
// For FAILE and BUSY we only need to update CALL_STATUS
else if (participantState.equals(CallParticipantState.BUSY))
else if (participantState.equals(CallPeerState.BUSY))
{
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
}
else if (participantState.equals(CallParticipantState.FAILED))
else if (participantState.equals(CallPeerState.FAILED))
{
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
}
else
{
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
logger.error("Could not determine call participant state!");
}
} // end call
@ -2700,7 +2700,7 @@ public void sayError(CallPeerSipImpl callParticipant,
throws OperationFailedException
{
Dialog dialog = callParticipant.getDialog();
callParticipant.setState(CallParticipantState.FAILED);
callParticipant.setState(CallPeerState.FAILED);
if (dialog == null)
{
logger.error("Failed to extract participant's associated dialog! "
@ -2917,17 +2917,17 @@ public synchronized void answerCallParticipant(CallPeer participant)
if (transaction == null || !dialog.isServer())
{
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
throw new OperationFailedException(
"Failed to extract a ServerTransaction "
+ "from the call's associated dialog!",
OperationFailedException.INTERNAL_ERROR);
}
CallParticipantState participantState = participant.getState();
CallPeerState participantState = participant.getState();
if (participantState.equals(CallParticipantState.CONNECTED)
|| CallParticipantState.isOnHold(participantState))
if (participantState.equals(CallPeerState.CONNECTED)
|| CallPeerState.isOnHold(participantState))
{
logger.info("Ignoring user request to answer a CallParticipant "
+ "that is already connected. CP:" + participant);
@ -2944,7 +2944,7 @@ public synchronized void answerCallParticipant(CallPeer participant)
}
catch (ParseException ex)
{
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
throwOperationFailedException(
"Failed to construct an OK response to an INVITE request",
OperationFailedException.INTERNAL_ERROR, ex);
@ -2963,7 +2963,7 @@ public synchronized void answerCallParticipant(CallPeer participant)
catch (ParseException ex)
{
// Shouldn't happen
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
throwOperationFailedException(
"Failed to create a content type header for the OK response",
OperationFailedException.INTERNAL_ERROR, ex);
@ -3035,7 +3035,7 @@ public synchronized void answerCallParticipant(CallPeer participant)
}
catch (Exception ex)
{
callParticipant.setState(CallParticipantState.DISCONNECTED);
callParticipant.setState(CallPeerState.DISCONNECTED);
throwOperationFailedException(
"Failed to send an OK response to an INVITE request",
OperationFailedException.NETWORK_FAILURE,
@ -3089,8 +3089,8 @@ private CallPeerSipImpl createCallParticipantFor(
callParticipant.setState(
incomingCall ?
CallParticipantState.INCOMING_CALL :
CallParticipantState.INITIATING_CALL);
CallPeerState.INCOMING_CALL :
CallPeerState.INITIATING_CALL);
callParticipant.setDialog(containingTransaction.getDialog());
callParticipant.setFirstTransaction(containingTransaction);

@ -16,7 +16,7 @@ public class CallParticipantRecord
protected String participantAddress = null;
protected Date startTime = null;
protected Date endTime = null;
protected CallParticipantState state = CallParticipantState.UNKNOWN;
protected CallPeerState state = CallPeerState.UNKNOWN;
/**
* Creates CallParticipantRecord
@ -66,7 +66,7 @@ public Date getStartTime()
* Returns the actual state of the participant
* @return CallParticipantState
*/
public CallParticipantState getState()
public CallPeerState getState()
{
return state;
}

@ -1,300 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.protocol;
/**
* The CallParticipantState class reflects the current state of a call
* participant. In other words when you start calling your grand mother she will
* be in a INITIATING_CALL state, when her phone rings her state will change to
* ALERTING_REMOTE_SIDE, and when she replies she will enter a CONNCECTED state.
*
* <p>Though not mandatory CallParticipantState would generally have one of the
* following life cycles
*
* <p> In the case with your grand mother that we just described we have:
* <br>INITIATING_CALL -> CONNECTING -> ALERTING_REMOTE_USER -> CONNECTED -> DISCONNECTED
*
* <p> If your granny was already on the phone we have:
* <br>INITIATING_CALL -> CONNECTING -> BUSY -> DISCONNECTED
*
* <p>Whenever someone tries to reach you:
* <br>INCOMING_CALL -> CONNECTED -> DISCONNECTED
*
* <p>A FAILED state is prone to appear at any place in the above diagram and is
* generally followed by a disconnected state.
*
* <p>Information on call participant is shown in the phone user interface until
* they enter the DISCONNECTED state. At that point call participant information
* is automatically removed from the user interface and the call is considered
* terminated.
*
* @author Emil Ivov
* @author Lubomir Marinov
*/
public class CallParticipantState
{
/**
* This constant value indicates a String representation of the UNKNOWN
* call state.
* <br>This constant has the String value "Unknown".
*/
public static final String _UNKNOWN = "Unknown";
/**
* This constant value indicates that the state of the call participant is
* is UNKNOWN - which means that there is no information on the state for
* the time being (this constant should be used as a default value for
* newly created call participant that don't yet have an attributed call
* state.
*/
public static final CallParticipantState UNKNOWN =
new CallParticipantState(_UNKNOWN);
/**
* This constant value indicates a String representation of the
* INITIATING_CALL call state.
* <br>This constant has the String value "Initiating Call".
*/
public static final String _INITIATING_CALL = "Initiating Call";
/**
* This constant value indicates that the state of the call participant is
* is INITIATING_CALL - which means that we're currently trying to open a
* socket and send our request. In the case of SIP for example we will leave
* this state the moment we receive a "100 Trying" request from a proxy or
* the remote side.
*/
public static final CallParticipantState INITIATING_CALL =
new CallParticipantState(_INITIATING_CALL);
/**
* This constant value indicates a String representation of the CONNECTING
* call state.
* <br>This constant has the String value "Connecting".
*/
public static final String _CONNECTING = "Connecting";
/**
* This constant value indicates that the state of the call participant is
* CONNECTING - which means that a network connection to that participant
* is currently being established.
*/
public static final CallParticipantState CONNECTING =
new CallParticipantState(_CONNECTING);
/**
* This constant value indicates a String representation of the CONNECTING
* call state but in cases where early media is being exchanged.
* <br>This constant has the String value "Connecting".
*/
public static final String _CONNECTING_WITH_EARLY_MEDIA = "Connecting*";
/**
* This constant value indicates that the state of the call participant is
* CONNECTING - which means that a network connection to that participant
* is currently being established.
*/
public static final CallParticipantState CONNECTING_WITH_EARLY_MEDIA =
new CallParticipantState( _CONNECTING_WITH_EARLY_MEDIA );
/**
* This constant value indicates a String representation of the
* ALERTING_REMOTE_SIDE call state.
* <br>This constant has the String value "Alerting Remote User".
*/
public static final String _ALERTING_REMOTE_SIDE
= "Alerting Remote User (Ringing)";
/**
* This constant value indicates that the state of the call participant is
* is ALERTING_REMOTE_SIDE - which means that a network connection to that participant
* has been established and participant's phone is currently alerting the
* remote user of the current call.
*/
public static final CallParticipantState ALERTING_REMOTE_SIDE =
new CallParticipantState(_ALERTING_REMOTE_SIDE);
/**
* This constant value indicates a String representation of the
* INCOMING_CALL call state.
* <br>This constant has the String value "Incoming Call".
*/
public static final String _INCOMING_CALL = "Incoming Call";
/**
* This constant value indicates that the state of the call participant is
* is INCOMING_CALL - which means that the participant is willing to start
* a call with us. At that point local side should be playing a sound or a
* graphical alert (the phone is ringing).
*/
public static final CallParticipantState INCOMING_CALL
= new CallParticipantState(_INCOMING_CALL);
/**
* This constant value indicates a String representation of the CONNECTED
* call state.
* <br>This constant has the String value "Connected".
*/
public static final String _CONNECTED = "Connected";
/**
* This constant value indicates that the state of the call participant is
* is CONNECTED - which means that there is an ongoing call with that
* participant.
*/
public static final CallParticipantState CONNECTED
= new CallParticipantState(_CONNECTED);
/**
* This constant value indicates a String representation of the DISCONNECTED
* call state.
* <br>This constant has the String value "Disconnected".
*/
public static final String _DISCONNECTED = "Disconnected";
/**
* This constant value indicates that the state of the call participant is
* is DISCONNECTET - which means that this participant is not participating :)
* in the call any more.
*/
public static final CallParticipantState DISCONNECTED =
new CallParticipantState(_DISCONNECTED);
/**
* This constant value indicates a String representation of the BUSY
* call state.
* <br>This constant has the String value "Busy".
*/
public static final String _BUSY = "Busy";
/**
* This constant value indicates that the state of the call participant is
* is BUSY - which means that an attempt to establish a call with that
* participant has been made and that it has been turned down by them (e.g.
* because they were already in a call).
*/
public static final CallParticipantState BUSY
= new CallParticipantState(_BUSY);
/**
* This constant value indicates a String representation of the FAILED
* call state.
* <br>This constant has the String value "Failed".
*/
public static final String _FAILED = "Failed";
/**
* This constant value indicates that the state of the call participant is
* is ON_HOLD - which means that an attempt to establish a call with that
* participant has failed for an unexpected reason.
*/
public static final CallParticipantState FAILED
= new CallParticipantState(_FAILED);
/**
* The constant value being a String representation of the ON_HOLD_LOCALLY
* call participant state.
* <p>
* This constant has the String value "Locally On Hold".
* </p>
*/
public static final String _ON_HOLD_LOCALLY = "Locally On Hold";
/**
* The constant value indicating that the state of a call participant is
* locally put on hold.
*/
public static final CallParticipantState ON_HOLD_LOCALLY
= new CallParticipantState(_ON_HOLD_LOCALLY);
/**
* The constant value being a String representation of the ON_HOLD_MUTUALLY
* call participant state.
* <p>
* This constant has the String value "Mutually On Hold".
* </p>
*/
public static final String _ON_HOLD_MUTUALLY = "Mutually On Hold";
/**
* The constant value indicating that the state of a call participant is
* mutually - locally and remotely - put on hold.
*/
public static final CallParticipantState ON_HOLD_MUTUALLY
= new CallParticipantState(_ON_HOLD_MUTUALLY);
/**
* The constant value being a String representation of the ON_HOLD_REMOTELY
* call participant state.
* <p>
* This constant has the String value "Remotely On Hold".
* </p>
*/
public static final String _ON_HOLD_REMOTELY = "Remotely On Hold";
/**
* The constant value indicating that the state of a call participant is
* remotely put on hold.
*/
public static final CallParticipantState ON_HOLD_REMOTELY
= new CallParticipantState(_ON_HOLD_REMOTELY);
/**
* Determines whether a specific <tt>CallParticipantState</tt> value
* signal a call hold regardless of the issuer (which may be local and/or
* remote).
*
* @param state
* the <tt>CallParticipantState</tt> value to be checked
* whether it signals a call hold
* @return <tt>true</tt> if the specified <tt>state</tt> signals a call
* hold; <tt>false</tt>, otherwise
*/
public static final boolean isOnHold(CallParticipantState state)
{
return CallParticipantState.ON_HOLD_LOCALLY.equals(state)
|| CallParticipantState.ON_HOLD_MUTUALLY.equals(state)
|| CallParticipantState.ON_HOLD_REMOTELY.equals(state);
}
/**
* A string representationf this Participant Call State. Could be
* _CONNECTED, _FAILED, _CALLING and etc.
*/
private String callStateStr;
/**
* Create a participant call state object with a value corresponding to the
* specified string.
* @param callParticipantState a string representation of the state.
*/
private CallParticipantState(String callParticipantState)
{
this.callStateStr = callParticipantState;
}
/**
* Returns a String representation of tha CallParticipantSte.
*
* @return A string value (one of the _BUSY, _CALLING, _CONNECTED,
* _CONNECTING, _DISCONNECTED, _FAILED, _RINGING constants) representing
* this call participant state).
*/
public String getStateString()
{
return callStateStr;
}
/**
* Returns a string representation of this call state. Strings returned
* by this method have the following format:
* CallParticipantState:<STATE_STRING>
* and are meant to be used for logging/debugging purposes.
* @return a string representation of this object.
*/
public String toString()
{
return getClass().getName()+":"+getStateString();
}
}

@ -132,10 +132,10 @@ public void testCreateCancelCall()
//check states for call participants at both parties
CallParticipantStateEventCollector stateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.ALERTING_REMOTE_SIDE);
participantAtP1, CallPeerState.ALERTING_REMOTE_SIDE);
CallParticipantStateEventCollector stateCollectorForPp2
= new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.INCOMING_CALL);
participantAtP2, CallPeerState.INCOMING_CALL);
stateCollectorForPp1.waitForEvent(10000, true);
stateCollectorForPp2.waitForEvent(10000, true);
@ -148,11 +148,11 @@ public void testCreateCancelCall()
//make sure that the participants are in the proper state
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.ALERTING_REMOTE_SIDE
, CallPeerState.ALERTING_REMOTE_SIDE
, participantAtP1.getState());
assertEquals("The participant at provider two was not in the "
+"right state."
, CallParticipantState.INCOMING_CALL
, CallPeerState.INCOMING_CALL
, participantAtP2.getState());
@ -209,9 +209,9 @@ public void testCreateCancelCall()
//listeners monitoring state change of the participant
stateCollectorForPp1 = new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.DISCONNECTED);
participantAtP1, CallPeerState.DISCONNECTED);
stateCollectorForPp2 = new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.DISCONNECTED);
participantAtP2, CallPeerState.DISCONNECTED);
//listeners waiting for the op set to announce the end of the call
call1Listener = new CallEventCollector(basicTelephonyP1);
@ -238,7 +238,7 @@ public void testCreateCancelCall()
//make sure that the participant is disconnected
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP1.getState());
//make sure the telephony operation set distributed an event for the end
@ -261,7 +261,7 @@ public void testCreateCancelCall()
//make sure that the participant is disconnected
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP2.getState());
//make sure the telephony operation set distributed an event for the end
@ -362,10 +362,10 @@ public void testCreateRejectCall()
//check states for call participants at both parties
CallParticipantStateEventCollector stateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.ALERTING_REMOTE_SIDE);
participantAtP1, CallPeerState.ALERTING_REMOTE_SIDE);
CallParticipantStateEventCollector stateCollectorForPp2
= new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.INCOMING_CALL);
participantAtP2, CallPeerState.INCOMING_CALL);
stateCollectorForPp1.waitForEvent(10000, true);
stateCollectorForPp2.waitForEvent(10000, true);
@ -378,11 +378,11 @@ public void testCreateRejectCall()
//make sure that the participants are in the proper state
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.ALERTING_REMOTE_SIDE
, CallPeerState.ALERTING_REMOTE_SIDE
, participantAtP1.getState());
assertEquals("The participant at provider two was not in the "
+"right state."
, CallParticipantState.INCOMING_CALL
, CallPeerState.INCOMING_CALL
, participantAtP2.getState());
@ -440,11 +440,11 @@ public void testCreateRejectCall()
//listeners monitoring state change of the participant
CallParticipantStateEventCollector busyStateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.BUSY);
participantAtP1, CallPeerState.BUSY);
stateCollectorForPp1 = new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.DISCONNECTED);
participantAtP1, CallPeerState.DISCONNECTED);
stateCollectorForPp2 = new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.DISCONNECTED);
participantAtP2, CallPeerState.DISCONNECTED);
//listeners waiting for the op set to announce the end of the call
call1Listener = new CallEventCollector(basicTelephonyP1);
@ -473,7 +473,7 @@ public void testCreateRejectCall()
//make sure that the participant is disconnected
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP1.getState());
@ -498,7 +498,7 @@ public void testCreateRejectCall()
//make sure that the participant is disconnected
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP2.getState());
//make sure the telephony operation set distributed an event for the end
@ -599,10 +599,10 @@ public void aTestCreateAnswerHangupCall()
//check states for call participants at both parties
CallParticipantStateEventCollector stateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.ALERTING_REMOTE_SIDE);
participantAtP1, CallPeerState.ALERTING_REMOTE_SIDE);
CallParticipantStateEventCollector stateCollectorForPp2
= new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.INCOMING_CALL);
participantAtP2, CallPeerState.INCOMING_CALL);
stateCollectorForPp1.waitForEvent(10000, true);
stateCollectorForPp2.waitForEvent(10000, true);
@ -615,11 +615,11 @@ public void aTestCreateAnswerHangupCall()
//make sure that the participants are in the proper state
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.ALERTING_REMOTE_SIDE
, CallPeerState.ALERTING_REMOTE_SIDE
, participantAtP1.getState());
assertEquals("The participant at provider two was not in the "
+"right state."
, CallParticipantState.INCOMING_CALL
, CallPeerState.INCOMING_CALL
, participantAtP2.getState());
@ -676,10 +676,10 @@ public void aTestCreateAnswerHangupCall()
//a connected state after we answer
stateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.CONNECTED);
participantAtP1, CallPeerState.CONNECTED);
stateCollectorForPp2
= new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.CONNECTED);
participantAtP2, CallPeerState.CONNECTED);
//we will now anser the call and verify that both parties change states
//accordingly.
@ -691,11 +691,11 @@ public void aTestCreateAnswerHangupCall()
//make sure that the participants are in the proper state
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.CONNECTED
, CallPeerState.CONNECTED
, participantAtP1.getState());
assertEquals("The participant at provider two was not in the "
+"right state."
, CallParticipantState.CONNECTED
, CallPeerState.CONNECTED
, participantAtP2.getState());
//make sure that events have been distributed when states were changed.
@ -712,10 +712,10 @@ public void aTestCreateAnswerHangupCall()
//the states they are expected to.
stateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.DISCONNECTED);
participantAtP1, CallPeerState.DISCONNECTED);
stateCollectorForPp2
= new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.DISCONNECTED);
participantAtP2, CallPeerState.DISCONNECTED);
//we will now end the call and verify that both parties change states
//accordingly.
@ -727,11 +727,11 @@ public void aTestCreateAnswerHangupCall()
//make sure that the participants are in the proper state
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP1.getState());
assertEquals("The participant at provider two was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP2.getState());
//make sure that the corresponding events were delivered.
@ -862,7 +862,7 @@ public class CallParticipantStateEventCollector
{
public ArrayList collectedEvents = new ArrayList();
private CallPeer listenedCallParticipant = null;
public CallParticipantState awaitedState = null;
public CallPeerState awaitedState = null;
/**
* Creates an instance of this collector and adds it as a listener
@ -874,7 +874,7 @@ public class CallParticipantStateEventCollector
*/
public CallParticipantStateEventCollector(
CallPeer callParticipant,
CallParticipantState awaitedState)
CallPeerState awaitedState)
{
this.listenedCallParticipant = callParticipant;
this.listenedCallParticipant.addCallParticipantListener(this);
@ -893,7 +893,7 @@ public void participantStateChanged(CallPeerChangeEvent event)
logger.debug(
"Collected evt("+collectedEvents.size()+")= "+event);
if(((CallParticipantState)event.getNewValue())
if(((CallPeerState)event.getNewValue())
.equals(awaitedState))
{
this.collectedEvents.add(event);

@ -131,10 +131,10 @@ public void testCreateCancelCall()
//check states for call participants at both parties
CallParticipantStateEventCollector stateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.ALERTING_REMOTE_SIDE);
participantAtP1, CallPeerState.ALERTING_REMOTE_SIDE);
CallParticipantStateEventCollector stateCollectorForPp2
= new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.INCOMING_CALL);
participantAtP2, CallPeerState.INCOMING_CALL);
stateCollectorForPp1.waitForEvent(10000, true);
stateCollectorForPp2.waitForEvent(10000, true);
@ -147,11 +147,11 @@ public void testCreateCancelCall()
//make sure that the participants are in the proper state
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.ALERTING_REMOTE_SIDE
, CallPeerState.ALERTING_REMOTE_SIDE
, participantAtP1.getState());
assertEquals("The participant at provider two was not in the "
+"right state."
, CallParticipantState.INCOMING_CALL
, CallPeerState.INCOMING_CALL
, participantAtP2.getState());
@ -208,9 +208,9 @@ public void testCreateCancelCall()
//listeners monitoring state change of the participant
stateCollectorForPp1 = new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.DISCONNECTED);
participantAtP1, CallPeerState.DISCONNECTED);
stateCollectorForPp2 = new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.DISCONNECTED);
participantAtP2, CallPeerState.DISCONNECTED);
//listeners waiting for the op set to announce the end of the call
call1Listener = new CallEventCollector(basicTelephonyP1);
@ -237,7 +237,7 @@ public void testCreateCancelCall()
//make sure that the participant is disconnected
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP1.getState());
//make sure the telephony operation set distributed an event for the end
@ -260,7 +260,7 @@ public void testCreateCancelCall()
//make sure that the participant is disconnected
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP2.getState());
//make sure the telephony operation set distributed an event for the end
@ -361,10 +361,10 @@ public void testCreateRejectCall()
//check states for call participants at both parties
CallParticipantStateEventCollector stateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.ALERTING_REMOTE_SIDE);
participantAtP1, CallPeerState.ALERTING_REMOTE_SIDE);
CallParticipantStateEventCollector stateCollectorForPp2
= new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.INCOMING_CALL);
participantAtP2, CallPeerState.INCOMING_CALL);
stateCollectorForPp1.waitForEvent(10000, true);
stateCollectorForPp2.waitForEvent(10000, true);
@ -377,11 +377,11 @@ public void testCreateRejectCall()
//make sure that the participants are in the proper state
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.ALERTING_REMOTE_SIDE
, CallPeerState.ALERTING_REMOTE_SIDE
, participantAtP1.getState());
assertEquals("The participant at provider two was not in the "
+"right state."
, CallParticipantState.INCOMING_CALL
, CallPeerState.INCOMING_CALL
, participantAtP2.getState());
@ -439,11 +439,11 @@ public void testCreateRejectCall()
//listeners monitoring state change of the participant
CallParticipantStateEventCollector busyStateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.BUSY);
participantAtP1, CallPeerState.BUSY);
stateCollectorForPp1 = new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.DISCONNECTED);
participantAtP1, CallPeerState.DISCONNECTED);
stateCollectorForPp2 = new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.DISCONNECTED);
participantAtP2, CallPeerState.DISCONNECTED);
//listeners waiting for the op set to announce the end of the call
call1Listener = new CallEventCollector(basicTelephonyP1);
@ -472,7 +472,7 @@ public void testCreateRejectCall()
//make sure that the participant is disconnected
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP1.getState());
@ -497,7 +497,7 @@ public void testCreateRejectCall()
//make sure that the participant is disconnected
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP2.getState());
//make sure the telephony operation set distributed an event for the end
@ -598,10 +598,10 @@ public void aTestCreateAnswerHangupCall()
//check states for call participants at both parties
CallParticipantStateEventCollector stateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.ALERTING_REMOTE_SIDE);
participantAtP1, CallPeerState.ALERTING_REMOTE_SIDE);
CallParticipantStateEventCollector stateCollectorForPp2
= new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.INCOMING_CALL);
participantAtP2, CallPeerState.INCOMING_CALL);
stateCollectorForPp1.waitForEvent(10000, true);
stateCollectorForPp2.waitForEvent(10000, true);
@ -614,11 +614,11 @@ public void aTestCreateAnswerHangupCall()
//make sure that the participants are in the proper state
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.ALERTING_REMOTE_SIDE
, CallPeerState.ALERTING_REMOTE_SIDE
, participantAtP1.getState());
assertEquals("The participant at provider two was not in the "
+"right state."
, CallParticipantState.INCOMING_CALL
, CallPeerState.INCOMING_CALL
, participantAtP2.getState());
@ -675,10 +675,10 @@ public void aTestCreateAnswerHangupCall()
//a connected state after we answer
stateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.CONNECTED);
participantAtP1, CallPeerState.CONNECTED);
stateCollectorForPp2
= new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.CONNECTED);
participantAtP2, CallPeerState.CONNECTED);
//we will now anser the call and verify that both parties change states
//accordingly.
@ -690,11 +690,11 @@ public void aTestCreateAnswerHangupCall()
//make sure that the participants are in the proper state
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.CONNECTED
, CallPeerState.CONNECTED
, participantAtP1.getState());
assertEquals("The participant at provider two was not in the "
+"right state."
, CallParticipantState.CONNECTED
, CallPeerState.CONNECTED
, participantAtP2.getState());
//make sure that events have been distributed when states were changed.
@ -711,10 +711,10 @@ public void aTestCreateAnswerHangupCall()
//the states they are expected to.
stateCollectorForPp1
= new CallParticipantStateEventCollector(
participantAtP1, CallParticipantState.DISCONNECTED);
participantAtP1, CallPeerState.DISCONNECTED);
stateCollectorForPp2
= new CallParticipantStateEventCollector(
participantAtP2, CallParticipantState.DISCONNECTED);
participantAtP2, CallPeerState.DISCONNECTED);
//we will now end the call and verify that both parties change states
//accordingly.
@ -726,11 +726,11 @@ public void aTestCreateAnswerHangupCall()
//make sure that the participants are in the proper state
assertEquals("The participant at provider one was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP1.getState());
assertEquals("The participant at provider two was not in the "
+"right state."
, CallParticipantState.DISCONNECTED
, CallPeerState.DISCONNECTED
, participantAtP2.getState());
//make sure that the corresponding events were delivered.
@ -861,7 +861,7 @@ public class CallParticipantStateEventCollector
{
public ArrayList collectedEvents = new ArrayList();
private CallPeer listenedCallParticipant = null;
public CallParticipantState awaitedState = null;
public CallPeerState awaitedState = null;
/**
* Creates an instance of this collector and adds it as a listener
@ -873,7 +873,7 @@ public class CallParticipantStateEventCollector
*/
public CallParticipantStateEventCollector(
CallPeer callParticipant,
CallParticipantState awaitedState)
CallPeerState awaitedState)
{
this.listenedCallParticipant = callParticipant;
this.listenedCallParticipant.addCallParticipantListener(this);
@ -892,7 +892,7 @@ public void participantStateChanged(CallPeerChangeEvent event)
logger.debug(
"Collected evt("+collectedEvents.size()+")= "+event);
if(((CallParticipantState)event.getNewValue())
if(((CallPeerState)event.getNewValue())
.equals(awaitedState))
{
this.collectedEvents.add(event);

Loading…
Cancel
Save