Skip to content

Commit

Permalink
- delay processing of pre-uploaded presentation to make sure that me…
Browse files Browse the repository at this point in the history
…eting has been created before

   presentation conversion has completed.
  • Loading branch information
ritzalam committed Jun 19, 2017
1 parent 65d91bf commit d0343b4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ private void sendConversionCompleted(String messageKey, String conference,
@Override
public void handleMessage(String pattern, String channel, String message) {
if (channel.equalsIgnoreCase(MessagingConstants.TO_PRESENTATION_CHANNEL)) {
System.out.println("Presentation message: " + channel + " " + message);
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import org.bigbluebutton.common.messages.BroadcastLayoutMessage
import org.bigbluebutton.common.messages.UserEjectedFromMeetingMessage
import org.bigbluebutton.common.messages.LockLayoutMessage
import org.bigbluebutton.common.converters.ToJsonEncoder
import org.bigbluebutton.common.messages.TransferUserToVoiceConfRequestMessage
import org.bigbluebutton.common.messages.TransferUserToVoiceConfRequestMessage
import scala.collection.JavaConverters

object MessageSenderActor {
Expand Down
80 changes: 40 additions & 40 deletions akka-bbb-fsesl/src/main/scala/org/bigbluebutton/Boot.scala
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
package org.bigbluebutton

import akka.actor.{ ActorSystem }

import org.bigbluebutton.endpoint.redis.{ AppsRedisSubscriberActor, RedisPublisher }
import org.bigbluebutton.freeswitch.{ RxJsonMsgHdlrActor, VoiceConferenceService }
import org.bigbluebutton.freeswitch.bus.InsonMsgBus
import org.bigbluebutton.freeswitch.voice.FreeswitchConferenceEventListener
import org.bigbluebutton.freeswitch.voice.freeswitch.{ ConnectionManager, ESLEventListener, FreeswitchApplication }
package org.bigbluebutton

import akka.actor.{ ActorSystem }

import org.bigbluebutton.endpoint.redis.{ AppsRedisSubscriberActor, RedisPublisher }
import org.bigbluebutton.freeswitch.{ RxJsonMsgHdlrActor, VoiceConferenceService }
import org.bigbluebutton.freeswitch.bus.InsonMsgBus
import org.bigbluebutton.freeswitch.voice.FreeswitchConferenceEventListener
import org.bigbluebutton.freeswitch.voice.freeswitch.{ ConnectionManager, ESLEventListener, FreeswitchApplication }
import org.bigbluebutton.freeswitch.pubsub.receivers.RedisMessageReceiver
import org.freeswitch.esl.client.manager.DefaultManagerConnection

object Boot extends App with SystemConfiguration {

implicit val system = ActorSystem("bigbluebutton-fsesl-system")

val redisPublisher = new RedisPublisher(system)

val eslConnection = new DefaultManagerConnection(eslHost, eslPort, eslPassword)

val voiceConfService = new VoiceConferenceService(redisPublisher)

val fsConfEventListener = new FreeswitchConferenceEventListener(voiceConfService)
fsConfEventListener.start()

val eslEventListener = new ESLEventListener(fsConfEventListener)
val connManager = new ConnectionManager(eslConnection, eslEventListener, fsConfEventListener)

connManager.start()

val fsApplication = new FreeswitchApplication(connManager, fsProfile)
fsApplication.start()

val redisMsgReceiver = new RedisMessageReceiver(fsApplication)

val inJsonMsgBus = new InsonMsgBus
val redisMessageHandlerActor = system.actorOf(RxJsonMsgHdlrActor.props(fsApplication))
inJsonMsgBus.subscribe(redisMessageHandlerActor, toFsAppsJsonChannel)

val redisSubscriberActor = system.actorOf(AppsRedisSubscriberActor.props(system, redisMsgReceiver, inJsonMsgBus), "redis-subscriber")

}

object Boot extends App with SystemConfiguration {

implicit val system = ActorSystem("bigbluebutton-fsesl-system")

val redisPublisher = new RedisPublisher(system)

val eslConnection = new DefaultManagerConnection(eslHost, eslPort, eslPassword)

val voiceConfService = new VoiceConferenceService(redisPublisher)

val fsConfEventListener = new FreeswitchConferenceEventListener(voiceConfService)
fsConfEventListener.start()

val eslEventListener = new ESLEventListener(fsConfEventListener)
val connManager = new ConnectionManager(eslConnection, eslEventListener, fsConfEventListener)

connManager.start()

val fsApplication = new FreeswitchApplication(connManager, fsProfile)
fsApplication.start()

val redisMsgReceiver = new RedisMessageReceiver(fsApplication)

val inJsonMsgBus = new InsonMsgBus
val redisMessageHandlerActor = system.actorOf(RxJsonMsgHdlrActor.props(fsApplication))
inJsonMsgBus.subscribe(redisMessageHandlerActor, toFsAppsJsonChannel)

val redisSubscriberActor = system.actorOf(AppsRedisSubscriberActor.props(system, redisMsgReceiver, inJsonMsgBus), "redis-subscriber")

}
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ package org.bigbluebutton.modules.present.services.messaging
}

private function handleGetPresentationInfoReply(msg:Object) : void {
// trace(LOG + "*** handleGetPresentationInfoReply " + msg.msg + " **** \n");
LOGGER.debug("*** handleGetPresentationInfoReply " + msg.msg + " **** \n");
var map:Object = JSON.parse(msg.msg);

var presenterMap:Object = map.presenter as Object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class PresentationService {
// Run conversion on another thread.
Timer t = new Timer(uploadedPres.getName(), false)

t.runAfter(1000) {
t.runAfter(5000) {
try {
documentConversionService.processDocument(uploadedPres)
} finally {
Expand Down

0 comments on commit d0343b4

Please sign in to comment.