From 8da1535c28b0dbc223942afab43491c753a957e0 Mon Sep 17 00:00:00 2001 From: Leonardo Crauss Daronco Date: Thu, 9 Feb 2012 12:33:03 -0200 Subject: [PATCH 1/7] Adding internalMeetingID, isPresenter, hasVideoStream, and videoStreamName to the response of getMeetingInfo. --- .../web/controllers/ApiController.groovy | 4 +++ .../org/bigbluebutton/api/domain/User.java | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index f84d646ac1..c7ec483e7d 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -1154,6 +1154,7 @@ class ApiController { returncode(RESP_CODE_SUCCESS) meetingName(meeting.getName()) meetingID(meeting.getExternalId()) + internalMeetingID(meeting.getInternalId()) createTime(meeting.getCreateTime()) voiceBridge(meeting.getTelVoice()) attendeePW(meeting.getViewerPassword()) @@ -1172,6 +1173,9 @@ class ApiController { userID("${att.externalUserId}") fullName("${att.fullname}") role("${att.role}") + isPresenter("${att.isPresenter()}") + hasVideoStream("${att.hasStream()}") + videoStreamName("${att.getStreamName()}") } } } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java index 380a9ccbbc..bdaaa21b31 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java @@ -59,4 +59,32 @@ public class User { public Map getStatus(){ return this.status; } + + public boolean isPresenter() { + String isPresenter = this.status.get("presenter"); + if (isPresenter != null) { + return isPresenter.equalsIgnoreCase("true"); + } + return false; + } + + public boolean hasStream() { + String hasStream = this.status.get("hasStream"); + if (hasStream != null) { + // hasStream example: "false,stream=320x24038-1328716010847" + String[] a = hasStream.split(","); + return (a.length > 0) && (a[0].equalsIgnoreCase("true")); + } + return false; + } + + public String getStreamName() { + if (this.hasStream()) { + // hasStream example: "true,stream=320x24038-1328716010847" + String str = this.status.get("hasStream"); + int pos = str.indexOf("stream="); + return str.substring(pos + 7, str.length()); + } + return ""; + } } From 1d848b1aaaf79be9c72dbd934836da4ddbadba84 Mon Sep 17 00:00:00 2001 From: Leonardo Crauss Daronco Date: Mon, 13 Feb 2012 17:04:58 -0200 Subject: [PATCH 2/7] Added "isListener" to the response of "getMeetingInfo". Had to change bbb-apps, bbb-web and bbb-client to generate and detect events when the user starts/stops its audio. The method used in bbb-client to send the externalUserId can still be improved. --- .../service/messaging/MessagingConstants.java | 2 + .../webconference/voice/Participant.java | 1 + .../webconference/voice/Room.java | 2 + .../voice/events/ParticipantJoinedEvent.java | 10 ++- .../freeswitch/FreeswitchApplication.java | 11 ++- .../voice/internal/IRoomListener.java | 28 ++++++ .../voice/internal/ParticipantImp.java | 8 +- .../ParticipantUpdatingRoomListener.java | 75 ++++++++++++++++ .../webconference/voice/internal/RoomImp.java | 52 +++++++++-- .../voice/internal/RoomManager.java | 21 +++-- .../src/main/webapp/WEB-INF/bbb-voice-app.xml | 89 ++++++++++++++----- .../web/controllers/ApiController.groovy | 1 + .../org/bigbluebutton/api/MeetingService.java | 34 ++++++- .../org/bigbluebutton/api/domain/Meeting.java | 9 ++ .../org/bigbluebutton/api/domain/User.java | 10 +++ .../api/messaging/MessageListener.java | 2 + .../api/messaging/MessagingConstants.java | 2 + .../api/messaging/RedisMessagingService.java | 12 +++ 18 files changed, 329 insertions(+), 40 deletions(-) create mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/IRoomListener.java create mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantUpdatingRoomListener.java diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/MessagingConstants.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/MessagingConstants.java index 892f4ee328..750c4b68f4 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/MessagingConstants.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/MessagingConstants.java @@ -16,4 +16,6 @@ public class MessagingConstants { public static final String USER_JOINED_EVENT = "UserJoinedEvent"; public static final String USER_LEFT_EVENT = "UserLeftEvent"; public static final String USER_STATUS_CHANGE_EVENT = "UserStatusChangeEvent"; + public static final String USER_JOINED_VOICE_EVENT = "UserJoinedVoiceEvent"; + public static final String USER_LEFT_VOICE_EVENT = "UserLeftVoiceEvent"; } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Participant.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Participant.java index 194b49af4c..aae9dbdef4 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Participant.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Participant.java @@ -25,6 +25,7 @@ public interface Participant { public boolean isMuted(); public boolean isTalking(); public int getId(); + public String getExternalUserId(); public String getName(); public boolean isMuteLocked(); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Room.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Room.java index 78e1635a42..8d4d0bffb7 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Room.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Room.java @@ -35,4 +35,6 @@ public interface Room { public boolean record(); public void recording(boolean rec); public boolean isRecording(); + public String getMeetingId(); + public void setMeetingId(String meetingid); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ParticipantJoinedEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ParticipantJoinedEvent.java index 13747d1270..1cfa3c691e 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ParticipantJoinedEvent.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ParticipantJoinedEvent.java @@ -25,15 +25,17 @@ public class ParticipantJoinedEvent extends ConferenceEvent { private final String callerIdNum; private final String callerIdName; + private final String callerIdExternalUserId; private final Boolean muted; private final Boolean speaking; private final Boolean locked = false; public ParticipantJoinedEvent(Integer participantId, String room, - String callerIdNum, String callerIdName, - Boolean muted, Boolean speaking) { + String callerIdNum, String callerIdName, String callerIdExternalUserId, + Boolean muted, Boolean speaking) { super(participantId, room); this.callerIdName = callerIdName; + this.callerIdExternalUserId = callerIdExternalUserId; this.callerIdNum = callerIdNum; this.muted = muted; this.speaking = speaking; @@ -47,6 +49,10 @@ public class ParticipantJoinedEvent extends ConferenceEvent { return callerIdName; } + public String getCallerIdExternalUserId() { + return callerIdExternalUserId; + } + public Boolean getMuted() { return muted; } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java index 49e1f8ea1f..4594e91edc 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java @@ -193,10 +193,11 @@ public class FreeswitchApplication extends Observable implements ConferenceServi Map headers = event.getEventHeaders(); String callerId = this.getCallerIdFromEvent(event); String callerIdName = this.getCallerIdNameFromEvent(event); + String callerIdExternalUserId = this.getCallerIdExternalUserIdFromEvent(event); boolean muted = headers.get("Speak").equals("true") ? false : true; //Was inverted which was causing a State issue boolean speeking = headers.get("Talking").equals("true") ? true : false; - ParticipantJoinedEvent pj = new ParticipantJoinedEvent(memberId, confName, callerId, callerIdName, muted, speeking); + ParticipantJoinedEvent pj = new ParticipantJoinedEvent(memberId, confName, callerId, callerIdName, callerIdExternalUserId, muted, speeking); conferenceEventListener.handleConferenceEvent(pj); } @@ -365,7 +366,13 @@ public class FreeswitchApplication extends Observable implements ConferenceServi private String getCallerIdNameFromEvent(EslEvent e) { - return e.getEventHeaders().get("Caller-Caller-ID-Name"); + return e.getEventHeaders().get("Caller-Caller-ID-Name").split(";")[0]; + } + + private String getCallerIdExternalUserIdFromEvent(EslEvent e) + { + // TODO: this information should get here in another header section + return e.getEventHeaders().get("Caller-Caller-ID-Name").split(";")[1]; } private String getRecordFilenameFromEvent(EslEvent e) { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/IRoomListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/IRoomListener.java new file mode 100644 index 0000000000..1114cb726a --- /dev/null +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/IRoomListener.java @@ -0,0 +1,28 @@ +/** +* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ +* +* Copyright (c) 2010 BigBlueButton Inc. and by respective authors (see below). +* +* This program is free software; you can redistribute it and/or modify it under the +* terms of the GNU Lesser General Public License as published by the Free Software +* Foundation; either version 2.1 of the License, or (at your option) any later +* version. +* +* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY +* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public License along +* with BigBlueButton; if not, see . +* +*/ + +package org.bigbluebutton.webconference.voice.internal; + +import org.bigbluebutton.webconference.voice.Participant; + +public interface IRoomListener { + public String getName(); + public void participantJoined(Participant participant); + public void participantLeft(Participant participant); +} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantImp.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantImp.java index af95fd1b4d..5287e3f48f 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantImp.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantImp.java @@ -28,14 +28,16 @@ import net.jcip.annotations.ThreadSafe; @ThreadSafe class ParticipantImp implements Participant { private final int id; + private final String externalUserId; private final String name; private boolean muted = false; private boolean talking = false; private boolean locked = false; - ParticipantImp(int id, String name) { + ParticipantImp(int id, String name, String externalUserId) { this.id = id; this.name = name; + this.externalUserId = externalUserId; } synchronized void setTalking(boolean talking) { @@ -69,4 +71,8 @@ class ParticipantImp implements Participant { public String getName() { return name; } + + public String getExternalUserId() { + return externalUserId; + } } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantUpdatingRoomListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantUpdatingRoomListener.java new file mode 100644 index 0000000000..01729c3d15 --- /dev/null +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantUpdatingRoomListener.java @@ -0,0 +1,75 @@ +/** +* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ +* +* Copyright (c) 2010 BigBlueButton Inc. and by respective authors (see below). +* +* This program is free software; you can redistribute it and/or modify it under the +* terms of the GNU Lesser General Public License as published by the Free Software +* Foundation; either version 2.1 of the License, or (at your option) any later +* version. +* +* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY +* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public License along +* with BigBlueButton; if not, see . +* +*/ + +package org.bigbluebutton.webconference.voice.internal; + +import java.util.HashMap; + +import org.bigbluebutton.conference.service.messaging.MessagingConstants; +import org.bigbluebutton.conference.service.messaging.MessagingService; +import org.bigbluebutton.webconference.voice.Room; +import org.bigbluebutton.webconference.voice.Participant; +import org.red5.logging.Red5LoggerFactory; +import org.slf4j.Logger; + +import com.google.gson.Gson; + + +public class ParticipantUpdatingRoomListener implements IRoomListener { + + private static Logger log = Red5LoggerFactory.getLogger(ParticipantUpdatingRoomListener.class, "bigbluebutton"); + + MessagingService messagingService; + private Room room; + + public ParticipantUpdatingRoomListener(Room room, MessagingService messagingService) { + this.room = room; + this.messagingService = messagingService; + } + + public String getName() { + return "VOICE:PARTICIPANT:UPDATE:ROOM"; + } + + public void participantJoined(Participant p) { + if (messagingService != null) { + HashMap map= new HashMap(); + map.put("meetingId", this.room.getMeetingId()); + map.put("messageId", MessagingConstants.USER_JOINED_VOICE_EVENT); + map.put("externalUserId", p.getExternalUserId()); + + Gson gson= new Gson(); + messagingService.send(MessagingConstants.PARTICIPANTS_CHANNEL, gson.toJson(map)); + log.debug("Publishing message participant joined voice in " + this.room.getMeetingId()); + } + } + + public void participantLeft(Participant p) { + if (messagingService != null) { + HashMap map= new HashMap(); + map.put("meetingId", this.room.getMeetingId()); + map.put("messageId", MessagingConstants.USER_LEFT_VOICE_EVENT); + map.put("externalUserId", p.getExternalUserId()); + + Gson gson= new Gson(); + messagingService.send(MessagingConstants.PARTICIPANTS_CHANNEL, gson.toJson(map)); + log.debug("Publishing message participant left voice in " + this.room.getMeetingId()); + } + } +} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomImp.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomImp.java index 099f42a0e8..b23bfcbb76 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomImp.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomImp.java @@ -23,10 +23,13 @@ package org.bigbluebutton.webconference.voice.internal; import java.util.ArrayList; import java.util.Collections; +import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import org.slf4j.Logger; +import org.red5.logging.Red5LoggerFactory; import org.bigbluebutton.webconference.voice.Participant; import org.bigbluebutton.webconference.voice.Room; @@ -34,6 +37,7 @@ import net.jcip.annotations.ThreadSafe; @ThreadSafe public class RoomImp implements Room { + private static Logger log = Red5LoggerFactory.getLogger( RoomImp.class, "bigbluebutton" ); private final String name; private final ConcurrentMap participants; @@ -42,18 +46,33 @@ public class RoomImp implements Room { private boolean record = false; private String meetingid; private boolean recording = false; + + private transient final Map listeners; public RoomImp(String name,boolean record, String meetingid) { this.name = name; this.record = record; this.meetingid = meetingid; participants = new ConcurrentHashMap(); + listeners = new ConcurrentHashMap(); } public String getName() { return name; } - + + public void addRoomListener(IRoomListener listener) { + if (! listeners.containsKey(listener.getName())) { + log.debug("adding room listener"); + listeners.put(listener.getName(), listener); + } + } + + public void removeRoomListener(IRoomListener listener) { + log.debug("removing room listener"); + listeners.remove(listener); + } + public int numParticipants() { return participants.size(); } @@ -63,8 +82,22 @@ public class RoomImp implements Room { } public Participant add(Participant p) { - return participants.putIfAbsent(p.getId(), p); - } + int key = p.getId(); + if (!participants.containsKey(key)) { + participants.put(key, p); + + log.debug("Informing roomlisteners " + listeners.size()); + for (Iterator it = listeners.values().iterator(); it.hasNext();) { + IRoomListener listener = (IRoomListener) it.next(); + log.debug("calling participantJoined on listener " + listener.getName()); + listener.participantJoined(p); + } + + return p; + } else { + return participants.get(key); + } + } public boolean hasParticipant(Integer id) { return participants.containsKey(id); @@ -72,7 +105,14 @@ public class RoomImp implements Room { public void remove(Integer id) { Participant p = participants.remove(id); - if (p != null) p = null; + if (p != null) { + for (Iterator it = listeners.values().iterator(); it.hasNext();) { + IRoomListener listener = (IRoomListener) it.next(); + log.debug("calling participantLeft on listener " + listener.getName()); + listener.participantLeft(p); + } + p = null; + } } public void mute(boolean mute) { @@ -99,11 +139,11 @@ public class RoomImp implements Room { return recording; } - public String getMeeting() { + public String getMeetingId() { return meetingid; } - public void setMeeting(String meetingid) { + public void setMeetingId(String meetingid) { this.meetingid = meetingid; } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomManager.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomManager.java index 5196d3bd62..f709cb348b 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomManager.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomManager.java @@ -21,6 +21,8 @@ package org.bigbluebutton.webconference.voice.internal; import java.util.ArrayList; import java.util.concurrent.ConcurrentHashMap; +import org.bigbluebutton.conference.Constants; +import org.bigbluebutton.conference.service.messaging.MessagingService; import org.bigbluebutton.webconference.voice.ConferenceService; import org.bigbluebutton.webconference.voice.Participant; import org.bigbluebutton.webconference.voice.VoiceEventRecorder; @@ -34,6 +36,7 @@ import org.bigbluebutton.webconference.voice.events.StartRecordingEvent; import org.red5.logging.Red5LoggerFactory; import org.slf4j.Logger; import net.jcip.annotations.ThreadSafe; +//import org.red5.server.api.IConnection; @ThreadSafe public class RoomManager { @@ -42,14 +45,21 @@ public class RoomManager { private final ConcurrentHashMap rooms; private ConferenceService confService; private VoiceEventRecorder recorder; + private MessagingService messagingService; public RoomManager() { rooms = new ConcurrentHashMap(); } + public void setMessagingService(MessagingService messagingService) { + this.messagingService = messagingService; + this.messagingService.start(); + } + public void createRoom(String name,boolean record, String meetingid) { log.debug("Creating room: " + name); RoomImp r = new RoomImp(name,record,meetingid); + r.addRoomListener(new ParticipantUpdatingRoomListener(r, messagingService)); rooms.putIfAbsent(name, r); } @@ -140,17 +150,18 @@ public class RoomManager { /** * Record the event if the meeting is being recorded. */ - recorder.recordConferenceEvent(event, rm.getMeeting()); + recorder.recordConferenceEvent(event, rm.getMeetingId()); } private void handleParticipantJoinedEvent(ConferenceEvent event, RoomImp rm) { log.debug("Processing ParticipantJoinedEvent for room: " + event.getRoom()); ParticipantJoinedEvent pje = (ParticipantJoinedEvent) event; - ParticipantImp p = new ParticipantImp(pje.getParticipantId(), pje.getCallerIdName()); + ParticipantImp p = new ParticipantImp(pje.getParticipantId(), pje.getCallerIdName(), pje.getCallerIdExternalUserId()); + p.setMuted(pje.getMuted()); p.setTalking(pje.getSpeaking()); - log.debug("Joined [" + p.getId() + "," + p.getName() + "," + p.isMuted() + "," + p.isTalking() + "] to room " + rm.getName()); - + log.debug("Joined [" + p.getId() + "," + p.getName() + "," + p.getExternalUserId() + "," + p.isMuted() + "," + p.isTalking() + "] to room " + rm.getName()); + rm.add(p); if ((rm.numParticipants() == 1) && rm.record() && !rm.isRecording()) { @@ -162,7 +173,7 @@ public class RoomManager { rm.recording(true); log.debug("Starting recording of voice conference"); log.warn(" ** WARNING: Prototyping only. Works only with FreeSWITCH for now. We need to come up with a generic way to trigger recording for both Asterisk and FreeSWITCH."); - confService.recordSession(event.getRoom(), rm.getMeeting()); + confService.recordSession(event.getRoom(), rm.getMeetingId()); } if (rm.isMuted() && !p.isMuted()) { diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml index 7b71bb9d51..79da2de971 100755 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml +++ b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml @@ -1,33 +1,76 @@ - + http://www.springframework.org/schema/beans/spring-beans-2.5.xsd + http://www.springframework.org/schema/util + http://www.springframework.org/schema/util/spring-util-2.0.xsd"> - - - - + + + + - + - - - - - + + + + + - - - + + + + - - - + + + - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index c7ec483e7d..7b9db89ae5 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -1176,6 +1176,7 @@ class ApiController { isPresenter("${att.isPresenter()}") hasVideoStream("${att.hasStream()}") videoStreamName("${att.getStreamName()}") + isListener("${att.isListener()}") } } } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java index f22d9a8712..fd25c10b0d 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java @@ -323,6 +323,38 @@ public class MeetingService { } log.warn("The meeting " + meetingId + " doesn't exist"); } + + @Override + public void userJoinedVoice(String meetingId, String externalUserId) { + Meeting m = getMeeting(meetingId); + if (m != null) { + User user = m.getUserByExternalId(externalUserId); + if(user != null){ + user.setIsListener(true); + log.debug("The user " + user.getFullname() + " joined the voice meeting in the meeting " + meetingId); + return; + } + log.warn("The participant " + externalUserId + " doesn't exist in the meeting " + meetingId); + return; + } + log.warn("The meeting " + meetingId + " doesn't exist"); + } + + @Override + public void userLeftVoice(String meetingId, String externalUserId) { + Meeting m = getMeeting(meetingId); + if (m != null) { + User user = m.getUserByExternalId(externalUserId); + if(user != null){ + user.setIsListener(false); + log.debug("The user " + user.getFullname() + " left the voice meeting in the meeting " + meetingId); + return; + } + log.warn("The participant " + externalUserId + " doesn't exist in the meeting " + meetingId); + return; + } + log.warn("The meeting " + meetingId + " doesn't exist"); + } } -} \ No newline at end of file +} diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java index dbc94b6a41..93e357fb52 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java @@ -175,6 +175,15 @@ public class Meeting { public User getUserById(String id){ return this.users.get(id); } + + public User getUserByExternalId(String externalUserId){ + for (String key : users.keySet()) { + User u = (User) users.get(key); + if (u.getExternalUserId().equals(externalUserId)) + return u; + } + return null; + } public int getNumUsers(){ return this.users.size(); diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java index bdaaa21b31..8ea1ee35f8 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java @@ -9,6 +9,7 @@ public class User { private String fullname; private String role; private Map status; + private boolean isListener; public User(String internalUserId, String externalUserId, String fullname, String role) { this.internalUserId = internalUserId; @@ -16,6 +17,7 @@ public class User { this.fullname = fullname; this.role = role; this.status = new ConcurrentHashMap(); + this.isListener = false; } public String getInternalUserId() { @@ -60,6 +62,14 @@ public class User { return this.status; } + public boolean isListener() { + return isListener; + } + + public void setIsListener(boolean isListener) { + this.isListener = isListener; + } + public boolean isPresenter() { String isPresenter = this.status.get("presenter"); if (isPresenter != null) { diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageListener.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageListener.java index 25cbdd6a3b..aafe7fb581 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageListener.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageListener.java @@ -6,4 +6,6 @@ public interface MessageListener { void userJoined(String meetingId, String internalUserId, String externalUserId, String name, String role); void userLeft(String meetingId, String internalUserId); void updatedStatus(String meetingId, String internalUserId, String status, String value); + void userJoinedVoice(String meetingId, String externalUserId); + void userLeftVoice(String meetingId, String externalUserId); } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingConstants.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingConstants.java index 47fc64626e..a50989338b 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingConstants.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessagingConstants.java @@ -16,4 +16,6 @@ public class MessagingConstants { public static final String USER_JOINED_EVENT = "UserJoinedEvent"; public static final String USER_LEFT_EVENT = "UserLeftEvent"; public static final String USER_STATUS_CHANGE_EVENT = "UserStatusChangeEvent"; + public static final String USER_JOINED_VOICE_EVENT = "UserJoinedVoiceEvent"; + public static final String USER_LEFT_VOICE_EVENT = "UserLeftVoiceEvent"; } 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 3fcd5f066d..114db0210c 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java @@ -160,6 +160,18 @@ public class RedisMessagingService implements MessagingService { for (MessageListener listener : listeners) { listener.userLeft(meetingId, internalUserId); } + } else if(MessagingConstants.USER_JOINED_VOICE_EVENT.equalsIgnoreCase(messageId)){ + String externalUserId = map.get("externalUserId"); + + for (MessageListener listener : listeners) { + listener.userJoinedVoice(meetingId, externalUserId); + } + } else if(MessagingConstants.USER_LEFT_VOICE_EVENT.equalsIgnoreCase(messageId)){ + String externalUserId = map.get("externalUserId"); + + for (MessageListener listener : listeners) { + listener.userLeftVoice(meetingId, externalUserId); + } } } } From f6f744cf5e6bf3cd36d9993afb86f9f40ba572e2 Mon Sep 17 00:00:00 2001 From: Leonardo Crauss Daronco Date: Thu, 16 Feb 2012 13:48:26 -0200 Subject: [PATCH 3/7] Removed the tag from getMeetingInfo and added a tag . This is a simpler solution that doesn't require matching a voice conference user with a "normal" user. --- .../webconference/voice/Participant.java | 1 - .../voice/events/ParticipantJoinedEvent.java | 8 +------ .../freeswitch/FreeswitchApplication.java | 11 ++------- .../voice/internal/ParticipantImp.java | 8 +------ .../ParticipantUpdatingRoomListener.java | 2 -- .../voice/internal/RoomManager.java | 4 ++-- .../web/controllers/ApiController.groovy | 2 +- .../org/bigbluebutton/api/MeetingService.java | 22 +++++------------- .../org/bigbluebutton/api/domain/Meeting.java | 23 +++++++++++-------- .../org/bigbluebutton/api/domain/User.java | 10 -------- .../api/messaging/MessageListener.java | 4 ++-- .../api/messaging/RedisMessagingService.java | 8 ++----- 12 files changed, 31 insertions(+), 72 deletions(-) diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Participant.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Participant.java index aae9dbdef4..194b49af4c 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Participant.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/Participant.java @@ -25,7 +25,6 @@ public interface Participant { public boolean isMuted(); public boolean isTalking(); public int getId(); - public String getExternalUserId(); public String getName(); public boolean isMuteLocked(); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ParticipantJoinedEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ParticipantJoinedEvent.java index 1cfa3c691e..a9bab043e1 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ParticipantJoinedEvent.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ParticipantJoinedEvent.java @@ -25,17 +25,15 @@ public class ParticipantJoinedEvent extends ConferenceEvent { private final String callerIdNum; private final String callerIdName; - private final String callerIdExternalUserId; private final Boolean muted; private final Boolean speaking; private final Boolean locked = false; public ParticipantJoinedEvent(Integer participantId, String room, - String callerIdNum, String callerIdName, String callerIdExternalUserId, + String callerIdNum, String callerIdName, Boolean muted, Boolean speaking) { super(participantId, room); this.callerIdName = callerIdName; - this.callerIdExternalUserId = callerIdExternalUserId; this.callerIdNum = callerIdNum; this.muted = muted; this.speaking = speaking; @@ -49,10 +47,6 @@ public class ParticipantJoinedEvent extends ConferenceEvent { return callerIdName; } - public String getCallerIdExternalUserId() { - return callerIdExternalUserId; - } - public Boolean getMuted() { return muted; } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java index 4594e91edc..7835852f20 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java @@ -193,11 +193,10 @@ public class FreeswitchApplication extends Observable implements ConferenceServi Map headers = event.getEventHeaders(); String callerId = this.getCallerIdFromEvent(event); String callerIdName = this.getCallerIdNameFromEvent(event); - String callerIdExternalUserId = this.getCallerIdExternalUserIdFromEvent(event); boolean muted = headers.get("Speak").equals("true") ? false : true; //Was inverted which was causing a State issue boolean speeking = headers.get("Talking").equals("true") ? true : false; - ParticipantJoinedEvent pj = new ParticipantJoinedEvent(memberId, confName, callerId, callerIdName, callerIdExternalUserId, muted, speeking); + ParticipantJoinedEvent pj = new ParticipantJoinedEvent(memberId, confName, callerId, callerIdName, muted, speeking); conferenceEventListener.handleConferenceEvent(pj); } @@ -366,15 +365,9 @@ public class FreeswitchApplication extends Observable implements ConferenceServi private String getCallerIdNameFromEvent(EslEvent e) { - return e.getEventHeaders().get("Caller-Caller-ID-Name").split(";")[0]; + return e.getEventHeaders().get("Caller-Caller-ID-Name"); } - private String getCallerIdExternalUserIdFromEvent(EslEvent e) - { - // TODO: this information should get here in another header section - return e.getEventHeaders().get("Caller-Caller-ID-Name").split(";")[1]; - } - private String getRecordFilenameFromEvent(EslEvent e) { return e.getEventHeaders().get("Path"); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantImp.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantImp.java index 5287e3f48f..af95fd1b4d 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantImp.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantImp.java @@ -28,16 +28,14 @@ import net.jcip.annotations.ThreadSafe; @ThreadSafe class ParticipantImp implements Participant { private final int id; - private final String externalUserId; private final String name; private boolean muted = false; private boolean talking = false; private boolean locked = false; - ParticipantImp(int id, String name, String externalUserId) { + ParticipantImp(int id, String name) { this.id = id; this.name = name; - this.externalUserId = externalUserId; } synchronized void setTalking(boolean talking) { @@ -71,8 +69,4 @@ class ParticipantImp implements Participant { public String getName() { return name; } - - public String getExternalUserId() { - return externalUserId; - } } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantUpdatingRoomListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantUpdatingRoomListener.java index 01729c3d15..463ed82f84 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantUpdatingRoomListener.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/ParticipantUpdatingRoomListener.java @@ -52,7 +52,6 @@ public class ParticipantUpdatingRoomListener implements IRoomListener { HashMap map= new HashMap(); map.put("meetingId", this.room.getMeetingId()); map.put("messageId", MessagingConstants.USER_JOINED_VOICE_EVENT); - map.put("externalUserId", p.getExternalUserId()); Gson gson= new Gson(); messagingService.send(MessagingConstants.PARTICIPANTS_CHANNEL, gson.toJson(map)); @@ -65,7 +64,6 @@ public class ParticipantUpdatingRoomListener implements IRoomListener { HashMap map= new HashMap(); map.put("meetingId", this.room.getMeetingId()); map.put("messageId", MessagingConstants.USER_LEFT_VOICE_EVENT); - map.put("externalUserId", p.getExternalUserId()); Gson gson= new Gson(); messagingService.send(MessagingConstants.PARTICIPANTS_CHANNEL, gson.toJson(map)); diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomManager.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomManager.java index f709cb348b..088fbfa417 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomManager.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/internal/RoomManager.java @@ -156,11 +156,11 @@ public class RoomManager { private void handleParticipantJoinedEvent(ConferenceEvent event, RoomImp rm) { log.debug("Processing ParticipantJoinedEvent for room: " + event.getRoom()); ParticipantJoinedEvent pje = (ParticipantJoinedEvent) event; - ParticipantImp p = new ParticipantImp(pje.getParticipantId(), pje.getCallerIdName(), pje.getCallerIdExternalUserId()); + ParticipantImp p = new ParticipantImp(pje.getParticipantId(), pje.getCallerIdName()); p.setMuted(pje.getMuted()); p.setTalking(pje.getSpeaking()); - log.debug("Joined [" + p.getId() + "," + p.getName() + "," + p.getExternalUserId() + "," + p.isMuted() + "," + p.isTalking() + "] to room " + rm.getName()); + log.debug("Joined [" + p.getId() + "," + p.getName() + "," + p.isMuted() + "," + p.isTalking() + "] to room " + rm.getName()); rm.add(p); diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index 7b9db89ae5..c7b5730ea1 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -1167,6 +1167,7 @@ class ApiController { participantCount(meeting.getNumUsers()) maxUsers(meeting.getMaxUsers()) moderatorCount(meeting.getNumModerators()) + listenerCount(meeting.getNumListeners()) attendees() { meeting.getUsers().each { att -> attendee() { @@ -1176,7 +1177,6 @@ class ApiController { isPresenter("${att.isPresenter()}") hasVideoStream("${att.hasStream()}") videoStreamName("${att.getStreamName()}") - isListener("${att.isListener()}") } } } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java index fd25c10b0d..7d75b79780 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java @@ -325,32 +325,22 @@ public class MeetingService { } @Override - public void userJoinedVoice(String meetingId, String externalUserId) { + public void userJoinedVoice(String meetingId) { Meeting m = getMeeting(meetingId); if (m != null) { - User user = m.getUserByExternalId(externalUserId); - if(user != null){ - user.setIsListener(true); - log.debug("The user " + user.getFullname() + " joined the voice meeting in the meeting " + meetingId); - return; - } - log.warn("The participant " + externalUserId + " doesn't exist in the meeting " + meetingId); + m.userJoinedVoice(); + log.debug("A user joined the voice conference in the meeting " + meetingId); return; } log.warn("The meeting " + meetingId + " doesn't exist"); } @Override - public void userLeftVoice(String meetingId, String externalUserId) { + public void userLeftVoice(String meetingId) { Meeting m = getMeeting(meetingId); if (m != null) { - User user = m.getUserByExternalId(externalUserId); - if(user != null){ - user.setIsListener(false); - log.debug("The user " + user.getFullname() + " left the voice meeting in the meeting " + meetingId); - return; - } - log.warn("The participant " + externalUserId + " doesn't exist in the meeting " + meetingId); + m.userLeftVoice(); + log.debug("A user left the voice conference in the meeting " + meetingId); return; } log.warn("The meeting " + meetingId + " doesn't exist"); diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java index 93e357fb52..add57d2b50 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java @@ -46,6 +46,7 @@ public class Meeting { private int maxUsers; private boolean record; private String dialNumber; + private int listenerCount = 0; private Map metadata; private final ConcurrentMap users; @@ -176,15 +177,6 @@ public class Meeting { return this.users.get(id); } - public User getUserByExternalId(String externalUserId){ - for (String key : users.keySet()) { - User u = (User) users.get(key); - if (u.getExternalUserId().equals(externalUserId)) - return u; - } - return null; - } - public int getNumUsers(){ return this.users.size(); } @@ -238,6 +230,19 @@ public class Meeting { System.out.println("Expiry " + now + " endTime=" + endTime + "expiry=" + (expiry * MILLIS_IN_A_MINUTE)); return (System.currentTimeMillis() - endTime > (expiry * MILLIS_IN_A_MINUTE)); } + + public void userJoinedVoice() { + listenerCount++; + } + + public void userLeftVoice() { + listenerCount--; + } + + public int getNumListeners() { + return listenerCount; + } + /*** * Meeting Builder diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java index 8ea1ee35f8..bdaaa21b31 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java @@ -9,7 +9,6 @@ public class User { private String fullname; private String role; private Map status; - private boolean isListener; public User(String internalUserId, String externalUserId, String fullname, String role) { this.internalUserId = internalUserId; @@ -17,7 +16,6 @@ public class User { this.fullname = fullname; this.role = role; this.status = new ConcurrentHashMap(); - this.isListener = false; } public String getInternalUserId() { @@ -62,14 +60,6 @@ public class User { return this.status; } - public boolean isListener() { - return isListener; - } - - public void setIsListener(boolean isListener) { - this.isListener = isListener; - } - public boolean isPresenter() { String isPresenter = this.status.get("presenter"); if (isPresenter != null) { diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageListener.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageListener.java index aafe7fb581..7bb8040496 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageListener.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/MessageListener.java @@ -6,6 +6,6 @@ public interface MessageListener { void userJoined(String meetingId, String internalUserId, String externalUserId, String name, String role); void userLeft(String meetingId, String internalUserId); void updatedStatus(String meetingId, String internalUserId, String status, String value); - void userJoinedVoice(String meetingId, String externalUserId); - void userLeftVoice(String meetingId, String externalUserId); + void userJoinedVoice(String meetingId); + void userLeftVoice(String meetingId); } 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 114db0210c..b1fe668fce 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/messaging/RedisMessagingService.java @@ -161,16 +161,12 @@ public class RedisMessagingService implements MessagingService { listener.userLeft(meetingId, internalUserId); } } else if(MessagingConstants.USER_JOINED_VOICE_EVENT.equalsIgnoreCase(messageId)){ - String externalUserId = map.get("externalUserId"); - for (MessageListener listener : listeners) { - listener.userJoinedVoice(meetingId, externalUserId); + listener.userJoinedVoice(meetingId); } } else if(MessagingConstants.USER_LEFT_VOICE_EVENT.equalsIgnoreCase(messageId)){ - String externalUserId = map.get("externalUserId"); - for (MessageListener listener : listeners) { - listener.userLeftVoice(meetingId, externalUserId); + listener.userLeftVoice(meetingId); } } } From 6a5c39d012f6a69b54bc6cd4aad8dc0ad9ba6b6d Mon Sep 17 00:00:00 2001 From: Leonardo Crauss Daronco Date: Tue, 3 Apr 2012 12:04:29 -0300 Subject: [PATCH 4/7] Added to the reponse of getMeetings. --- .../org/bigbluebutton/web/controllers/ApiController.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index c7b5730ea1..7bd6aecf23 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -667,6 +667,7 @@ class ApiController { moderatorPW(m.getModeratorPassword()) hasBeenForciblyEnded(m.isForciblyEnded() ? "true" : "false") running(m.isRunning() ? "true" : "false") + participantCount(m.getNumUsers()) } } } From 1f4c32cef3c34a965d4bcf07f4803047a3852f7c Mon Sep 17 00:00:00 2001 From: Leonardo Crauss Daronco Date: Fri, 25 May 2012 14:19:15 -0300 Subject: [PATCH 5/7] Added and to the response of 'getMeetings'. --- .../bigbluebutton/web/controllers/ApiController.groovy | 2 ++ .../src/java/org/bigbluebutton/api/domain/Meeting.java | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index 7bd6aecf23..afcba47321 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -668,6 +668,8 @@ class ApiController { hasBeenForciblyEnded(m.isForciblyEnded() ? "true" : "false") running(m.isRunning() ? "true" : "false") participantCount(m.getNumUsers()) + listenerCount(m.getNumListeners()) + videoCount(m.getNumVideos()) } } } diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java index add57d2b50..7318fff33f 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Meeting.java @@ -243,6 +243,15 @@ public class Meeting { return listenerCount; } + public int getNumVideos() { + int sum = 0; + for (String key : users.keySet()) { + User u = (User) users.get(key); + if (u.hasStream()) sum++; + } + return sum; + } + /*** * Meeting Builder From b1c83f4917a83d7313e74c7eef0d54352a0f5934 Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Mon, 14 Oct 2013 11:41:10 -0300 Subject: [PATCH 6/7] fixing the issue introduced during the merge --- bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml index cc19a12ac4..c8a22dbe77 100755 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml +++ b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml @@ -21,8 +21,11 @@ with BigBlueButton; if not, see . + http://www.springframework.org/schema/beans/spring-beans-2.5.xsd + http://www.springframework.org/schema/util + http://www.springframework.org/schema/util/spring-util-2.0.xsd"> From 0cf35712cf775be5919d403554f75039bb92b08b Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Mon, 14 Oct 2013 11:48:39 -0300 Subject: [PATCH 7/7] added and on create and getMeetings call --- .../bigbluebutton/web/controllers/ApiController.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index 36562ef64a..96d49f1aec 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -742,8 +742,10 @@ class ApiController { mtgs.each { m -> meeting() { meetingID(m.getExternalId()) - meetingName(m.getName()) - createTime(m.getCreateTime()) + meetingName(m.getName()) + createTime(m.getCreateTime()) + voiceBridge(m.getTelVoice()) + dialNumber(m.getDialNumber()) attendeePW(m.getViewerPassword()) moderatorPW(m.getModeratorPassword()) hasBeenForciblyEnded(m.isForciblyEnded() ? "true" : "false") @@ -1505,6 +1507,8 @@ class ApiController { attendeePW(meeting.getViewerPassword()) moderatorPW(meeting.getModeratorPassword()) createTime(meeting.getCreateTime()) + voiceBridge(meeting.getTelVoice()) + dialNumber(meeting.getDialNumber()) hasBeenForciblyEnded(meeting.isForciblyEnded() ? "true" : "false") messageKey(msgKey == null ? "" : msgKey) message(msg == null ? "" : msg)