From bcf28e8b73f38dc5393487d4c75e2f78e0519bd4 Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Tue, 22 Oct 2024 14:07:27 -0700 Subject: [PATCH] Add play_dialtone --- .../io/livekit/server/SipServiceClient.kt | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/io/livekit/server/SipServiceClient.kt b/src/main/kotlin/io/livekit/server/SipServiceClient.kt index 94545cf..b80ec46 100644 --- a/src/main/kotlin/io/livekit/server/SipServiceClient.kt +++ b/src/main/kotlin/io/livekit/server/SipServiceClient.kt @@ -242,8 +242,17 @@ class SipServiceClient( opts.participantName?.let { this.participantName = it } opts.participantMetadata?.let { this.participantMetadata = it } opts.dtmf?.let { this.dtmf = it } - opts.playRingtone?.let { this.playRingtone = it } opts.hidePhoneNumber?.let { this.hidePhoneNumber = it } + opts.playRingtone?.let { + if (it) { + this.playRingtone = true + this.playDialtone = true + } + opts.playDialtone?.let { + if (it) { + this.playRingtone = true + this.playDialtone = true + } } build() } @@ -261,11 +270,16 @@ class SipServiceClient( roomName: String, participantIdentity: String, transferTo: String, + options: TransferSipParticipantOptions? = null, ): Call { val request = with(LivekitSip.TransferSIPParticipantRequest.newBuilder()) { this.roomName = roomName this.participantIdentity = participantIdentity this.transferTo = transferTo + + options?.let { opts -> + opts.playDialtone?.let { this.playDialtone = it } + } build() } @@ -357,6 +371,11 @@ data class CreateSipParticipantOptions( var participantName: String? = null, var participantMetadata: String? = null, var dtmf: String? = null, - var playRingtone: Boolean? = null, + var playRingtone: Boolean? = null, // deprecated, use playDialtone instead + var playDialtone Boolean? = null, var hidePhoneNumber: Boolean? = null, ) + +data class TransferSipParticipantOptions( + var playDialtone Boolean? = null, +)