From e6e1b337e78df147b2260bdc3b44decc9c160d34 Mon Sep 17 00:00:00 2001 From: Alexandre Savard <alexandre.savard@savoirfairelinux.net> Date: Mon, 24 Aug 2009 13:09:40 -0400 Subject: [PATCH] [#2006] Dragndrop fully functional with INCOMING and HOLD call --- sflphone-common/src/managerimpl.cpp | 31 +++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 84dd46719b..59f1a42888 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -493,16 +493,18 @@ ManagerImpl::offHoldCall (const CallID& id) AccountID accountid; bool returnValue, rec; std::string codecName; - CallID call_id; + CallID call_id, current_call_id; stopTone (false); call_id = id; + current_call_id = getCurrentCallId(); //Place current call on hold if it isn't - if (hasCurrentCall() ) { + if (hasCurrentCall() && !participToConference(current_call_id)) + { _debug ("Put the current call (ID=%s) on hold\n", getCurrentCallId().c_str()); - onHoldCall (getCurrentCallId()); + onHoldCall (current_call_id); } switchCall(id); @@ -759,16 +761,37 @@ ManagerImpl::joinParticipant(const CallID& call_id1, const CallID& call_id2) if(iter == _conferencemap.end()) { _debug("NO CONFERENCE YET, CREATE ONE\n"); - // createConference(call_id1, call_id2); + createConference(call_id1, call_id2); + // answerCall(call_id); call_details = getCallDetails(call_id1); std::map<std::string, std::string>::iterator iter = call_details.find("CALL_STATE"); _debug(" call %s state: %s\n", call_id1.c_str(), iter->second.c_str()); + if (iter->second == "HOLD") + { + _debug(" OFFHOLD %s\n", call_id1.c_str()); + offHoldCall(call_id1); + } + else if(iter->second == "INCOMING") + { + _debug(" INCOMING %s\n", call_id1.c_str()); + answerCall(call_id1); + } call_details = getCallDetails(call_id2); iter = call_details.find("CALL_STATE"); _debug(" call %s state: %s\n", call_id2.c_str(), iter->second.c_str()); + if (iter->second == "HOLD") + { + _debug(" OFFHOLD %s\n", call_id2.c_str()); + offHoldCall (call_id2); + } + else if(iter->second == "INCOMING") + { + _debug(" INCOMING %s\n", call_id2.c_str()); + answerCall(call_id2); + } -- GitLab