@Override public void roomDisconnect(IConnection conn) { String remoteHost = Red5.getConnectionLocal().getRemoteAddress(); int remotePort = Red5.getConnectionLocal().getRemotePort(); String clientId = Red5.getConnectionLocal().getClient().getId(); log.info( "[clientid=" + clientId + "] disconnnected from " + remoteHost + ":" + remotePort + "."); BigBlueButtonSession bbbSession = (BigBlueButtonSession) Red5.getConnectionLocal().getAttribute(Constants.SESSION); log.info( "User [" + bbbSession.getUsername() + "] disconnected from room [" + bbbSession.getRoom() + "]"); super.roomDisconnect(conn); }
@Override public void roomDisconnect(IConnection conn) { String remoteHost = Red5.getConnectionLocal().getRemoteAddress(); int remotePort = Red5.getConnectionLocal().getRemotePort(); String clientId = Red5.getConnectionLocal().getClient().getId(); BigBlueButtonSession bbbSession = (BigBlueButtonSession) Red5.getConnectionLocal().getAttribute(Constants.SESSION); String meetingId = bbbSession.getRoom(); String userId = bbbSession.getInternalUserID(); String connType = getConnectionType(Red5.getConnectionLocal().getType()); String userFullname = bbbSession.getUsername(); String connId = Red5.getConnectionLocal().getSessionId(); String sessionId = CONN + userId; Map<String, Object> logData = new HashMap<String, Object>(); logData.put("meetingId", meetingId); logData.put("connType", connType); logData.put("connId", connId); logData.put("conn", remoteHost + ":" + remotePort); logData.put("sessionId", sessionId); logData.put("userId", userId); logData.put("username", userFullname); logData.put("event", "user_leaving_bbb_apps"); logData.put("description", "User leaving BBB Apps."); Gson gson = new Gson(); String logStr = gson.toJson(logData); boolean removeUser = userConnections.userDisconnected(userId, connId); if (removeUser) { log.info("User leaving bbb-apps: data={}", logStr); red5InGW.userLeft(bbbSession.getRoom(), getBbbSession().getInternalUserID(), sessionId); } else { log.info("User not leaving bbb-apps but just disconnected: data={}", logStr); } super.roomDisconnect(conn); }