Commit cc51a151 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

#6149: Add dbus call for creating conference from history

parent e19092b7
......@@ -133,7 +133,7 @@
</arg>
</method>
<method name="attendedTransfer" tp:name-for-bindings="attendedTransfer">
<method name="attendedTransfer" tp:name-for-bindings="attendedTransfer">
<tp:docstring>
Perform an attended transfer on two calls
</tp:docstring>
......@@ -212,6 +212,15 @@
<arg type="s" name="drag_callID" direction="in"/>
</method>
<method name="createConfFromParticipantList" tp:name-for-bindings="createConfFromParticipantList">
<tp:added version="0.9.14"/>
<tp:docstring>
<p>Create a conference from a list of participant</p>
<tp:rationale>The signal <tp:member-ref>conferenceCreated</tp:member-ref> is emitted on success.</tp:rationale>
</tp:docstring>
<arg type="as" name="participants" direction="in"/>
</method>
<method name="addParticipant" tp:name-for-bindings="addParticipant">
<tp:added version="0.9.7"/>
<tp:docstring>
......
......@@ -211,10 +211,16 @@ CallManager::getVolume (const std::string& device)
void
CallManager::joinParticipant (const std::string& sel_callID, const std::string& drag_callID)
{
_debug ("CallManager::joinParticipant received %s, %s", sel_callID.c_str(), drag_callID.c_str());
_debug ("CallManager: Join participant %s, %s", sel_callID.c_str(), drag_callID.c_str());
Manager::instance().joinParticipant (sel_callID, drag_callID);
}
void
CallManager::createConfFromParticipantList(const std::vector< std::string >& participants)
{
_debug("CallManager: Create conference from participant list");
}
void
CallManager::addParticipant (const std::string& callID, const std::string& confID)
{
......
......@@ -88,6 +88,7 @@ class CallManager
/* Conference related methods */
void joinParticipant (const std::string& sel_callID, const std::string& drag_callID);
void createConfFromParticipantList(const std::vector< std::string >& participants);
void addParticipant (const std::string& callID, const std::string& confID);
void addMainParticipant (const std::string& confID);
void detachParticipant (const std::string& callID);
......
......@@ -65,20 +65,26 @@ HistoryItem::HistoryItem (std::string timestamp, std::string serialized_form)
switch (indice) {
case 0: // The call type
id = tmp;
_error("Unserialized id: %s", tmp.c_str());
break;
case 1: // The number field
number = tmp;
_error("Unserialized number: %s", tmp.c_str());
break;
case 2: // The name field
name = tmp;
_error("Unserialized name: %s", tmp.c_str());
break;
case 3: // The end timestamp
_error("Unserialized timestamp: %s", tmp.c_str());
stop = tmp;
break;
case 4: // The account ID
_error("Unserialized account: %s", tmp.c_str());
account = tmp;
break;
case 5: // The recorded file name
_error("Unserialized recordfile: %s", tmp.c_str());
recordFile = tmp;
break;
default: // error
......@@ -94,7 +100,7 @@ HistoryItem::HistoryItem (std::string timestamp, std::string serialized_form)
_number = number;
(name == EMPTY_STRING) ? _name = "" : _name = name;
_timestamp_stop = stop;
(serialized_form == EMPTY_STRING) ? _account_id = "" : _account_id=serialized_form ;
(serialized_form == EMPTY_STRING) ? _account_id = "" : _account_id=tmp;
}
HistoryItem::~HistoryItem ()
......
......@@ -267,15 +267,9 @@ bool ManagerImpl::outgoingCall (const std::string& account_id,
if (hasCurrentCall()) {
_debug ("Manager: Has current call (%s) put it onhold", current_call_id.c_str());
// std::string currentCallState = getCallDetails(current_call_id).find("CALL_STATE")->second;
//Call *call = getAccountLink(getAccountFromCall(current_call_id))->getCall(current_call_id);
// if this is not a conferenceand this and is not a conference participant
if (!isConference (current_call_id) && !participToConference (current_call_id)) {
// if(currentCallState != "RINGING") {
// if(call->getConnectionState() == Call::Connected) {
onHoldCall (current_call_id);
// }
onHoldCall (current_call_id);
} else if (isConference (current_call_id) && !participToConference (call_id)) {
detachParticipant (default_id, current_call_id);
}
......@@ -404,7 +398,6 @@ bool ManagerImpl::answerCall (const CallID& call_id)
else {
_dbus->getCallManager()->callStateChanged(call_id, "CURRENT");
}
// _dbus->getCallManager()->callStateChanged(call_id, "CURRENT");
return true;
}
......@@ -1312,6 +1305,40 @@ void ManagerImpl::joinParticipant (const CallID& callId1, const CallID& callId2)
getMainBuffer()->stateInfo();
}
void ManagerImpl::createConfFromParticipantList(const std::vector< std::string > &participantList)
{
_debug("Manager: Create conference from participant list");
Conference *conf = new Conference();
// std::vector< std::string >::iterator iter;
// iter = participantList.begin();
/*
while(iter != participantList.end()) {
std::string participant = *iter;
_debug("PARTICIPANT LIST %s", participant.c_str());
iter++;
}
*/
std::string generatedCallID = "callid";
std::string tostr = "147";
std::string accountstr = "AccountID:123456";
for(unsigned int i = 0; i < participantList.size(); i++) {
_debug("PARTICIPANT LIST %s", participantList[i].c_str());
generatedCallID = generatedCallID + participantList[i];
outgoingCall(accountstr, generatedCallID, tostr);
conf->add(generatedCallID);
}
_conferencemap.insert(std::pair<CallID, Conference *> (conf->getConfID(), conf));
}
void ManagerImpl::detachParticipant (const CallID& call_id,
const CallID& current_id)
{
......
......@@ -340,6 +340,12 @@ class ManagerImpl
*/
void joinParticipant (const CallID& call_id1, const CallID& call_id2);
/**
* Create a conference from a list of participant
* @param A vector containing the list of participant
*/
void createConfFromParticipantList(const std::vector< std::string > &);
/**
* Detach a participant from a conference, put the call on hold, do not hangup it
* @param call id
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment