Skip to content
Snippets Groups Projects
Commit fc796a3d authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Olivier SOLDANO
Browse files

conference: prevent a call to be added twice


Fix Manager::addParticipant() to always accept (return true)
to add a call already in given conference (no-op).
Without this patch, doing so causes a daemon crash.

Change-Id: I7b03a1349e7cac148ba3991b8e0bc2a9f1521c85
Reviewed-by: default avatarOlivier Soldano <olivier.soldano@savoirfairelinux.com>
parent 48ea2b17
Branches
Tags
No related merge requests found
...@@ -1307,8 +1307,6 @@ bool ...@@ -1307,8 +1307,6 @@ bool
Manager::addParticipant(const std::string& callId, Manager::addParticipant(const std::string& callId,
const std::string& conferenceId) const std::string& conferenceId)
{ {
RING_DBG("Add participant %s to %s", callId.c_str(), conferenceId.c_str());
auto iter = pimpl_->conferenceMap_.find(conferenceId); auto iter = pimpl_->conferenceMap_.find(conferenceId);
if (iter == pimpl_->conferenceMap_.end() or iter->second == nullptr) { if (iter == pimpl_->conferenceMap_.end() or iter->second == nullptr) {
RING_ERR("Conference id is not valid"); RING_ERR("Conference id is not valid");
...@@ -1321,6 +1319,14 @@ Manager::addParticipant(const std::string& callId, ...@@ -1321,6 +1319,14 @@ Manager::addParticipant(const std::string& callId,
return false; 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) // store the current call id (it will change in offHoldCall or in answerCall)
auto current_call_id = getCurrentCallId(); auto current_call_id = getCurrentCallId();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment