Skip to content

Commit 54e5a33

Browse files
Allow requesting a dial tone during participant transfer (#91)
1 parent a497f10 commit 54e5a33

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

.changeset/gold-flowers-decide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"server-sdk-kotlin": patch
3+
---
4+
5+
Implement transferSipParticipant

protocol

Submodule protocol updated 81 files

src/main/kotlin/io/livekit/server/SipServiceClient.kt

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import livekit.LivekitSip.SIPDispatchRuleIndividual
2626
import livekit.LivekitSip.SIPDispatchRuleInfo
2727
import livekit.LivekitSip.SIPParticipantInfo
2828
import livekit.LivekitSip.SIPTrunkInfo
29-
import com.google.protobuf.Empty
3029
import okhttp3.OkHttpClient
3130
import retrofit2.Call
3231
import retrofit2.Retrofit
@@ -242,8 +241,19 @@ class SipServiceClient(
242241
opts.participantName?.let { this.participantName = it }
243242
opts.participantMetadata?.let { this.participantMetadata = it }
244243
opts.dtmf?.let { this.dtmf = it }
245-
opts.playRingtone?.let { this.playRingtone = it }
246244
opts.hidePhoneNumber?.let { this.hidePhoneNumber = it }
245+
opts.playRingtone?.let {
246+
if (it) {
247+
this.playRingtone = true
248+
this.playDialtone = true
249+
}
250+
}
251+
opts.playDialtone?.let {
252+
if (it) {
253+
this.playRingtone = true
254+
this.playDialtone = true
255+
}
256+
}
247257
}
248258
build()
249259
}
@@ -261,11 +271,16 @@ class SipServiceClient(
261271
roomName: String,
262272
participantIdentity: String,
263273
transferTo: String,
274+
options: TransferSipParticipantOptions? = null,
264275
): Call<Void?> {
265276
val request = with(LivekitSip.TransferSIPParticipantRequest.newBuilder()) {
266277
this.roomName = roomName
267278
this.participantIdentity = participantIdentity
268279
this.transferTo = transferTo
280+
281+
options?.let { opts ->
282+
opts.playDialtone?.let { this.playDialtone = it }
283+
}
269284
build()
270285
}
271286

@@ -357,6 +372,11 @@ data class CreateSipParticipantOptions(
357372
var participantName: String? = null,
358373
var participantMetadata: String? = null,
359374
var dtmf: String? = null,
360-
var playRingtone: Boolean? = null,
375+
var playRingtone: Boolean? = null, // deprecated, use playDialtone instead
376+
var playDialtone: Boolean? = null,
361377
var hidePhoneNumber: Boolean? = null,
362378
)
379+
380+
data class TransferSipParticipantOptions(
381+
var playDialtone: Boolean? = null,
382+
)

0 commit comments

Comments
 (0)