Revert "Merge pull request #8782 from ritzalam/generate-meeting-data"

This reverts commit 37ed2c7501, reversing
changes made to 5af41dabb4.
This commit is contained in:
Anton Georgiev 2020-03-25 16:13:01 -04:00
parent 97682d9162
commit 1299abdf2c
14 changed files with 17 additions and 196 deletions

View File

@ -16,8 +16,8 @@ object ScreenshareModel {
return status.screenshareStarted
}
def setScreenshareStarted(status: ScreenshareModel, started: Boolean) {
status.screenshareStarted = started
def setScreenshareStarted(status: ScreenshareModel, b: Boolean) {
status.screenshareStarted = b
}
def setScreenshareVideoWidth(status: ScreenshareModel, videoWidth: Int) {
@ -37,7 +37,6 @@ object ScreenshareModel {
}
def broadcastingRTMPStarted(status: ScreenshareModel) {
status.screenshareCountTotal += 1
status.broadcastingRTMP = true
}
@ -80,12 +79,9 @@ object ScreenshareModel {
def getTimestamp(status: ScreenshareModel): String = {
status.timestamp
}
def getscreenshareCountTotal(status: ScreenshareModel): Int = status.screenshareCountTotal
}
class ScreenshareModel {
private var screenshareCountTotal = 0
private var rtmpBroadcastingUrl: String = ""
private var screenshareStarted = false
private var screenshareVideoWidth = 0

View File

@ -33,7 +33,7 @@ trait UserConnectedToGlobalAudioMsgHdlr {
val vu = VoiceUserState(
intId = user.intId,
voiceUserId = user.intId,
callingWith = "kms",
callingWith = "flash",
callerName = user.name,
callerNum = user.name,
muted = true,

View File

@ -22,8 +22,6 @@ object RegisteredUsers {
)
}
def findAll(users: RegisteredUsers): Vector[RegisteredUser] = users.toVector
def findWithToken(token: String, users: RegisteredUsers): Option[RegisteredUser] = {
users.toVector.find(u => u.authToken == token)
}

View File

@ -9,8 +9,6 @@ object Users2x {
}
def findAll(users: Users2x): Vector[UserState] = users.toVector
def findAllModerators(users: Users2x): Vector[UserState] = users.toVector.filter(u => u.role == Roles.MODERATOR_ROLE)
def findAllViewers(users: Users2x): Vector[UserState] = users.toVector.filter(u => u.role == Roles.VIEWER_ROLE)
def add(users: Users2x, user: UserState): Option[UserState] = {
users.save(user)

View File

@ -14,19 +14,8 @@ object VoiceUsers {
def findAll(users: VoiceUsers): Vector[VoiceUserState] = users.toVector
def findAllNonListenOnlyVoiceUsers(users: VoiceUsers): Vector[VoiceUserState] = users.toVector.filter(u => u.listenOnly == false)
def findAllListenOnlyVoiceUsers(users: VoiceUsers): Vector[VoiceUserState] = users.toVector.filter(u => u.listenOnly == true)
def findAllFreeswitchListenOnly(users: VoiceUsers): Vector[VoiceUserState] = users.toVector.filter(u => u.calledInto == "freeswitch" && u.listenOnly)
def findAllFreeswitchCallers(users: VoiceUsers): Vector[VoiceUserState] = users.toVector.filter(u => u.calledInto == "freeswitch")
def findAllKurentoCallers(users: VoiceUsers): Vector[VoiceUserState] = users.toVector.filter(u => u.calledInto == "kms")
def findAllDialInUsers(users: VoiceUsers): Vector[VoiceUserState] = users.toVector.filter(u => u.callingWith == "phone")
def findTwoWayCallers(users: VoiceUsers): Vector[VoiceUserState] = users.toVector.filter(u => u.calledInto == "freeswitch" && !u.listenOnly)
def findAllMuted(users: VoiceUsers): Vector[VoiceUserState] = users.toVector.filter(u => u.muted && !u.listenOnly)
def findAllUnMuted(users: VoiceUsers): Vector[VoiceUserState] = users.toVector.filter(u => !u.muted && !u.listenOnly)
def add(users: VoiceUsers, user: VoiceUserState): Unit = {
users.save(user)

View File

@ -9,8 +9,6 @@ object Webcams {
webcams.toVector.filter(w => w.stream.userId == userId)
}
def findWebcamsCountTotal(webcams: Webcams): Int = webcams.webcamsCountTotal
def findAll(webcams: Webcams): Vector[WebcamStream] = webcams.toVector
def addWebcamBroadcastStream(webcams: Webcams, webcamStream: WebcamStream): Option[WebcamStream] = {
@ -35,14 +33,11 @@ object Webcams {
}
class Webcams {
private var webcamsCountTotal = 0
private var webcams: collection.immutable.HashMap[String, WebcamStream] = new collection.immutable.HashMap[String, WebcamStream]
private def toVector: Vector[WebcamStream] = webcams.values.toVector
private def save(webcam: WebcamStream): WebcamStream = {
webcamsCountTotal += 1
webcams += webcam.stream.id -> webcam
webcam
}

View File

@ -1,6 +1,6 @@
package org.bigbluebutton.core.running
import java.io.{PrintWriter, StringWriter}
import java.io.{ PrintWriter, StringWriter }
import akka.actor._
import akka.actor.SupervisorStrategy.Resume
@ -11,7 +11,7 @@ import org.bigbluebutton.core.apps.users._
import org.bigbluebutton.core.apps.whiteboard.ClientToServerLatencyTracerMsgHdlr
import org.bigbluebutton.core.domain._
import org.bigbluebutton.core.util.TimeUtil
import org.bigbluebutton.common2.domain.{DefaultProps, LockSettingsProps, MeetingStatsInfoVO, MeetingStatsVO, ScreenshareStatsVO, UsersCountVO, UsersStatsVO, VoiceUsersListenOnlyStatsVO, VoiceUsersStatsVO, WebcamStatsVO}
import org.bigbluebutton.common2.domain.{ DefaultProps, LockSettingsProps }
import org.bigbluebutton.core.api._
import org.bigbluebutton.core.apps._
import org.bigbluebutton.core.apps.caption.CaptionApp2x
@ -23,7 +23,7 @@ import org.bigbluebutton.core.apps.sharednotes.SharedNotesApp2x
import org.bigbluebutton.core.apps.whiteboard.WhiteboardApp2x
import org.bigbluebutton.core.bus._
import org.bigbluebutton.core.models._
import org.bigbluebutton.core2.{MeetingStatus2x, Permissions}
import org.bigbluebutton.core2.{ MeetingStatus2x, Permissions }
import org.bigbluebutton.core2.message.handlers._
import org.bigbluebutton.core2.message.handlers.meeting._
import org.bigbluebutton.common2.msgs._
@ -35,9 +35,9 @@ import akka.actor.SupervisorStrategy.Resume
import scala.concurrent.duration._
import org.bigbluebutton.core.apps.layout.LayoutApp2x
import org.bigbluebutton.core.apps.meeting.{SyncGetMeetingInfoRespMsgHdlr, ValidateConnAuthTokenSysMsgHdlr}
import org.bigbluebutton.core.apps.meeting.{ SyncGetMeetingInfoRespMsgHdlr, ValidateConnAuthTokenSysMsgHdlr }
import org.bigbluebutton.core.apps.users.ChangeLockSettingsInMeetingCmdMsgHdlr
import org.bigbluebutton.core2.message.senders.{MsgBuilder, Sender}
import org.bigbluebutton.core2.message.senders.{ MsgBuilder, Sender }
import scala.concurrent.ExecutionContext.Implicits.global
@ -569,73 +569,8 @@ class MeetingActor(
processUserInactivityAudit()
flagRegisteredUsersWhoHasNotJoined()
checkIfNeetToEndMeetingWhenNoAuthedUsers(liveMeeting)
if (System.currentTimeMillis - lastsendMeetingStatsData > 5*1000*60) {
sendMeetingStatsData()
}
}
var lastsendMeetingStatsData = System.currentTimeMillis
def sendMeetingStatsData(): Unit = {
lastsendMeetingStatsData = System.currentTimeMillis
val meetingStatsInfo = MeetingStatsInfoVO(
props.meetingProp,
props.recordProp,
props.metadataProp,
MeetingStatus2x.isRecording(liveMeeting.status)
)
val usersCount = UsersCountVO(
Users2x.findAll(liveMeeting.users2x).size,
Users2x.findAllModerators(liveMeeting.users2x).size,
Users2x.findAllViewers(liveMeeting.users2x).size
)
val usersStats = UsersStatsVO(
registered = RegisteredUsers.findAll(liveMeeting.registeredUsers).size,
usersCount
)
val listenOnlyStats = VoiceUsersListenOnlyStatsVO(
total = VoiceUsers.findAllListenOnlyVoiceUsers(liveMeeting.voiceUsers).size,
kurento = VoiceUsers.findAllKurentoCallers(liveMeeting.voiceUsers).size,
freeswitch = VoiceUsers.findAllFreeswitchListenOnly(liveMeeting.voiceUsers).size
)
val voiceUsersStats = VoiceUsersStatsVO(
users = VoiceUsers.findAllNonListenOnlyVoiceUsers(liveMeeting.voiceUsers).size,
listenOnly = listenOnlyStats,
twoWayCallers = VoiceUsers.findTwoWayCallers(liveMeeting.voiceUsers).size,
dialIn = VoiceUsers.findAllDialInUsers(liveMeeting.voiceUsers).size,
muted = VoiceUsers.findAllMuted(liveMeeting.voiceUsers).size,
unmuted = VoiceUsers.findAllUnMuted(liveMeeting.voiceUsers).size,
)
val webcamStats = WebcamStatsVO(
Webcams.findWebcamsCountTotal(liveMeeting.webcams),
Webcams.findAll(liveMeeting.webcams).size
)
val screenshareStats = ScreenshareStatsVO(
ScreenshareModel.getscreenshareCountTotal(liveMeeting.screenshareModel),
ScreenshareModel.getScreenshareStarted(liveMeeting.screenshareModel)
)
val meetingStats = MeetingStatsVO(
meetingStatsInfo,
usersStats,
voiceUsersStats,
webcamStats,
screenshareStats
)
val event = MsgBuilder.buildMeetingStatsDataSysMsg(meetingStats)
outGW.send(event)
}
def checkVoiceConfUsersStatus(): Unit = {
val event = MsgBuilder.buildLastcheckVoiceConfUsersStatus(
props.meetingProp.intId,

View File

@ -30,7 +30,6 @@ class AnalyticsActor extends Actor with ActorLogging {
def handleBbbCommonEnvCoreMsg(msg: BbbCommonEnvCoreMsg): Unit = {
msg.core match {
case m: MeetingStatsDataSysMsg => logMessage(msg)
case m: GetAllMeetingsReqMsg => logMessage(msg)
case m: RegisterUserReqMsg => logMessage(msg)

View File

@ -1,6 +1,6 @@
package org.bigbluebutton.core2.message.senders
import org.bigbluebutton.common2.domain.{ DefaultProps, MeetingStatsVO }
import org.bigbluebutton.common2.domain.DefaultProps
import org.bigbluebutton.common2.msgs.{ BbbCommonEnvCoreMsg, BbbCoreEnvelope, BbbCoreHeaderWithMeetingId, MessageTypes, Routing, ValidateConnAuthTokenSysRespMsg, ValidateConnAuthTokenSysRespMsgBody, _ }
import org.bigbluebutton.core.models.GuestWaiting
@ -344,13 +344,4 @@ object MsgBuilder {
val event = RegisteredUserJoinTimeoutMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
}
def buildMeetingStatsDataSysMsg(stats: MeetingStatsVO): BbbCommonEnvCoreMsg = {
val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka")
val envelope = BbbCoreEnvelope(MeetingStatsDataSysMsg.NAME, routing)
val header = BbbCoreBaseHeader(MeetingStatsDataSysMsg.NAME)
val body = MeetingStatsDataSysMsgBody(stats)
val event = MeetingStatsDataSysMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
}
}

View File

@ -87,7 +87,6 @@ public class ESLEventListener implements IEslEventListener {
String origCallerIdName = headers.get("Caller-Caller-ID-Name");
String origCallerDestNumber = headers.get("Caller-Destination-Number");
String clientSession = "0";
String callingWith = "browser";
Matcher matcher = CALLERNAME_PATTERN.matcher(callerIdName);
Matcher callWithSess = CALLERNAME_WITH_SESS_INFO_PATTERN.matcher(callerIdName);
@ -103,7 +102,6 @@ public class ESLEventListener implements IEslEventListener {
// us to identify the user as such in other parts of the system.
// (ralam - sept 1, 2017)
voiceUserId = "v_" + memberId.toString();
callingWith = "phone";
}
VoiceCallStateEvent csEvent = new VoiceCallStateEvent(
@ -134,7 +132,7 @@ public class ESLEventListener implements IEslEventListener {
callerIdName,
muted,
speaking,
callingWith);
"none");
conferenceEventListener.handleConferenceEvent(pj);

View File

@ -51,8 +51,7 @@ public class GetAllUsersCommand extends FreeswitchCommand {
}
private static final Pattern CALLERNAME_PATTERN = Pattern.compile("(.*)-bbbID-(.*)$");
private static final Pattern CALLERNAME_WITH_SESS_INFO_PATTERN = Pattern.compile("^(.*)_(\\d+)-bbbID-(.*)$");
public void handleResponse(EslMessage response, ConferenceEventListener eventListener) {
//Test for Known Conference
@ -100,29 +99,16 @@ public class GetAllUsersCommand extends FreeswitchCommand {
String callerIdName = member.getCallerIdName();
String voiceUserId = callerIdName;
String uuid = member.getUUID();
String callingWith = "browser";
log.info("Conf user. uuid=" + uuid
+ ",caller=" + callerIdName + ",callerId=" + callerId + ",conf=" + room);
Matcher matcher = CALLERNAME_PATTERN.matcher(callerIdName);
Matcher callWithSess = CALLERNAME_WITH_SESS_INFO_PATTERN.matcher(callerIdName);
if (callWithSess.matches()) {
voiceUserId = callWithSess.group(1).trim();
callerIdName = callWithSess.group(3).trim();
} else if (matcher.matches()) {
if (matcher.matches()) {
voiceUserId = matcher.group(1).trim();
callerIdName = matcher.group(2).trim();
} else {
// This is a caller using phone. Let's create a userId that will allow
// us to identify the user as such in other parts of the system.
// (ralam - sept 1, 2017)
voiceUserId = "v_" + member.getId().toString();
callingWith = "phone";
}
VoiceUserJoinedEvent pj = new VoiceUserJoinedEvent(voiceUserId, member.getId().toString(), confXML.getConferenceRoom(),
callerId, callerIdName, member.getMuted(), member.getSpeaking(), callingWith);
callerId, callerIdName, member.getMuted(), member.getSpeaking(), "none");
eventListener.handleConferenceEvent(pj);
} else if ("recording_node".equals(member.getMemberType())) {

View File

@ -75,7 +75,6 @@ public class GetUsersStatusCommand extends FreeswitchCommand {
String voiceUserId = callerIdName;
String uuid = member.getUUID();
String clientSession = "0";
String callingWith = "browser";
Matcher gapMatcher = GLOBAL_AUDION_PATTERN.matcher(callerIdName);
// Ignore GLOBAL_AUDIO user.
@ -86,15 +85,10 @@ public class GetUsersStatusCommand extends FreeswitchCommand {
voiceUserId = callWithSess.group(1).trim();
clientSession = callWithSess.group(2).trim();
callerIdName = callWithSess.group(3).trim();
} else if (matcher.matches()) {
} else
if (matcher.matches()) {
voiceUserId = matcher.group(1).trim();
callerIdName = matcher.group(2).trim();
} else {
// This is a caller using phone. Let's create a userId that will allow
// us to identify the user as such in other parts of the system.
// (ralam - sept 1, 2017)
voiceUserId = "v_" + member.getId().toString();
callingWith = "phone";
}
log.info("Conf user. uuid=" + uuid
@ -110,7 +104,7 @@ public class GetUsersStatusCommand extends FreeswitchCommand {
callerId, callerIdName,
member.getMuted(),
member.getSpeaking(),
callingWith);
"none");
confMembers.add(confMember);
}
} else if ("recording_node".equals(member.getMemberType())) {

View File

@ -86,52 +86,3 @@ case class UserVO(id: String, externalId: String, name: String, role: String,
case class VoiceUserVO(userId: String, webUserId: String, callerName: String,
callerNum: String, joined: Boolean, locked: Boolean, muted: Boolean,
talking: Boolean, avatarURL: String, listenOnly: Boolean)
case class UsersCountVO(
users: Int,
moderators: Int,
viewers: Int
)
case class UsersStatsVO(
registered: Int,
users: UsersCountVO
)
case class VoiceUsersListenOnlyStatsVO(
total: Int,
kurento: Int,
freeswitch: Int,
)
case class VoiceUsersStatsVO(
users: Int,
listenOnly: VoiceUsersListenOnlyStatsVO,
twoWayCallers: Int,
dialIn: Int,
muted: Int,
unmuted: Int
)
case class WebcamStatsVO(
total: Int,
webcams: Int
)
case class ScreenshareStatsVO(
total: Int,
isSharing: Boolean
)
case class MeetingStatsInfoVO(
meeting: MeetingProp,
record: RecordProp,
metadata: MetadataProp,
isRecording: Boolean
)
case class MeetingStatsVO(
meeting: MeetingStatsInfoVO,
users: UsersStatsVO,
voice: VoiceUsersStatsVO,
webcams: WebcamStatsVO,
screenshare: ScreenshareStatsVO
)

View File

@ -1,15 +1,6 @@
package org.bigbluebutton.common2.msgs
import org.bigbluebutton.common2.domain.{ DefaultProps, MeetingStatsVO }
object MeetingStatsDataSysMsg { val NAME = "MeetingStatsDataSysMsg" }
case class MeetingStatsDataSysMsg(
header: BbbCoreBaseHeader,
body: MeetingStatsDataSysMsgBody
) extends BbbCoreMsg
case class MeetingStatsDataSysMsgBody(
stats: MeetingStatsVO
)
import org.bigbluebutton.common2.domain.DefaultProps
/** Request Messages **/
object CreateMeetingReqMsg { val NAME = "CreateMeetingReqMsg" }