Added DTMFs settings in advanced calls section

This commit is contained in:
Sylvain Berfini 2026-04-13 09:39:10 +02:00
parent 6d51f23e11
commit afe65c51cb
5 changed files with 91 additions and 1 deletions

View file

@ -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

View file

@ -229,6 +229,8 @@ class SettingsViewModel
val mediaEncryptionLabels = arrayListOf<String>()
private val mediaEncryptionValues = arrayListOf<MediaEncryption>()
val mediaEncryptionMandatory = MutableLiveData<Boolean>()
val rfc2833Dtmf = MutableLiveData<Boolean>()
val sipInfoDtmf = MutableLiveData<Boolean>()
val acceptEarlyMedia = MutableLiveData<Boolean>()
val ringDuringEarlyMedia = MutableLiveData<Boolean>()
val allowOutgoingEarlyMedia = MutableLiveData<Boolean>()
@ -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

View file

@ -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"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/settings_title_style"
android:onClick="@{() -> viewModel.toggleRfc2833Dtmf()}"
android:id="@+id/rfc_2833_dtmf_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="10dp"
android:text="@string/settings_advanced_calls_rfc_2833_dmtf_title"
android:maxLines="2"
android:ellipsize="end"
android:labelFor="@id/rfc_2833_dtmf_switch"
app:layout_constraintTop_toTopOf="@id/rfc_2833_dtmf_switch"
app:layout_constraintBottom_toBottomOf="@id/rfc_2833_dtmf_switch"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/rfc_2833_dtmf_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/rfc_2833_dtmf_switch"
android:onClick="@{() -> viewModel.toggleRfc2833Dtmf()}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_marginEnd="16dp"
android:checked="@{viewModel.rfc2833Dtmf}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/media_encryption_mandatory_switch"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/settings_title_style"
android:onClick="@{() -> viewModel.toggleSipInfoDtmf()}"
android:id="@+id/sip_info_dtmf_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="10dp"
android:text="@string/settings_advanced_calls_sip_info_dmtf_title"
android:maxLines="2"
android:ellipsize="end"
android:labelFor="@id/sip_info_dtmf_switch"
app:layout_constraintTop_toTopOf="@id/sip_info_dtmf_switch"
app:layout_constraintBottom_toBottomOf="@id/sip_info_dtmf_switch"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/sip_info_dtmf_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/sip_info_dtmf_switch"
android:onClick="@{() -> viewModel.toggleSipInfoDtmf()}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_marginEnd="16dp"
android:checked="@{viewModel.sipInfoDtmf}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/rfc_2833_dtmf_switch"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -226,6 +226,8 @@
<string name="settings_calls_change_ringtone_title">Changer de sonnerie</string>
<string name="settings_calls_change_ringtone_pick_title">Choisissez la sonnerie</string>
<string name="settings_calls_change_ringtone_picker_unavailable_toast">Le sélectionneur de sonnerie n\'est pas disponible !</string>
<string name="settings_advanced_calls_rfc_2833_dmtf_title">Utiliser la RFC 2833 pour les DTMFs</string>
<string name="settings_advanced_calls_sip_info_dmtf_title">Utiliser SIP INFO pour les DTMFs</string>
<string name="settings_conversations_title">Conversations</string>
<string name="settings_conversations_auto_download_title">Télécharger automatiquement les fichiers</string>
<string name="settings_conversations_auto_export_media_to_native_gallery_title">Rendre visible dans la galerie les médias téléchargés</string>

View file

@ -268,6 +268,8 @@
<string name="settings_calls_change_ringtone_title">Change ringtone</string>
<string name="settings_calls_change_ringtone_pick_title">Pick ringtone</string>
<string name="settings_calls_change_ringtone_picker_unavailable_toast">Ringtone picker isn\'t available!</string>
<string name="settings_advanced_calls_rfc_2833_dmtf_title">Use RFC 2833 for DTMFs</string>
<string name="settings_advanced_calls_sip_info_dmtf_title">Use SIP INFO for DTMFs</string>
<string name="settings_conversations_title">Conversations</string>
<string name="settings_conversations_auto_download_title">Auto-download files</string>
<string name="settings_conversations_auto_export_media_to_native_gallery_title">Make downloaded media public</string>