diff --git a/sflphone-client-gnome/src/dbus/callmanager-introspec.xml b/sflphone-client-gnome/src/dbus/callmanager-introspec.xml
index f627cd73d..b42b3c3e8 100644
--- a/sflphone-client-gnome/src/dbus/callmanager-introspec.xml
+++ b/sflphone-client-gnome/src/dbus/callmanager-introspec.xml
@@ -52,10 +52,6 @@
-
-
-
-
diff --git a/sflphone-common/src/dbus/callmanager-introspec.xml b/sflphone-common/src/dbus/callmanager-introspec.xml
index 8777adce8..26e8d03e9 100644
--- a/sflphone-common/src/dbus/callmanager-introspec.xml
+++ b/sflphone-common/src/dbus/callmanager-introspec.xml
@@ -52,10 +52,6 @@
-
-
-
-
diff --git a/sflphone-common/src/dbus/callmanager.cpp b/sflphone-common/src/dbus/callmanager.cpp
index f8d7593fb..a07256f3a 100644
--- a/sflphone-common/src/dbus/callmanager.cpp
+++ b/sflphone-common/src/dbus/callmanager.cpp
@@ -117,13 +117,6 @@ CallManager::getVolume (const std::string& device)
return 0;
}
-void
-CallManager::addParticipant (const std::string& callID)
-{
- _debug ("CallManager::addParticipant received %s\n", callID.c_str());
- Manager::instance().addParticipant(callID);
-}
-
void
CallManager::joinParticipant (const std::string& sel_callID, const std::string& drag_callID)
{
@@ -135,7 +128,7 @@ void
CallManager::detachParticipant (const std::string& callID)
{
_debug ("CallManager::detachParticipant received %s\n", callID.c_str());
- // Manager::instance().detachParticipant(callID);
+ Manager::instance().detachParticipant(callID);
}
diff --git a/sflphone-common/src/dbus/callmanager.h b/sflphone-common/src/dbus/callmanager.h
index ea54252e1..9f231d99c 100644
--- a/sflphone-common/src/dbus/callmanager.h
+++ b/sflphone-common/src/dbus/callmanager.h
@@ -48,7 +48,6 @@ public:
void transfert( const std::string& callID, const std::string& to );
void setVolume( const std::string& device, const double& value );
double getVolume( const std::string& device );
- void addParticipant( const std::string& callID );
void joinParticipant( const std::string& sel_callID, const std::string& drag_callID );
void detachParticipant( const std::string& callID );
void setRecording( const std::string& callID );
diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp
index 828bff1c2..096b1110d 100644
--- a/sflphone-common/src/managerimpl.cpp
+++ b/sflphone-common/src/managerimpl.cpp
@@ -716,7 +716,7 @@ ManagerImpl::participToConference(const CallID& call_id)
return true;
}
}
-
+/*
void
ManagerImpl::addParticipant(const CallID& call_id)
{
@@ -747,6 +747,7 @@ ManagerImpl::addParticipant(const CallID& call_id)
}
}
+*/
void
ManagerImpl::joinParticipant(const CallID& call_id1, const CallID& call_id2)
@@ -755,39 +756,38 @@ ManagerImpl::joinParticipant(const CallID& call_id1, const CallID& call_id2)
// _debug(" Current call ID %s\n", getCurrentCallId().c_str());
// TODO: add conference_id as a second parameter
- std::map call_details;
+ std::map call1_details = getCallDetails(call_id1);
+ std::map call2_details = getCallDetails(call_id2);
+
ConferenceMap::iterator iter = _conferencemap.find(default_conf);
+ std::map::iterator iter_details;
if(iter == _conferencemap.end())
{
_debug("NO CONFERENCE YET, CREATE ONE\n");
createConference(call_id1, call_id2);
-
- // answerCall(call_id);
- call_details = getCallDetails(call_id1);
- std::map::iterator iter = call_details.find("CALL_STATE");
- _debug(" call %s state: %s\n", call_id1.c_str(), iter->second.c_str());
- if (iter->second == "HOLD")
+ iter_details = call1_details.find("CALL_STATE");
+ _debug(" call %s state: %s\n", call_id1.c_str(), iter_details->second.c_str());
+ if (iter_details->second == "HOLD")
{
_debug(" OFFHOLD %s\n", call_id1.c_str());
offHoldCall(call_id1);
}
- else if(iter->second == "INCOMING")
+ else if(iter_details->second == "INCOMING")
{
_debug(" ANSWER %s\n", call_id1.c_str());
answerCall(call_id1);
}
- call_details = getCallDetails(call_id2);
- iter = call_details.find("CALL_STATE");
- _debug(" call %s state: %s\n", call_id2.c_str(), iter->second.c_str());
- if (iter->second == "HOLD")
+ iter_details = call2_details.find("CALL_STATE");
+ _debug(" call %s state: %s\n", call_id2.c_str(), iter_details->second.c_str());
+ if (iter_details->second == "HOLD")
{
_debug(" OFFHOLD %s\n", call_id2.c_str());
offHoldCall (call_id2);
}
- else if(iter->second == "INCOMING")
+ else if(iter_details->second == "INCOMING")
{
_debug(" ANSWER %s\n", call_id2.c_str());
answerCall(call_id2);
@@ -799,8 +799,27 @@ ManagerImpl::joinParticipant(const CallID& call_id1, const CallID& call_id2)
else
{
_debug("ALREADY A CONFERENCE CREATED, ADD PARTICIPANT TO IT\n");
- // Conference* conf = iter->second;
+ Conference* conf = iter->second;
+ iter_details = call1_details.find("CALL_STATE");
+ if(iter_details->second == "HOLD")
+ {
+
+ }
+ else if(iter_details->second == "INCOMING")
+ {
+
+ }
+
+ iter_details = call2_details.find("CALL_STATE");
+ if(iter_details->second == "HOLD")
+ {
+
+ }
+ else if(iter_details->second == "INCOMING")
+ {
+
+ }
// conf->add(call_id);
// _conferencecall.insert(pair(call_id, conf));
@@ -809,6 +828,36 @@ ManagerImpl::joinParticipant(const CallID& call_id1, const CallID& call_id2)
}
+
+void
+ManagerImpl::detachParticipant(const CallID& call_id)
+{
+ _debug("ManagerImpl::detachParticipant(%s)\n", call_id.c_str());
+
+ // TODO: add conference_id as a second parameter
+ ConferenceMap::iterator iter = _conferencemap.find(default_conf);
+
+ if(iter == _conferencemap.end())
+ {
+ _debug("Error there is no conference, call is not conferencing\n");
+
+ }
+ else
+ {
+ _debug("ALREADY A CONFERENCE CREATED, ADD PARTICIPANT TO IT\n");
+ Conference* conf = iter->second;
+
+ // conf->remove(call_id);
+
+ // _conferencecall.erase(call_id);
+ removeParticipant(call_id);
+
+ onHoldCall(call_id);
+ }
+
+}
+
+
void
ManagerImpl::removeParticipant(const CallID& call_id)
{
diff --git a/sflphone-common/src/managerimpl.h b/sflphone-common/src/managerimpl.h
index 586f71d6c..ef0e27274 100644
--- a/sflphone-common/src/managerimpl.h
+++ b/sflphone-common/src/managerimpl.h
@@ -192,10 +192,14 @@ class ManagerImpl {
bool participToConference(const CallID& call_id);
+/*
void addParticipant(const CallID& call_id);
+*/
void joinParticipant(const CallID& call_id1, const CallID& call_id2);
+ void detachParticipant(const CallID& call_id);
+
void removeParticipant(const CallID& call_id);
void addStream(const CallID& call_id);