diff --git a/jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/colibri/Colibri2Session.kt b/jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/colibri/Colibri2Session.kt index 909f1ce865..4c8c344660 100644 --- a/jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/colibri/Colibri2Session.kt +++ b/jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/colibri/Colibri2Session.kt @@ -77,19 +77,7 @@ internal class Colibri2Session( internal fun sendAllocationRequest(participant: ParticipantInfo): StanzaCollector { val request = createRequest(!created) - val endpoint = Colibri2Endpoint.getBuilder().apply { - setId(participant.id) - setCreate(true) - if (participant.sources.isNotEmpty()) { - setSources(participant.sources.toColibriMediaSources()) - } - setStatsId(participant.statsId) - if (participant.supportsSourceNames) { - addCapability(Capability.CAP_SOURCE_NAME_SUPPORT) - } - if (participant.useSsrcRewriting) { - addCapability(Capability.CAP_SSRC_REWRITING_SUPPORT) - } + val endpoint = participant.toEndpoint(create = true, expire = false).apply { if (participant.audioMuted || participant.videoMuted) { setForceMute(participant.audioMuted, participant.videoMuted) } @@ -417,7 +405,7 @@ internal class Colibri2Session( setId(id) } val endpoints = Endpoints.getBuilder() - endpoints.addEndpoint(participant.toEndpoint(create = create, expire = false)) + endpoints.addEndpoint(participant.toEndpoint(create = create, expire = false).build()) relay.setEndpoints(endpoints.build()) request.addRelay(relay.build()) sendRequest(request.build(), "Relay.updateParticipant") @@ -429,7 +417,7 @@ internal class Colibri2Session( val relay = Colibri2Relay.getBuilder().apply { setId(id) } val endpoints = Endpoints.getBuilder() - participants.forEach { endpoints.addEndpoint(it.toEndpoint(create = false, expire = true)) } + participants.forEach { endpoints.addEndpoint(it.toEndpoint(create = false, expire = true).build()) } relay.setEndpoints(endpoints.build()) request.addRelay(relay.build()) @@ -461,7 +449,7 @@ internal class Colibri2Session( ) val endpoints = Endpoints.getBuilder() - participants.forEach { endpoints.addEndpoint(it.toEndpoint(create = true, expire = false)) } + participants.forEach { endpoints.addEndpoint(it.toEndpoint(create = true, expire = false).build()) } relay.setEndpoints(endpoints.build()) relay.setTransport( diff --git a/jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/colibri/Extensions.kt b/jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/colibri/Extensions.kt index 6e8d819043..22aaf76ed2 100644 --- a/jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/colibri/Extensions.kt +++ b/jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/colibri/Extensions.kt @@ -105,7 +105,7 @@ internal fun ParticipantInfo.toEndpoint( create: Boolean, /** Whether the request should have the "expire" flag set. */ expire: Boolean -): Colibri2Endpoint = Colibri2Endpoint.getBuilder().apply { +): Colibri2Endpoint.Builder = Colibri2Endpoint.getBuilder().apply { setId(id) if (create) { setCreate(true) @@ -124,7 +124,7 @@ internal fun ParticipantInfo.toEndpoint( if (expire) { setExpire(true) } -}.build() +} internal fun AbstractXMPPConnection.sendIqAndHandleResponseAsync(iq: IQ, block: (IQ?) -> Unit) { val stanzaCollector = createStanzaCollectorAndSend(iq)