diff --git a/labs/akka-bbb-apps/build.sbt b/labs/akka-bbb-apps/build.sbt index 2fbfbf15f907a76e0e7d2882c37139c1a6f337c2..b17eafe18b4ff4bbc2604cc58b74403618eee17c 100755 --- a/labs/akka-bbb-apps/build.sbt +++ b/labs/akka-bbb-apps/build.sbt @@ -56,7 +56,6 @@ libraryDependencies ++= { "org.apache.commons" % "commons-lang3" % "3.2" )} -libraryDependencies += "org.freeswitch" % "fs-esl-client" % "0.8.2" from "http://blindside.googlecode.com/svn/repository/org/freeswitch/fs-esl-client/0.8.2/fs-esl-client-0.8.2.jar" seq(Revolver.settings: _*) diff --git a/labs/akka-bbb-apps/src/main/scala/org/bigbluebutton/Boot.scala b/labs/akka-bbb-apps/src/main/scala/org/bigbluebutton/Boot.scala index c89272e37a69b43b8beaeab956719551760860b7..5774cfea2375acd8c17e25462ee22c053a89343b 100755 --- a/labs/akka-bbb-apps/src/main/scala/org/bigbluebutton/Boot.scala +++ b/labs/akka-bbb-apps/src/main/scala/org/bigbluebutton/Boot.scala @@ -37,13 +37,9 @@ object Boot extends App with SystemConfiguration { senders.add(whiteboardSender) val outGW = new MessageOutGateway(senders) - val bbbGW = new BigBlueButtonGateway(system, outGW) - val bbbInGW = new BigBlueButtonInGW(bbbGW) - val redisMsgReceiver = new RedisMessageReceiver(bbbInGW) - val redisSubscriberActor = system.actorOf( - AppsRedisSubscriberActor.props(redisMsgReceiver), "redis-subscriber") + val redisSubscriberActor = system.actorOf(AppsRedisSubscriberActor.props(redisMsgReceiver), "redis-subscriber") } \ No newline at end of file diff --git a/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/FreeswitchConferenceEventListener.java b/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/FreeswitchConferenceEventListener.java index fb30de3eeaae944223988014f71cd143e3b73213..638770574c6c7fff2d6a177d16aa17d902d3419f 100755 --- a/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/FreeswitchConferenceEventListener.java +++ b/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/FreeswitchConferenceEventListener.java @@ -38,10 +38,10 @@ public class FreeswitchConferenceEventListener implements ConferenceEventListene private static final Executor runExec = Executors.newFixedThreadPool(SENDERTHREADS); private BlockingQueue<VoiceConferenceEvent> messages = new LinkedBlockingQueue<VoiceConferenceEvent>(); - private volatile boolean sendMessages = false; - private IVoiceConferenceService vcs; + private volatile boolean sendMessages = false; + private final IVoiceConferenceService vcs; - public void setVoiceConferenceService(IVoiceConferenceService vcs) { + public FreeswitchConferenceEventListener(IVoiceConferenceService vcs) { this.vcs = vcs; } diff --git a/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ConnectionManager.java b/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ConnectionManager.java index 59ec85ff0b83256325c0169e8be9066ff85b8f96..8d6662d8faad9c26aa34bb4f5d4dbeb38f8df238 100755 --- a/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ConnectionManager.java +++ b/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ConnectionManager.java @@ -41,13 +41,19 @@ public class ConnectionManager { private static final ScheduledExecutorService connExec = Executors.newSingleThreadScheduledExecutor(); - private ManagerConnection manager; + private final ManagerConnection manager; private ScheduledFuture<ConnectThread> connectTask; private volatile boolean subscribed = false; - private ConferenceEventListener conferenceEventListener; - private ESLEventListener eslEventListener; + private final ConferenceEventListener conferenceEventListener; + private final ESLEventListener eslEventListener; + + public ConnectionManager(ManagerConnection connManager, ESLEventListener eventListener, ConferenceEventListener confListener) { + this.manager = connManager; + this.eslEventListener = eventListener; + this.conferenceEventListener = confListener; + } private void connect() { try { @@ -137,18 +143,5 @@ public class ConnectionManager { EslMessage response = c.sendSyncApiCommand(rcc.getCommand(), rcc.getCommandArgs()); rcc.handleResponse(response, conferenceEventListener); } - } - - public void setManagerConnection(ManagerConnection manager) { - this.manager = manager; - } - - public void setESLEventListener(ESLEventListener listener) { - this.eslEventListener = listener; - } - - public void setConferenceEventListener(ConferenceEventListener listener) { - this.conferenceEventListener = listener; - } - + } } \ No newline at end of file diff --git a/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java b/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java index 1bfd7c249a968f51f737936fc8befa3b4f54a96f..7e6c2b4a3432f8228b8714121cfd66b64c50a0bf 100755 --- a/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java +++ b/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java @@ -23,7 +23,11 @@ public class ESLEventListener implements IEslEventListener { private static final String START_RECORDING_EVENT = "start-recording"; private static final String STOP_RECORDING_EVENT = "stop-recording"; - private ConferenceEventListener conferenceEventListener; + private final ConferenceEventListener conferenceEventListener; + + public ESLEventListener(ConferenceEventListener conferenceEventListener) { + this.conferenceEventListener = conferenceEventListener; + } @Override public void conferenceEventPlayFile(String uniqueId, String confName, int confSize, EslEvent event) { @@ -191,12 +195,4 @@ public class ESLEventListener implements IEslEventListener { private String getRecordFilenameFromEvent(EslEvent e) { return e.getEventHeaders().get("Path"); } - - /*private String getRecordTimestampFromEvent(EslEvent e) { - return e.getEventHeaders().get("Event-Date-Timestamp"); - }*/ - - public void setConferenceEventListener(ConferenceEventListener listener) { - this.conferenceEventListener = listener; - } } diff --git a/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/FreeswitchApplication.java b/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/FreeswitchApplication.java index 3a31fe7ba3b2c05fe15450f0a4b6935875395ec3..8157bddb8024cad6b162d10bad55dd1f38b74c77 100755 --- a/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/FreeswitchApplication.java +++ b/labs/akka-bbb-fs/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/FreeswitchApplication.java @@ -24,8 +24,6 @@ import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; - -import org.bigbluebutton.freeswitch.voice.ConferenceServiceProvider; import org.bigbluebutton.freeswitch.voice.freeswitch.actions.BroadcastConferenceCommand; import org.bigbluebutton.freeswitch.voice.freeswitch.actions.EjectAllUsersCommand; import org.bigbluebutton.freeswitch.voice.freeswitch.actions.EjectParticipantCommand; @@ -34,170 +32,117 @@ import org.bigbluebutton.freeswitch.voice.freeswitch.actions.MuteParticipantComm import org.bigbluebutton.freeswitch.voice.freeswitch.actions.PopulateRoomCommand; import org.bigbluebutton.freeswitch.voice.freeswitch.actions.RecordConferenceCommand; -public class FreeswitchApplication implements ConferenceServiceProvider { +public class FreeswitchApplication { private static final int SENDERTHREADS = 1; private static final Executor msgSenderExec = Executors.newFixedThreadPool(SENDERTHREADS); private static final Executor runExec = Executors.newFixedThreadPool(SENDERTHREADS); private BlockingQueue<FreeswitchCommand> messages = new LinkedBlockingQueue<FreeswitchCommand>(); - private ConnectionManager manager; - - private String icecastProtocol = "shout"; - private String icecastHost = "localhost"; - private int icecastPort = 8000; - private String icecastUsername = "source"; - private String icecastPassword = "hackme"; - private String icecastStreamExtension = ".mp3"; - private Boolean icecastBroadcast = false; - - private final String USER = "0"; /* not used for now */ - - private volatile boolean sendMessages = false; - - private void queueMessage(FreeswitchCommand command) { - try { - messages.offer(command, 5, TimeUnit.SECONDS); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @Override - public void populateRoom(String room) { - PopulateRoomCommand prc = new PopulateRoomCommand(room, USER); - queueMessage(prc); - } - - public void mute(String room, String participant, Boolean mute) { - MuteParticipantCommand mpc = new MuteParticipantCommand(room, participant, mute, USER); - queueMessage(mpc); - } - - public void eject(String room, String participant) { - EjectParticipantCommand mpc = new EjectParticipantCommand(room, participant, USER); - queueMessage(mpc); - } - - @Override - public void ejectAll(String room) { - EjectAllUsersCommand mpc = new EjectAllUsersCommand(room, USER); - queueMessage(mpc); - } - - private Long genTimestamp() { - return TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - } - - @Override - public void record(String room, String meetingid){ - String RECORD_DIR = "/var/freeswitch/meetings"; - String voicePath = RECORD_DIR + File.separatorChar + meetingid + "-" + genTimestamp() + ".wav"; - - RecordConferenceCommand rcc = new RecordConferenceCommand(room, USER, true, voicePath); - queueMessage(rcc); - } - - @Override - public void broadcast(String room, String meetingid) { - if (icecastBroadcast) { - broadcastToIcecast(room, meetingid); - } - } - - private void broadcastToIcecast(String room, String meetingid) { - String shoutPath = icecastProtocol + "://" + icecastUsername + ":" + icecastPassword + "@" + icecastHost + ":" + icecastPort - + File.separatorChar + meetingid + "." + icecastStreamExtension; - - BroadcastConferenceCommand rcc = new BroadcastConferenceCommand(room, USER, true, shoutPath); - queueMessage(rcc); - } - - public void setConnectionManager(ConnectionManager manager) { - this.manager = manager; - } - - public void setIcecastProtocol(String protocol) { - icecastProtocol = protocol; - } - - public void setIcecastHost(String host) { - icecastHost = host; - } - - public void setIcecastPort(int port) { - icecastPort = port; - } - - public void setIcecastUsername(String username) { - icecastUsername = username; - } - - public void setIcecastPassword(String password) { - icecastPassword = password; - } - - public void setIcecastBroadcast(Boolean broadcast) { - icecastBroadcast = broadcast; - } - - public void setIcecastStreamExtension(String ext) { - icecastStreamExtension = ext; - } - - private void sendMessageToFreeswitch(final FreeswitchCommand command) { - Runnable task = new Runnable() { - public void run() { - if (command instanceof PopulateRoomCommand) { - PopulateRoomCommand cmd = (PopulateRoomCommand) command; - System.out.println("Sending PopulateRoomCommand for conference = [" + cmd.getRoom() + "]"); - manager.getUsers(cmd); - } else if (command instanceof MuteParticipantCommand) { - MuteParticipantCommand cmd = (MuteParticipantCommand) command; - System.out.println("Sending MuteParticipantCommand for conference = [" + cmd.getRoom() + "]"); - System.out.println("Sending MuteParticipantCommand for conference = [" + cmd.getRoom() + "]"); - manager.mute(cmd); - } else if (command instanceof EjectParticipantCommand) { - EjectParticipantCommand cmd = (EjectParticipantCommand) command; - System.out.println("Sending EjectParticipantCommand for conference = [" + cmd.getRoom() + "]"); - manager.eject(cmd); - } else if (command instanceof EjectAllUsersCommand) { - EjectAllUsersCommand cmd = (EjectAllUsersCommand) command; - System.out.println("Sending EjectAllUsersCommand for conference = [" + cmd.getRoom() + "]"); - manager.ejectAll(cmd); - } else if (command instanceof RecordConferenceCommand) { - manager.record((RecordConferenceCommand) command); - } else if (command instanceof BroadcastConferenceCommand) { - manager.broadcast((BroadcastConferenceCommand) command); - } - } - }; - runExec.execute(task); + private final ConnectionManager manager; + + private final String USER = "0"; /* not used for now */ + + private volatile boolean sendMessages = false; + + public FreeswitchApplication(ConnectionManager manager) { + this.manager = manager; } + + private void queueMessage(FreeswitchCommand command) { + try { + messages.offer(command, 5, TimeUnit.SECONDS); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public void populateRoom(String room) { + PopulateRoomCommand prc = new PopulateRoomCommand(room, USER); + queueMessage(prc); + } + + public void mute(String room, String participant, Boolean mute) { + MuteParticipantCommand mpc = new MuteParticipantCommand(room, participant, mute, USER); + queueMessage(mpc); + } + + public void eject(String room, String participant) { + EjectParticipantCommand mpc = new EjectParticipantCommand(room, participant, USER); + queueMessage(mpc); + } - public void start() { - sendMessages = true; - Runnable sender = new Runnable() { - public void run() { - while (sendMessages) { - FreeswitchCommand message; - try { - message = messages.take(); - sendMessageToFreeswitch(message); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + public void ejectAll(String room) { + EjectAllUsersCommand mpc = new EjectAllUsersCommand(room, USER); + queueMessage(mpc); + } + + private Long genTimestamp() { + return TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); + } + + public void record(String room, String meetingid){ + String RECORD_DIR = "/var/freeswitch/meetings"; + String voicePath = RECORD_DIR + File.separatorChar + meetingid + "-" + genTimestamp() + ".wav"; + + RecordConferenceCommand rcc = new RecordConferenceCommand(room, USER, true, voicePath); + queueMessage(rcc); + } + + private void sendMessageToFreeswitch(final FreeswitchCommand command) { + Runnable task = new Runnable() { + public void run() { + if (command instanceof PopulateRoomCommand) { + PopulateRoomCommand cmd = (PopulateRoomCommand) command; + System.out.println("Sending PopulateRoomCommand for conference = [" + cmd.getRoom() + "]"); + manager.getUsers(cmd); + } else if (command instanceof MuteParticipantCommand) { + MuteParticipantCommand cmd = (MuteParticipantCommand) command; + System.out.println("Sending MuteParticipantCommand for conference = [" + cmd.getRoom() + "]"); + System.out.println("Sending MuteParticipantCommand for conference = [" + cmd.getRoom() + "]"); + manager.mute(cmd); + } else if (command instanceof EjectParticipantCommand) { + EjectParticipantCommand cmd = (EjectParticipantCommand) command; + System.out.println("Sending EjectParticipantCommand for conference = [" + cmd.getRoom() + "]"); + manager.eject(cmd); + } else if (command instanceof EjectAllUsersCommand) { + EjectAllUsersCommand cmd = (EjectAllUsersCommand) command; + System.out.println("Sending EjectAllUsersCommand for conference = [" + cmd.getRoom() + "]"); + manager.ejectAll(cmd); + } else if (command instanceof RecordConferenceCommand) { + manager.record((RecordConferenceCommand) command); + } else if (command instanceof BroadcastConferenceCommand) { + manager.broadcast((BroadcastConferenceCommand) command); + } + } + }; + + runExec.execute(task); + } + + public void start() { + sendMessages = true; + Runnable sender = new Runnable() { + public void run() { + while (sendMessages) { + FreeswitchCommand message; + try { + message = messages.take(); + sendMessageToFreeswitch(message); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } - } - } - }; - msgSenderExec.execute(sender); - } - - public void stop() { - sendMessages = false; - } + }; + msgSenderExec.execute(sender); + } + + public void stop() { + sendMessages = false; + } } \ No newline at end of file diff --git a/labs/akka-bbb-fs/src/main/resources/application.conf b/labs/akka-bbb-fs/src/main/resources/application.conf old mode 100644 new mode 100755 index 89ab866646e716d8ee2d1ffc9e44bd36d77e10a4..0dcca5464be5303325d238179cef6ffc290cd973 --- a/labs/akka-bbb-fs/src/main/resources/application.conf +++ b/labs/akka-bbb-fs/src/main/resources/application.conf @@ -8,16 +8,18 @@ akka { stdout-loglevel = "DEBUG" } -spray.can.server { - request-timeout = 10s -} -service { - host = "192.168.153.144" - port = 8989 +freeswitch { + esl { + host="127.0.0.1" + port=8021 + password="ClueCon" + } } -api { - channel = "bbb-apps-channel" - source = "bigbluebutton-apps" -} +redis { + host="127.0.0.1" + port=6379 + password="" +} + diff --git a/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/Boot.scala b/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/Boot.scala index 245ccd7ffce054f1bc9870e7f687a5f9f910af7e..fdbe161235b912d5dec013c49d89961644ad2bea 100755 --- a/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/Boot.scala +++ b/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/Boot.scala @@ -5,17 +5,32 @@ import scala.concurrent.duration._ import redis.RedisClient import scala.concurrent.{ Future, Await } import scala.concurrent.ExecutionContext.Implicits.global -//import org.bigbluebutton.apps.MeetingManager -import org.bigbluebutton.endpoint.redis.AppsRedisPublisherActor +import org.freeswitch.esl.client.manager.DefaultManagerConnection +import org.bigbluebutton.endpoint.redis.RedisPublisher +import org.bigbluebutton.freeswitch.VoiceConferenceService +import org.bigbluebutton.freeswitch.voice.FreeswitchConferenceEventListener +import org.bigbluebutton.freeswitch.voice.freeswitch.{ ESLEventListener, ConnectionManager, FreeswitchApplication } +import org.bigbluebutton.freeswitch.voice.IVoiceConferenceService object Boot extends App with SystemConfiguration { - implicit val system = ActorSystem("bigbluebutton-apps-system") + implicit val system = ActorSystem("bigbluebutton-fsesl-system") - val redisPublisherActor = system.actorOf( - AppsRedisPublisherActor.props(system), - "redis-publisher") + val redisPublisher = new RedisPublisher(system) - // val meetingManager = system.actorOf(MeetingManager.props(redisPublisherActor), "meeting-manager") + 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) + fsApplication.start() } \ No newline at end of file diff --git a/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/SystemConfig.scala b/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/SystemConfig.scala deleted file mode 100644 index 3fbdbc4b527cf3a188f4f50ddef24186a8130027..0000000000000000000000000000000000000000 --- a/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/SystemConfig.scala +++ /dev/null @@ -1,20 +0,0 @@ -package org.bigbluebutton - -import com.typesafe.config.ConfigFactory -import scala.util.Try - -trait SystemConfiguration { - - val config = ConfigFactory.load() - - lazy val serviceHost = Try(config.getString("service.host")).getOrElse("127.0.0.1") - - lazy val servicePort = Try(config.getInt("service.port")).getOrElse(8080) - - lazy val redisHost = Try(config.getString("redis.host")).getOrElse("127.0.0.1") - - lazy val redisPort = Try(config.getInt("redis.port")).getOrElse(6379) - - lazy val apiSourceName = Try(config.getString("api.source")).getOrElse("bigbluebutton-apps") - lazy val apiChannel = Try(config.getString("api.channel")).getOrElse("bbb-apps-channel") -} \ No newline at end of file diff --git a/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/SystemConfiguration.scala b/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/SystemConfiguration.scala new file mode 100755 index 0000000000000000000000000000000000000000..cb7a5ac605d91cba13ae2be2cda4e21df1a24813 --- /dev/null +++ b/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/SystemConfiguration.scala @@ -0,0 +1,18 @@ +package org.bigbluebutton + +import com.typesafe.config.ConfigFactory +import scala.util.Try + +trait SystemConfiguration { + + val config = ConfigFactory.load() + + lazy val eslHost = Try(config.getString("freeswitch.esl.host")).getOrElse("127.0.0.1") + lazy val eslPort = Try(config.getInt("freeswitch.esl.port")).getOrElse(8021) + lazy val eslPassword = Try(config.getString("freeswitch.esl.password")).getOrElse("ClueCon") + + lazy val redisHost = Try(config.getString("redis.host")).getOrElse("127.0.0.1") + lazy val redisPort = Try(config.getInt("redis.port")).getOrElse(6379) + lazy val redisPassword = Try(config.getString("redis.password")).getOrElse("") + +} \ No newline at end of file diff --git a/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/endpoint/redis/RedisPublisher.scala b/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/endpoint/redis/RedisPublisher.scala new file mode 100755 index 0000000000000000000000000000000000000000..df8c7818a3fe1377128636583c34c4f922ef6344 --- /dev/null +++ b/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/endpoint/redis/RedisPublisher.scala @@ -0,0 +1,33 @@ +package org.bigbluebutton.endpoint.redis + +import akka.actor.Props +import redis.RedisClient +import scala.concurrent.duration._ +import scala.concurrent.ExecutionContext.Implicits.global +import akka.actor.ActorSystem +import scala.concurrent.Await +import akka.actor.Actor +import org.bigbluebutton.SystemConfiguration + +class RedisPublisher(val system: ActorSystem) extends SystemConfiguration { + + val redis = RedisClient(redisHost, redisPort)(system) + + val futurePong = redis.ping() + println("Ping sent!") + futurePong.map(pong => { + println(s"Redis replied with a $pong") + }) + + Await.result(futurePong, 5 seconds) + + // publish after 2 seconds every 2 or 5 seconds + system.scheduler.schedule(2 seconds, 2 seconds)(redis.publish("time", System.currentTimeMillis())) + // system.scheduler.schedule(2 seconds, 5 seconds)(redis.publish("bigbluebutton:to-bbb-apps:users", "pattern value")) + + def publish(channel: String, data: String) { + println("PUBLISH TO [" + channel + "]: \n [" + data + "]") + redis.publish(channel, data) + } + +} diff --git a/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/freeswitch/VoiceConferenceService.scala b/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/freeswitch/VoiceConferenceService.scala new file mode 100755 index 0000000000000000000000000000000000000000..1afd5ad5abdb3abace2d96638c8a872d212b1a78 --- /dev/null +++ b/labs/akka-bbb-fs/src/main/scala/org/bigbluebutton/freeswitch/VoiceConferenceService.scala @@ -0,0 +1,48 @@ +package org.bigbluebutton.freeswitch + +import org.bigbluebutton.freeswitch.voice.IVoiceConferenceService +import org.bigbluebutton.core.api._ +import org.bigbluebutton.endpoint.redis.RedisPublisher + +class VoiceConferenceService(sender: RedisPublisher) extends IVoiceConferenceService { + + def voiceStartedRecording(conference: String, recordingFile: String, + timestamp: String, recording: java.lang.Boolean) { + val fsRec = new FsRecording(conference, recordingFile, timestamp, recording) + + } + + def voiceUserJoined(userId: String, webUserId: String, conference: String, + callerIdNum: String, callerIdName: String, + muted: java.lang.Boolean, talking: java.lang.Boolean) { + // println("******** FreeswitchConferenceService received voiceUserJoined vui=[" + userId + "] wui=[" + webUserId + "]") + val vuj = new FsVoiceUserJoined(userId, webUserId, + conference, callerIdNum, + callerIdName, muted, + talking) + + } + + def voiceUserLeft(userId: String, conference: String) { + // println("******** FreeswitchConferenceService received voiceUserLeft vui=[" + userId + "] conference=[" + conference + "]") + val vul = new FsVoiceUserLeft(userId, conference) + + } + + def voiceUserLocked(userId: String, conference: String, locked: java.lang.Boolean) { + val vul = new FsVoiceUserLocked(userId, conference, locked) + + } + + def voiceUserMuted(userId: String, conference: String, muted: java.lang.Boolean) { + println("******** FreeswitchConferenceService received voiceUserMuted vui=[" + userId + "] muted=[" + muted + "]") + val vum = new FsVoiceUserMuted(userId, conference, muted) + + } + + def voiceUserTalking(userId: String, conference: String, talking: java.lang.Boolean) { + println("******** FreeswitchConferenceService received voiceUserTalking vui=[" + userId + "] talking=[" + talking + "]") + val vut = new FsVoiceUserTalking(userId, conference, talking) + + } +} \ No newline at end of file