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

feat(transcription): Drops TranscriberManager and expects dialIQ. #1163

Merged
merged 5 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions jicofo-selector/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ jicofo {
// the next in line when the current owner leaves).
enable-auto-owner = true

// Can be used to disable moderator checks for starting a recording or placing a call
enable-moderator-checks = true

// How long to wait for the initial participant in a conference.
initial-timeout = 15 seconds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ public class JitsiMeetConferenceImpl
*/
private JibriSipGateway jibriSipGateway;

/**
* The {@link TranscriberManager} who listens for participants requesting
* transcription and, when necessary, dialing the transcriber instance.
*/
private TranscriberManager transcriberManager;

private ChatRoomRoleManager chatRoomRoleManager;

/**
Expand Down Expand Up @@ -502,15 +496,6 @@ private void joinTheRoom()
this.chatRoom = chatRoom;
chatRoom.addListener(chatRoomListener);

transcriberManager = new TranscriberManager(
jicofoServices.getXmppServices().getXmppConnectionByName(
JigasiConfig.config.xmppConnectionName()
),
this,
chatRoom,
jicofoServices.getXmppServices().getJigasiDetector(),
logger);

ChatRoomInfo chatRoomInfo = chatRoom.join();
if (chatRoomInfo.getMeetingId() == null)
{
Expand Down Expand Up @@ -651,11 +636,6 @@ private void leaveTheRoom()
chatRoom.removeListener(chatRoomRoleManager);
chatRoomRoleManager.stop();
}
if (transcriberManager != null)
{
transcriberManager.dispose();
transcriberManager = null;
}

chatRoom.leave();

Expand Down Expand Up @@ -1545,7 +1525,6 @@ private OrderedJsonObject getDebugState(boolean full)
o.put("participants", participantsJson);
//o.put("jibri_recorder", jibriRecorder.getDebugState());
//o.put("jibri_sip_gateway", jibriSipGateway.getDebugState());
//o.put("transcriber_manager", transcriberManager.getDebugState());
ChatRoomRoleManager chatRoomRoleManager = this.chatRoomRoleManager;
o.put("chat_room_role_manager", chatRoomRoleManager == null ? "null" : chatRoomRoleManager.getDebugState());
o.put("started", started.get());
Expand Down Expand Up @@ -2159,7 +2138,12 @@ public IqProcessingResult handleJibriRequest(@NotNull IqRequest<JibriIq> request
@Override
public boolean acceptJigasiRequest(@NotNull Jid from)
{
return MemberRoleKt.hasModeratorRights(getRoleForMucJid(from));
if (ConferenceConfig.config.getEnableModeratorChecks())
{
return MemberRoleKt.hasModeratorRights(getRoleForMucJid(from));
}

return true;
}

@Override
Expand Down
291 changes: 0 additions & 291 deletions jicofo/src/main/java/org/jitsi/jicofo/jigasi/TranscriberManager.java

This file was deleted.

4 changes: 4 additions & 0 deletions jicofo/src/main/kotlin/org/jitsi/jicofo/ConferenceConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ class ConferenceConfig private constructor() {
}
fun enableAutoOwner(): Boolean = enableAutoOwner

val enableModeratorChecks: Boolean by config {
"jicofo.conference.enable-moderator-checks".from(newConfig)
}

val maxSsrcsPerUser: Int by config {
"org.jitsi.jicofo.MAX_SSRC_PER_USER".from(legacyConfig)
"jicofo.conference.max-ssrcs-per-user".from(newConfig)
Expand Down
9 changes: 6 additions & 3 deletions jicofo/src/main/kotlin/org/jitsi/jicofo/jibri/BaseJibri.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package org.jitsi.jicofo.jibri

import org.jitsi.jicofo.ConferenceConfig
import org.jitsi.jicofo.TaskPools
import org.jitsi.jicofo.conference.JitsiMeetConferenceImpl
import org.jitsi.jicofo.jibri.JibriSession.StateListener
Expand Down Expand Up @@ -156,9 +157,11 @@ abstract class BaseJibri internal constructor(
return session.processJibriIqRequestFromJibri(iq)
}

verifyModeratorRole(iq)?.let {
logger.warn("Ignored Jibri request from non-moderator.")
return IQ.createErrorResponse(iq, it)
if (ConferenceConfig.config.enableModeratorChecks) {
verifyModeratorRole(iq)?.let {
logger.warn("Ignored Jibri request from non-moderator.")
return IQ.createErrorResponse(iq, it)
}
}

return when (iq.action) {
Expand Down
Loading
Loading