Skip to content

Commit eaaf613

Browse files
authored
Use UUID for jibri sessions. (#1059)
1 parent cbed240 commit eaaf613

File tree

4 files changed

+4
-54
lines changed

4 files changed

+4
-54
lines changed

jicofo/src/main/java/org/jitsi/jicofo/jibri/Utils.java

Lines changed: 0 additions & 43 deletions
This file was deleted.

jicofo/src/main/kotlin/org/jitsi/jicofo/jibri/BaseJibri.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,6 @@ abstract class BaseJibri internal constructor(
198198
else -> StanzaError.getBuilder(StanzaError.Condition.not_allowed).build()
199199
}
200200
}
201-
202-
protected fun generateSessionId(): String = Utils.generateSessionId(SESSION_ID_LENGTH)
203-
204-
companion object {
205-
/**
206-
* The length of the session id field we generate to uniquely identify a Jibri session.
207-
*/
208-
const val SESSION_ID_LENGTH = 16
209-
}
210201
}
211202

212203
typealias JibriRequest = IqRequest<JibriIq>

jicofo/src/main/kotlin/org/jitsi/jicofo/jibri/JibriRecorder.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import org.jitsi.xmpp.extensions.jibri.RecordingStatus
3232
import org.jitsi.xmpp.util.XmlStringBuilderUtil.Companion.toStringOpt
3333
import org.jivesoftware.smack.packet.IQ
3434
import org.jivesoftware.smack.packet.StanzaError
35+
import java.util.*
3536
import org.jitsi.jicofo.util.ErrorResponse.create as error
3637

3738
/**
@@ -101,7 +102,7 @@ class JibriRecorder(
101102
// Stream ID should not be provided with requests to record to a file.
102103
error(iq, StanzaError.Condition.bad_request, "Stream ID is provided for a FILE recording.")
103104
} else {
104-
val sessionId = generateSessionId()
105+
val sessionId = UUID.randomUUID().toString()
105106
try {
106107
val jibriSession = JibriSession(
107108
this,

jicofo/src/main/kotlin/org/jitsi/jicofo/jibri/JibriSipGateway.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import org.jitsi.xmpp.extensions.jibri.SipCallState
2929
import org.jitsi.xmpp.util.XmlStringBuilderUtil.Companion.toStringOpt
3030
import org.jivesoftware.smack.packet.IQ
3131
import org.jivesoftware.smack.packet.StanzaError
32+
import java.util.UUID
3233
import kotlin.collections.HashMap
3334
import org.jitsi.jicofo.util.ErrorResponse.create as error
3435

@@ -72,7 +73,7 @@ class JibriSipGateway(
7273
get() = ArrayList(sipSessions.values)
7374

7475
override fun handleStartRequest(iq: JibriIq): IQ = if (StringUtils.isNotBlank(iq.sipAddress)) {
75-
val sessionId = generateSessionId()
76+
val sessionId = UUID.randomUUID().toString()
7677
val jibriSession = JibriSession(
7778
this,
7879
conference.roomName,

0 commit comments

Comments
 (0)