mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
[#2006] Remove addParticipant method for conference, use joinParticipant only
This commit is contained in:
@ -52,10 +52,6 @@
|
||||
<arg type="d" name="value" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="addParticipant">
|
||||
<arg type="s" name="callID" direction="in"/>
|
||||
</method>
|
||||
|
||||
<method name="joinParticipant">
|
||||
<arg type="s" name="sel_callID" direction="in"/>
|
||||
<arg type="s" name="drag_callID" direction="in"/>
|
||||
|
@ -52,10 +52,6 @@
|
||||
<arg type="d" name="value" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="addParticipant">
|
||||
<arg type="s" name="callID" direction="in"/>
|
||||
</method>
|
||||
|
||||
<method name="joinParticipant">
|
||||
<arg type="s" name="sel_callID" direction="in"/>
|
||||
<arg type="s" name="drag_callID" direction="in"/>
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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 );
|
||||
|
@ -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<std::string, std::string> call_details;
|
||||
std::map<std::string, std::string> call1_details = getCallDetails(call_id1);
|
||||
std::map<std::string, std::string> call2_details = getCallDetails(call_id2);
|
||||
|
||||
ConferenceMap::iterator iter = _conferencemap.find(default_conf);
|
||||
std::map<std::string, std::string>::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<std::string, std::string>::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<CallID, Conference*>(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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user