Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use UUID for jibri sessions. #1059

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading