diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp index bcb6f62ae..eebb6a0c2 100644 --- a/linphone-app/src/components/call/CallModel.cpp +++ b/linphone-app/src/components/call/CallModel.cpp @@ -187,7 +187,6 @@ void CallModel::acceptWithVideo () { void CallModel::terminate () { CoreManager *core = CoreManager::getInstance(); - core->lockVideoRender(); mCall->terminate(); core->unlockVideoRender(); @@ -365,10 +364,10 @@ void CallModel::accept (bool withVideo) { // ----------------------------------------------------------------------------- void CallModel::updateIsInConference () { - if (mIsInConference != mCall->getParams()->getLocalConferenceMode()) { + if (mIsInConference != mCall->getCurrentParams()->getLocalConferenceMode()) { mIsInConference = !mIsInConference; - emit isInConferenceChanged(mIsInConference); } + emit isInConferenceChanged(mIsInConference); } // ----------------------------------------------------------------------------- diff --git a/linphone-app/src/components/calls/CallsListModel.cpp b/linphone-app/src/components/calls/CallsListModel.cpp index e9b394c5c..d50ae296a 100644 --- a/linphone-app/src/components/calls/CallsListModel.cpp +++ b/linphone-app/src/components/calls/CallsListModel.cpp @@ -239,7 +239,7 @@ void CallsListModel::addCall (const shared_ptr &call) { } CallModel *callModel = new CallModel(call); - qInfo() << QStringLiteral("Add call:") << callModel; + qInfo() << QStringLiteral("Add call:") << callModel->getFullLocalAddress() << callModel->getFullPeerAddress(); App::getInstance()->getEngine()->setObjectOwnership(callModel, QQmlEngine::CppOwnership); // This connection is (only) useful for `CallsListProxyModel`. diff --git a/linphone-app/src/components/conference/ConferenceAddModel.cpp b/linphone-app/src/components/conference/ConferenceAddModel.cpp index 898597314..aa856fdff 100644 --- a/linphone-app/src/components/conference/ConferenceAddModel.cpp +++ b/linphone-app/src/components/conference/ConferenceAddModel.cpp @@ -42,7 +42,7 @@ ConferenceHelperModel::ConferenceAddModel::ConferenceAddModel (QObject *parent) ); for (const auto &call : coreManager->getCore()->getCalls()) { - if (call->getParams()->getLocalConferenceMode()) + if (call->getCurrentParams()->getLocalConferenceMode()) addToConference(call->getRemoteAddress()); } } @@ -134,33 +134,41 @@ bool ConferenceHelperModel::ConferenceAddModel::removeFromConference (const QStr // ----------------------------------------------------------------------------- void ConferenceHelperModel::ConferenceAddModel::update () { - list> linphoneAddresses; + shared_ptr conference = mConferenceHelperModel->mCore->getConference(); + if(!conference){ + conference = mConferenceHelperModel->mCore->createConferenceWithParams(mConferenceHelperModel->mCore->createConferenceParams()); + } + auto currentCalls = CoreManager::getInstance()->getCore()->getCalls(); + list> allLinphoneAddresses; + +//1) Invite participants first to avoid removing conference if empty for (const auto &map : mRefs) { shared_ptr linphoneAddress = map->value("__linphoneAddress").value>(); Q_CHECK_PTR(linphoneAddress); - linphoneAddresses.push_back(linphoneAddress); + allLinphoneAddresses.push_back(linphoneAddress); } + if( allLinphoneAddresses.size() > 0) + conference->inviteParticipants( + allLinphoneAddresses, + CoreManager::getInstance()->getCore()->createCallParams(nullptr) + ); - shared_ptr conference = mConferenceHelperModel->mCore->getConference(); - if(!conference) - conference = mConferenceHelperModel->mCore->createConferenceWithParams(mConferenceHelperModel->mCore->createConferenceParams()); - - // Remove sip addresses if necessary. - for (const auto &call : CoreManager::getInstance()->getCore()->getCalls()) { - if (!call->getParams()->getLocalConferenceMode()) - continue; - - const QString sipAddress = Utils::coreStringToAppString(call->getRemoteAddress()->asStringUriOnly()); - if (!mSipAddresses.contains(sipAddress)) - call->terminate(); - } - - conference->inviteParticipants( - linphoneAddresses, - CoreManager::getInstance()->getCore()->createCallParams(nullptr) - ); +// 2) Put in pause and remove all calls that are not in the conference list + for(const auto &call : CoreManager::getInstance()->getCore()->getCalls()){ + const std::string callAddress = call->getRemoteAddress()->asStringUriOnly(); + auto address = allLinphoneAddresses.begin(); + while(address != allLinphoneAddresses.end() && (*address)->asStringUriOnly() != callAddress) + ++address; + if(address == allLinphoneAddresses.end()){// Not in conference list : put in pause and remove it from conference if it's the case + call->pause(); + if( call->getParams()->getLocalConferenceMode() ){// Remove conference if it is not yet requested + CoreManager::getInstance()->getCore()->removeFromConference(call); + } + } + } } + // ----------------------------------------------------------------------------- void ConferenceHelperModel::ConferenceAddModel::addToConferencePrivate (const shared_ptr &linphoneAddress) { diff --git a/linphone-app/src/components/conference/ConferenceModel.cpp b/linphone-app/src/components/conference/ConferenceModel.cpp index cb9c37350..324d027ae 100644 --- a/linphone-app/src/components/conference/ConferenceModel.cpp +++ b/linphone-app/src/components/conference/ConferenceModel.cpp @@ -50,7 +50,7 @@ ConferenceModel::ConferenceModel (QObject *parent) : QSortFilterProxyModel(paren CoreManager::getInstance()->getHandlers().get(), &CoreHandlers::callStateChanged, this, [this] { emit conferenceChanged(); }); } - +// Show all paraticpants thar should be, will be or are still in conference bool ConferenceModel::filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const { const QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); const CallModel *callModel = index.data().value(); @@ -63,7 +63,7 @@ void ConferenceModel::terminate () { core->terminateConference(); for (const auto &call : core->getCalls()) { - if (call->getParams()->getLocalConferenceMode()) + if (call->getParams()->getLocalConferenceMode())// Terminate all call where participants are or will be in conference call->terminate(); } } diff --git a/linphone-sdk b/linphone-sdk index 752772024..5fae77a2f 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 75277202452c3af9b61f3c1e238e9d7c1bb72473 +Subproject commit 5fae77a2f789c4e61972b5b706359b9cc2404acd