diff --git a/sflphone-common/src/dbus/callmanager.cpp b/sflphone-common/src/dbus/callmanager.cpp index c8fb552b4e3d00af636c23542d968b1301b94a87..ed4ebe37419cb477f7d656129225e3cd4eead5f0 100644 --- a/sflphone-common/src/dbus/callmanager.cpp +++ b/sflphone-common/src/dbus/callmanager.cpp @@ -128,7 +128,7 @@ void CallManager::joinParticipant (const std::string& sel_callID, const std::string& drag_callID) { _debug ("CallManager::joinParticipant received %s, %s\n", sel_callID.c_str(), drag_callID.c_str()); - // Manager::instance().joinParticipant(callID); + Manager::instance().joinParticipant(sel_callID, drag_callID); } void diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index d39f198899dbdb34651e75276cb0927582d7fc8e..a63a676cb9c7247541f616dc74f1b707e19f2675 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -641,18 +641,18 @@ ManagerImpl::refuseCall (const CallID& id) void -ManagerImpl::createConference(const CallID& id) +ManagerImpl::createConference(const CallID& id1, const CallID& id2) { _debug("ManagerImpl::createConference()\n"); Conference* conf = new Conference(); - _conferencecall.insert(pair<CallID, Conference*>(id, conf)); - _conferencecall.insert(pair<CallID, Conference*>(getCurrentCallId(), conf)); + _conferencecall.insert(pair<CallID, Conference*>(id1, conf)); + _conferencecall.insert(pair<CallID, Conference*>(id2, conf)); _conferencemap.insert(pair<CallID, Conference*>(default_conf, conf)); - conf->add(getCurrentCallId()); - conf->add(id); + conf->add(id1); + conf->add(id2); } @@ -727,7 +727,7 @@ ManagerImpl::addParticipant(const CallID& call_id) if(iter == _conferencemap.end()) { _debug("NO CONFERENCE YET, CREATE ONE\n"); - createConference(call_id); + createConference(call_id, getCurrentCallId()); answerCall(call_id); @@ -746,6 +746,36 @@ ManagerImpl::addParticipant(const CallID& call_id) } +void +ManagerImpl::joinParticipant(const CallID& call_id1, const CallID& call_id2) +{ + _debug("ManagerImpl::joinParticipant(%s, %s)\n", call_id1.c_str(), call_id2.c_str()); + // _debug(" Current call ID %s\n", getCurrentCallId().c_str()); + + // TODO: add conference_id as a second parameter + ConferenceMap::iterator iter = _conferencemap.find(default_conf); + + if(iter == _conferencemap.end()) + { + _debug("NO CONFERENCE YET, CREATE ONE\n"); + // createConference(call_id1, call_id2); + + // answerCall(call_id); + + } + else + { + _debug("ALREADY A CONFERENCE CREATED, ADD PARTICIPANT TO IT\n"); + // Conference* conf = iter->second; + + // conf->add(call_id); + // _conferencecall.insert(pair<CallID, Conference*>(call_id, conf)); + + // answerCall(call_id); + } + +} + void ManagerImpl::removeParticipant(const CallID& call_id) { diff --git a/sflphone-common/src/managerimpl.h b/sflphone-common/src/managerimpl.h index f6b6d9184ce0f0667ddf0be10fa7abe16fa10719..586f71d6c07755fe17911ff575e6e6e79614cd68 100644 --- a/sflphone-common/src/managerimpl.h +++ b/sflphone-common/src/managerimpl.h @@ -186,7 +186,7 @@ class ManagerImpl { */ bool refuseCall(const CallID& id); - void createConference(const CallID& id); + void createConference(const CallID& id1, const CallID& id2); void removeConference(const CallID& conference_id); @@ -194,6 +194,8 @@ class ManagerImpl { void addParticipant(const CallID& call_id); + void joinParticipant(const CallID& call_id1, const CallID& call_id2); + void removeParticipant(const CallID& call_id); void addStream(const CallID& call_id);