fixing bugs in sending messages to bbb-web

This commit is contained in:
Markos Calderon 2013-07-04 18:26:13 -05:00
parent 944db497e2
commit 5e6cfb73ea
8 changed files with 44 additions and 13 deletions

View File

@ -34,7 +34,6 @@ public class MeetingMessageHandler implements MessageHandler {
}
if(messageId.equalsIgnoreCase(KEEP_ALIVE_REQUEST)){
String keepAliveId = map.get("aliveId");
log.debug("Sending keep alive request");
bbbGW.isAliveAudit(keepAliveId);
}
}

View File

@ -5,6 +5,7 @@ import scala.actors.Actor._
import scala.collection.mutable.HashMap
import org.bigbluebutton.core.api.CreateMeeting
import org.bigbluebutton.core.api.MeetingCreated
import org.bigbluebutton.core.api.MeetingEnded
import org.bigbluebutton.core.api.MessageOutGateway
import org.bigbluebutton.core.api.InMessage
import org.bigbluebutton.core.api.InitializeMeeting
@ -47,6 +48,7 @@ class BigBlueButtonActor(outGW: MessageOutGateway) extends Actor {
meetings.get(msg.meetingID) match {
case None => // do nothing
case Some(m) => {
outGW.send(new MeetingEnded(m.meetingID))
m ! StopMeetingActor
meetings -= msg.meetingID
}
@ -59,7 +61,7 @@ class BigBlueButtonActor(outGW: MessageOutGateway) extends Actor {
var m = new Meeting(msg.meetingID, msg.recorded, msg.voiceBridge, outGW)
m.start
meetings += m.meetingID -> m
outGW.send(new MeetingCreated(m.meetingID, m.recorded))
outGW.send(new MeetingCreated(m.meetingID))
m ! new InitializeMeeting(m.meetingID, m.recorded)
}

View File

@ -1,7 +1,8 @@
package org.bigbluebutton.core.api
abstract class OutMessage
case class MeetingCreated(meetingID: String, recorded: Boolean) extends IOutMessage
case class MeetingCreated(meetingID: String) extends IOutMessage
case class MeetingEnded(meetingID: String) extends IOutMessage
case class MeetingDestroyed(meetingID: String) extends IOutMessage
case class KeepAliveMessageReply(aliveID:String) extends IOutMessage
case object IsAliveMessage extends IOutMessage

View File

@ -63,7 +63,7 @@ class UsersApp(meetingID: String, recorded: Boolean, outGW: MessageOutGateway) {
}
private def handleUserJoin(msg: UserJoining):Unit = {
println("UsersApp: init handleUserJoin")
users.addUser(msg.userID, msg.extUserID, msg.name, msg.role)
outGW.send(new UserJoined(meetingID, recorded, msg.userID,
@ -74,7 +74,8 @@ class UsersApp(meetingID: String, recorded: Boolean, outGW: MessageOutGateway) {
if (users.isModerator(msg.userID)) {
assignNewPresenter(msg.userID, msg.name, msg.userID)
}
}
}
println("UsersApp: end handleUserJoin")
}
private def handleUserLeft(msg: UserLeaving):Unit = {

View File

@ -34,6 +34,7 @@ class UsersEventRedisPublisher(service: MessageSender) extends OutMessageListene
}
private def handleUserJoined(msg: UserJoined) {
println("UsersEventRedisPublisher: init handleUserJoined")
val map= new java.util.HashMap[String, String]();
map.put("meetingId", msg.meetingID);
map.put("messageId", MessagingConstants.USER_JOINED_EVENT);
@ -44,6 +45,7 @@ class UsersEventRedisPublisher(service: MessageSender) extends OutMessageListene
val gson= new Gson();
service.send(MessagingConstants.PARTICIPANTS_CHANNEL, gson.toJson(map));
println("UsersEventRedisPublisher: end handleUserJoined")
}
private def handleUserLeft(msg: UserLeft) {

View File

@ -4,6 +4,8 @@ import org.bigbluebutton.conference.service.messaging.redis.MessageSender
import org.bigbluebutton.core.api.OutMessageListener2
import org.bigbluebutton.core.api.IOutMessage
import org.bigbluebutton.core.api.KeepAliveMessageReply
import org.bigbluebutton.core.api.MeetingCreated
import org.bigbluebutton.core.api.MeetingEnded
import scala.collection.immutable.HashMap
import com.google.gson.Gson
import scala.collection.JavaConverters._
@ -15,16 +17,28 @@ class MeetingEventRedisPublisher(service: MessageSender) extends OutMessageListe
def handleMessage(msg: IOutMessage) {
msg match {
case meetingCreated: MeetingCreated => handleMeetingCreated(meetingCreated)
case meetingEnded: MeetingEnded => handleMeetingEnded(meetingEnded)
case keepAliveMessageReply: KeepAliveMessageReply => handleKeepAliveMessageReply(keepAliveMessageReply)
case _ => //println("Unhandled message in MeetingEventRedisPublisher")
}
}
private def handleKeepAliveMessageReply(msg: KeepAliveMessageReply):Unit = {
val gson = new Gson;
val gson = new Gson
var map = Map("messageId" -> KEEP_ALIVE_REPLY, "aliveId" -> msg.aliveID)
println("check map:" + map.asJava)
service.send(MessagingConstants.SYSTEM_CHANNEL, gson.toJson(map.asJava))
}
private def handleMeetingCreated(msg:MeetingCreated):Unit = {
val gson = new Gson
var map = Map("messageId" -> MessagingConstants.MEETING_STARTED_EVENT, "meetingId" -> msg.meetingID)
service.send(MessagingConstants.SYSTEM_CHANNEL, gson.toJson(map.asJava))
}
private def handleMeetingEnded(msg:MeetingEnded):Unit = {
val gson = new Gson
var map = Map("messageId" -> MessagingConstants.MEETING_ENDED_EVENT, "meetingId" -> msg.meetingID)
service.send(MessagingConstants.SYSTEM_CHANNEL, gson.toJson(map.asJava))
}
}

View File

@ -32,10 +32,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<property name="redisPool"> <ref bean="redisPool"/></property>
</bean>
<bean id="meetingEventRedisPublisher" class="org.bigbluebutton.core.meeting.MeetingEventRedisPublisher">
<constructor-arg ref="redisMessageSender" />
</bean>
<bean id="redisMessageReceiver" class="org.bigbluebutton.conference.service.messaging.redis.MessageReceiver" init-method="start" destroy-method="stop">
<property name="redisPool"> <ref bean="redisPool"/></property>
<property name="messageHandler"> <ref local="redisMessageHandler"/> </property>

View File

@ -93,7 +93,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<ref bean="presentationRedisRecorder" />
<ref bean="usersRedisRecorder" />
<ref bean="meetingEventRedisPublisher" />
<ref bean="pollRed5ClientSender" />
<ref bean="pollRed5ClientSender" />
<ref bean="usersRedisPublisher" />
<ref bean="pollRedisRecorder" />
</set>
</property>
</bean>
@ -117,6 +119,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<bean id="pollRed5ClientSender" class="org.bigbluebutton.core.apps.poll.red5.PollClientMessageSender">
<constructor-arg index="0" ref="connInvokerService"/>
</bean>
<bean id="meetingEventRedisPublisher" class="org.bigbluebutton.core.meeting.MeetingEventRedisPublisher">
<constructor-arg ref="redisMessageSender" />
</bean>
<bean id="usersRedisPublisher" class="org.bigbluebutton.core.apps.users.redis.UsersEventRedisPublisher">
<constructor-arg index="0" ref="redisMessageSender"/>
</bean>
<bean id="pollRedisRecorder" class="org.bigbluebutton.core.apps.poll.redis.PollEventRedisRecorder">
<constructor-arg index="0" ref="recorderApplication"/>
</bean>
<bean id="meetingMessageHandler" class="org.bigbluebutton.conference.meeting.messaging.redis.MeetingMessageHandler">
<property name="bigBlueButtonInGW"> <ref bean="bbbInGW"/></property>