Skip to content

Commit

Permalink
Use UUID for jibri sessions. (#1059)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev authored May 29, 2024
1 parent cbed240 commit eaaf613
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 54 deletions.
43 changes: 0 additions & 43 deletions jicofo/src/main/java/org/jitsi/jicofo/jibri/Utils.java

This file was deleted.

9 changes: 0 additions & 9 deletions jicofo/src/main/kotlin/org/jitsi/jicofo/jibri/BaseJibri.kt
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,6 @@ abstract class BaseJibri internal constructor(
else -> StanzaError.getBuilder(StanzaError.Condition.not_allowed).build()
}
}

protected fun generateSessionId(): String = Utils.generateSessionId(SESSION_ID_LENGTH)

companion object {
/**
* The length of the session id field we generate to uniquely identify a Jibri session.
*/
const val SESSION_ID_LENGTH = 16
}
}

typealias JibriRequest = IqRequest<JibriIq>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.jitsi.xmpp.extensions.jibri.RecordingStatus
import org.jitsi.xmpp.util.XmlStringBuilderUtil.Companion.toStringOpt
import org.jivesoftware.smack.packet.IQ
import org.jivesoftware.smack.packet.StanzaError
import java.util.*
import org.jitsi.jicofo.util.ErrorResponse.create as error

/**
Expand Down Expand Up @@ -101,7 +102,7 @@ class JibriRecorder(
// Stream ID should not be provided with requests to record to a file.
error(iq, StanzaError.Condition.bad_request, "Stream ID is provided for a FILE recording.")
} else {
val sessionId = generateSessionId()
val sessionId = UUID.randomUUID().toString()
try {
val jibriSession = JibriSession(
this,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import org.jitsi.xmpp.extensions.jibri.SipCallState
import org.jitsi.xmpp.util.XmlStringBuilderUtil.Companion.toStringOpt
import org.jivesoftware.smack.packet.IQ
import org.jivesoftware.smack.packet.StanzaError
import java.util.UUID
import kotlin.collections.HashMap
import org.jitsi.jicofo.util.ErrorResponse.create as error

Expand Down Expand Up @@ -72,7 +73,7 @@ class JibriSipGateway(
get() = ArrayList(sipSessions.values)

override fun handleStartRequest(iq: JibriIq): IQ = if (StringUtils.isNotBlank(iq.sipAddress)) {
val sessionId = generateSessionId()
val sessionId = UUID.randomUUID().toString()
val jibriSession = JibriSession(
this,
conference.roomName,
Expand Down

0 comments on commit eaaf613

Please sign in to comment.