Skip to content

Commit c6a1cda

Browse files
committed
feat: Adds notification for conference audio recordings.
1 parent 6fabbf8 commit c6a1cda

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

src/main/java/org/jitsi/jigasi/JigasiBundleActivator.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,17 @@ public void startWithServices(final BundleContext bundleContext)
236236
new DefaultPacketExtensionProvider<>(RecordingStatus.class)
237237
);
238238

239+
ProviderManager.addExtensionProvider(
240+
ConferenceProperties.ELEMENT,
241+
ConferenceProperties.NAMESPACE,
242+
new DefaultPacketExtensionProvider<>(ConferenceProperties.class)
243+
);
244+
ProviderManager.addExtensionProvider(
245+
ConferenceProperties.ConferenceProperty.ELEMENT,
246+
ConferenceProperties.NAMESPACE,
247+
new DefaultPacketExtensionProvider<>(ConferenceProperties.ConferenceProperty.class)
248+
);
249+
239250
logger.info("initialized SipGateway");
240251
sipGateway = new SipGateway(bundleContext)
241252
{

src/main/java/org/jitsi/jigasi/sounds/SoundNotificationManager.java

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.jitsi.utils.*;
3131
import org.jitsi.utils.logging.Logger;
3232
import org.jitsi.xmpp.extensions.jibri.*;
33+
import org.jitsi.xmpp.extensions.jitsimeet.*;
3334
import org.jivesoftware.smack.packet.*;
3435

3536
import java.util.*;
@@ -232,13 +233,30 @@ private CallContext getCallContext()
232233
*/
233234
public void process(Presence presence)
234235
{
235-
RecordingStatus rs = presence.getExtension(RecordingStatus.class);
236-
237-
if (rs != null
238-
&& gatewaySession.getFocusResourceAddr().equals(
239-
presence.getFrom().getResourceOrEmpty().toString()))
236+
if (gatewaySession.getFocusResourceAddr().equals(presence.getFrom().getResourceOrEmpty().toString()))
240237
{
241-
notifyRecordingStatusChanged(rs.getRecordingMode(), rs.getStatus());
238+
RecordingStatus rs = presence.getExtension(RecordingStatus.class);
239+
240+
if (rs != null)
241+
{
242+
notifyRecordingStatusChanged(rs.getRecordingMode(), rs.getStatus());
243+
244+
return;
245+
}
246+
247+
ConferenceProperties props = presence.getExtension(ConferenceProperties.class);
248+
if (props != null)
249+
{
250+
props.getProperties().stream()
251+
.filter(p -> ConferenceProperties.KEY_AUDIO_RECORDING_ENABLED.equals(p.getKey()))
252+
.findFirst().ifPresent(p ->
253+
{
254+
if (p.getValue().equals(Boolean.TRUE.toString()))
255+
{
256+
notifyRecordingStatusChanged(JibriIq.RecordingMode.FILE, JibriIq.Status.ON);
257+
}
258+
});
259+
}
242260
}
243261
}
244262

0 commit comments

Comments
 (0)