Commit a05f5b93 authored by Sébastien Blin's avatar Sébastien Blin

callmodel: avoid to hold detached calls

Change-Id: I79f48e08e62e8a9dfdc28b2f2e4f89ea4b6f4ba0
parent 49f5f63e
......@@ -96,6 +96,7 @@ struct ConfProperties_t {
QString mailbox;
QString dtmfType;
bool autoAnswer;
bool isRendezVous;
int activeCallLimit;
QString hostname;
QString username;
......
......@@ -738,6 +738,7 @@ account::Info::fromDetails(const MapStringString& details)
confProperties.mailbox = details[ConfProperties::MAILBOX];
confProperties.dtmfType = details[ConfProperties::DTMF_TYPE];
confProperties.autoAnswer = toBool(details[ConfProperties::AUTOANSWER]);
confProperties.isRendezVous = toBool(details[ConfProperties::ISRENDEZVOUS]);
confProperties.activeCallLimit = toInt(details[ConfProperties::ACTIVE_CALL_LIMIT]);
confProperties.hostname = details[ConfProperties::HOSTNAME];
profileInfo.uri = (profileInfo.type == profile::Type::RING and details[ConfProperties::USERNAME].contains("ring:"))
......@@ -844,6 +845,7 @@ account::ConfProperties_t::toDetails() const
details[ConfProperties::MAILBOX] = this->mailbox;
details[ConfProperties::DTMF_TYPE] = this->dtmfType;
details[ConfProperties::AUTOANSWER] = toQString(this->autoAnswer);
details[ConfProperties::ISRENDEZVOUS] = toQString(this->isRendezVous);
details[ConfProperties::ACTIVE_CALL_LIMIT] = toQString(this->activeCallLimit);
details[ConfProperties::HOSTNAME] = this->hostname;
details[ConfProperties::ROUTE] = this->routeset;
......
......@@ -39,6 +39,7 @@
// Ring daemon
#include <media_const.h>
#include <account_const.h>
// Qt
#include <QObject>
......@@ -614,7 +615,12 @@ NewCallModel::setCurrentCall(const QString& callId) const
for (const auto& cid : Lrc::activeCalls()) {
auto filtered = std::find(filterCalls.begin(), filterCalls.end(), cid) != filterCalls.end();
if (cid != callId && !filtered) {
CallManager::instance().hold(cid);
// Only hold calls for a non rendez-vous point
MapStringString callDetails = CallManager::instance().getCallDetails(callId);
auto accountId = callDetails["ACCOUNTID"];
MapStringString detailsMap = ConfigurationManager::instance().getAccountDetails(accountId);
if (detailsMap[DRing::Account::ConfProperties::ISRENDEZVOUS] == "FALSE")
CallManager::instance().hold(cid);
}
}
if (!lrc::api::Lrc::holdConferences) {
......@@ -622,6 +628,10 @@ NewCallModel::setCurrentCall(const QString& callId) const
}
for (const auto& confId : conferences) {
if (callId != confId) {
MapStringString confDetails = CallManager::instance().getConferenceDetails(confId);
// Only hold conference if attached
if (confDetails["CALL_STATE"] == "ACTIVE_DETACHED")
continue;
QStringList callList = CallManager::instance().getParticipantList(confId);
if (callList.indexOf(callId) == -1)
CallManager::instance().holdConference(confId);
......@@ -684,6 +694,11 @@ NewCallModelPimpl::slotIncomingCall(const QString& accountId, const QString& cal
if (linked.owner.id != accountId) {
return;
}
if (linked.owner.confProperties.isRendezVous) {
// Do not notify for calls if rendez vous because it's in a detached
// mode and auto answer is managed by the daemon
return;
}
// do not use auto here (QDBusPendingReply<MapStringString>)
MapStringString callDetails = CallManager::instance().getCallDetails(callId);
......
Markdown is supported
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