diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/messaging/RedisMessagingService.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/messaging/RedisMessagingService.java index a3efffc43690a2a451b55db34e5e00e61096695f..11da04a9f7c525a296437691cacb8284b2a82f91 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/messaging/RedisMessagingService.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/messaging/RedisMessagingService.java @@ -28,14 +28,14 @@ public class RedisMessagingService implements IMessagingService { private Map<String, String> buildRouting() { Map<String, String> routing = new HashMap<String, String>(); routing.put("msgType", "SYSTEM"); - routing.put("sender", "bbb-video"); + routing.put("sender", "bbb-voice"); return routing; } public void validateConnAuthToken(String meetingId, String userId, String authToken, String connId) { BbbCoreBaseHeader header = new BbbCoreBaseHeader("ValidateConnAuthTokenSysMsg"); ValidateConnAuthTokenSysMsgBody body = new ValidateConnAuthTokenSysMsgBody(meetingId, - userId, authToken, connId, "VIDEO"); + userId, authToken, connId, "VOICE"); ValidateConnAuthTokenSysMsg msg = new ValidateConnAuthTokenSysMsg(header, body); Map<String, String> routing = buildRouting(); diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Application.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Application.java index 682ab351bfab818d6522f8dcf7c490363cbc37e7..7bdaad0edac19bd606c9f565c21ea2752dcb6c19 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Application.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Application.java @@ -21,6 +21,8 @@ package org.bigbluebutton.voiceconf.red5; import java.util.HashMap; import java.util.Map; import java.util.Set; + +import org.bigbluebutton.voiceconf.messaging.IMessagingService; import org.slf4j.Logger; import org.bigbluebutton.voiceconf.sip.PeerNotFoundException; import org.bigbluebutton.voiceconf.sip.SipPeerManager; @@ -50,6 +52,7 @@ public class Application extends MultiThreadedApplicationAdapter { private CallStreamFactory callStreamFactory; private ConnectionInvokerService connInvokerService; + private IMessagingService messagingService; @Override public boolean appStart(IScope scope) { @@ -66,6 +69,8 @@ public class Application extends MultiThreadedApplicationAdapter { // TODO Auto-generated catch block e.printStackTrace(); } + + connInvokerService.setAppScope(scope); return super.appStart(scope); } @@ -285,4 +290,8 @@ public class Application extends MultiThreadedApplicationAdapter { public void setConnInvokerService(ConnectionInvokerService connInvokerService) { this.connInvokerService = connInvokerService; } + + public void setMessagingService(IMessagingService service) { + messagingService = service; + } } diff --git a/bbb-voice/src/main/webapp/WEB-INF/bbb-redis-messaging.xml b/bbb-voice/src/main/webapp/WEB-INF/bbb-redis-messaging.xml index 6c50ea7a70e7a2cbf49e6a7b0732dbf09048e3c7..fe19d06cc39a355141fc0d48cf604f7b9f8913bb 100755 --- a/bbb-voice/src/main/webapp/WEB-INF/bbb-redis-messaging.xml +++ b/bbb-voice/src/main/webapp/WEB-INF/bbb-redis-messaging.xml @@ -37,7 +37,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. <property name="port" value="${redis.port}"/> </bean> - <bean id="meetingMessageHandler" class="org.bigbluebutton.red5.pubsub.MeetingMessageHandler"> + <bean id="meetingMessageHandler" class="org.bigbluebutton.voiceconf.messaging.MeetingMessageHandler"> <property name="connInvokerService" ref="connInvokerService"/> </bean> diff --git a/bbb-voice/src/main/webapp/WEB-INF/bbb-redis-pool.xml b/bbb-voice/src/main/webapp/WEB-INF/bbb-redis-pool.xml deleted file mode 100755 index b30253c68270271b8aaadb17a0606a4a09352027..0000000000000000000000000000000000000000 --- a/bbb-voice/src/main/webapp/WEB-INF/bbb-redis-pool.xml +++ /dev/null @@ -1,66 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - -BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ - -Copyright (c) 2012 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 3.0 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 <http://www.gnu.org/licenses/>. - ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:util="http://www.springframework.org/schema/util" - xsi:schemaLocation="http://www.springframework.org/schema/beans - 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 - "> - - <bean id="redisPool" class="redis.clients.jedis.JedisPool"> - <constructor-arg index="0"> - <bean factory-bean="config" factory-method="getConfig" /> - </constructor-arg> - <constructor-arg index="1" value="${redis.host}"/> - <constructor-arg index="2" value="${redis.port}"/> - </bean> - - <bean id="config" class="org.bigbluebutton.voiceconf.messaging.GenericObjectPoolConfigWrapper"> - <!-- Action to take when trying to acquire a connection and all connections are taken --> - <property name="whenExhaustedAction"> - <!-- Fail-fast behaviour, we don't like to keep the kids waiting --> - <util:constant static-field="org.apache.commons.pool.impl.GenericObjectPool.WHEN_EXHAUSTED_FAIL" /> - <!-- Default behaviour, block the caller until a resource becomes available --> - <!--<util:constant static-field="org.apache.commons.pool.impl.GenericObjectPool.WHEN_EXHAUSTED_BLOCK" />--> - </property> - <!-- Maximum active connections to Redis instance --> - <property name="maxActive" value="12" /> - <!-- Number of connections to Redis that just sit there and do nothing --> - <property name="maxIdle" value="6" /> - <!-- Minimum number of idle connections to Redis - these can be seen as always open and ready to serve --> - <property name="minIdle" value="1" /> - <!-- Tests whether connection is dead when connection retrieval method is called --> - <property name="testOnBorrow" value="true" /> - <!-- Tests whether connection is dead when returning a connection to the pool --> - <property name="testOnReturn" value="true" /> - <!-- Tests whether connections are dead during idle periods --> - <property name="testWhileIdle" value="true" /> - <!-- Maximum number of connections to test in each idle check --> - <property name="numTestsPerEvictionRun" value="12" /> - <!-- Idle connection checking period --> - <property name="timeBetweenEvictionRunsMillis" value="60000" /> - <!-- Maximum time, in milliseconds, to wait for a resource when exausted action is set to WHEN_EXAUSTED_BLOCK --> - <property name="maxWait" value="5000" /> - </bean> - -</beans> diff --git a/bbb-voice/src/main/webapp/WEB-INF/red5-web.xml b/bbb-voice/src/main/webapp/WEB-INF/red5-web.xml index df02df9dcc0c989cb4bdf55970cf307973205fba..12f3bb8eebe8e7b6c2f0778a9aabf5983d045e08 100755 --- a/bbb-voice/src/main/webapp/WEB-INF/red5-web.xml +++ b/bbb-voice/src/main/webapp/WEB-INF/red5-web.xml @@ -28,12 +28,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. http://www.springframework.org/schema/lang/spring-lang-2.0.xsd"> <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> - <property name="locations"> - <list> - <value>/WEB-INF/red5-web.properties</value> - <value>/WEB-INF/bigbluebutton-sip.properties</value> - </list> - </property> + <property name="locations"> + <list> + <value>/WEB-INF/red5-web.properties</value> + <value>/WEB-INF/bigbluebutton-sip.properties</value> + </list> + </property> </bean> @@ -60,12 +60,17 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. <property name="stopAudioPort" value="${stopAudioPort}" /> <property name="sipPeerManager" ref="sipPeerManager"/> <property name="clientConnectionManager" ref="clientConnectionManager"/> + <property name="connInvokerService" ref="connInvokerService"/> + <property name="messagingService" ref="messagingService"/> + </bean> + + <bean id="voiceconf.service" class="org.bigbluebutton.voiceconf.red5.Service"> + <property name="sipPeerManager" ref="sipPeerManager"/> </bean> - <bean id="voiceconf.service" class="org.bigbluebutton.voiceconf.red5.Service"> - <property name="sipPeerManager" ref="sipPeerManager"/> - </bean> - + <bean id="connInvokerService" class="org.bigbluebutton.voiceconf.red5.ConnectionInvokerService" + init-method="start" destroy-method="stop"/> + <bean id="sipPeerManager" class="org.bigbluebutton.voiceconf.sip.SipPeerManager"> <property name="sipStackDebugLevel" value="${sipStackDebugLevel}"/> <property name="sipRemotePort" value="${freeswitch.port}"/> @@ -75,7 +80,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. <bean id="clientConnectionManager" class="org.bigbluebutton.voiceconf.red5.ClientConnectionManager"/> - <import resource="bbb-redis-pool.xml"/> - <import resource="bbb-redis-messaging.xml"/> - + <import resource="bbb-redis-messaging.xml"/> + </beans>