diff --git a/assets/languages/en.ts b/assets/languages/en.ts
index eb3afd7e7..3f65841c3 100644
--- a/assets/languages/en.ts
+++ b/assets/languages/en.ts
@@ -1188,6 +1188,10 @@ your friend's SIP address or username.
chatEnabledLabel
Chat enabled
+
+ callRecorderEnabledLabel
+ Call recorder enabled
+
SettingsNetwork
diff --git a/assets/languages/fr_FR.ts b/assets/languages/fr_FR.ts
index 5abf989da..29ea44683 100644
--- a/assets/languages/fr_FR.ts
+++ b/assets/languages/fr_FR.ts
@@ -1186,6 +1186,10 @@ Cliquez ici : <a href="%1">%1</a>
chatEnabledLabel
Chat activé
+
+ callRecorderEnabledLabel
+ Enregistrement d'appel activé
+
SettingsNetwork
diff --git a/assets/languages/ru.ts b/assets/languages/ru.ts
index 83c6d0d67..2c4af0325 100644
--- a/assets/languages/ru.ts
+++ b/assets/languages/ru.ts
@@ -1186,6 +1186,10 @@
chatEnabledLabel
+
+ callRecorderEnabledLabel
+
+
SettingsNetwork
diff --git a/assets/languages/tr.ts b/assets/languages/tr.ts
index caebb3e6b..9059c3a85 100644
--- a/assets/languages/tr.ts
+++ b/assets/languages/tr.ts
@@ -1188,6 +1188,10 @@ arkadaşınızın SIP adresini veya kullanıcı adını girin.
chatEnabledLabel
+
+ callRecorderEnabledLabel
+
+
SettingsNetwork
diff --git a/src/components/call/CallModel.cpp b/src/components/call/CallModel.cpp
index 346f0f3b9..a87b067e7 100644
--- a/src/components/call/CallModel.cpp
+++ b/src/components/call/CallModel.cpp
@@ -23,19 +23,21 @@
#include
#include
-#include "../../app/App.hpp"
-#include "../../utils/LinphoneUtils.hpp"
-#include "../../utils/Utils.hpp"
-#include "../core/CoreManager.hpp"
+#include "app/App.hpp"
+#include "components/core/CoreManager.hpp"
+#include "utils/LinphoneUtils.hpp"
+#include "utils/Utils.hpp"
#include "CallModel.hpp"
-#define AUTO_ANSWER_OBJECT_NAME "auto-answer-timer"
-#define DTMF_SOUND_DELAY 200
+// =============================================================================
using namespace std;
-// =============================================================================
+namespace {
+ constexpr char cAutoAnswerObjectName[] = "auto-answer-timer";
+ constexpr int cDtmfSoundDelay = 200;
+}
CallModel::CallModel (shared_ptr call) {
Q_CHECK_PTR(call);
@@ -54,7 +56,7 @@ CallModel::CallModel (shared_ptr call) {
QTimer *timer = new QTimer(this);
timer->setInterval(settings->getAutoAnswerDelay());
timer->setSingleShot(true);
- timer->setObjectName(AUTO_ANSWER_OBJECT_NAME);
+ timer->setObjectName(cAutoAnswerObjectName);
QObject::connect(timer, &QTimer::timeout, this, &CallModel::acceptWithAutoAnswerDelay);
timer->start();
@@ -328,7 +330,7 @@ void CallModel::updateIsInConference () {
// -----------------------------------------------------------------------------
void CallModel::stopAutoAnswerTimer () const {
- QTimer *timer = findChild(AUTO_ANSWER_OBJECT_NAME, Qt::FindDirectChildrenOnly);
+ QTimer *timer = findChild(cAutoAnswerObjectName, Qt::FindDirectChildrenOnly);
if (timer) {
timer->stop();
timer->deleteLater();
@@ -550,7 +552,7 @@ void CallModel::sendDtmf (const QString &dtmf) {
const char key = dtmf.constData()[0].toLatin1();
qInfo() << QStringLiteral("Send dtmf: `%1`.").arg(key);
mCall->sendDtmf(key);
- CoreManager::getInstance()->getCore()->playDtmf(key, DTMF_SOUND_DELAY);
+ CoreManager::getInstance()->getCore()->playDtmf(key, cDtmfSoundDelay);
}
// -----------------------------------------------------------------------------
diff --git a/src/components/settings/SettingsModel.cpp b/src/components/settings/SettingsModel.cpp
index 1c1c66acc..0ccb7d805 100644
--- a/src/components/settings/SettingsModel.cpp
+++ b/src/components/settings/SettingsModel.cpp
@@ -281,6 +281,17 @@ void SettingsModel::setAutoAnswerVideoStatus (bool status) {
// -----------------------------------------------------------------------------
+bool SettingsModel::getCallRecorderEnabled () const {
+ return !!mConfig->getInt(UI_SECTION, "call_recorder_enabled", 1);
+}
+
+void SettingsModel::setCallRecorderEnabled (bool status) {
+ mConfig->setInt(UI_SECTION, "call_recorder_enabled", status);
+ emit callRecorderEnabledChanged(status);
+}
+
+// -----------------------------------------------------------------------------
+
bool SettingsModel::getChatEnabled () const {
return !!mConfig->getInt(UI_SECTION, "chat_enabled", 1);
}
@@ -290,6 +301,8 @@ void SettingsModel::setChatEnabled (bool status) {
emit chatEnabledChanged(status);
}
+// -----------------------------------------------------------------------------
+
QString SettingsModel::getFileTransferUrl () const {
return Utils::coreStringToAppString(
CoreManager::getInstance()->getCore()->getFileTransferServer()
diff --git a/src/components/settings/SettingsModel.hpp b/src/components/settings/SettingsModel.hpp
index 86a79f9c7..f62396244 100644
--- a/src/components/settings/SettingsModel.hpp
+++ b/src/components/settings/SettingsModel.hpp
@@ -69,6 +69,8 @@ class SettingsModel : public QObject {
Q_PROPERTY(bool autoAnswerVideoStatus READ getAutoAnswerVideoStatus WRITE setAutoAnswerVideoStatus NOTIFY autoAnswerVideoStatusChanged);
Q_PROPERTY(int autoAnswerDelay READ getAutoAnswerDelay WRITE setAutoAnswerDelay NOTIFY autoAnswerDelayChanged);
+ Q_PROPERTY(bool callRecorderEnabled READ getCallRecorderEnabled WRITE setCallRecorderEnabled NOTIFY callRecorderEnabledChanged);
+
Q_PROPERTY(bool chatEnabled READ getChatEnabled WRITE setChatEnabled NOTIFY chatEnabledChanged);
Q_PROPERTY(QString fileTransferUrl READ getFileTransferUrl WRITE setFileTransferUrl NOTIFY fileTransferUrlChanged);
@@ -211,6 +213,9 @@ public:
int getAutoAnswerDelay () const;
void setAutoAnswerDelay (int delay);
+ bool getCallRecorderEnabled () const;
+ void setCallRecorderEnabled (bool status);
+
bool getChatEnabled () const;
void setChatEnabled (bool status);
@@ -364,6 +369,8 @@ signals:
void autoAnswerVideoStatusChanged (bool status);
void autoAnswerDelayChanged (int delay);
+ void callRecorderEnabledChanged (bool status);
+
void chatEnabledChanged (bool status);
void fileTransferUrlChanged (const QString &url);
diff --git a/ui/views/App/Calls/Incall.qml b/ui/views/App/Calls/Incall.qml
index 7f7515f9a..2a388e9cf 100644
--- a/ui/views/App/Calls/Incall.qml
+++ b/ui/views/App/Calls/Incall.qml
@@ -177,6 +177,7 @@ Rectangle {
enabled: incall.call.recording
icon: 'record'
useStates: false
+ visible: SettingsModel.callRecorderEnabled
onClicked: {
var call = incall.call
@@ -185,6 +186,12 @@ Rectangle {
: call.stopRecording()
}
+ onVisibleChanged: {
+ if (!visible) {
+ call.stopRecording()
+ }
+ }
+
TooltipArea {
text: !recordingSwitch.enabled
? qsTr('startRecordingLabel')
diff --git a/ui/views/App/Calls/IncallFullscreenWindow.qml b/ui/views/App/Calls/IncallFullscreenWindow.qml
index 2f110eb93..9bb5fbf7b 100644
--- a/ui/views/App/Calls/IncallFullscreenWindow.qml
+++ b/ui/views/App/Calls/IncallFullscreenWindow.qml
@@ -236,6 +236,7 @@ Window {
enabled: call.recording
icon: 'record'
useStates: false
+ visible: SettingsModel.callRecorderEnabled
onClicked: !enabled
? call.startRecording()
diff --git a/ui/views/App/Settings/SettingsCallsChat.qml b/ui/views/App/Settings/SettingsCallsChat.qml
index 22190e018..f1dac252d 100644
--- a/ui/views/App/Settings/SettingsCallsChat.qml
+++ b/ui/views/App/Settings/SettingsCallsChat.qml
@@ -99,6 +99,20 @@ TabContainer {
}
}
}
+
+ FormLine {
+ visible: SettingsModel.developerSettingsEnabled
+
+ FormGroup {
+ label: qsTr('callRecorderEnabledLabel')
+
+ Switch {
+ checked: SettingsModel.callRecorderEnabled
+
+ onClicked: SettingsModel.callRecorderEnabled = !checked
+ }
+ }
+ }
}
Form {