diff --git a/src/manager.cpp b/src/manager.cpp index d66067e794041d2e04ab4dedad5557efaf94d6bc..b3edbad11ecf0b30e0f79a32766d048be5a8563a 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -1307,8 +1307,6 @@ bool Manager::addParticipant(const std::string& callId, const std::string& conferenceId) { - RING_DBG("Add participant %s to %s", callId.c_str(), conferenceId.c_str()); - auto iter = pimpl_->conferenceMap_.find(conferenceId); if (iter == pimpl_->conferenceMap_.end() or iter->second == nullptr) { RING_ERR("Conference id is not valid"); @@ -1321,6 +1319,14 @@ Manager::addParticipant(const std::string& callId, return false; } + // No-op if the call is already a conference participant + if (call->getConfId() == conferenceId) { + RING_WARN("Call %s already participant of conf %s", callId.c_str(), conferenceId.c_str()); + return true; + } + + RING_DBG("Add participant %s to %s", callId.c_str(), conferenceId.c_str()); + // store the current call id (it will change in offHoldCall or in answerCall) auto current_call_id = getCurrentCallId();