From f848fd936487b37c7dbf95d1415ec0db019d5ef8 Mon Sep 17 00:00:00 2001 From: Ingo Bauersachs Date: Tue, 4 Oct 2011 12:52:27 +0000 Subject: [PATCH] Avoid a race condition in SIP conference calls --- .../impl/protocol/sip/CallPeerSipImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java index 35a38a3a7..d09c948cb 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java @@ -1287,10 +1287,14 @@ public synchronized void answer() fireRequestProcessed(invite, ok); - if(sdpOffer != null && sdpOffer.length() > 0) - setState(CallPeerState.CONNECTING_INCOMING_CALL_WITH_MEDIA); - else - setState(CallPeerState.CONNECTING_INCOMING_CALL); + // the ACK to our answer might already be processed before we get here + if(CallPeerState.INCOMING_CALL.equals(getState())) + { + if(sdpOffer != null && sdpOffer.length() > 0) + setState(CallPeerState.CONNECTING_INCOMING_CALL_WITH_MEDIA); + else + setState(CallPeerState.CONNECTING_INCOMING_CALL); + } } /**