aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java
diff options
context:
space:
mode:
authorEmil Ivov <emcho@jitsi.org>2009-08-09 21:24:15 +0000
committerEmil Ivov <emcho@jitsi.org>2009-08-09 21:24:15 +0000
commit39f039f526ab790c768ffcd88af379b8134dddbd (patch)
tree8793be1096b4bc58f10b49b0b1e85d2a62dfe1ae /src/net/java
parent54d5fa8ac15d4aa60bba646a0267e6574829e498 (diff)
downloadjitsi-39f039f526ab790c768ffcd88af379b8134dddbd.zip
jitsi-39f039f526ab790c768ffcd88af379b8134dddbd.tar.gz
jitsi-39f039f526ab790c768ffcd88af379b8134dddbd.tar.bz2
Renames CallParticipant to CallPeer so that it would better reflect our new Call architecture that also includes conferencing and ConferenceMembers
Diffstat (limited to 'src/net/java')
-rw-r--r--src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java74
-rw-r--r--src/net/java/sip/communicator/impl/callhistory/CallParticipantRecordImpl.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java20
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java4
-rw-r--r--src/net/java/sip/communicator/impl/media/CallSessionImpl.java12
-rw-r--r--src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java8
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java12
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java14
-rw-r--r--src/net/java/sip/communicator/impl/protocol/mock/MockCall.java12
-rw-r--r--src/net/java/sip/communicator/impl/protocol/mock/MockOperationSetBasicTelephony.java16
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java12
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java158
-rw-r--r--src/net/java/sip/communicator/service/callhistory/CallParticipantRecord.java4
-rw-r--r--src/net/java/sip/communicator/service/protocol/CallParticipantState.java300
14 files changed, 174 insertions, 474 deletions
diff --git a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java
index 7c52623..ea8aecb 100644
--- a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java
@@ -346,7 +346,7 @@ public class CallHistoryServiceImpl
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 @@ public class CallHistoryServiceImpl
* @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 @@ public class CallHistoryServiceImpl
* @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 @@ public class CallHistoryServiceImpl
{
public void participantStateChanged(CallPeerChangeEvent evt)
{
- if(evt.getNewValue().equals(CallParticipantState.DISCONNECTED))
+ if(evt.getNewValue().equals(CallPeerState.DISCONNECTED))
return;
else
{
@@ -868,11 +868,11 @@ public class CallHistoryServiceImpl
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 @@ public class CallHistoryServiceImpl
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());
}
diff --git a/src/net/java/sip/communicator/impl/callhistory/CallParticipantRecordImpl.java b/src/net/java/sip/communicator/impl/callhistory/CallParticipantRecordImpl.java
index 02864b7..24a7718 100644
--- a/src/net/java/sip/communicator/impl/callhistory/CallParticipantRecordImpl.java
+++ b/src/net/java/sip/communicator/impl/callhistory/CallParticipantRecordImpl.java
@@ -63,7 +63,7 @@ public class CallParticipantRecordImpl
* Sets the participant state
* @param state CallParticipantState
*/
- public void setState(CallParticipantState state)
+ public void setState(CallPeerState state)
{
this.state = state;
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java
index 4d9d93c..8b19464 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java
@@ -159,7 +159,7 @@ public class CallPanel
if (participantPanel != null)
{
- CallParticipantState state = participant.getState();
+ CallPeerState state = participant.getState();
participantPanel.setState(state.getStateString(), null);
@@ -204,20 +204,20 @@ public class CallPanel
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 @@ public class CallPanel
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);
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java
index 4a5e3e9..89b6e71 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java
@@ -913,14 +913,14 @@ public class CallParticipantPanel
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()),
diff --git a/src/net/java/sip/communicator/impl/media/CallSessionImpl.java b/src/net/java/sip/communicator/impl/media/CallSessionImpl.java
index 4321f31..495f88a 100644
--- a/src/net/java/sip/communicator/impl/media/CallSessionImpl.java
+++ b/src/net/java/sip/communicator/impl/media/CallSessionImpl.java
@@ -1206,10 +1206,10 @@ public class CallSessionImpl
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 @@ public class CallSessionImpl
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();
}
diff --git a/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java b/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java
index 3bf10d9..4e5a3c3 100644
--- a/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java
+++ b/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java
@@ -318,11 +318,11 @@ public class SingleCallInProgressPolicy
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
{
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java
index 8c0df04..3798337 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java
@@ -160,16 +160,16 @@ public class CallJabberImpl
*/
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);
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java
index 1baab26..aac4316 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java
@@ -262,7 +262,7 @@ public class OperationSetBasicTelephonyJabberImpl
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 class OperationSetBasicTelephonyJabberImpl
}
finally
{
- callParticipant.setState(CallParticipantState.DISCONNECTED);
+ callParticipant.setState(CallPeerState.DISCONNECTED);
}
}
@@ -436,7 +436,7 @@ public class OperationSetBasicTelephonyJabberImpl
= 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 class OperationSetBasicTelephonyJabberImpl
{
return;
}
- callParticipant.setState(CallParticipantState.CONNECTED);
+ callParticipant.setState(CallPeerState.CONNECTED);
}
else if (newState instanceof OutgoingJingleSession.Inviting)
{
@@ -548,7 +548,7 @@ public class OperationSetBasicTelephonyJabberImpl
{
return;
}
- callParticipant.setState(CallParticipantState.CONNECTING);
+ callParticipant.setState(CallPeerState.CONNECTING);
}
else if (newState instanceof OutgoingJingleSession.Pending)
{
@@ -560,7 +560,7 @@ public class OperationSetBasicTelephonyJabberImpl
{
return;
}
- callParticipant.setState(CallParticipantState.ALERTING_REMOTE_SIDE);
+ callParticipant.setState(CallPeerState.ALERTING_REMOTE_SIDE);
}
else if (newState instanceof OutgoingJingleSession.Active)
{
@@ -572,7 +572,7 @@ public class OperationSetBasicTelephonyJabberImpl
{
return;
}
- callParticipant.setState(CallParticipantState.CONNECTED);
+ callParticipant.setState(CallPeerState.CONNECTED);
}
if ((newState == null) && (oldState != null))
diff --git a/src/net/java/sip/communicator/impl/protocol/mock/MockCall.java b/src/net/java/sip/communicator/impl/protocol/mock/MockCall.java
index ddf3682..c85971a 100644
--- a/src/net/java/sip/communicator/impl/protocol/mock/MockCall.java
+++ b/src/net/java/sip/communicator/impl/protocol/mock/MockCall.java
@@ -100,16 +100,16 @@ public class MockCall
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);
diff --git a/src/net/java/sip/communicator/impl/protocol/mock/MockOperationSetBasicTelephony.java b/src/net/java/sip/communicator/impl/protocol/mock/MockOperationSetBasicTelephony.java
index 3d495ee..6dea6bc 100644
--- a/src/net/java/sip/communicator/impl/protocol/mock/MockOperationSetBasicTelephony.java
+++ b/src/net/java/sip/communicator/impl/protocol/mock/MockOperationSetBasicTelephony.java
@@ -49,14 +49,14 @@ public class MockOperationSetBasicTelephony
{
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 class MockOperationSetBasicTelephony
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 class MockOperationSetBasicTelephony
= (MockCallParticipant)participant;
logger.info("hangupCallParticipant");
- callParticipant.setState(CallParticipantState.DISCONNECTED, null);
+ callParticipant.setState(CallPeerState.DISCONNECTED, null);
}
/**
@@ -193,8 +193,8 @@ public class MockOperationSetBasicTelephony
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 class MockOperationSetBasicTelephony
{
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;
}
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java
index cacde87..7167865 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java
@@ -173,16 +173,16 @@ public class CallSipImpl
*/
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);
}
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java
index 3511a29..f1af80c 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java
@@ -421,25 +421,25 @@ public class OperationSetBasicTelephonySipImpl
*/
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 class OperationSetBasicTelephonySipImpl
+ " " + response.getReasonPhrase());
if (callParticipant != null)
- callParticipant.setState(CallParticipantState.FAILED);
+ callParticipant.setState(CallPeerState.FAILED);
processed = true;
}
@@ -812,10 +812,10 @@ public class OperationSetBasicTelephonySipImpl
}
// 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 @@ public class OperationSetBasicTelephonySipImpl
}
// change status.
- callParticipant.setState(CallParticipantState.ALERTING_REMOTE_SIDE);
+ callParticipant.setState(CallPeerState.ALERTING_REMOTE_SIDE);
}
/**
@@ -880,7 +880,7 @@ public class OperationSetBasicTelephonySipImpl
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 @@ public class OperationSetBasicTelephonySipImpl
// change status
callParticipant
- .setState(CallParticipantState.CONNECTING_WITH_EARLY_MEDIA);
+ .setState(CallPeerState.CONNECTING_WITH_EARLY_MEDIA);
}
/**
@@ -1071,7 +1071,7 @@ public class OperationSetBasicTelephonySipImpl
// !!! 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 @@ public class OperationSetBasicTelephonySipImpl
* 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 @@ public class OperationSetBasicTelephonySipImpl
//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 @@ public class OperationSetBasicTelephonySipImpl
}
// change status
- callParticipant.setState(CallParticipantState.BUSY);
+ callParticipant.setState(CallPeerState.BUSY);
}
/**
@@ -1313,7 +1313,7 @@ public class OperationSetBasicTelephonySipImpl
}
// 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 class OperationSetBasicTelephonySipImpl
}
// change status
- callParticipant.setState(CallParticipantState.DISCONNECTED);
+ callParticipant.setState(CallPeerState.DISCONNECTED);
return true;
}
@@ -1598,7 +1598,7 @@ public class OperationSetBasicTelephonySipImpl
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 @@ public class OperationSetBasicTelephonySipImpl
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 @@ public class OperationSetBasicTelephonySipImpl
{
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 @@ public class OperationSetBasicTelephonySipImpl
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 @@ public class OperationSetBasicTelephonySipImpl
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 @@ public class OperationSetBasicTelephonySipImpl
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 @@ public class OperationSetBasicTelephonySipImpl
}
else
{
- callParticipant.setState(CallParticipantState.DISCONNECTED);
+ callParticipant.setState(CallPeerState.DISCONNECTED);
}
}
@@ -1997,10 +1997,10 @@ public class OperationSetBasicTelephonySipImpl
}
// 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 @@ public class OperationSetBasicTelephonySipImpl
}
}
else
- participant.setState(CallParticipantState.CONNECTED);
+ participant.setState(CallPeerState.CONNECTED);
}
}
@@ -2103,7 +2103,7 @@ public class OperationSetBasicTelephonySipImpl
}
// change status
- callParticipant.setState(CallParticipantState.DISCONNECTED);
+ callParticipant.setState(CallPeerState.DISCONNECTED);
}
/**
@@ -2337,7 +2337,7 @@ public class OperationSetBasicTelephonySipImpl
"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 @@ public class OperationSetBasicTelephonySipImpl
"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 @@ public class OperationSetBasicTelephonySipImpl
&& !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 @@ public class OperationSetBasicTelephonySipImpl
}
if (!dialogIsAlive)
{
- participant.setState(CallParticipantState.DISCONNECTED);
+ participant.setState(CallPeerState.DISCONNECTED);
}
}
@@ -2457,7 +2457,7 @@ public class OperationSetBasicTelephonySipImpl
activeCallsRepository.findCallParticipant(dialog);
if (callParticipant != null)
{
- callParticipant.setState(CallParticipantState.DISCONNECTED);
+ callParticipant.setState(CallPeerState.DISCONNECTED);
}
}
return true;
@@ -2617,8 +2617,8 @@ public class OperationSetBasicTelephonySipImpl
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 class OperationSetBasicTelephonySipImpl
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 @@ public class OperationSetBasicTelephonySipImpl
// 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 class OperationSetBasicTelephonySipImpl
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 class OperationSetBasicTelephonySipImpl
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 class OperationSetBasicTelephonySipImpl
}
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 class OperationSetBasicTelephonySipImpl
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 class OperationSetBasicTelephonySipImpl
}
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 @@ public class OperationSetBasicTelephonySipImpl
callParticipant.setState(
incomingCall ?
- CallParticipantState.INCOMING_CALL :
- CallParticipantState.INITIATING_CALL);
+ CallPeerState.INCOMING_CALL :
+ CallPeerState.INITIATING_CALL);
callParticipant.setDialog(containingTransaction.getDialog());
callParticipant.setFirstTransaction(containingTransaction);
diff --git a/src/net/java/sip/communicator/service/callhistory/CallParticipantRecord.java b/src/net/java/sip/communicator/service/callhistory/CallParticipantRecord.java
index caefbb3..0973dbf 100644
--- a/src/net/java/sip/communicator/service/callhistory/CallParticipantRecord.java
+++ b/src/net/java/sip/communicator/service/callhistory/CallParticipantRecord.java
@@ -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 class CallParticipantRecord
* Returns the actual state of the participant
* @return CallParticipantState
*/
- public CallParticipantState getState()
+ public CallPeerState getState()
{
return state;
}
diff --git a/src/net/java/sip/communicator/service/protocol/CallParticipantState.java b/src/net/java/sip/communicator/service/protocol/CallParticipantState.java
deleted file mode 100644
index d331363..0000000
--- a/src/net/java/sip/communicator/service/protocol/CallParticipantState.java
+++ /dev/null
@@ -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();
- }
-}