diff --git a/daemon/src/dbus/callmanager-introspec.xml b/daemon/src/dbus/callmanager-introspec.xml index 9f155ce5ad84309834dba53362264a124179852d..ea9e3c76da4fccf8b2ae1e05f557fd13620a4f3f 100644 --- a/daemon/src/dbus/callmanager-introspec.xml +++ b/daemon/src/dbus/callmanager-introspec.xml @@ -298,6 +298,8 @@ The call ID </tp:docstring> </arg> + <arg type="b" name="detachSucceeded" direction="out"> + </arg> </method> <method name="joinConference" tp:name-for-bindings="joinConference"> diff --git a/daemon/src/dbus/callmanager.cpp b/daemon/src/dbus/callmanager.cpp index 988596369e72b6166683e61b445ecd9dd72e78f2..cd264827697c41664f7318696eeada328fbba3a4 100644 --- a/daemon/src/dbus/callmanager.cpp +++ b/daemon/src/dbus/callmanager.cpp @@ -194,10 +194,10 @@ CallManager::addMainParticipant(const std::string& confID) return Manager::instance().addMainParticipant(confID); } -void +bool CallManager::detachParticipant(const std::string& callID) { - Manager::instance().detachParticipant(callID, ""); + return Manager::instance().detachParticipant(callID, ""); } void diff --git a/daemon/src/dbus/callmanager.h b/daemon/src/dbus/callmanager.h index 3f95dcf4a862964fb7c2c1224252ba79209e3619..445cc235126192fe37874d4699b516049fbda339 100644 --- a/daemon/src/dbus/callmanager.h +++ b/daemon/src/dbus/callmanager.h @@ -92,7 +92,7 @@ class CallManager void createConfFromParticipantList(const std::vector< std::string >& participants); bool addParticipant(const std::string& callID, const std::string& confID); bool addMainParticipant(const std::string& confID); - void detachParticipant(const std::string& callID); + bool detachParticipant(const std::string& callID); void joinConference(const std::string& sel_confID, const std::string& drag_confID); bool hangUpConference(const std::string& confID); bool holdConference(const std::string& confID); diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index cd23d063ab9f8643628745cadbd0b43acbc53df0..ff7e95ee8dbe9e5c865dc4bcca473eadba6e8616 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -1106,26 +1106,25 @@ void ManagerImpl::createConfFromParticipantList(const std::vector< std::string > } } -void ManagerImpl::detachParticipant(const std::string& call_id, - const std::string& current_id) +bool +ManagerImpl::detachParticipant(const std::string& call_id, + const std::string& current_id) { - DEBUG("Detach participant %s (current id: %s)", call_id.c_str(), - current_id.c_str()); - std::string current_call_id(getCurrentCallId()); + const std::string current_call_id(getCurrentCallId()); if (call_id != MainBuffer::DEFAULT_ID) { Call *call = getCallFromCallID(call_id); if (call == NULL) { ERROR("Could not find call %s", call_id.c_str()); - return; + return false; } Conference *conf = getConferenceFromCallID(call_id); if (conf == NULL) { ERROR("Call is not conferencing, cannot detach"); - return; + return false; } std::map<std::string, std::string> call_details(getCallDetails(call_id)); @@ -1133,7 +1132,7 @@ void ManagerImpl::detachParticipant(const std::string& call_id, if (iter_details == call_details.end()) { ERROR("Could not find CALL_STATE"); - return; + return false; } if (iter_details->second == "RINGING") { @@ -1150,7 +1149,7 @@ void ManagerImpl::detachParticipant(const std::string& call_id, if (not isConference(current_call_id)) { ERROR("Current call id (%s) is not a conference", current_call_id.c_str()); - return; + return false; } ConferenceMap::iterator iter = conferenceMap_.find(current_call_id); @@ -1158,7 +1157,7 @@ void ManagerImpl::detachParticipant(const std::string& call_id, Conference *conf = iter->second; if (iter == conferenceMap_.end() or conf == 0) { DEBUG("Conference is NULL"); - return; + return false; } if (conf->getState() == Conference::ACTIVE_ATTACHED) @@ -1173,6 +1172,8 @@ void ManagerImpl::detachParticipant(const std::string& call_id, unsetCurrentCall(); } + + return true; } void ManagerImpl::removeParticipant(const std::string& call_id) diff --git a/daemon/src/managerimpl.h b/daemon/src/managerimpl.h index 987b23327c8bff62a5ec2c7aa8cf1a611446c5c2..83cf10c1950ac81e0469dbdb187226df858a3097 100644 --- a/daemon/src/managerimpl.h +++ b/daemon/src/managerimpl.h @@ -308,7 +308,8 @@ class ManagerImpl { * @param call id * @param the current call id */ - void detachParticipant(const std::string& call_id, const std::string& current_call_id); + bool detachParticipant(const std::string& call_id, + const std::string& current_call_id); /** * Remove the conference participant from a conference diff --git a/gnome/src/dbus/callmanager-introspec.xml b/gnome/src/dbus/callmanager-introspec.xml index 9f155ce5ad84309834dba53362264a124179852d..ea9e3c76da4fccf8b2ae1e05f557fd13620a4f3f 100644 --- a/gnome/src/dbus/callmanager-introspec.xml +++ b/gnome/src/dbus/callmanager-introspec.xml @@ -298,6 +298,8 @@ The call ID </tp:docstring> </arg> + <arg type="b" name="detachSucceeded" direction="out"> + </arg> </method> <method name="joinConference" tp:name-for-bindings="joinConference"> diff --git a/gnome/src/dbus/dbus.c b/gnome/src/dbus/dbus.c index 64061885efaaf88e52b0b3ad889d3433f6eea99f..7b69b5723413b708e3cfa1d31aba5d646208801f 100644 --- a/gnome/src/dbus/dbus.c +++ b/gnome/src/dbus/dbus.c @@ -1509,7 +1509,9 @@ void dbus_detach_participant(const gchar *callID) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_detach_participant(call_proxy, callID, &error); + gboolean result; + org_sflphone_SFLphone_CallManager_detach_participant(call_proxy, callID, + &result, &error); check_error(error); }