From afe65c51cb5657dcb3d84d3d318b4fe3915eedf3 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 13 Apr 2026 09:39:10 +0200 Subject: [PATCH] Added DTMFs settings in advanced calls section --- CHANGELOG.md | 1 + .../settings/viewmodel/SettingsViewModel.kt | 25 ++++++++ .../settings_advanced_calls_fragment.xml | 62 ++++++++++++++++++- app/src/main/res/values-fr/strings.xml | 2 + app/src/main/res/values/strings.xml | 2 + 5 files changed, 91 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79b73e837..9f61dc3ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ Group changes to describe their impact on the project, as follows: - one to let edit native contacts Linphone copy in-app instead of opening native addressbook third party app - one to show past meetings (they are now hidden by default) - one to hide received message content in android notification + - possibility to choose between RFC2833 and SIP INFO for DTMFs - Added a vu meter for recording & playback volumes (must be enabled in developer settings) - Added support for HDMI audio devices - Added video preview during in-call conversation diff --git a/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt b/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt index e3b81a2a9..5e997ee37 100644 --- a/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt +++ b/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt @@ -229,6 +229,8 @@ class SettingsViewModel val mediaEncryptionLabels = arrayListOf() private val mediaEncryptionValues = arrayListOf() val mediaEncryptionMandatory = MutableLiveData() + val rfc2833Dtmf = MutableLiveData() + val sipInfoDtmf = MutableLiveData() val acceptEarlyMedia = MutableLiveData() val ringDuringEarlyMedia = MutableLiveData() val allowOutgoingEarlyMedia = MutableLiveData() @@ -380,6 +382,9 @@ class SettingsViewModel deviceName.postValue(corePreferences.deviceName) remoteProvisioningUrl.postValue(core.provisioningUri) + rfc2833Dtmf.postValue(core.useRfc2833ForDtmf) + sipInfoDtmf.postValue(core.useInfoForDtmf) + acceptEarlyMedia.postValue(corePreferences.acceptEarlyMedia) ringDuringEarlyMedia.postValue(core.ringDuringIncomingEarlyMedia) allowOutgoingEarlyMedia.postValue(corePreferences.allowOutgoingEarlyMedia) @@ -919,6 +924,26 @@ class SettingsViewModel } } + @UiThread + fun toggleRfc2833Dtmf() { + val newValue = rfc2833Dtmf.value == false + + coreContext.postOnCoreThread { core -> + core.useRfc2833ForDtmf = newValue + rfc2833Dtmf.postValue(newValue) + } + } + + @UiThread + fun toggleSipInfoDtmf() { + val newValue = sipInfoDtmf.value == false + + coreContext.postOnCoreThread { core -> + core.useInfoForDtmf = newValue + sipInfoDtmf.postValue(newValue) + } + } + @UiThread fun toggleEarlyMediaExpand() { expandEarlyMedia.value = expandEarlyMedia.value == false diff --git a/app/src/main/res/layout/settings_advanced_calls_fragment.xml b/app/src/main/res/layout/settings_advanced_calls_fragment.xml index e8c1bc348..57e372050 100644 --- a/app/src/main/res/layout/settings_advanced_calls_fragment.xml +++ b/app/src/main/res/layout/settings_advanced_calls_fragment.xml @@ -218,7 +218,67 @@ android:layout_marginEnd="16dp" android:checked="@{viewModel.mediaEncryptionMandatory}" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@id/media_encryption" + app:layout_constraintTop_toBottomOf="@id/media_encryption"/> + + + + + + + + diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 0add41d91..86b911a3a 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -226,6 +226,8 @@ Changer de sonnerie Choisissez la sonnerie Le sélectionneur de sonnerie n\'est pas disponible ! + Utiliser la RFC 2833 pour les DTMFs + Utiliser SIP INFO pour les DTMFs Conversations Télécharger automatiquement les fichiers Rendre visible dans la galerie les médias téléchargés diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 597d9d55b..0aa8608f9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -268,6 +268,8 @@ Change ringtone Pick ringtone Ringtone picker isn\'t available! + Use RFC 2833 for DTMFs + Use SIP INFO for DTMFs Conversations Auto-download files Make downloaded media public