Skip to content
Snippets Groups Projects
Commit e6e1b337 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2006] Dragndrop fully functional with INCOMING and HOLD call

parent c15bd15b
Branches
Tags
No related merge requests found
...@@ -493,16 +493,18 @@ ManagerImpl::offHoldCall (const CallID& id) ...@@ -493,16 +493,18 @@ ManagerImpl::offHoldCall (const CallID& id)
AccountID accountid; AccountID accountid;
bool returnValue, rec; bool returnValue, rec;
std::string codecName; std::string codecName;
CallID call_id; CallID call_id, current_call_id;
stopTone (false); stopTone (false);
call_id = id; call_id = id;
current_call_id = getCurrentCallId();
//Place current call on hold if it isn't //Place current call on hold if it isn't
if (hasCurrentCall() ) { if (hasCurrentCall() && !participToConference(current_call_id))
{
_debug ("Put the current call (ID=%s) on hold\n", getCurrentCallId().c_str()); _debug ("Put the current call (ID=%s) on hold\n", getCurrentCallId().c_str());
onHoldCall (getCurrentCallId()); onHoldCall (current_call_id);
} }
switchCall(id); switchCall(id);
...@@ -759,16 +761,37 @@ ManagerImpl::joinParticipant(const CallID& call_id1, const CallID& call_id2) ...@@ -759,16 +761,37 @@ ManagerImpl::joinParticipant(const CallID& call_id1, const CallID& call_id2)
if(iter == _conferencemap.end()) if(iter == _conferencemap.end())
{ {
_debug("NO CONFERENCE YET, CREATE ONE\n"); _debug("NO CONFERENCE YET, CREATE ONE\n");
// createConference(call_id1, call_id2); createConference(call_id1, call_id2);
// answerCall(call_id); // answerCall(call_id);
call_details = getCallDetails(call_id1); call_details = getCallDetails(call_id1);
std::map<std::string, std::string>::iterator iter = call_details.find("CALL_STATE"); 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()); _debug(" call %s state: %s\n", call_id1.c_str(), iter->second.c_str());
if (iter->second == "HOLD")
{
_debug(" OFFHOLD %s\n", call_id1.c_str());
offHoldCall(call_id1);
}
else if(iter->second == "INCOMING")
{
_debug(" INCOMING %s\n", call_id1.c_str());
answerCall(call_id1);
}
call_details = getCallDetails(call_id2); call_details = getCallDetails(call_id2);
iter = call_details.find("CALL_STATE"); iter = call_details.find("CALL_STATE");
_debug(" call %s state: %s\n", call_id2.c_str(), iter->second.c_str()); _debug(" call %s state: %s\n", call_id2.c_str(), iter->second.c_str());
if (iter->second == "HOLD")
{
_debug(" OFFHOLD %s\n", call_id2.c_str());
offHoldCall (call_id2);
}
else if(iter->second == "INCOMING")
{
_debug(" INCOMING %s\n", call_id2.c_str());
answerCall(call_id2);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment