From 49d5f9c41cebb0b3dd28363dc00133ed11eec5f7 Mon Sep 17 00:00:00 2001 From: Pedro Beschorner Marin Date: Wed, 21 Sep 2016 16:32:11 +0000 Subject: [PATCH 1/2] Refactored redis recording events --- .../grails-app/conf/spring/resources.xml | 1 + .../org/bigbluebutton/api/MeetingService.java | 4 ++-- .../bigbluebutton/api/RecordingService.java | 20 +++++++++++++++++++ .../bigbluebutton/api/domain/Recording.java | 12 +++++++++++ .../api/messaging/Constants.java | 1 + .../api/messaging/MessageToJson.java | 6 ++++++ .../api/messaging/MessagingService.java | 4 ++-- .../api/messaging/RedisMessagingService.java | 18 ++++++++--------- .../messages/DeleteRecordingMessage.java | 6 +++++- .../messages/PublishRecordingMessage.java | 6 +++++- .../messages/UnpublishRecordingMessage.java | 6 +++++- .../lib/recordandplayback/events_archiver.rb | 11 ++++++++++ .../recordandplayback/generators/events.rb | 9 +++++++++ .../core/scripts/rap-worker.rb | 13 ++++++++++-- 14 files changed, 99 insertions(+), 18 deletions(-) diff --git a/bigbluebutton-web/grails-app/conf/spring/resources.xml b/bigbluebutton-web/grails-app/conf/spring/resources.xml index 753a078f4e..869d1bc29d 100755 --- a/bigbluebutton-web/grails-app/conf/spring/resources.xml +++ b/bigbluebutton-web/grails-app/conf/spring/resources.xml @@ -58,6 +58,7 @@ with BigBlueButton; if not, see . + diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java index e70962e0b2..3e45921c6a 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java @@ -445,7 +445,7 @@ public class MeetingService implements MessageListener { success = recordingService.changeState(id, Recording.STATE_UNPUBLISHED); } if (success) { - messagingService.publishRecording(id, publish); + log.debug("Publish recording operation succeeded for meeting {}", id); } } } @@ -454,7 +454,7 @@ public class MeetingService implements MessageListener { for (String id : idList) { boolean success = recordingService.changeState(id, Recording.STATE_DELETED); if (success) { - messagingService.deleteRecording(id); + log.debug("Delete recording operation succeeded for meeting {}", id); } } } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/RecordingService.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/RecordingService.java index 141c6ca9c7..3416d0c5f5 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/RecordingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/RecordingService.java @@ -34,6 +34,7 @@ import java.util.Map; import java.util.Set; import org.bigbluebutton.api.domain.Recording; +import org.bigbluebutton.api.messaging.MessagingService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,6 +46,7 @@ public class RecordingService { private String unpublishedDir = "/var/bigbluebutton/unpublished"; private String deletedDir = "/var/bigbluebutton/deleted"; private RecordingServiceHelper recordingServiceHelper; + private MessagingService messagingService; private String recordStatusDir; public void startIngestAndProcessing(String meetingId) { @@ -339,6 +341,7 @@ public class RecordingService { deleteRecording(recordingId, deletedDir); } recordingServiceHelper.writeRecordingInfo(dest.getAbsolutePath() + File.separatorChar + recordings.get(f).getName(), r); + sendRedisEvent(r.getId(), r.getExternalMeetingId(), format[i], state); log.debug(String.format("Recording successfully %s!", state)); } else { log.debug("Recording was not moved"); @@ -351,6 +354,19 @@ public class RecordingService { return anyResult; } + private void sendRedisEvent(String meetingId, String externalMeetingId, String format, String state) { + log.debug("Sending Redis event for meeting {} {}", meetingId, format); + if (state.equals(Recording.STATE_PUBLISHED)) { + messagingService.publishRecording(meetingId, externalMeetingId, format, true); + } else if (state.equals(Recording.STATE_UNPUBLISHED)) { + messagingService.publishRecording(meetingId, externalMeetingId, format, false); + } else if (state.equals(Recording.STATE_DELETED)) { + messagingService.deleteRecording(meetingId, externalMeetingId, format); + } else { + log.debug("No event for {}", state); + } + } + private List getAllDirectories(String state) { List allDirectories = new ArrayList(); @@ -406,4 +422,8 @@ public class RecordingService { return allDirectories; } + public void setMessagingService(MessagingService service) { + messagingService = service; + } + } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Recording.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Recording.java index 0b781904fa..9cec6cbb4f 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Recording.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Recording.java @@ -282,6 +282,18 @@ public class Recording { return newdate; } + public String getExternalMeetingId() { + String externalMeetingId = null; + if (this.metadata != null) { + externalMeetingId = this.metadata.get("meetingId"); + } + + if (externalMeetingId != null) { + return externalMeetingId; + } else { + return ""; + } + } } /* diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/Constants.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/Constants.java index a7472fdd4e..866908df06 100644 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/Constants.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/Constants.java @@ -94,4 +94,5 @@ public class Constants { public static final String CREATE_DATE = "create_date"; public static final String GUEST = "guest"; public static final String WAITING_FOR_ACCEPTANCE = "waiting_for_acceptance"; + public static final String FORMAT = "format"; } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageToJson.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageToJson.java index 3eb7d72fbd..e297d432c1 100644 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageToJson.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageToJson.java @@ -74,6 +74,8 @@ public class MessageToJson { public static String publishRecordingMessageToJson(PublishRecordingMessage message) { HashMap payload = new HashMap(); payload.put(Constants.MEETING_ID, message.meetingId); + payload.put(Constants.EXTERNAL_MEETING_ID, message.externalMeetingId); + payload.put(Constants.FORMAT, message.format); java.util.HashMap header = MessageBuilder.buildHeader(PublishRecordingMessage.PUBLISH_RECORDING, PublishRecordingMessage.VERSION, null); return MessageBuilder.buildJson(header, payload); @@ -82,6 +84,8 @@ public class MessageToJson { public static String unpublishRecordingMessageToJson(UnpublishRecordingMessage message) { HashMap payload = new HashMap(); payload.put(Constants.MEETING_ID, message.meetingId); + payload.put(Constants.EXTERNAL_MEETING_ID, message.externalMeetingId); + payload.put(Constants.FORMAT, message.format); java.util.HashMap header = MessageBuilder.buildHeader(UnpublishRecordingMessage.UNPUBLISH_RECORDING, UnpublishRecordingMessage.VERSION, null); return MessageBuilder.buildJson(header, payload); @@ -90,6 +94,8 @@ public class MessageToJson { public static String deleteRecordingMessageToJson(DeleteRecordingMessage message) { HashMap payload = new HashMap(); payload.put(Constants.MEETING_ID, message.meetingId); + payload.put(Constants.EXTERNAL_MEETING_ID, message.externalMeetingId); + payload.put(Constants.FORMAT, message.format); java.util.HashMap header = MessageBuilder.buildHeader(DeleteRecordingMessage.DELETE_RECORDING, DeleteRecordingMessage.VERSION, null); return MessageBuilder.buildJson(header, payload); diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingService.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingService.java index c57a780eaf..180e932e43 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingService.java @@ -34,6 +34,6 @@ public interface MessagingService { void sendPolls(String meetingId, String title, String question, String questionType, List answers); void registerUser(String meetingID, String internalUserId, String fullname, String role, String externUserID, String authToken, String guest); void sendKeepAlive(String system, Long timestamp); - void publishRecording(String meetingId, boolean publish); - void deleteRecording(String meetingId); + void publishRecording(String meetingId, String externalMeetingId, String format, boolean publish); + void deleteRecording(String meetingId, String externalMeetingId, String format); } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java index d314fb8020..aaa2d3ddb8 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java @@ -134,28 +134,28 @@ public class RedisMessagingService implements MessagingService { storeService.removeMeeting(meetingId); } - private void publishRecording(String meetingId) { - PublishRecordingMessage msg = new PublishRecordingMessage(meetingId); + private void publishRecording(String meetingId, String externalMeetingId, String format) { + PublishRecordingMessage msg = new PublishRecordingMessage(meetingId, externalMeetingId, format); String json = MessageToJson.publishRecordingMessageToJson(msg); sender.send(MessagingConstants.FROM_BBB_RECORDING_CHANNEL, json); } - private void unpublishRecording(String meetingId) { - UnpublishRecordingMessage msg = new UnpublishRecordingMessage(meetingId); + private void unpublishRecording(String meetingId, String externalMeetingId, String format) { + UnpublishRecordingMessage msg = new UnpublishRecordingMessage(meetingId, externalMeetingId, format); String json = MessageToJson.unpublishRecordingMessageToJson(msg); sender.send(MessagingConstants.FROM_BBB_RECORDING_CHANNEL, json); } - public void publishRecording(String meetingId, boolean publish) { + public void publishRecording(String meetingId, String externalMeetingId, String format, boolean publish) { if (publish) { - publishRecording(meetingId); + publishRecording(meetingId, externalMeetingId, format); } else { - unpublishRecording(meetingId); + unpublishRecording(meetingId, externalMeetingId, format); } } - public void deleteRecording(String meetingId) { - DeleteRecordingMessage msg = new DeleteRecordingMessage(meetingId); + public void deleteRecording(String meetingId, String externalMeetingId, String format) { + DeleteRecordingMessage msg = new DeleteRecordingMessage(meetingId, externalMeetingId, format); String json = MessageToJson.deleteRecordingMessageToJson(msg); sender.send(MessagingConstants.FROM_BBB_RECORDING_CHANNEL, json); } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/DeleteRecordingMessage.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/DeleteRecordingMessage.java index 40f71cf3b9..4b509649dd 100644 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/DeleteRecordingMessage.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/DeleteRecordingMessage.java @@ -5,8 +5,12 @@ public class DeleteRecordingMessage { public static final String VERSION = "0.0.1"; public final String meetingId; + public final String externalMeetingId; + public final String format; - public DeleteRecordingMessage(String meetingId) { + public DeleteRecordingMessage(String meetingId, String externalMeetingId, String format) { this.meetingId = meetingId; + this.externalMeetingId = externalMeetingId; + this.format = format; } } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/PublishRecordingMessage.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/PublishRecordingMessage.java index 9c0ed85681..5aee59982c 100644 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/PublishRecordingMessage.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/PublishRecordingMessage.java @@ -5,8 +5,12 @@ public class PublishRecordingMessage { public static final String VERSION = "0.0.1"; public final String meetingId; + public final String externalMeetingId; + public final String format; - public PublishRecordingMessage(String meetingId) { + public PublishRecordingMessage(String meetingId, String externalMeetingId, String format) { this.meetingId = meetingId; + this.externalMeetingId = externalMeetingId; + this.format = format; } } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/UnpublishRecordingMessage.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/UnpublishRecordingMessage.java index 4a7dae4a72..5fdbe7f94b 100644 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/UnpublishRecordingMessage.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/UnpublishRecordingMessage.java @@ -5,8 +5,12 @@ public class UnpublishRecordingMessage { public static final String VERSION = "0.0.1"; public final String meetingId; + public final String externalMeetingId; + public final String format; - public UnpublishRecordingMessage(String meetingId) { + public UnpublishRecordingMessage(String meetingId, String externalMeetingId, String format) { this.meetingId = meetingId; + this.externalMeetingId = externalMeetingId; + this.format = format; } } diff --git a/record-and-playback/core/lib/recordandplayback/events_archiver.rb b/record-and-playback/core/lib/recordandplayback/events_archiver.rb index 4918b21e17..29e8a330f1 100755 --- a/record-and-playback/core/lib/recordandplayback/events_archiver.rb +++ b/record-and-playback/core/lib/recordandplayback/events_archiver.rb @@ -26,6 +26,10 @@ require 'builder' require 'yaml' module BigBlueButton + $bbb_props = YAML::load(File.open('../../core/scripts/bigbluebutton.yml')) + $recording_dir = $bbb_props['recording_dir'] + $raw_recording_dir = "#{$recording_dir}/raw" + # Class to wrap Redis so we can mock # for testing class RedisWrapper @@ -93,6 +97,13 @@ module BigBlueButton RECORDINGS_CHANNEL = "bigbluebutton:from-rap" def put_message(message_type, meeting_id, additional_payload = {}) + events_xml = "#{$raw_recording_dir}/#{meeting_id}/events.xml" + if File.exist?(events_xml) + additional_payload.merge!({ + "external_meeting_id" => BigBlueButton::Events.get_external_meeting_id(events_xml) + }) + end + msg = build_message build_header(message_type), additional_payload.merge({ "meeting_id" => meeting_id }) diff --git a/record-and-playback/core/lib/recordandplayback/generators/events.rb b/record-and-playback/core/lib/recordandplayback/generators/events.rb index abbf17a114..54e381d1c2 100755 --- a/record-and-playback/core/lib/recordandplayback/generators/events.rb +++ b/record-and-playback/core/lib/recordandplayback/generators/events.rb @@ -38,6 +38,15 @@ module BigBlueButton end metadata end + + # Get the external meeting id + def self.get_external_meeting_id(events_xml) + BigBlueButton.logger.info("Task: Getting external meeting id") + metadata = get_meeting_metadata(events_xml) + external_meeting_id = {} + external_meeting_id = metadata['meetingId'] if !metadata['meetingId'].nil? + external_meeting_id + end # Get the timestamp of the first event. def self.first_event_timestamp(events_xml) diff --git a/record-and-playback/core/scripts/rap-worker.rb b/record-and-playback/core/scripts/rap-worker.rb index 44d9710909..b07c0e3567 100755 --- a/record-and-playback/core/scripts/rap-worker.rb +++ b/record-and-playback/core/scripts/rap-worker.rb @@ -242,13 +242,19 @@ def publish_processed_meeting(recording_dir) playback = {} metadata = {} download = {} + raw_size = {} + start_time = {} + end_time = {} metadata_xml_path = "#{published_dir}/#{publish_type}/#{meeting_id}/metadata.xml" if File.exists? metadata_xml_path begin doc = Hash.from_xml(File.open(metadata_xml_path)) playback = doc[:recording][:playback] if !doc[:recording][:playback].nil? - metadata = doc[:recording][:metadata] if !doc[:recording][:metadata].nil? + metadata = doc[:recording][:meta] if !doc[:recording][:meta].nil? download = doc[:recording][:download] if !doc[:recording][:download].nil? + raw_size = doc[:recording][:raw_size] if !doc[:recording][:raw_size].nil? + start_time = doc[:recording][:start_time] if !doc[:recording][:start_time].nil? + end_time = doc[:recording][:end_time] if !doc[:recording][:end_time].nil? rescue Exception => e BigBlueButton.logger.warn "An exception occurred while loading the extra information for the publish event" BigBlueButton.logger.warn e.message @@ -265,7 +271,10 @@ def publish_processed_meeting(recording_dir) "step_time" => step_time, "playback" => playback, "metadata" => metadata, - "download" => download + "download" => download, + "raw_size" => raw_size, + "start_time" => start_time, + "end_time" => end_time } if step_succeeded From 694c9564a54f6c2b01f82e56b95a8bd4ac4d88ef Mon Sep 17 00:00:00 2001 From: Pedro Beschorner Marin Date: Wed, 21 Sep 2016 20:12:57 +0000 Subject: [PATCH 2/2] Added record_id to redis recording events --- .../bigbluebutton/api/RecordingService.java | 10 +++++----- .../bigbluebutton/api/messaging/Constants.java | 1 + .../api/messaging/MessageToJson.java | 3 +++ .../api/messaging/MessagingService.java | 4 ++-- .../api/messaging/RedisMessagingService.java | 18 +++++++++--------- .../messages/DeleteRecordingMessage.java | 4 +++- .../messages/PublishRecordingMessage.java | 4 +++- .../messages/UnpublishRecordingMessage.java | 4 +++- .../lib/recordandplayback/events_archiver.rb | 1 + 9 files changed, 30 insertions(+), 19 deletions(-) diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/RecordingService.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/RecordingService.java index 3416d0c5f5..1e99a2ee32 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/RecordingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/RecordingService.java @@ -341,7 +341,7 @@ public class RecordingService { deleteRecording(recordingId, deletedDir); } recordingServiceHelper.writeRecordingInfo(dest.getAbsolutePath() + File.separatorChar + recordings.get(f).getName(), r); - sendRedisEvent(r.getId(), r.getExternalMeetingId(), format[i], state); + sendRedisEvent(r.getId(), r.getId(), r.getExternalMeetingId(), format[i], state); log.debug(String.format("Recording successfully %s!", state)); } else { log.debug("Recording was not moved"); @@ -354,14 +354,14 @@ public class RecordingService { return anyResult; } - private void sendRedisEvent(String meetingId, String externalMeetingId, String format, String state) { + private void sendRedisEvent(String recordId, String meetingId, String externalMeetingId, String format, String state) { log.debug("Sending Redis event for meeting {} {}", meetingId, format); if (state.equals(Recording.STATE_PUBLISHED)) { - messagingService.publishRecording(meetingId, externalMeetingId, format, true); + messagingService.publishRecording(recordId, meetingId, externalMeetingId, format, true); } else if (state.equals(Recording.STATE_UNPUBLISHED)) { - messagingService.publishRecording(meetingId, externalMeetingId, format, false); + messagingService.publishRecording(recordId, meetingId, externalMeetingId, format, false); } else if (state.equals(Recording.STATE_DELETED)) { - messagingService.deleteRecording(meetingId, externalMeetingId, format); + messagingService.deleteRecording(recordId, meetingId, externalMeetingId, format); } else { log.debug("No event for {}", state); } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/Constants.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/Constants.java index 866908df06..14642499cc 100644 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/Constants.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/Constants.java @@ -95,4 +95,5 @@ public class Constants { public static final String GUEST = "guest"; public static final String WAITING_FOR_ACCEPTANCE = "waiting_for_acceptance"; public static final String FORMAT = "format"; + public static final String RECORD_ID = "record_id"; } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageToJson.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageToJson.java index e297d432c1..e0e7f67bb1 100644 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageToJson.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageToJson.java @@ -73,6 +73,7 @@ public class MessageToJson { public static String publishRecordingMessageToJson(PublishRecordingMessage message) { HashMap payload = new HashMap(); + payload.put(Constants.RECORD_ID, message.recordId); payload.put(Constants.MEETING_ID, message.meetingId); payload.put(Constants.EXTERNAL_MEETING_ID, message.externalMeetingId); payload.put(Constants.FORMAT, message.format); @@ -83,6 +84,7 @@ public class MessageToJson { public static String unpublishRecordingMessageToJson(UnpublishRecordingMessage message) { HashMap payload = new HashMap(); + payload.put(Constants.RECORD_ID, message.recordId); payload.put(Constants.MEETING_ID, message.meetingId); payload.put(Constants.EXTERNAL_MEETING_ID, message.externalMeetingId); payload.put(Constants.FORMAT, message.format); @@ -93,6 +95,7 @@ public class MessageToJson { public static String deleteRecordingMessageToJson(DeleteRecordingMessage message) { HashMap payload = new HashMap(); + payload.put(Constants.RECORD_ID, message.recordId); payload.put(Constants.MEETING_ID, message.meetingId); payload.put(Constants.EXTERNAL_MEETING_ID, message.externalMeetingId); payload.put(Constants.FORMAT, message.format); diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingService.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingService.java index 180e932e43..c73dda23ef 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingService.java @@ -34,6 +34,6 @@ public interface MessagingService { void sendPolls(String meetingId, String title, String question, String questionType, List answers); void registerUser(String meetingID, String internalUserId, String fullname, String role, String externUserID, String authToken, String guest); void sendKeepAlive(String system, Long timestamp); - void publishRecording(String meetingId, String externalMeetingId, String format, boolean publish); - void deleteRecording(String meetingId, String externalMeetingId, String format); + void publishRecording(String recordId, String meetingId, String externalMeetingId, String format, boolean publish); + void deleteRecording(String recordId, String meetingId, String externalMeetingId, String format); } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java index aaa2d3ddb8..0d4de70264 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java @@ -134,28 +134,28 @@ public class RedisMessagingService implements MessagingService { storeService.removeMeeting(meetingId); } - private void publishRecording(String meetingId, String externalMeetingId, String format) { - PublishRecordingMessage msg = new PublishRecordingMessage(meetingId, externalMeetingId, format); + private void publishRecording(String recordId, String meetingId, String externalMeetingId, String format) { + PublishRecordingMessage msg = new PublishRecordingMessage(recordId, meetingId, externalMeetingId, format); String json = MessageToJson.publishRecordingMessageToJson(msg); sender.send(MessagingConstants.FROM_BBB_RECORDING_CHANNEL, json); } - private void unpublishRecording(String meetingId, String externalMeetingId, String format) { - UnpublishRecordingMessage msg = new UnpublishRecordingMessage(meetingId, externalMeetingId, format); + private void unpublishRecording(String recordId, String meetingId, String externalMeetingId, String format) { + UnpublishRecordingMessage msg = new UnpublishRecordingMessage(recordId, meetingId, externalMeetingId, format); String json = MessageToJson.unpublishRecordingMessageToJson(msg); sender.send(MessagingConstants.FROM_BBB_RECORDING_CHANNEL, json); } - public void publishRecording(String meetingId, String externalMeetingId, String format, boolean publish) { + public void publishRecording(String recordId, String meetingId, String externalMeetingId, String format, boolean publish) { if (publish) { - publishRecording(meetingId, externalMeetingId, format); + publishRecording(recordId, meetingId, externalMeetingId, format); } else { - unpublishRecording(meetingId, externalMeetingId, format); + unpublishRecording(recordId, meetingId, externalMeetingId, format); } } - public void deleteRecording(String meetingId, String externalMeetingId, String format) { - DeleteRecordingMessage msg = new DeleteRecordingMessage(meetingId, externalMeetingId, format); + public void deleteRecording(String recordId, String meetingId, String externalMeetingId, String format) { + DeleteRecordingMessage msg = new DeleteRecordingMessage(recordId, meetingId, externalMeetingId, format); String json = MessageToJson.deleteRecordingMessageToJson(msg); sender.send(MessagingConstants.FROM_BBB_RECORDING_CHANNEL, json); } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/DeleteRecordingMessage.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/DeleteRecordingMessage.java index 4b509649dd..a14d2d64eb 100644 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/DeleteRecordingMessage.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/DeleteRecordingMessage.java @@ -4,11 +4,13 @@ public class DeleteRecordingMessage { public static final String DELETE_RECORDING = "deleted"; public static final String VERSION = "0.0.1"; + public final String recordId; public final String meetingId; public final String externalMeetingId; public final String format; - public DeleteRecordingMessage(String meetingId, String externalMeetingId, String format) { + public DeleteRecordingMessage(String recordId, String meetingId, String externalMeetingId, String format) { + this.recordId = recordId; this.meetingId = meetingId; this.externalMeetingId = externalMeetingId; this.format = format; diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/PublishRecordingMessage.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/PublishRecordingMessage.java index 5aee59982c..36cd27b66b 100644 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/PublishRecordingMessage.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/PublishRecordingMessage.java @@ -4,11 +4,13 @@ public class PublishRecordingMessage { public static final String PUBLISH_RECORDING = "published"; public static final String VERSION = "0.0.1"; + public final String recordId; public final String meetingId; public final String externalMeetingId; public final String format; - public PublishRecordingMessage(String meetingId, String externalMeetingId, String format) { + public PublishRecordingMessage(String recordId, String meetingId, String externalMeetingId, String format) { + this.recordId = recordId; this.meetingId = meetingId; this.externalMeetingId = externalMeetingId; this.format = format; diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/UnpublishRecordingMessage.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/UnpublishRecordingMessage.java index 5fdbe7f94b..c0ba6d0f57 100644 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/UnpublishRecordingMessage.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/converters/messages/UnpublishRecordingMessage.java @@ -4,11 +4,13 @@ public class UnpublishRecordingMessage { public static final String UNPUBLISH_RECORDING = "unpublished"; public static final String VERSION = "0.0.1"; + public final String recordId; public final String meetingId; public final String externalMeetingId; public final String format; - public UnpublishRecordingMessage(String meetingId, String externalMeetingId, String format) { + public UnpublishRecordingMessage(String recordId, String meetingId, String externalMeetingId, String format) { + this.recordId = recordId; this.meetingId = meetingId; this.externalMeetingId = externalMeetingId; this.format = format; diff --git a/record-and-playback/core/lib/recordandplayback/events_archiver.rb b/record-and-playback/core/lib/recordandplayback/events_archiver.rb index 29e8a330f1..3015d0dd5d 100755 --- a/record-and-playback/core/lib/recordandplayback/events_archiver.rb +++ b/record-and-playback/core/lib/recordandplayback/events_archiver.rb @@ -105,6 +105,7 @@ module BigBlueButton end msg = build_message build_header(message_type), additional_payload.merge({ + "record_id" => meeting_id, "meeting_id" => meeting_id }) @redis.publish RECORDINGS_CHANNEL, msg.to_json