diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index fdd16a7a7df9134e77f96c28155d40234a681141..6430f0c31e749b782f23479dcd3951ca9a982aaf 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -832,6 +832,10 @@ ManagerImpl::addParticipant(const std::string& callId, const std::string& confer return false; } + // ensure that calls are only in one conference at a time + if (isConferenceParticipant(callId)) + detachParticipant(callId); + // store the current call id (it will change in offHoldCall or in answerCall) std::string current_call_id(getCurrentCallId()); @@ -978,6 +982,12 @@ ManagerImpl::joinParticipant(const std::string& callId1, const std::string& call return false; } + // ensure that calls are only in one conference at a time + if (isConferenceParticipant(callId1)) + detachParticipant(callId1); + if (isConferenceParticipant(callId2)) + detachParticipant(callId2); + std::map<std::string, std::string> call1Details(getCallDetails(callId1)); std::map<std::string, std::string> call2Details(getCallDetails(callId2)); @@ -1260,10 +1270,8 @@ ManagerImpl::joinConference(const std::string& conf_id1, ParticipantSet participants(conf->getParticipantList()); for (ParticipantSet::const_iterator p = participants.begin(); - p != participants.end(); ++p) { - detachParticipant(*p); + p != participants.end(); ++p) addParticipant(*p, conf_id2); - } return true; }