diff --git a/.github/banner_dark.png b/.github/banner_dark.png index 157b69b..7fe2b7f 100644 Binary files a/.github/banner_dark.png and b/.github/banner_dark.png differ diff --git a/.github/banner_light.png b/.github/banner_light.png index 237fcde..c69618d 100644 Binary files a/.github/banner_light.png and b/.github/banner_light.png differ diff --git a/.idea/misc.xml b/.idea/misc.xml index d15ee75..ddcc4e7 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/CHANGELOG.md b/CHANGELOG.md index a843a25..0f9d436 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # server-sdk-kotlin +## 0.10.1 + +### Patch Changes + +- Properly set rule id when updating dispatch rule - [#131](https://github.com/livekit/server-sdk-kotlin/pull/131) ([@davidliu](https://github.com/davidliu)) + +- Add missing headers for SipService call - [#129](https://github.com/livekit/server-sdk-kotlin/pull/129) ([@davidliu](https://github.com/davidliu)) + ## 0.10.0 ### Minor Changes diff --git a/README.md b/README.md index d4f642d..e5fbfe5 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ This SDK is available as a Maven package through [Maven Central](https://search. io.livekit livekit-server - 0.10.0 + 0.10.1 ``` @@ -35,7 +35,7 @@ This SDK is available as a Maven package through [Maven Central](https://search. ```groovy title="build.gradle" dependencies { - implementation 'io.livekit:livekit-server:0.10.0' + implementation 'io.livekit:livekit-server:0.10.1' } ``` @@ -99,9 +99,9 @@ By default, tokens expire 6 hours after generation. You may override this by usi
- + - + diff --git a/build.gradle.kts b/build.gradle.kts index 52ca889..b86aa83 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,6 @@ buildscript { } dependencies { classpath("com.google.protobuf:protobuf-gradle-plugin:0.8.19") - classpath("io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0") classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.9.20") } } @@ -29,6 +28,7 @@ plugins { id("io.codearte.nexus-staging") version "0.30.0" id("com.google.protobuf") version "0.8.19" id("com.diffplug.spotless") version "6.21.0" + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" } java { @@ -147,10 +147,19 @@ tasks.test { useJUnitPlatform() } -nexusStaging { - serverUrl = "https://s01.oss.sonatype.org/service/local/" - packageGroup = properties["GROUP"] as String - stagingProfileId = "16b57cbf143daa" +group = properties["GROUP"].toString() +version = properties["VERSION_NAME"].toString() + +nexusPublishing { + repositories { + sonatype { + //only for users registered in Sonatype after 24 Feb 2021 + username.set(properties["nexusUsername"].toString()) + password.set(properties["nexusPassword"].toString()) + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) + } + } } publishing { diff --git a/gradle.properties b/gradle.properties index 362a9e5..114a1f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ kotlin.code.style=official ############################################################### GROUP=io.livekit -VERSION_NAME=0.10.0 +VERSION_NAME=0.10.2-SNAPSHOT POM_NAME=LiveKit Server SDK POM_ARTIFACT_ID=livekit-server @@ -22,8 +22,8 @@ POM_LICENCE_DIST=repo POM_DEVELOPER_ID=livekit POM_DEVELOPER_NAME=LiveKit -RELEASE_REPOSITORY_URL=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ -SNAPSHOT_REPOSITORY_URL=https://s01.oss.sonatype.org/content/repositories/snapshots/ +RELEASE_REPOSITORY_URL=https://ossrh-staging-api.central.sonatype.com/service/local/ +SNAPSHOT_REPOSITORY_URL=https://central.sonatype.com/repository/maven-snapshots/ # Variables required to allow build.gradle to parse for publishing. # WARNING: Do not edit this and potentially commit to repo. diff --git a/gradle/gradle-mvn-push.gradle b/gradle/gradle-mvn-push.gradle index 63aa3a0..50ef1f7 100644 --- a/gradle/gradle-mvn-push.gradle +++ b/gradle/gradle-mvn-push.gradle @@ -31,12 +31,12 @@ def isReleaseBuild() { def getReleaseRepositoryUrl() { return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL - : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + : "https://ossrh-staging-api.central.sonatype.com/service/local/" } def getSnapshotRepositoryUrl() { return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL - : "https://oss.sonatype.org/content/repositories/snapshots/" + : "https://central.sonatype.com/repository/maven-snapshots/" } def getRepositoryUsername() { diff --git a/package.json b/package.json index d44f595..43ffc93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "server-sdk-kotlin", - "version": "0.10.0", + "version": "0.10.1", "main": "index.js", "repository": "https://github.com/livekit/server-sdk-kotlin.git", "license": "Apache License 2.0", diff --git a/src/main/kotlin/io/livekit/server/SipService.kt b/src/main/kotlin/io/livekit/server/SipService.kt index af2b97c..a44c948 100644 --- a/src/main/kotlin/io/livekit/server/SipService.kt +++ b/src/main/kotlin/io/livekit/server/SipService.kt @@ -84,6 +84,7 @@ interface SipService { @Header("Authorization") authorization: String ): Call + @Headers("Content-Type: application/protobuf") @POST("/twirp/livekit.SIP/UpdateSIPDispatchRule") fun updateSipDispatchRule( @Body request: LivekitSip.UpdateSIPDispatchRuleRequest, diff --git a/src/main/kotlin/io/livekit/server/SipServiceClient.kt b/src/main/kotlin/io/livekit/server/SipServiceClient.kt index dafb5d4..b8c4eed 100644 --- a/src/main/kotlin/io/livekit/server/SipServiceClient.kt +++ b/src/main/kotlin/io/livekit/server/SipServiceClient.kt @@ -40,8 +40,8 @@ import java.util.function.Supplier */ class SipServiceClient( private val service: SipService, - private val apiKey: String, - private val secret: String, + apiKey: String, + secret: String, ) : ServiceClientBase(apiKey, secret) { /** @@ -50,6 +50,7 @@ class SipServiceClient( * See: [SIP Inbound Trunk](https://docs.livekit.io/sip/trunk-inbound/) */ @JvmOverloads + @Suppress("unused") fun createSipInboundTrunk( name: String, numbers: List, @@ -82,6 +83,7 @@ class SipServiceClient( * See: [SIP Outbound Trunk](https://docs.livekit.io/sip/trunk-outbound/) */ @JvmOverloads + @Suppress("unused") fun createSipOutboundTrunk( name: String, address: String, @@ -115,6 +117,7 @@ class SipServiceClient( * UpdateSIPInboundTrunk updates an existing SIP Inbound Trunk. */ @JvmOverloads + @Suppress("unused") fun updateSipInboundTrunk( sipTrunkId: String, options: UpdateSipInboundTrunkOptions? = null @@ -145,6 +148,7 @@ class SipServiceClient( * UpdateSIPOutboundTrunk updates an existing SIP Outbound Trunk. */ @JvmOverloads + @Suppress("unused") fun updateSipOutboundTrunk( sipTrunkId: String, options: UpdateSipOutboundTrunkOptions? = null, @@ -178,6 +182,7 @@ class SipServiceClient( * See: [SIP Inbound Trunk](https://docs.livekit.io/sip/trunk-inbound/) */ @JvmOverloads + @Suppress("unused") fun listSipInboundTrunk(): Call> { val request = LivekitSip.ListSIPInboundTrunkRequest.newBuilder().build() @@ -192,6 +197,7 @@ class SipServiceClient( * See: [SIP Outbound Trunk](https://docs.livekit.io/sip/trunk-outbound/) */ @JvmOverloads + @Suppress("unused") fun listSipOutboundTrunk(): Call> { val request = LivekitSip.ListSIPOutboundTrunkRequest.newBuilder().build() @@ -204,6 +210,7 @@ class SipServiceClient( * Deletes a trunk. */ @JvmOverloads + @Suppress("unused") fun deleteSipTrunk(sipTrunkId: String): Call { val request = with(LivekitSip.DeleteSIPTrunkRequest.newBuilder()) { this.sipTrunkId = sipTrunkId @@ -220,6 +227,7 @@ class SipServiceClient( * See: [Dispatch Rules](https://docs.livekit.io/sip/dispatch-rule/) */ @JvmOverloads + @Suppress("unused") fun createSipDispatchRule( rule: SipDispatchRule, options: CreateSipDispatchRuleOptions? = null @@ -261,31 +269,33 @@ class SipServiceClient( * UpdateSIPDispatchRule updates an existing SIP Dispatch Rule. */ @JvmOverloads + @Suppress("unused") fun updateSipDispatchRule( sipDispatchRuleId: String, options: UpdateSipDispatchRuleOptions? = null ): Call { val request = with(LivekitSip.UpdateSIPDispatchRuleRequest.newBuilder()) { + this.sipDispatchRuleId = sipDispatchRuleId update = with(LivekitSip.SIPDispatchRuleUpdate.newBuilder()) { options?.let { opt -> opt.name?.let { this.name = it } opt.metadata?.let { this.metadata = it } opt.trunkIds?.let { this.trunkIds = buildListUpdate(it) } - opt.rule?.let { + opt.rule?.let { optRule -> this.rule = with(SIPDispatchRule.newBuilder()) { - when (it) { + when (optRule) { is SipDispatchRuleDirect -> { dispatchRuleDirect = with(SIPDispatchRuleDirect.newBuilder()) { - roomName = it.roomName - it.pin?.let { this.pin = it } + roomName = optRule.roomName + optRule.pin?.let { this.pin = it } build() } } is SipDispatchRuleIndividual -> { dispatchRuleIndividual = with(SIPDispatchRuleIndividual.newBuilder()) { - roomPrefix = it.roomPrefix - it.pin?.let { this.pin = it } + roomPrefix = optRule.roomPrefix + optRule.pin?.let { this.pin = it } build() } } @@ -308,6 +318,7 @@ class SipServiceClient( * * See: [Dispatch Rules](https://docs.livekit.io/sip/dispatch-rule/) */ + @Suppress("unused") fun listSipDispatchRule(): Call> { val request = LivekitSip.ListSIPDispatchRuleRequest.newBuilder().build() val credentials = authHeader(emptyList(), listOf(SIPAdmin())) @@ -320,6 +331,7 @@ class SipServiceClient( * * See: [Dispatch Rules](https://docs.livekit.io/sip/dispatch-rule/) */ + @Suppress("unused") fun deleteSipDispatchRule(sipDispatchRuleId: String): Call { val request = with(LivekitSip.DeleteSIPDispatchRuleRequest.newBuilder()) { this.sipDispatchRuleId = sipDispatchRuleId @@ -334,6 +346,7 @@ class SipServiceClient( * * See: [SIP Participant](https://docs.livekit.io/sip/sip-participant/) */ + @Suppress("unused") fun createSipParticipant( sipTrunkId: String, number: String, @@ -377,6 +390,7 @@ class SipServiceClient( * * See: [SIP Participant](https://docs.livekit.io/sip/sip-participant/) */ + @Suppress("unused") fun transferSipParticipant( roomName: String, participantIdentity: String,
LiveKit Ecosystem
LiveKit SDKsBrowser · iOS/macOS/visionOS · Android · Flutter · React Native · Rust · Node.js · Python · Unity · Unity (WebGL)
LiveKit SDKsBrowser · iOS/macOS/visionOS · Android · Flutter · React Native · Rust · Node.js · Python · Unity · Unity (WebGL) · ESP32
Server APIsNode.js · Golang · Ruby · Java/Kotlin · Python · Rust · PHP (community) · .NET (community)
UI ComponentsReact · Android Compose · SwiftUI
UI ComponentsReact · Android Compose · SwiftUI · Flutter
Agents FrameworksPython · Node.js · Playground
ServicesLiveKit server · Egress · Ingress · SIP
ResourcesDocs · Example apps · Cloud · Self-hosting · CLI