From 0bba549b383c9c34a747cf2a829d3fda15a99764 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Wed, 2 Dec 2015 23:03:44 +0000 Subject: [PATCH] - sometimes we see multiple wav files on recorded meetings. This was due to starting recording again when the user gets disconnected from bbb-apps but still connected to audio. --- .../bigbluebutton/core/apps/UsersApp.scala | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/UsersApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/UsersApp.scala index 8343a71fa4..bff33f23de 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/UsersApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/UsersApp.scala @@ -390,7 +390,7 @@ trait UsersApp { * and is reconnecting. Make the user as joined only in the voice conference. If we get a * user left voice conference message, then we will remove the user from the users list. */ - handleUserJoinedVoiceConfMessage((new UserJoinedVoiceConfMessage(mProps.voiceBridge, + switchUserToPhoneUser((new UserJoinedVoiceConfMessage(mProps.voiceBridge, vu.userId, u.userID, u.externUserID, vu.callerName, vu.callerNum, vu.muted, vu.talking, u.listenOnly))); } @@ -461,6 +461,34 @@ trait UsersApp { } } + def switchUserToPhoneUser(msg: UserJoinedVoiceConfMessage) = { + log.info("User has been disconnected but still in voice conf. Switching to phone user. meetingId=" + + mProps.meetingID + " callername=" + msg.callerIdName + + " userId=" + msg.userId + " extUserId=" + msg.externUserId) + + usersModel.getUser(msg.userId) match { + case Some(user) => { + val vu = new VoiceUser(msg.voiceUserId, msg.userId, msg.callerIdName, + msg.callerIdNum, joined = true, locked = false, + msg.muted, msg.talking, msg.listenOnly) + val nu = user.copy(voiceUser = vu, listenOnly = msg.listenOnly) + usersModel.addUser(nu) + + log.info("User joined voice. meetingId=" + mProps.meetingID + " userId=" + user.userID + " user=" + nu) + outGW.send(new UserJoinedVoice(mProps.meetingID, mProps.recorded, mProps.voiceBridge, nu)) + + if (meetingModel.isMeetingMuted()) { + outGW.send(new MuteVoiceUser(mProps.meetingID, mProps.recorded, + nu.userID, nu.userID, mProps.voiceBridge, + nu.voiceUser.userId, meetingModel.isMeetingMuted())) + } + } + case None => { + handleUserJoinedVoiceFromPhone(msg) + } + } + } + def handleUserJoinedVoiceConfMessage(msg: UserJoinedVoiceConfMessage) = { log.info("Received user joined voice. meetingId=" + mProps.meetingID + " callername=" + msg.callerIdName + " userId=" + msg.userId + " extUserId=" + msg.externUserId)