Skip to content

Commit

Permalink
feat: Adds notification for conference audio recordings.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Oct 28, 2024
1 parent 6fabbf8 commit c6a1cda
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/jitsi/jigasi/JigasiBundleActivator.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,17 @@ public void startWithServices(final BundleContext bundleContext)
new DefaultPacketExtensionProvider<>(RecordingStatus.class)
);

ProviderManager.addExtensionProvider(
ConferenceProperties.ELEMENT,
ConferenceProperties.NAMESPACE,
new DefaultPacketExtensionProvider<>(ConferenceProperties.class)
);
ProviderManager.addExtensionProvider(
ConferenceProperties.ConferenceProperty.ELEMENT,
ConferenceProperties.NAMESPACE,
new DefaultPacketExtensionProvider<>(ConferenceProperties.ConferenceProperty.class)
);

logger.info("initialized SipGateway");
sipGateway = new SipGateway(bundleContext)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.jitsi.utils.*;
import org.jitsi.utils.logging.Logger;
import org.jitsi.xmpp.extensions.jibri.*;
import org.jitsi.xmpp.extensions.jitsimeet.*;
import org.jivesoftware.smack.packet.*;

import java.util.*;
Expand Down Expand Up @@ -232,13 +233,30 @@ private CallContext getCallContext()
*/
public void process(Presence presence)
{
RecordingStatus rs = presence.getExtension(RecordingStatus.class);

if (rs != null
&& gatewaySession.getFocusResourceAddr().equals(
presence.getFrom().getResourceOrEmpty().toString()))
if (gatewaySession.getFocusResourceAddr().equals(presence.getFrom().getResourceOrEmpty().toString()))
{
notifyRecordingStatusChanged(rs.getRecordingMode(), rs.getStatus());
RecordingStatus rs = presence.getExtension(RecordingStatus.class);

if (rs != null)
{
notifyRecordingStatusChanged(rs.getRecordingMode(), rs.getStatus());

return;
}

ConferenceProperties props = presence.getExtension(ConferenceProperties.class);
if (props != null)
{
props.getProperties().stream()
.filter(p -> ConferenceProperties.KEY_AUDIO_RECORDING_ENABLED.equals(p.getKey()))
.findFirst().ifPresent(p ->
{
if (p.getValue().equals(Boolean.TRUE.toString()))
{
notifyRecordingStatusChanged(JibriIq.RecordingMode.FILE, JibriIq.Status.ON);
}
});
}
}
}

Expand Down

0 comments on commit c6a1cda

Please sign in to comment.