diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index dbdfae944b02f0b342840452ed562f16170e9908..d929e1fd50ff0dc9d98a725cd20564d914757909 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -64,7 +64,7 @@ new_call_created_cb (DBusGProxy *proxy UNUSED, const gchar *accountID, { callable_obj_t *c; gchar *peer_name = (gchar *)to; - gchar *peer_number = ""; + gchar *peer_number = (gchar *)to; DEBUG("DBUS: New Call (%s) created to (%s)", callID, to); diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index dc09c3a85144e231bb2199222c1ea573118f1c7c..9dc000fe697de764d56d66d2d168ee18f701582c 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -1314,8 +1314,17 @@ void ManagerImpl::joinParticipant (const CallID& callId1, const CallID& callId2) void ManagerImpl::createConfFromParticipantList(const std::vector< std::string > &participantList) { + bool callSuccess; + int successCounter = 0; + _debug("Manager: Create conference from participant list"); + // we must at least have 2 participant for a conference + if(participantList.size() <= 1) { + _error("Manager: Error: Participant number must be higher or equal to 2"); + return; + } + Conference *conf = new Conference(); for(unsigned int i = 0; i < participantList.size(); i++) { @@ -1325,21 +1334,42 @@ void ManagerImpl::createConfFromParticipantList(const std::vector< std::string > std::string generatedCallID = getNewCallID(); + // Manager methods may behave differently if the call id particip to a conference conf->add(generatedCallID); - outgoingCall(account, generatedCallID, tostr, conf->getConfID()); + // Create call + callSuccess = outgoingCall(account, generatedCallID, tostr, conf->getConfID()); - if(_dbus) { + // If not able to create call remove this participant from the conference + if(!callSuccess) + conf->remove(generatedCallID); + + if(_dbus && callSuccess) { _dbus->getCallManager()->newCallCreated(account, generatedCallID, tostr); + successCounter++; } } - _conferencemap.insert(std::pair<CallID, Conference *> (conf->getConfID(), conf)); - - if (_dbus) { - _dbus->getCallManager()->conferenceCreated (conf->getConfID()); - } + // Create the conference if and only if at least 2 calls have been successfully created + if(successCounter >= 2 ) { + _conferencemap.insert(std::pair<CallID, Conference *> (conf->getConfID(), conf)); + if (_dbus) { + _dbus->getCallManager()->conferenceCreated (conf->getConfID()); + } + + audioLayerMutexLock(); + if(_audiodriver) { + conf->setRecordingSmplRate(_audiodriver->getSampleRate()); + } + audioLayerMutexUnlock(); + + getMainBuffer()->stateInfo(); + } + else { + delete conf; + conf = NULL; + } }