30
30
import org .jitsi .utils .*;
31
31
import org .jitsi .utils .logging .Logger ;
32
32
import org .jitsi .xmpp .extensions .jibri .*;
33
+ import org .jitsi .xmpp .extensions .jitsimeet .*;
33
34
import org .jivesoftware .smack .packet .*;
34
35
35
36
import java .util .*;
@@ -232,13 +233,37 @@ private CallContext getCallContext()
232
233
*/
233
234
public void process (Presence presence )
234
235
{
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 ()))
240
237
{
241
- notifyRecordingStatusChanged (rs .getRecordingMode (), rs .getStatus ());
238
+ boolean isJibriRecordingOn = false ;
239
+ RecordingStatus rs = presence .getExtension (RecordingStatus .class );
240
+ if (rs != null )
241
+ {
242
+ isJibriRecordingOn = rs .getStatus () == JibriIq .Status .ON ;
243
+ }
244
+
245
+ boolean isAudioRecordingOn = false ;
246
+ ConferenceProperties props = presence .getExtension (ConferenceProperties .class );
247
+
248
+ if (props != null )
249
+ {
250
+ ConferenceProperties .ConferenceProperty prop
251
+ = props .getProperties ().stream ()
252
+ .filter (p -> ConferenceProperties .KEY_AUDIO_RECORDING_ENABLED .equals (p .getKey ()))
253
+ .findFirst ().orElse (null );
254
+
255
+ isAudioRecordingOn = prop != null && Boolean .parseBoolean (prop .getValue ());
256
+ }
257
+
258
+ JibriIq .Status newStatus
259
+ = isJibriRecordingOn || isAudioRecordingOn ? JibriIq .Status .ON : JibriIq .Status .OFF ;
260
+
261
+ if (currentJibriStatus .equals (newStatus ))
262
+ {
263
+ return ;
264
+ }
265
+
266
+ notifyRecordingStatusChanged (rs != null ? rs .getRecordingMode () : JibriIq .RecordingMode .FILE , newStatus );
242
267
}
243
268
}
244
269
@@ -251,11 +276,6 @@ public void process(Presence presence)
251
276
private void notifyRecordingStatusChanged (
252
277
JibriIq .RecordingMode mode , JibriIq .Status status )
253
278
{
254
- // not a change, ignore
255
- if (currentJibriStatus .equals (status ))
256
- {
257
- return ;
258
- }
259
279
currentJibriStatus = status ;
260
280
261
281
String offSound ;
0 commit comments