diff --git a/.changeset/gold-flowers-decide.md b/.changeset/gold-flowers-decide.md new file mode 100644 index 0000000..b2b940b --- /dev/null +++ b/.changeset/gold-flowers-decide.md @@ -0,0 +1,5 @@ +--- +"server-sdk-kotlin": patch +--- + +Implement transferSipParticipant diff --git a/protocol b/protocol index be21ccf..caa595e 160000 --- a/protocol +++ b/protocol @@ -1 +1 @@ -Subproject commit be21ccf7da84688d8c421225bbe7383c8627b7e0 +Subproject commit caa595ed32926f47977a9e0a863a28341ff889d4 diff --git a/src/main/kotlin/io/livekit/server/SipServiceClient.kt b/src/main/kotlin/io/livekit/server/SipServiceClient.kt index 94545cf..56c24ff 100644 --- a/src/main/kotlin/io/livekit/server/SipServiceClient.kt +++ b/src/main/kotlin/io/livekit/server/SipServiceClient.kt @@ -26,7 +26,6 @@ import livekit.LivekitSip.SIPDispatchRuleIndividual import livekit.LivekitSip.SIPDispatchRuleInfo import livekit.LivekitSip.SIPParticipantInfo import livekit.LivekitSip.SIPTrunkInfo -import com.google.protobuf.Empty import okhttp3.OkHttpClient import retrofit2.Call import retrofit2.Retrofit @@ -242,8 +241,19 @@ 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 +271,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 +372,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, +)