diff --git a/sflphone-common/src/dbus/callmanager-introspec.xml b/sflphone-common/src/dbus/callmanager-introspec.xml index a6157fc72455d1a9256de404854f0b503a450f29..503c84f22776ca6880f39ab6045babeca917e9fc 100644 --- a/sflphone-common/src/dbus/callmanager-introspec.xml +++ b/sflphone-common/src/dbus/callmanager-introspec.xml @@ -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> diff --git a/sflphone-common/src/dbus/callmanager.cpp b/sflphone-common/src/dbus/callmanager.cpp index e405e8e6be23d0615d8a656412654402aa339ae7..e626602576b86cff2e617e08456f2f3ab92ee85c 100644 --- a/sflphone-common/src/dbus/callmanager.cpp +++ b/sflphone-common/src/dbus/callmanager.cpp @@ -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) { diff --git a/sflphone-common/src/dbus/callmanager.h b/sflphone-common/src/dbus/callmanager.h index 88cecdbf2c5c6b5c0ef717c26c986d80cc0145d5..e9ad5c79a9559f2f1b1183d610ee637cec263c00 100644 --- a/sflphone-common/src/dbus/callmanager.h +++ b/sflphone-common/src/dbus/callmanager.h @@ -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); diff --git a/sflphone-common/src/history/historyitem.cpp b/sflphone-common/src/history/historyitem.cpp index bf475861ab3d76b53a83ec02809ae5ac78d78ef9..b4ec1c8b2307f8b5ed8d4c8b0974b68e94a8d758 100644 --- a/sflphone-common/src/history/historyitem.cpp +++ b/sflphone-common/src/history/historyitem.cpp @@ -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 () diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 889dc95509475ad3430591a74935c48097ba1107..7e8a33ccf6f9fdbca000832af68d4582b0eb0572 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -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) { diff --git a/sflphone-common/src/managerimpl.h b/sflphone-common/src/managerimpl.h index 6d98e091fa16e09a171ed3982ea6e849197a11b2..c8890d0e008efb206ddb10d374f8b20887597e19 100644 --- a/sflphone-common/src/managerimpl.h +++ b/sflphone-common/src/managerimpl.h @@ -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