From 4f3ba37355c59c9adf0f873c312d344493b5d3a9 Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Fri, 26 Oct 2012 13:23:44 -0200 Subject: [PATCH 01/28] Change client to autoJoin without Microphone and mute. --- .../bigbluebutton/main/model/users/BBBUser.as | 5 +- .../main/model/users/Conference.as | 12 ++- .../bigbluebutton/main/views/MicSettings.mxml | 14 ++- .../listeners/business/ListenersSOService.as | 23 ++++- .../modules/listeners/business/vo/Listener.as | 3 +- .../modules/listeners/views/ListenerItem.mxml | 3 +- .../modules/phone/managers/PhoneManager.as | 23 ++++- .../modules/phone/managers/StreamManager.as | 86 +++++++++++++++---- .../modules/phone/maps/PhoneEventMap.mxml | 13 +++ 9 files changed, 149 insertions(+), 33 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BBBUser.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BBBUser.as index c2ad2cd461..402ee75f8a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BBBUser.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BBBUser.as @@ -24,7 +24,7 @@ package org.bigbluebutton.main.model.users import org.bigbluebutton.common.LogUtil; import org.bigbluebutton.common.Role; - import org.bigbluebutton.main.model.users.events.StreamStartedEvent; + import org.bigbluebutton.main.model.users.events.StreamStartedEvent; public class BBBUser { public static const MODERATOR:String = "MODERATOR"; @@ -46,6 +46,7 @@ package org.bigbluebutton.main.model.users [Bindable] public var voiceMuted:Boolean = false; [Bindable] public var voiceJoined:Boolean = false; [Bindable] public var voiceLocked:Boolean = false; + [Bindable] public var firstTimeUnMute:Boolean = true; private var _status:StatusCollection = new StatusCollection(); @@ -124,4 +125,4 @@ package org.bigbluebutton.main.model.users dispatcher.dispatchEvent(new StreamStartedEvent(userid, name, streamName)); } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as index 9804d62a44..88b9785894 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as @@ -152,7 +152,15 @@ package org.bigbluebutton.main.model.users { public function amIThisUser(userid:int):Boolean { return me.userid == userid; } - + + public function setFirstTimeUnMute(firstTimeUnMute:Boolean):void { + me.firstTimeUnMute = firstTimeUnMute; + } + + public function getFirstTimeUnMute():Boolean { + return me.firstTimeUnMute; + } + public function amIModerator():Boolean { return me.role == Role.MODERATOR; } @@ -263,4 +271,4 @@ package org.bigbluebutton.main.model.users { users.refresh(); } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml index b33fb36d44..1e6f9cfc73 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml @@ -23,6 +23,8 @@ [Bindable] private var cancelIcon:Class = images.delete_icon; private function initDefaultMic():void { + + mic = Microphone.getMicrophone(-1); mic.setLoopBack(true); if (mic != null) { @@ -33,6 +35,8 @@ timer = new Timer(100); timer.addEventListener(TimerEvent.TIMER, updateMicLevel); timer.start(); + + } private function micStatusEventHandler(event:StatusEvent):void { @@ -72,9 +76,10 @@ private function onJoinClicked():void { cleanUp(); - var joinEvent:BBBEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); - joinEvent.payload['useMicrophone'] = true; - dispatchEvent(joinEvent); + dispatchEvent(new BBBEvent("VOICE_CONFERENCE_EVENT_BEGIN_PUBLISH")); + //var joinEvent:BBBEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); + //joinEvent.payload['useMicrophone'] = true; + //dispatchEvent(joinEvent); PopUpManager.removePopUp(this); } @@ -83,6 +88,9 @@ var event:BBBEvent = new BBBEvent("MIC_SETTINGS_CLOSED"); event.payload['clicked'] = "cancel"; dispatchEvent(event); + + dispatchEvent(new BBBEvent("UNMUTE_VOICE_CONFIG")); + PopUpManager.removePopUp(this); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as index 44f062a6b7..955ebf4433 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as @@ -31,7 +31,7 @@ package org.bigbluebutton.modules.listeners.business import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.modules.listeners.business.vo.Listener; import org.bigbluebutton.modules.listeners.business.vo.Listeners; - import org.bigbluebutton.modules.listeners.events.ListenersEvent; + import org.bigbluebutton.modules.listeners.events.ListenersEvent; public class ListenersSOService { @@ -153,7 +153,24 @@ package org.bigbluebutton.modules.listeners.business * Let's store the voice userid so we can do push to talk. */ if (UserManager.getInstance().getConference().amIThisVoiceUser(userId)) { - UserManager.getInstance().getConference().muteMyVoice(l.muted); + UserManager.getInstance().getConference().muteMyVoice(l.muted); + if(l.muted == false && UserManager.getInstance().getConference().getFirstTimeUnMute()) { + UserManager.getInstance().getConference().setFirstTimeUnMute(false); + dispatcher.dispatchEvent(new BBBEvent("MUTE_AUDIO_CONFIG")); + dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS")); + LogUtil.debug("Chamei"); + //dispatcher.dispatchEvent(new BBBEvent("VOICE_CONFERENCE_EVENT_BEGIN_PUBLISH")); + + + } + else { + if(UserManager.getInstance().getConference().getFirstTimeUnMute() == false) { + + } + + } + + } } } @@ -413,4 +430,4 @@ package org.bigbluebutton.modules.listeners.business _soErrors.push(error); } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/vo/Listener.as b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/vo/Listener.as index e05a03dd72..ce571c9215 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/vo/Listener.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/vo/Listener.as @@ -28,9 +28,10 @@ package org.bigbluebutton.modules.listeners.business.vo { public var muted:Boolean; public var talking:Boolean; public var locked:Boolean; + public var firstTimeUnMute:Boolean = true; // Stores if the participant is moderator or not. // This is not the role of the joining listener // but of the participant running the client. public var moderator:Boolean = false; } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenerItem.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenerItem.mxml index d6d81d4f84..dfaf8e63e5 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenerItem.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenerItem.mxml @@ -45,7 +45,8 @@ [Bindable] private var statusTooltip : String = ""; [Bindable] private var ejectTooltip : String = ResourceUtil.getInstance().getString('bbb.listeners.ejectTooltip'); [Bindable] private var moderator:Boolean = false; - + private var firstMute:Boolean = true; + public function onRollOver():void{ if (moderator) kickUserBtn.visible = true; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as index bd68d4363d..ac08675533 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as @@ -47,7 +47,7 @@ package org.bigbluebutton.modules.phone.managers { connectionManager = new ConnectionManager(); streamManager = new StreamManager(); } - + public function setModuleAttributes(attributes:Object):void { this.attributes = attributes; var vxml:XML = BBB.getConfigForModule("PhoneModule"); @@ -57,18 +57,23 @@ package org.bigbluebutton.modules.phone.managers { phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; } - if (phoneOptions.autoJoin) { + + if (phoneOptions.skipCheck || noMicrophone()) { + /* if (noMicrophone()) { joinVoice(false); } else { joinVoice(true); } + */ + joinVoice(false); } else { var dispatcher:Dispatcher = new Dispatcher(); dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS")); } + } } @@ -84,7 +89,16 @@ package org.bigbluebutton.modules.phone.managers { else streamManager.initWithNoMicrophone(); } + + public function muteAudio():void { + streamManager.muteAudio(); + } + + public function unMuteAudio():void { + streamManager.unMuteAudio(); + } + private function setupConnection():void { streamManager.setConnection(connectionManager.getConnection()); } @@ -110,6 +124,11 @@ package org.bigbluebutton.modules.phone.managers { LogUtil.debug("*** Dialling conference ***"); connectionManager.doCall(attributes.webvoiceconf); } + + public function beginPublish():void { + LogUtil.debug("Chamei 2"); + streamManager.beginPublishing(); + } public function callConnected(event:CallConnectedEvent):void { setupConnection(); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as index 4fe58a6abb..5509009574 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as @@ -18,24 +18,27 @@ */ package org.bigbluebutton.modules.phone.managers { - import com.asfusion.mate.events.Dispatcher; - import flash.events.ActivityEvent; - import flash.events.AsyncErrorEvent; - import flash.events.IEventDispatcher; - import flash.events.NetStatusEvent; - import flash.events.StatusEvent; - import flash.media.Microphone; - import flash.media.MicrophoneEnhancedMode; - import flash.media.MicrophoneEnhancedOptions; - import flash.media.SoundCodec; - import flash.net.NetConnection; - import flash.net.NetStream; + import com.asfusion.mate.events.Dispatcher; + import flash.events.ActivityEvent; + import flash.events.AsyncErrorEvent; + import flash.events.IEventDispatcher; + import flash.events.NetStatusEvent; + import flash.events.StatusEvent; + import flash.media.Microphone; + import flash.media.MicrophoneEnhancedMode; + import flash.media.MicrophoneEnhancedOptions; + import flash.media.SoundCodec; + import flash.net.NetConnection; + import flash.net.NetStream; import org.bigbluebutton.common.LogUtil; import org.bigbluebutton.core.BBB; import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.modules.phone.PhoneOptions; import org.bigbluebutton.modules.phone.events.MicrophoneUnavailEvent; import org.bigbluebutton.modules.phone.events.PlayStreamStatusEvent; + import org.bigbluebutton.core.managers.UserManager; + + import org.bigbluebutton.modules.listeners.events.ListenersCommand; public class StreamManager { public var connection:NetConnection = null; @@ -45,9 +48,10 @@ package org.bigbluebutton.modules.phone.managers { private var mic:Microphone = null; private var isCallConnected:Boolean = false; private var muted:Boolean = false; - private var audioCodec:String = "SPEEX"; - private var dispatcher:Dispatcher; - + private var audioCodec:String = "SPEEX"; + private var dispatcher:Dispatcher; + private var onlyListening:Boolean = true; + private var _custom_obj:Object = null; public function StreamManager() { dispatcher = new Dispatcher(); } @@ -60,12 +64,20 @@ package org.bigbluebutton.modules.phone.managers { mic = Microphone.getMicrophone(-1); if(mic == null){ initWithNoMicrophone(); + onlyListening = true; } else { setupMicrophone(); mic.addEventListener(StatusEvent.STATUS, micStatusHandler); + onlyListening = false; } } - + public function muteAudio():void { + incomingStream.receiveAudio(false); + } + + public function unMuteAudio():void { + incomingStream.receiveAudio(true); + } private function setupMicrophone():void { var vxml:XML = BBB.getConfigForModule("PhoneModule"); var phoneOptions:PhoneOptions = new PhoneOptions(); @@ -104,8 +116,17 @@ package org.bigbluebutton.modules.phone.managers { } public function initWithNoMicrophone(): void { - var event:MicrophoneUnavailEvent = new MicrophoneUnavailEvent(); - dispatcher.dispatchEvent(event); + mic = Microphone.getMicrophone(-1); + if(mic == null){ + var event:MicrophoneUnavailEvent = new MicrophoneUnavailEvent(); + dispatcher.dispatchEvent(event); + } else { + setupMicrophone(); + mic.addEventListener(StatusEvent.STATUS, micStatusHandler); + mic = null; + + } + onlyListening = true; } private function micStatusHandler(event:StatusEvent):void { @@ -120,19 +141,45 @@ package org.bigbluebutton.modules.phone.managers { LogUtil.debug("unknown micStatusHandler event: " + event); } } + + public function beginPublishing():void { + unMuteAudio(); + if(mic == null) { + setupMicrophone(); + } + if(mic != null) { + onlyListening = false; + setupOutgoingStream(); + outgoingStream.client = _custom_obj; + publish(publishName); + } + + + } public function callConnected(playStreamName:String, publishStreamName:String, codec:String):void { isCallConnected = true; audioCodec = codec; + publishName = publishStreamName; setupIncomingStream(); if (mic != null) { + onlyListening = true; setupOutgoingStream(); } + else { + var e:ListenersCommand = new ListenersCommand(ListenersCommand.MUTE_USER); + e.userid = UserManager.getInstance().getConference().getMyVoiceUserId(); + e.mute = true; + dispatcher.dispatchEvent(e); + } setupPlayStatusHandler(); play(playStreamName); publish(publishStreamName); + + + } private function play(playStreamName:String):void { @@ -176,6 +223,7 @@ package org.bigbluebutton.modules.phone.managers { custom_obj.onPlayStatus = playStatus; custom_obj.onMetadata = onMetadata; incomingStream.client = custom_obj; + _custom_obj = custom_obj; if (mic != null) outgoingStream.client = custom_obj; } @@ -237,4 +285,4 @@ package org.bigbluebutton.modules.phone.managers { LogUtil.debug("Recieve ON METADATA from SIP"); } } -} +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml index 43c49cb555..f70f5e1cc6 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml @@ -73,6 +73,19 @@ + + + + + + + + + + + + + From 0d77d9cbe840c9ff7b110e16ad3dfcc66ada2670 Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Thu, 8 Nov 2012 15:09:27 -0200 Subject: [PATCH 02/28] Global Audio --- .../red5/ClientConnectionManager.java | 9 + .../bigbluebutton/voiceconf/red5/Service.java | 39 +++- .../voiceconf/sip/CallAgent.java | 81 +++++++- .../bigbluebutton/voiceconf/sip/SipPeer.java | 39 +++- .../voiceconf/sip/SipPeerManager.java | 13 ++ .../service/voice/VoiceService.java | 26 ++- .../red5/voice/ClientManager.java | 7 +- .../listeners/business/ListenersSOService.as | 11 +- .../phone/managers/ConnectionManager.as | 177 +++++++++--------- .../modules/phone/managers/PhoneManager.as | 6 +- .../modules/phone/managers/StreamManager.as | 24 ++- .../modules/phone/maps/PhoneEventMap.mxml | 10 +- .../phone/views/components/ToolbarButton.mxml | 25 ++- 13 files changed, 343 insertions(+), 124 deletions(-) diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java index 081a01f9fb..bd44812f19 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java @@ -44,6 +44,15 @@ public class ClientConnectionManager { log.debug("Removed client {} from ConnectionManager.", id); } } + + public void joinConferenceSuccessNew(String clientId, String listen) { + ClientConnection cc = clients.get(clientId); + if (cc != null) { + System.out.println("String Global"); + cc.onJoinConferenceSuccess("", listen, ""); + } + + } public void joinConferenceSuccess(String clientId, String usertalkStream, String userListenStream, String codec) { ClientConnection cc = clients.get(clientId); diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java index cd5f2238f1..f47ddf1454 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java @@ -26,6 +26,7 @@ import org.bigbluebutton.voiceconf.sip.SipPeerManager; import org.red5.logging.Red5LoggerFactory; import org.red5.server.api.IConnection; import org.red5.server.api.Red5; +import org.bigbluebutton.voiceconf.sip.GlobalCall; public class Service { private static Logger log = Red5LoggerFactory.getLogger(Service.class, "sip"); @@ -33,12 +34,46 @@ public class Service { private SipPeerManager sipPeerManager; private MessageFormat callExtensionPattern = new MessageFormat("{0}"); + + + public Boolean call(String peerId, String callerName, String destination, Boolean global) { + + + + if(global == true) { + hangup(peerId); + if(GlobalCall.roomHasGlobalStream(destination) == false) { + String extension = callExtensionPattern.format(new String[] { destination }); + try { + sipPeerManager.callGlobal(peerId, "9999999", "GLOBAL_AUDIO_" + destination, getClientId(), callerName, extension); + Red5.getConnectionLocal().setAttribute("VOICE_CONF_PEER", peerId); + } catch (PeerNotFoundException e) { + log.error("PeerNotFound {}", peerId); + return false; + } + } + else { + sipPeerManager.returnGlobalStream(peerId, getClientId(), destination); + } + } + else { + Boolean result = call(peerId, callerName, destination); + return result; + } + + return true; + + + } + public Boolean call(String peerId, String callerName, String destination) { - String clientId = Red5.getConnectionLocal().getClient().getId(); + + String clientId = Red5.getConnectionLocal().getClient().getId(); String userid = getUserId(); String username = getUsername(); - log.debug("{} is requesting to join into the conference {}", username + "[uid=" + userid + "][clientid=" + clientId + "]", destination); + + log.debug("{} is requesting to join into the conference {}", username + "[uid=" + userid + "][clientid=" + clientId + "]", destination); String extension = callExtensionPattern.format(new String[] { destination }); try { diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java index 05ff7ef64a..5f0608d952 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java @@ -55,7 +55,11 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver private ClientConnectionManager clientConnManager; private final String clientId; private final AudioConferenceProvider portProvider; - private DatagramSocket localSocket; + private DatagramSocket localSocket; + public String _callerName; + private String _destination; + private CallAgent caToInit = null; + private Boolean talking = false; private enum CallState { UA_IDLE(0), UA_INCOMING_CALL(1), UA_OUTGOING_CALL(2), UA_ONCALL(3); @@ -86,8 +90,11 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver log.debug("localSession Descriptor = " + localSession ); } - public void call(String callerName, String destination) { - log.debug("{} making a call to {}", callerName, destination); + public void callGlobal(String callerName, String destination, CallAgent ca) { + caToInit = ca; + _callerName = callerName; + _destination = destination; + log.debug("{} making a call to {}", callerName, destination); try { localSocket = getLocalAudioSocket(); userProfile.audioPort = localSocket.getLocalPort(); @@ -97,7 +104,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver return; } - setupCallerDisplayName(callerName, destination); + setupCallerDisplayName(callerName, destination); userProfile.initContactAddress(sipProvider); initSessionDescriptor(); @@ -110,12 +117,57 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver // In case of incomplete url (e.g. only 'user' is present), // try to complete it. destination = sipProvider.completeNameAddress(destination).toString(); - log.debug("call {}", destination); + + + log.debug("call {}", destination); if (userProfile.noOffer) { call.call(destination); } else { call.call(destination, localSession); } + + + + } + + public void call(String callerName, String destination) { + _callerName = callerName; + log.debug("{} making a call to {}", callerName, destination); + try { + localSocket = getLocalAudioSocket(); + userProfile.audioPort = localSocket.getLocalPort(); + } catch (Exception e) { + log.debug("{} failed to allocate local port for call to {}. Notifying client that call failed.", callerName, destination); + notifyListenersOnOutgoingCallFailed(); + return; + } + + setupCallerDisplayName(callerName, destination); + userProfile.initContactAddress(sipProvider); + initSessionDescriptor(); + + callState = CallState.UA_OUTGOING_CALL; + + call = new ExtendedCall(sipProvider, userProfile.fromUrl, + userProfile.contactUrl, userProfile.username, + userProfile.realm, userProfile.passwd, this); + + // In case of incomplete url (e.g. only 'user' is present), + // try to complete it. + destination = sipProvider.completeNameAddress(destination).toString(); + + + log.debug("call {}", destination); + if (userProfile.noOffer) { + call.call(destination); + } else { + call.call(destination, localSession); + } + + + + + } private void setupCallerDisplayName(String callerName, String destination) { @@ -186,7 +238,16 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver callStream = callStreamFactory.createCallStream(sipCodec, connInfo); callStream.addCallStreamObserver(this); callStream.start(); - notifyListenersOnCallConnected(callStream.getTalkStreamName(), callStream.getListenStreamName()); + if(_callerName.contains("GLOBAL_AUDIO") == true) { + //String room = _callerName.subSequence(13, _callerName.length()).toString(); + GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName()); + caToInit.returnGlobalStreamName(caToInit.getCallId(), _destination); + talking = false; + } + else { + talking = true; + notifyListenersOnCallConnected(callStream.getTalkStreamName(), callStream.getListenStreamName()); + } } catch (Exception e) { log.error("Failed to create Call Stream."); System.out.println(StackTraceUtil.getStackTrace(e)); @@ -213,6 +274,12 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver callStream.stopTalkStream(broadcastStream, scope); } } + + public void returnGlobalStreamName(String clientId, String destination) { + talking = false; + clientConnManager.joinConferenceSuccessNew(clientId, GlobalCall.getGlobalAudioStream(destination)); + + } private void closeVoiceStreams() { log.debug("Shutting down the voice streams."); @@ -312,6 +379,8 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver notifyListenersOfOnIncomingCallCancelled(); } + + private void notifyListenersOnCallConnected(String talkStream, String listenStream) { log.debug("notifyListenersOnCallConnected for {}", clientId); clientConnManager.joinConferenceSuccess(clientId, talkStream, listenStream, sipCodec.getCodecName()); diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java index 5adfa925d7..17f6fadbfe 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java @@ -98,7 +98,34 @@ public class SipPeer implements SipRegisterAgentListener { log.debug( "SIPUser register : {}", fromURL ); log.debug( "SIPUser register : {}", registeredProfile.contactUrl ); } - + public void callGlobal(String clientIdGlobal, String callerNameGlobal, String clientId, String callerName, String destination) { + if (!registered) { + /* + * If we failed to register with FreeSWITCH, reject all calls right away. + * This way the user will know that there is a problem as quickly as possible. + * If we pass the call, it take more that 30seconds for the call to timeout + * (in case FS is offline) and the user will be kept wondering why the call + * isn't going through. + */ + log.warn("We are not registered to FreeSWITCH. However, we will allow {} to call {}.", callerName, destination); +// return; + } + SipPeerProfile callerProfile = SipPeerProfile.copy(registeredProfile); + SipPeerProfile callerProfileGlobal = SipPeerProfile.copy(registeredProfile); + + CallAgent ca = new CallAgent(sipProvider, callerProfile, audioconfProvider, clientId); + CallAgent caGlobal = new CallAgent(sipProvider, callerProfileGlobal, audioconfProvider, clientIdGlobal); + + ca.setClientConnectionManager(clientConnManager); + ca.setCallStreamFactory(callStreamFactory); + + caGlobal.setClientConnectionManager(clientConnManager); + caGlobal.setCallStreamFactory(callStreamFactory); + + callManager.add(ca); + callManager.add(caGlobal); + caGlobal.callGlobal(callerNameGlobal, destination, ca); + } public void call(String clientId, String callerName, String destination) { if (!registered) { @@ -121,6 +148,16 @@ public class SipPeer implements SipRegisterAgentListener { ca.call(callerName, destination); } + public void returnGlobalStream(String clientId, String destination) { + SipPeerProfile callerProfile = SipPeerProfile.copy(registeredProfile); + CallAgent ca = new CallAgent(sipProvider, callerProfile, audioconfProvider, clientId); + ca.setClientConnectionManager(clientConnManager); + ca.setCallStreamFactory(callStreamFactory); + callManager.add(ca); + ca.returnGlobalStreamName(clientId, destination); + + } + public void close() { log.debug("SIPUser close1"); try { diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java index 93ad1c940d..e0ca3ff341 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java @@ -65,6 +65,12 @@ public final class SipPeerManager { if (sipPeer == null) throw new PeerNotFoundException("Can't find sip peer " + peerId); sipPeer.call(clientId, callerName, destination); } + + public void callGlobal(String peerId, String GlobalClientId, String GlobalCallerName, String clientId, String callerName, String destination) throws PeerNotFoundException { + SipPeer sipPeer = sipPeers.get(peerId); + if (sipPeer == null) throw new PeerNotFoundException("Can't find sip peer " + peerId); + sipPeer.callGlobal(GlobalClientId, GlobalCallerName, clientId, callerName, destination); + } public void unregister(String userid) { SipPeer sipUser = sipPeers.get(userid); @@ -100,6 +106,13 @@ public final class SipPeerManager { sipPeers.remove(userid); } + public void returnGlobalStream(String peerId, String clientId, String destination) { + SipPeer sipUser = sipPeers.get(peerId); + if (sipUser != null) { + sipUser.returnGlobalStream(clientId, destination); + } + } + public void close(String userid) { SipPeer sipUser = sipPeers.get(userid); if (sipUser != null) { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceService.java index f332822cf9..3b87d5fc1c 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceService.java @@ -20,12 +20,20 @@ * ===License Header=== */ package org.bigbluebutton.conference.service.voice; - import org.slf4j.Logger; import org.red5.server.api.Red5; import org.bigbluebutton.conference.BigBlueButtonSession; import org.bigbluebutton.conference.Constants; import org.red5.logging.Red5LoggerFactory; -import org.bigbluebutton.webconference.voice.ConferenceService; import java.util.ArrayList; import java.util.HashMap; + +import org.slf4j.Logger; +import org.red5.server.api.Red5; +import org.bigbluebutton.conference.BigBlueButtonSession; +import org.bigbluebutton.conference.Constants; +import org.red5.logging.Red5LoggerFactory; +import org.bigbluebutton.webconference.voice.ConferenceService; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; -import org.bigbluebutton.webconference.voice.Participant; +import org.bigbluebutton.webconference.voice.Participant; + public class VoiceService { private static Logger log = Red5LoggerFactory.getLogger( VoiceService.class, "bigbluebutton" ); @@ -38,17 +46,20 @@ public class VoiceService { log.debug("GetMeetmeUsers request for room[" + voiceBridge + "]"); ArrayList p = conferenceService.getParticipants(voiceBridge); - + Boolean hasGlobal = false; Map participants = new HashMap(); if (p == null) { participants.put("count", 0); } else { participants.put("count", p.size()); - if (p.size() > 0) { + if (p.size() > 0) { participants.put("participants", arrayListToMap(p)); } } - log.info("MeetMe::service - Sending " + p.size() + " current users..."); + if(hasGlobal) + log.info("MeetMe::service - Sending " + (p.size()-1) + " current users..."); + else + log.info("MeetMe::service - Sending " + p.size() + " current users..."); return participants; } @@ -64,7 +75,8 @@ public class VoiceService { pmap.put("talking", p.isTalking()); pmap.put("locked", p.isMuteLocked()); log.debug("[" + p.getId() + "," + p.getName() + "," + p.isMuted() + "," + p.isTalking() + "]"); - result.put(p.getId(), pmap); + if(p.getName().contains("GLOBAL_AUDIO") == false) + result.put(p.getId(), pmap); } return result; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/red5/voice/ClientManager.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/red5/voice/ClientManager.java index 87fd099365..a3b774698b 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/red5/voice/ClientManager.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/red5/voice/ClientManager.java @@ -63,14 +63,17 @@ public class ClientManager implements ClientNotifier { RoomInfo soi = voiceRooms.get(room); if (soi != null) { List list = new ArrayList(); + list.add(participant); list.add(name); list.add(name); list.add(muted); list.add(talking); list.add(locked); - log.debug("Sending join to client " + name); - soi.getSharedObject().sendMessage("userJoin", list); + log.debug("Sending join to client " + name); + System.out.println("O NOME EH " + name); + if(name.contains("GLOBAL_AUDIO") == false) + soi.getSharedObject().sendMessage("userJoin", list); } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as index 955ebf4433..ad32647131 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as @@ -158,15 +158,19 @@ package org.bigbluebutton.modules.listeners.business UserManager.getInstance().getConference().setFirstTimeUnMute(false); dispatcher.dispatchEvent(new BBBEvent("MUTE_AUDIO_CONFIG")); dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS")); - LogUtil.debug("Chamei"); //dispatcher.dispatchEvent(new BBBEvent("VOICE_CONFERENCE_EVENT_BEGIN_PUBLISH")); } else { - if(UserManager.getInstance().getConference().getFirstTimeUnMute() == false) { - + if(l.muted == true && UserManager.getInstance().getConference().getFirstTimeUnMute() == false) { + dispatcher.dispatchEvent(new BBBEvent("STOP_OUT_STREAM")); + + } + else if(l.muted == false && UserManager.getInstance().getConference().getFirstTimeUnMute() == false){ + dispatcher.dispatchEvent(new BBBEvent("VOICE_CONFERENCE_EVENT_BEGIN_PUBLISH")); + } } @@ -328,6 +332,7 @@ package org.bigbluebutton.modules.listeners.business if (result.count > 0) { for(var p:Object in result.participants) { + var u:Object = result.participants[p] userJoin(u.participant, u.name, u.name, u.muted, u.talking, u.locked); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as index 445c7a12b8..cc33e60999 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as @@ -17,70 +17,70 @@ * */ -package org.bigbluebutton.modules.phone.managers { - import com.asfusion.mate.events.Dispatcher; - import flash.events.AsyncErrorEvent; - import flash.events.Event; - import flash.events.IEventDispatcher; - import flash.events.NetStatusEvent; - import flash.events.SecurityErrorEvent; - import flash.external.*; - import flash.net.NetConnection; - import flash.net.NetStream; - import org.bigbluebutton.common.LogUtil; - import org.bigbluebutton.modules.phone.events.CallConnectedEvent; - import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent; - import org.bigbluebutton.modules.phone.events.ConnectionStatusEvent; - import org.bigbluebutton.modules.phone.events.RegistrationFailedEvent; - import org.bigbluebutton.modules.phone.events.RegistrationSuccessEvent; - - public class ConnectionManager { - - private var netConnection:NetConnection = null; - private var incomingNetStream:NetStream = null; - private var outgoingNetStream:NetStream = null; - private var username:String; - private var uri:String; - private var uid:String; - private var room:String; - - private var isConnected:Boolean = false; +package org.bigbluebutton.modules.phone.managers { + import com.asfusion.mate.events.Dispatcher; + import flash.events.AsyncErrorEvent; + import flash.events.Event; + import flash.events.IEventDispatcher; + import flash.events.NetStatusEvent; + import flash.events.SecurityErrorEvent; + import flash.external.*; + import flash.net.NetConnection; + import flash.net.NetStream; + import org.bigbluebutton.common.LogUtil; + import org.bigbluebutton.modules.phone.events.CallConnectedEvent; + import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent; + import org.bigbluebutton.modules.phone.events.ConnectionStatusEvent; + import org.bigbluebutton.modules.phone.events.RegistrationFailedEvent; + import org.bigbluebutton.modules.phone.events.RegistrationSuccessEvent; + + public class ConnectionManager { + + private var netConnection:NetConnection = null; + private var incomingNetStream:NetStream = null; + private var outgoingNetStream:NetStream = null; + private var username:String; + private var uri:String; + private var uid:String; + private var room:String; + + private var isConnected:Boolean = false; private var registered:Boolean = false; private var dispatcher:Dispatcher; public function ConnectionManager():void { - dispatcher = new Dispatcher(); + dispatcher = new Dispatcher(); } public function getConnection():NetConnection { return netConnection; } - + public function connect(uid:String, externUID:String, username:String, room:String, uri:String):void { if (isConnected) return; isConnected = true; - - this.uid = uid; - this.username = username; - this.room = room; + + this.uid = uid; + this.username = username; + this.room = room; this.uri = uri; - connectToServer(externUID, username); - } - - private function connectToServer(externUID:String, username:String):void { - NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0; - netConnection = new NetConnection(); - netConnection.client = this; - netConnection.addEventListener( NetStatusEvent.NET_STATUS , netStatus ); + connectToServer(externUID, username); + } + + private function connectToServer(externUID:String, username:String):void { + NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0; + netConnection = new NetConnection(); + netConnection.client = this; + netConnection.addEventListener( NetStatusEvent.NET_STATUS , netStatus ); netConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); - netConnection.connect(uri, externUID, username); - } - - public function disconnect():void { - netConnection.close(); - } - + netConnection.connect(uri, externUID, username); + } + + public function disconnect():void { + netConnection.close(); + } + private function netStatus (evt:NetStatusEvent ):void { if (evt.info.code == "NetConnection.Connect.Success") { var event:ConnectionStatusEvent = new ConnectionStatusEvent(); @@ -93,33 +93,33 @@ package org.bigbluebutton.modules.phone.managers { } else { LogUtil.info("Connection event info [" + evt.info.code + "]. Disconnecting."); disconnect(); - } - } - - private function asyncErrorHandler(event:AsyncErrorEvent):void { - LogUtil.debug("AsyncErrorEvent: " + event); - } - - private function securityErrorHandler(event:SecurityErrorEvent):void { - LogUtil.debug("securityErrorHandler: " + event); - } - + } + } + + private function asyncErrorHandler(event:AsyncErrorEvent):void { + LogUtil.debug("AsyncErrorEvent: " + event); + } + + private function securityErrorHandler(event:SecurityErrorEvent):void { + LogUtil.debug("securityErrorHandler: " + event); + } + public function call():void { LogUtil.debug("in call - Calling " + room); - doCall(room); - } - - //******************************************************************************************** - // - // CallBack Methods from Red5 - // + doCall(room); + } + + //******************************************************************************************** + // + // CallBack Methods from Red5 + // //******************************************************************************************** public function failedToJoinVoiceConferenceCallback(msg:String):* { LogUtil.debug("failedToJoinVoiceConferenceCallback " + msg); var event:CallDisconnectedEvent = new CallDisconnectedEvent(); dispatcher.dispatchEvent(event); isConnected = false; - } + } public function disconnectedFromJoinVoiceConferenceCallback(msg:String):* { LogUtil.debug("disconnectedFromJoinVoiceConferenceCallback " + msg); @@ -127,9 +127,9 @@ package org.bigbluebutton.modules.phone.managers { dispatcher.dispatchEvent(event); isConnected = false; } - - public function successfullyJoinedVoiceConferenceCallback(publishName:String, playName:String, codec:String):* { - LogUtil.debug("successfullyJoinedVoiceConferenceCallback " + publishName + " : " + playName + " : " + codec); + + public function successfullyJoinedVoiceConferenceCallback(publishName:String, playName:String, codec:String):* { + LogUtil.debug("successfullyJoinedVoiceConferenceCallback " + publishName + " : " + playName + " : " + codec); isConnected = true; var event:CallConnectedEvent = new CallConnectedEvent(); event.publishStreamName = publishName; @@ -137,22 +137,23 @@ package org.bigbluebutton.modules.phone.managers { event.codec = codec; dispatcher.dispatchEvent(event); } - - //******************************************************************************************** - // - // SIP Actions - // - //******************************************************************************************** + + //******************************************************************************************** + // + // SIP Actions + // + //******************************************************************************************** public function doCall(dialStr:String):void { - LogUtil.debug("in doCall - Calling " + dialStr); - netConnection.call("voiceconf.call", null, "default", username, dialStr); - } - - public function doHangUp():void { + LogUtil.debug("in doCall - Calling " + dialStr); + //netConnection.call("voiceconf.call", null, "default", username, dialStr); + netConnection.call("voiceconf.call", null, "default", username, dialStr, "true"); + } + + public function doHangUp():void { if (isConnected) { - netConnection.call("voiceconf.hangup", null, "default"); - isConnected = false; - } + netConnection.call("voiceconf.hangup", null, "default"); + isConnected = false; + } } public function onBWCheck(... rest):Number { @@ -164,6 +165,6 @@ package org.bigbluebutton.modules.phone.managers { // your application should do something here // when the bandwidth check is complete trace("bandwidth = " + p_bw + " Kbps."); - } - } -} \ No newline at end of file + } + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as index ac08675533..928f5e50da 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as @@ -99,6 +99,10 @@ package org.bigbluebutton.modules.phone.managers { streamManager.unMuteAudio(); } + public function stopOutStream():void { + streamManager.stopOutStream(); + } + private function setupConnection():void { streamManager.setConnection(connectionManager.getConnection()); } @@ -125,8 +129,8 @@ package org.bigbluebutton.modules.phone.managers { connectionManager.doCall(attributes.webvoiceconf); } + public function beginPublish():void { - LogUtil.debug("Chamei 2"); streamManager.beginPublishing(); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as index 5509009574..7378764b02 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as @@ -159,7 +159,7 @@ package org.bigbluebutton.modules.phone.managers { public function callConnected(playStreamName:String, publishStreamName:String, codec:String):void { isCallConnected = true; - audioCodec = codec; + //audioCodec = codec; publishName = publishStreamName; setupIncomingStream(); @@ -167,11 +167,8 @@ package org.bigbluebutton.modules.phone.managers { onlyListening = true; setupOutgoingStream(); } - else { - var e:ListenersCommand = new ListenersCommand(ListenersCommand.MUTE_USER); - e.userid = UserManager.getInstance().getConference().getMyVoiceUserId(); - e.mute = true; - dispatcher.dispatchEvent(e); + if(onlyListening) { + dispatcher.dispatchEvent(new BBBEvent("ONLY_LISTENING_USER")); } setupPlayStatusHandler(); @@ -211,11 +208,15 @@ package org.bigbluebutton.modules.phone.managers { } private function setupOutgoingStream():void { - outgoingStream = new NetStream(connection); + + if(outgoingStream == null) { + outgoingStream = new NetStream(connection); + } outgoingStream.addEventListener(NetStatusEvent.NET_STATUS, netStatus); outgoingStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); setupMicrophone(); outgoingStream.attachAudio(mic); + } private function setupPlayStatusHandler():void { @@ -227,6 +228,15 @@ package org.bigbluebutton.modules.phone.managers { if (mic != null) outgoingStream.client = custom_obj; } + + public function stopOutStream():void { + + outgoingStream.attachAudio(null); + //outgoingStream.close(); + mic = null; + //outgoingStream = null; + + } public function stopStreams():void { LogUtil.debug("Stopping Stream(s)"); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml index f70f5e1cc6..f4e65cc723 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml @@ -86,7 +86,15 @@ - + + + + + + + + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index 5db5f145b1..1e907b9f7b 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -29,6 +29,7 @@ + Date: Wed, 14 Nov 2012 10:40:43 -0200 Subject: [PATCH 03/28] Server side from global audio is done. Now to listen from a global audio in a conference, a client must call the remote method voiceconf.call with the parameter true. To start talking a client must call the remote method again with the parameter false. The global stream is created when a user join a voice conference listen to global audio. The parameter stating if a user is listen to global audio or not is optional. The default value is false, so the server is compatible with older clients. --- bbb-api-demo/src/main/webapp/mobile_conf.jsp | 2 +- .../bigbluebutton/voiceconf/red5/Service.java | 3 +- .../voiceconf/sip/CallAgent.java | 16 +++++- .../voiceconf/sip/CallManager.java | 22 +++++++- .../voiceconf/sip/GlobalCall.java | 51 +++++++++++++++++++ .../bigbluebutton/voiceconf/sip/SipPeer.java | 33 ++++++++++-- 6 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java diff --git a/bbb-api-demo/src/main/webapp/mobile_conf.jsp b/bbb-api-demo/src/main/webapp/mobile_conf.jsp index 7ee04df0ee..6c6c77bb7d 100644 --- a/bbb-api-demo/src/main/webapp/mobile_conf.jsp +++ b/bbb-api-demo/src/main/webapp/mobile_conf.jsp @@ -1,6 +1,6 @@ <%! // This is the mobile security salt that must be used to check the requests on mobile.jsp -String mobileSalt = ""; +String mobileSalt = "03b07"; %> diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java index f47ddf1454..79e7f651f5 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java @@ -46,7 +46,7 @@ public class Service { if(GlobalCall.roomHasGlobalStream(destination) == false) { String extension = callExtensionPattern.format(new String[] { destination }); try { - sipPeerManager.callGlobal(peerId, "9999999", "GLOBAL_AUDIO_" + destination, getClientId(), callerName, extension); + sipPeerManager.callGlobal(peerId, destination, "GLOBAL_AUDIO_" + destination, getClientId(), callerName, extension); Red5.getConnectionLocal().setAttribute("VOICE_CONF_PEER", peerId); } catch (PeerNotFoundException e) { log.error("PeerNotFound {}", peerId); @@ -55,6 +55,7 @@ public class Service { } else { sipPeerManager.returnGlobalStream(peerId, getClientId(), destination); + Red5.getConnectionLocal().setAttribute("VOICE_CONF_PEER", peerId); } } else { diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java index 5f0608d952..4d5ef6baeb 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java @@ -70,6 +70,10 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver private CallState callState; + public String getDestination() { + return _destination; + } + public CallAgent(SipProvider sipProvider, SipPeerProfile userProfile, AudioConferenceProvider portProvider, String clientId) { this.sipProvider = sipProvider; this.userProfile = userProfile; @@ -90,6 +94,10 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver log.debug("localSession Descriptor = " + localSession ); } + public Boolean isTalking() { + return talking; + } + public void callGlobal(String callerName, String destination, CallAgent ca) { caToInit = ca; _callerName = callerName; @@ -132,6 +140,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver public void call(String callerName, String destination) { _callerName = callerName; + _destination = destination; log.debug("{} making a call to {}", callerName, destination); try { localSocket = getLocalAudioSocket(); @@ -238,6 +247,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver callStream = callStreamFactory.createCallStream(sipCodec, connInfo); callStream.addCallStreamObserver(this); callStream.start(); + if(_callerName.contains("GLOBAL_AUDIO") == true) { //String room = _callerName.subSequence(13, _callerName.length()).toString(); GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName()); @@ -246,8 +256,10 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver } else { talking = true; + notifyListenersOnCallConnected(callStream.getTalkStreamName(), callStream.getListenStreamName()); } + } catch (Exception e) { log.error("Failed to create Call Stream."); System.out.println(StackTraceUtil.getStackTrace(e)); @@ -277,6 +289,8 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver public void returnGlobalStreamName(String clientId, String destination) { talking = false; + _destination = destination; + GlobalCall.addUser(_destination); clientConnManager.joinConferenceSuccessNew(clientId, GlobalCall.getGlobalAudioStream(destination)); } @@ -383,7 +397,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver private void notifyListenersOnCallConnected(String talkStream, String listenStream) { log.debug("notifyListenersOnCallConnected for {}", clientId); - clientConnManager.joinConferenceSuccess(clientId, talkStream, listenStream, sipCodec.getCodecName()); + clientConnManager.joinConferenceSuccess(clientId, talkStream, listenStream, sipCodec.getCodecName()); } private void notifyListenersOnOutgoingCallFailed() { diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallManager.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallManager.java index aa50a59313..02093f4602 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallManager.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallManager.java @@ -26,20 +26,40 @@ import java.util.concurrent.ConcurrentHashMap; public class CallManager { private final Map calls = new ConcurrentHashMap(); + private final Map callsGlobal = new ConcurrentHashMap(); public CallAgent add(CallAgent ca) { return calls.put(ca.getCallId(), ca); } - + + public CallAgent addGlobal(CallAgent ca) { + return callsGlobal.put(ca.getCallId(), ca); + } + public CallAgent remove(String id) { return calls.remove(id); } + public CallAgent removeGlobal(String id) { + return callsGlobal.remove(id); + } + + public CallAgent get(String id) { return calls.get(id); } + public CallAgent getGlobal(String id) { + return callsGlobal.get(id); + } + public Collection getAll() { return calls.values(); } + + public Collection getAllGlobal() { + return callsGlobal.values(); + } + + } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java new file mode 100644 index 0000000000..22beafa16b --- /dev/null +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java @@ -0,0 +1,51 @@ +package org.bigbluebutton.voiceconf.sip; + + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class GlobalCall { + + public static Map voiceConference = new ConcurrentHashMap(); + public static Map numberOfUsers = new ConcurrentHashMap(); + + + public static boolean roomHasGlobalStream(String roomName) { + return voiceConference.containsKey(roomName); + } + + public static void addGlobalAudioStream(String roomName, String globalAudioStreamName) { + voiceConference.put(roomName, globalAudioStreamName); + numberOfUsers.put(roomName, 0); + } + + public static String getGlobalAudioStream(String roomName) { + return voiceConference.get(roomName); + } + + public static void removeRoom(String roomName) { + System.out.println("REMOVENDO A SALA "+roomName); + voiceConference.remove(roomName); + } + + public static void addUser(String roomName) { + int nUsers = numberOfUsers.get(roomName); + nUsers+=1; + numberOfUsers.put(roomName, nUsers); + } + + public static void removeUser(String roomName) { + + if(numberOfUsers.containsKey(roomName)) { + int nUsers = numberOfUsers.get(roomName); + nUsers-=1; + numberOfUsers.put(roomName, nUsers); + } + } + + public static int getNumberOfUsers(String roomName) { + return numberOfUsers.get(roomName); + } + + +} diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java index 17f6fadbfe..33909c1751 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java @@ -123,7 +123,7 @@ public class SipPeer implements SipRegisterAgentListener { caGlobal.setCallStreamFactory(callStreamFactory); callManager.add(ca); - callManager.add(caGlobal); + callManager.addGlobal(caGlobal); caGlobal.callGlobal(callerNameGlobal, destination, ca); } @@ -172,11 +172,30 @@ public class SipPeer implements SipRegisterAgentListener { public void hangup(String clientId) { log.debug( "SIPUser hangup" ); - CallAgent ca = callManager.remove(clientId); - if (ca != null) { + String destination; + if(ca != null) { + destination = ca.getDestination(); + } + else { + destination = clientId; + } + if(ca != null && ca.isTalking() == false) + GlobalCall.removeUser(destination); + + if(GlobalCall.roomHasGlobalStream(destination) && GlobalCall.getNumberOfUsers(destination) <= 0) { + CallAgent caGlobal = callManager.removeGlobal(destination); + GlobalCall.removeRoom(destination); + if(caGlobal != null) { + caGlobal.hangup(); + + } + } + if (ca != null) { ca.hangup(); } + + } public void unregister() { @@ -188,6 +207,14 @@ public class SipPeer implements SipRegisterAgentListener { ca.hangup(); } + calls = callManager.getAllGlobal(); + for (Iterator iter = calls.iterator(); iter.hasNext();) { + CallAgent ca = (CallAgent) iter.next(); + ca.hangup(); + } + + + if (registerAgent != null) { registerAgent.unregister(); registerAgent = null; From 3d5fac595651da8b42d57210171bdc3ffb04f292 Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Thu, 29 Nov 2012 10:01:32 -0200 Subject: [PATCH 04/28] Global audio working on firefox and chrome. --- .../voiceconf/red5/ClientConnection.java | 21 ++- .../bigbluebutton/voiceconf/red5/Service.java | 4 +- .../voiceconf/red5/media/CallStream.java | 6 + .../voiceconf/sip/CallAgent.java | 47 ++++-- .../voiceconf/sip/GlobalCall.java | 4 + .../bigbluebutton/voiceconf/sip/SipPeer.java | 42 ++--- .../locale/en_US/bbbResources.properties | 2 + .../bigbluebutton/main/model/users/BBBUser.as | 5 +- .../main/model/users/Conference.as | 12 +- .../bigbluebutton/main/views/MicSettings.mxml | 14 +- .../listeners/business/ListenersSOService.as | 28 +--- .../modules/listeners/business/vo/Listener.as | 3 +- .../modules/listeners/views/ListenerItem.mxml | 3 +- .../modules/phone/PhoneOptions.as | 5 +- .../phone/managers/ConnectionManager.as | 14 +- .../modules/phone/managers/PhoneManager.as | 144 ++++++++++++------ .../modules/phone/managers/StreamManager.as | 114 ++++++-------- .../modules/phone/maps/PhoneEventMap.mxml | 39 +++-- .../phone/maps/PhoneEventMapDelegate.as | 13 +- .../modules/phone/views/assets/Images.as | 7 + .../phone/views/assets/images/sound.png | Bin 0 -> 610 bytes .../phone/views/assets/images/sound_mute.png | Bin 0 -> 474 bytes .../phone/views/components/MuteButton.mxml | 122 +++++++++++++++ .../phone/views/components/ToolbarButton.mxml | 72 +++------ 24 files changed, 435 insertions(+), 286 deletions(-) create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/images/sound.png create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/images/sound_mute.png create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java index 3594b4fd5d..bc6c18ab03 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java @@ -30,6 +30,7 @@ private static Logger log = Red5LoggerFactory.getLogger(ClientConnection.class, private final String connId; private final String userid; private final String username; + private String roomName; public ClientConnection(String connId, String userid, String username, IServiceCapableConnection connection) { this.connection = connection; @@ -37,6 +38,14 @@ private static Logger log = Red5LoggerFactory.getLogger(ClientConnection.class, this.userid = userid; this.username = username; } + + public void setRoomName(String roomName) { + this.roomName = roomName; + } + + public String getRoomName() { + return roomName; + } public String getConnId() { return connId; @@ -44,16 +53,22 @@ private static Logger log = Red5LoggerFactory.getLogger(ClientConnection.class, public void onJoinConferenceSuccess(String publishName, String playName, String codec) { log.debug("Notify client that {} [{}] has joined the conference.", username, userid); - connection.invoke("successfullyJoinedVoiceConferenceCallback", new Object[] {publishName, playName, codec}); + if(connection.isConnected()) + connection.invoke("successfullyJoinedVoiceConferenceCallback", new Object[] {publishName, playName, codec}); } public void onJoinConferenceFail() { log.debug("Notify client that {} [{}] failed to join the conference.", username, userid); - connection.invoke("failedToJoinVoiceConferenceCallback", new Object[] {"onUaCallFailed"}); + if(connection.isConnected()) + connection.invoke("failedToJoinVoiceConferenceCallback", new Object[] {"onUaCallFailed"}); } public void onLeaveConference() { + System.out.println("ESTOU AQUI + " + username + userid); log.debug("Notify client that {} [{}] left the conference.", username, userid); - connection.invoke("disconnectedFromJoinVoiceConferenceCallback", new Object[] {"onUaCallClosed"}); + if(connection != null && connection.isConnected()) + connection.invoke("disconnectedFromJoinVoiceConferenceCallback", new Object[] {"onUaCallClosed"}); + + System.out.println("PASSEI PALA INVOCACAO"); } } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java index 79e7f651f5..413900c5be 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java @@ -40,9 +40,8 @@ public class Service { public Boolean call(String peerId, String callerName, String destination, Boolean global) { - + if(global == true) { - hangup(peerId); if(GlobalCall.roomHasGlobalStream(destination) == false) { String extension = callExtensionPattern.format(new String[] { destination }); try { @@ -93,6 +92,7 @@ public class Service { String username = getUsername(); log.debug("{} is requesting to hang up from the conference.", username + "[uid=" + userid + "][clientid=" + clientId + "]"); try { + System.out.println("USUARIO " + username + " saiu da conferencia AKI OI OI OI"); sipPeerManager.hangup(peerId, getClientId()); return true; } catch (PeerNotFoundException e) { diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java index 0f23612af1..d4b5a21ef2 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java @@ -32,6 +32,8 @@ import org.slf4j.Logger; import org.red5.logging.Red5LoggerFactory; import org.red5.server.api.IScope; import org.red5.server.api.stream.IBroadcastStream; +import java.net.DatagramSocket; + public class CallStream implements StreamObserver { private final static Logger log = Red5LoggerFactory.getLogger(CallStream.class, "sip"); @@ -73,6 +75,10 @@ public class CallStream implements StreamObserver { userListenStream.start(); userTalkStream = new FlashToSipAudioStream(flashToSipTranscoder, connInfo.getSocket(), connInfo); } + + public DatagramSocket getSocket() { + return connInfo.getSocket(); + } public String getTalkStreamName() { return userTalkStream.getStreamName(); diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java index 4d5ef6baeb..0dad5d9b0d 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java @@ -55,12 +55,14 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver private ClientConnectionManager clientConnManager; private final String clientId; private final AudioConferenceProvider portProvider; - private DatagramSocket localSocket; + private DatagramSocket localSocket = null; public String _callerName; private String _destination; private CallAgent caToInit = null; private Boolean talking = false; + private Boolean socketGlobal = false; + private enum CallState { UA_IDLE(0), UA_INCOMING_CALL(1), UA_OUTGOING_CALL(2), UA_ONCALL(3); private final int state; @@ -70,11 +72,18 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver private CallState callState; + + public void setLocalSocketRelatedToGlobal() { + this.socketGlobal = true; + } + + public String getDestination() { return _destination; } public CallAgent(SipProvider sipProvider, SipPeerProfile userProfile, AudioConferenceProvider portProvider, String clientId) { + System.out.println("FUI CRIADO AGORA"); this.sipProvider = sipProvider; this.userProfile = userProfile; this.portProvider = portProvider; @@ -192,11 +201,18 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver /** Closes an ongoing, incoming, or pending call */ public void hangup() { log.debug("hangup"); - - if (callState == CallState.UA_IDLE) return; - closeVoiceStreams(); - if (call != null) call.hangup(); - callState = CallState.UA_IDLE; + if(talking) { + if (callState == CallState.UA_IDLE) return; + closeVoiceStreams(); + if (call != null) call.hangup(); + callState = CallState.UA_IDLE; + } + else { + callState = CallState.UA_IDLE; + System.out.println("NAO ESTOU FALANDO"); + System.out.println(clientId + " eh o usuario que ta indo"); + clientConnManager.leaveConference(clientId); + } } private DatagramSocket getLocalAudioSocket() throws Exception { @@ -250,9 +266,9 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver if(_callerName.contains("GLOBAL_AUDIO") == true) { //String room = _callerName.subSequence(13, _callerName.length()).toString(); - GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName()); + GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName()); caToInit.returnGlobalStreamName(caToInit.getCallId(), _destination); - talking = false; + talking = true; } else { talking = true; @@ -298,6 +314,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver private void closeVoiceStreams() { log.debug("Shutting down the voice streams."); if (callStream != null) { + System.out.println("FECHANDO AS VOICE STREAMS"); callStream.stop(); callStream = null; } else { @@ -412,18 +429,20 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver } private void notifyListenersOfOnCallClosed() { - log.debug("notifyListenersOfOnCallClosed for {}", clientId); + log.debug("notifyListenersOfOnCallClosed for {}", clientId); clientConnManager.leaveConference(clientId); - cleanup(); + cleanup(); } private void cleanup() { - log.debug("Closing local audio port {}", localSocket.getLocalPort()); - if (localSocket != null) { - localSocket.close(); + if (localSocket != null) { + if(talking == true) { + localSocket.close(); + } } else { - log.debug("Trying to close un-allocated port {}", localSocket.getLocalPort()); + log.debug("Trying to close un-allocated port {}", localSocket.getLocalPort()); } + } /** Callback function called when arriving a BYE request */ diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java index 22beafa16b..2ef96d0e6f 100644 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java @@ -3,6 +3,7 @@ package org.bigbluebutton.voiceconf.sip; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.net.DatagramSocket; public class GlobalCall { @@ -26,6 +27,8 @@ public class GlobalCall { public static void removeRoom(String roomName) { System.out.println("REMOVENDO A SALA "+roomName); voiceConference.remove(roomName); + numberOfUsers.remove(roomName); + } public static void addUser(String roomName) { @@ -40,6 +43,7 @@ public class GlobalCall { int nUsers = numberOfUsers.get(roomName); nUsers-=1; numberOfUsers.put(roomName, nUsers); + System.out.println("REMOVENDO USUARIO: numero eh de " + nUsers); } } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java index 33909c1751..fde2db7258 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java @@ -114,9 +114,9 @@ public class SipPeer implements SipRegisterAgentListener { SipPeerProfile callerProfileGlobal = SipPeerProfile.copy(registeredProfile); CallAgent ca = new CallAgent(sipProvider, callerProfile, audioconfProvider, clientId); + ca.setLocalSocketRelatedToGlobal(); CallAgent caGlobal = new CallAgent(sipProvider, callerProfileGlobal, audioconfProvider, clientIdGlobal); - - ca.setClientConnectionManager(clientConnManager); + ca.setClientConnectionManager(clientConnManager); ca.setCallStreamFactory(callStreamFactory); caGlobal.setClientConnectionManager(clientConnManager); @@ -142,7 +142,7 @@ public class SipPeer implements SipRegisterAgentListener { SipPeerProfile callerProfile = SipPeerProfile.copy(registeredProfile); CallAgent ca = new CallAgent(sipProvider, callerProfile, audioconfProvider, clientId); - ca.setClientConnectionManager(clientConnManager); + ca.setClientConnectionManager(clientConnManager); ca.setCallStreamFactory(callStreamFactory); callManager.add(ca); ca.call(callerName, destination); @@ -151,7 +151,7 @@ public class SipPeer implements SipRegisterAgentListener { public void returnGlobalStream(String clientId, String destination) { SipPeerProfile callerProfile = SipPeerProfile.copy(registeredProfile); CallAgent ca = new CallAgent(sipProvider, callerProfile, audioconfProvider, clientId); - ca.setClientConnectionManager(clientConnManager); + ca.setClientConnectionManager(clientConnManager); ca.setCallStreamFactory(callStreamFactory); callManager.add(ca); ca.returnGlobalStreamName(clientId, destination); @@ -180,23 +180,27 @@ public class SipPeer implements SipRegisterAgentListener { else { destination = clientId; } - if(ca != null && ca.isTalking() == false) - GlobalCall.removeUser(destination); - if(GlobalCall.roomHasGlobalStream(destination) && GlobalCall.getNumberOfUsers(destination) <= 0) { - CallAgent caGlobal = callManager.removeGlobal(destination); - GlobalCall.removeRoom(destination); - if(caGlobal != null) { - caGlobal.hangup(); - - } - } - if (ca != null) { - ca.hangup(); + + if(ca != null) { + if(ca.isTalking()) { + System.out.println("CA ESTA FALANDO"); + ca.hangup(); + } + else { + System.out.println("REMOVE USER"); + GlobalCall.removeUser(destination); + ca.hangup(); + if(GlobalCall.roomHasGlobalStream(destination) && GlobalCall.getNumberOfUsers(destination) <= 0) { + System.out.println("REMOVE GLOBAL"); + CallAgent caGlobal = callManager.removeGlobal(destination); + GlobalCall.removeRoom(destination); + caGlobal.hangup(); + } + } } - - - } + + } public void unregister() { log.debug( "SIPUser unregister" ); diff --git a/bigbluebutton-client/locale/en_US/bbbResources.properties b/bigbluebutton-client/locale/en_US/bbbResources.properties index 5a30925d16..4f84fa3ec8 100755 --- a/bigbluebutton-client/locale/en_US/bbbResources.properties +++ b/bigbluebutton-client/locale/en_US/bbbResources.properties @@ -131,6 +131,8 @@ bbb.desktopView.fitToWindow = Fit to Window bbb.desktopView.actualSize = Display actual size bbb.toolbar.phone.toolTip.start = Share My Microphone bbb.toolbar.phone.toolTip.stop = Stop Sharing My Microphone +bbb.toolbar.phone.toolTip.mute = Stop Listening Voice Conference +bbb.toolbar.phone.toolTip.unmute = Start Listening Voice Conference bbb.toolbar.deskshare.toolTip.start = Share My Desktop bbb.toolbar.deskshare.toolTip.stop = Stop Sharing My Desktop bbb.toolbar.video.toolTip.start = Share My Camera diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BBBUser.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BBBUser.as index 402ee75f8a..c2ad2cd461 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BBBUser.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BBBUser.as @@ -24,7 +24,7 @@ package org.bigbluebutton.main.model.users import org.bigbluebutton.common.LogUtil; import org.bigbluebutton.common.Role; - import org.bigbluebutton.main.model.users.events.StreamStartedEvent; + import org.bigbluebutton.main.model.users.events.StreamStartedEvent; public class BBBUser { public static const MODERATOR:String = "MODERATOR"; @@ -46,7 +46,6 @@ package org.bigbluebutton.main.model.users [Bindable] public var voiceMuted:Boolean = false; [Bindable] public var voiceJoined:Boolean = false; [Bindable] public var voiceLocked:Boolean = false; - [Bindable] public var firstTimeUnMute:Boolean = true; private var _status:StatusCollection = new StatusCollection(); @@ -125,4 +124,4 @@ package org.bigbluebutton.main.model.users dispatcher.dispatchEvent(new StreamStartedEvent(userid, name, streamName)); } } -} +} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as index 88b9785894..9804d62a44 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as @@ -152,15 +152,7 @@ package org.bigbluebutton.main.model.users { public function amIThisUser(userid:int):Boolean { return me.userid == userid; } - - public function setFirstTimeUnMute(firstTimeUnMute:Boolean):void { - me.firstTimeUnMute = firstTimeUnMute; - } - - public function getFirstTimeUnMute():Boolean { - return me.firstTimeUnMute; - } - + public function amIModerator():Boolean { return me.role == Role.MODERATOR; } @@ -271,4 +263,4 @@ package org.bigbluebutton.main.model.users { users.refresh(); } } -} +} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml index 1e6f9cfc73..b33fb36d44 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml @@ -23,8 +23,6 @@ [Bindable] private var cancelIcon:Class = images.delete_icon; private function initDefaultMic():void { - - mic = Microphone.getMicrophone(-1); mic.setLoopBack(true); if (mic != null) { @@ -35,8 +33,6 @@ timer = new Timer(100); timer.addEventListener(TimerEvent.TIMER, updateMicLevel); timer.start(); - - } private function micStatusEventHandler(event:StatusEvent):void { @@ -76,10 +72,9 @@ private function onJoinClicked():void { cleanUp(); - dispatchEvent(new BBBEvent("VOICE_CONFERENCE_EVENT_BEGIN_PUBLISH")); - //var joinEvent:BBBEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); - //joinEvent.payload['useMicrophone'] = true; - //dispatchEvent(joinEvent); + var joinEvent:BBBEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); + joinEvent.payload['useMicrophone'] = true; + dispatchEvent(joinEvent); PopUpManager.removePopUp(this); } @@ -88,9 +83,6 @@ var event:BBBEvent = new BBBEvent("MIC_SETTINGS_CLOSED"); event.payload['clicked'] = "cancel"; dispatchEvent(event); - - dispatchEvent(new BBBEvent("UNMUTE_VOICE_CONFIG")); - PopUpManager.removePopUp(this); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as index ad32647131..44f062a6b7 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/ListenersSOService.as @@ -31,7 +31,7 @@ package org.bigbluebutton.modules.listeners.business import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.modules.listeners.business.vo.Listener; import org.bigbluebutton.modules.listeners.business.vo.Listeners; - import org.bigbluebutton.modules.listeners.events.ListenersEvent; + import org.bigbluebutton.modules.listeners.events.ListenersEvent; public class ListenersSOService { @@ -153,28 +153,7 @@ package org.bigbluebutton.modules.listeners.business * Let's store the voice userid so we can do push to talk. */ if (UserManager.getInstance().getConference().amIThisVoiceUser(userId)) { - UserManager.getInstance().getConference().muteMyVoice(l.muted); - if(l.muted == false && UserManager.getInstance().getConference().getFirstTimeUnMute()) { - UserManager.getInstance().getConference().setFirstTimeUnMute(false); - dispatcher.dispatchEvent(new BBBEvent("MUTE_AUDIO_CONFIG")); - dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS")); - //dispatcher.dispatchEvent(new BBBEvent("VOICE_CONFERENCE_EVENT_BEGIN_PUBLISH")); - - - } - else { - if(l.muted == true && UserManager.getInstance().getConference().getFirstTimeUnMute() == false) { - dispatcher.dispatchEvent(new BBBEvent("STOP_OUT_STREAM")); - - - } - else if(l.muted == false && UserManager.getInstance().getConference().getFirstTimeUnMute() == false){ - dispatcher.dispatchEvent(new BBBEvent("VOICE_CONFERENCE_EVENT_BEGIN_PUBLISH")); - } - - } - - + UserManager.getInstance().getConference().muteMyVoice(l.muted); } } } @@ -332,7 +311,6 @@ package org.bigbluebutton.modules.listeners.business if (result.count > 0) { for(var p:Object in result.participants) { - var u:Object = result.participants[p] userJoin(u.participant, u.name, u.name, u.muted, u.talking, u.locked); } @@ -435,4 +413,4 @@ package org.bigbluebutton.modules.listeners.business _soErrors.push(error); } } -} +} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/vo/Listener.as b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/vo/Listener.as index ce571c9215..e05a03dd72 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/vo/Listener.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/business/vo/Listener.as @@ -28,10 +28,9 @@ package org.bigbluebutton.modules.listeners.business.vo { public var muted:Boolean; public var talking:Boolean; public var locked:Boolean; - public var firstTimeUnMute:Boolean = true; // Stores if the participant is moderator or not. // This is not the role of the joining listener // but of the participant running the client. public var moderator:Boolean = false; } -} +} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenerItem.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenerItem.mxml index dfaf8e63e5..d6d81d4f84 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenerItem.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenerItem.mxml @@ -45,8 +45,7 @@ [Bindable] private var statusTooltip : String = ""; [Bindable] private var ejectTooltip : String = ResourceUtil.getInstance().getString('bbb.listeners.ejectTooltip'); [Bindable] private var moderator:Boolean = false; - private var firstMute:Boolean = true; - + public function onRollOver():void{ if (moderator) kickUserBtn.visible = true; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as index a1a78b9839..ff3d6bb15a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as @@ -12,5 +12,8 @@ package org.bigbluebutton.modules.phone [Bindable] public var enabledEchoCancel:Boolean = false; + + [Bindable] + public var joinGlobal:Boolean = true; } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as index cc33e60999..c670d9419e 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as @@ -56,6 +56,10 @@ package org.bigbluebutton.modules.phone.managers { public function getConnection():NetConnection { return netConnection; } + + public function getConnected():Boolean { + return isConnected; + } public function connect(uid:String, externUID:String, username:String, room:String, uri:String):void { if (isConnected) return; @@ -137,6 +141,8 @@ package org.bigbluebutton.modules.phone.managers { event.codec = codec; dispatcher.dispatchEvent(event); } + + //******************************************************************************************** // @@ -145,10 +151,14 @@ package org.bigbluebutton.modules.phone.managers { //******************************************************************************************** public function doCall(dialStr:String):void { LogUtil.debug("in doCall - Calling " + dialStr); - //netConnection.call("voiceconf.call", null, "default", username, dialStr); - netConnection.call("voiceconf.call", null, "default", username, dialStr, "true"); + netConnection.call("voiceconf.call", null, "default", username, dialStr, "false"); } + public function doCallGlobal(dialStr:String):void { + LogUtil.debug("in doCallGlobal - Calling " + dialStr + " " + username); + netConnection.call("voiceconf.call", null, "default", username, dialStr, "true"); + } + public function doHangUp():void { if (isConnected) { netConnection.call("voiceconf.hangup", null, "default"); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as index 928f5e50da..c8c9cfee06 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as @@ -41,13 +41,16 @@ package org.bigbluebutton.modules.phone.managers { private var rejoining:Boolean = false; // User has requested to leave the voice conference. private var userHangup:Boolean = false; - + + private var globalCall:Boolean = true; + private var userRequestedToChangeToGlobal:Boolean = true; + private var userRequestedToChange:Boolean = false; public function PhoneManager() { connectionManager = new ConnectionManager(); streamManager = new StreamManager(); } - + public function setModuleAttributes(attributes:Object):void { this.attributes = attributes; var vxml:XML = BBB.getConfigForModule("PhoneModule"); @@ -56,24 +59,26 @@ package org.bigbluebutton.modules.phone.managers { phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; + phoneOptions.joinGlobal = (vxml.@joinGlobal.toString().toUpperCase() == "TRUE") ? true : false; } - if (phoneOptions.autoJoin) { - - - if (phoneOptions.skipCheck || noMicrophone()) { - /* - if (noMicrophone()) { - joinVoice(false); - } else { - joinVoice(true); - } - */ - joinVoice(false); - } else { - var dispatcher:Dispatcher = new Dispatcher(); - dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS")); - } + if (phoneOptions.autoJoin) { + if (phoneOptions.skipCheck) { + if (phoneOptions.joinGlobal) + joinVoiceGlobal(); + else if (noMicrophone()) { + joinVoice(false); + } else { + joinVoice(true); + } + } else { + if (phoneOptions.joinGlobal) + joinVoiceGlobal(); + else { + var dispatcher:Dispatcher = new Dispatcher(); + dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS")); + } + } } } @@ -89,49 +94,55 @@ package org.bigbluebutton.modules.phone.managers { else streamManager.initWithNoMicrophone(); } - - public function muteAudio():void { - streamManager.muteAudio(); - } - - public function unMuteAudio():void { - streamManager.unMuteAudio(); - } - - public function stopOutStream():void { - streamManager.stopOutStream(); - } - private function setupConnection():void { streamManager.setConnection(connectionManager.getConnection()); } - + + public function joinVoiceGlobal():void { + userHangup = false; + globalCall = true; + var uid:String = String(Math.floor(new Date().getTime())); + var uname:String = encodeURIComponent(UserManager.getInstance().getConference().getMyUserId() + "-" + attributes.username); + connectionManager.connect(uid, attributes.externUserID, uname , attributes.room, attributes.uri); + } + + + public function joinVoice(autoJoin:Boolean):void { userHangup = false; + globalCall = false; setupMic(autoJoin); var uid:String = String(Math.floor(new Date().getTime())); var uname:String = encodeURIComponent(UserManager.getInstance().getConference().getMyUserId() + "-" + attributes.username); connectionManager.connect(uid, attributes.externUserID, uname , attributes.room, attributes.uri); + } - - public function rejoin():void { - if (!rejoining && !userHangup) { - // We got disconnected and it's not because the user requested it. Let's rejoin the conference. - LogUtil.debug("Rejoining the conference"); - rejoining = true; - joinVoice(withMic); - } - } - - public function dialConference():void { - LogUtil.debug("*** Dialling conference ***"); - connectionManager.doCall(attributes.webvoiceconf); - } - public function beginPublish():void { - streamManager.beginPublishing(); + + public function rejoin():void { + + if (!rejoining && !userHangup) { + LogUtil.debug("Rejoining the conference"); + rejoining = true; + if(globalCall == false) { + joinVoice(true); + } + else + joinVoiceGlobal(); + } + } + + public function dialConference():void { + if(globalCall == false) { + LogUtil.debug("*** Talking/Listening ***"); + connectionManager.doCall(attributes.webvoiceconf); + } + else { + LogUtil.debug("*** Only Listening ***"); + connectionManager.doCallGlobal(attributes.webvoiceconf); + } } public function callConnected(event:CallConnectedEvent):void { @@ -141,19 +152,56 @@ package org.bigbluebutton.modules.phone.managers { // We have joined the conference. Reset so that if and when we get disconnected, we // can rejoin automatically. rejoining = false; + userHangup = false; + var dispatcher:Dispatcher = new Dispatcher(); + if(globalCall) + dispatcher.dispatchEvent(new BBBEvent("LISTENING_ONLY")); + else + dispatcher.dispatchEvent(new BBBEvent("SPEAKING_AND_LISTENING")); + } public function userRequestedHangup():void { LogUtil.debug("User has requested to hangup and leave the conference"); userHangup = true; + rejoining = false; + this.userRequestedToChange = false; hangup(); } + + public function userRequestedHangupToChange(event:BBBEvent):void { + userHangup = true; + rejoining = true; + userRequestedToChange = true; + userRequestedToChangeToGlobal = event.payload.global; + hangup(); + } + public function muteAudio():void { + LogUtil.debug("User has requested to mute audio"); + streamManager.muteAudio(); + } + + public function unmuteAudio():void { + LogUtil.debug("User has requested to unmute audio"); + streamManager.unmuteAudio(); + } + + public function hangup():void { if (onCall) { streamManager.stopStreams(); connectionManager.doHangUp(); onCall = false; + } + else { + if(this.userRequestedToChange) { + this.userRequestedToChange = false; + if(userRequestedToChangeToGlobal) + joinVoiceGlobal(); + else + joinVoice(withMic); + } } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as index 7378764b02..8850c4e3a8 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as @@ -36,9 +36,6 @@ package org.bigbluebutton.modules.phone.managers { import org.bigbluebutton.modules.phone.PhoneOptions; import org.bigbluebutton.modules.phone.events.MicrophoneUnavailEvent; import org.bigbluebutton.modules.phone.events.PlayStreamStatusEvent; - import org.bigbluebutton.core.managers.UserManager; - - import org.bigbluebutton.modules.listeners.events.ListenersCommand; public class StreamManager { public var connection:NetConnection = null; @@ -50,8 +47,8 @@ package org.bigbluebutton.modules.phone.managers { private var muted:Boolean = false; private var audioCodec:String = "SPEEX"; private var dispatcher:Dispatcher; - private var onlyListening:Boolean = true; - private var _custom_obj:Object = null; + private var listeningOnGlobal:Boolean; + public function StreamManager() { dispatcher = new Dispatcher(); } @@ -64,20 +61,12 @@ package org.bigbluebutton.modules.phone.managers { mic = Microphone.getMicrophone(-1); if(mic == null){ initWithNoMicrophone(); - onlyListening = true; } else { setupMicrophone(); mic.addEventListener(StatusEvent.STATUS, micStatusHandler); - onlyListening = false; } } - public function muteAudio():void { - incomingStream.receiveAudio(false); - } - - public function unMuteAudio():void { - incomingStream.receiveAudio(true); - } + private function setupMicrophone():void { var vxml:XML = BBB.getConfigForModule("PhoneModule"); var phoneOptions:PhoneOptions = new PhoneOptions(); @@ -116,17 +105,8 @@ package org.bigbluebutton.modules.phone.managers { } public function initWithNoMicrophone(): void { - mic = Microphone.getMicrophone(-1); - if(mic == null){ - var event:MicrophoneUnavailEvent = new MicrophoneUnavailEvent(); - dispatcher.dispatchEvent(event); - } else { - setupMicrophone(); - mic.addEventListener(StatusEvent.STATUS, micStatusHandler); - mic = null; - - } - onlyListening = true; + var event:MicrophoneUnavailEvent = new MicrophoneUnavailEvent(); + dispatcher.dispatchEvent(event); } private function micStatusHandler(event:StatusEvent):void { @@ -141,50 +121,46 @@ package org.bigbluebutton.modules.phone.managers { LogUtil.debug("unknown micStatusHandler event: " + event); } } - - public function beginPublishing():void { - unMuteAudio(); - if(mic == null) { - setupMicrophone(); - } - if(mic != null) { - onlyListening = false; - setupOutgoingStream(); - outgoingStream.client = _custom_obj; - publish(publishName); - } - - - } public function callConnected(playStreamName:String, publishStreamName:String, codec:String):void { + + LogUtil.debug("TOCANDO STREAM"); + setupMicrophone(); + if(codec != null) + audioCodec = codec; isCallConnected = true; - //audioCodec = codec; - publishName = publishStreamName; + if(incomingStream != null) { + stopStreams(); + incomingStream = null; + + } setupIncomingStream(); - - if (mic != null) { - onlyListening = true; - setupOutgoingStream(); + + if (publishStreamName != "") { + listeningOnGlobal = false; + if (mic != null) { + setupOutgoingStream(); + } } - if(onlyListening) { - dispatcher.dispatchEvent(new BBBEvent("ONLY_LISTENING_USER")); + else { + //mic = null; + listeningOnGlobal = true; } - setupPlayStatusHandler(); play(playStreamName); - publish(publishStreamName); - + if (listeningOnGlobal == false && publishStreamName != null) { + publish(publishStreamName); + } - } - private function play(playStreamName:String):void { + private function play(playStreamName:String):void { + LogUtil.debug("PLAY TO"); incomingStream.play(playStreamName); } private function publish(publishStreamName:String):void { - if (mic != null) + if (listeningOnGlobal == false && mic != null) outgoingStream.publish(publishStreamName, "live"); else LogUtil.debug("SM publish: No Microphone to publish"); @@ -206,17 +182,23 @@ package org.bigbluebutton.modules.phone.managers { incomingStream.receiveAudio(true); incomingStream.receiveVideo(false); } + + public function muteAudio():void { + if(incomingStream != null) + incomingStream.receiveAudio(false); + } + + public function unmuteAudio():void { + if(incomingStream != null) + incomingStream.receiveAudio(true); + } private function setupOutgoingStream():void { - - if(outgoingStream == null) { - outgoingStream = new NetStream(connection); - } + outgoingStream = new NetStream(connection); outgoingStream.addEventListener(NetStatusEvent.NET_STATUS, netStatus); outgoingStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); setupMicrophone(); outgoingStream.attachAudio(mic); - } private function setupPlayStatusHandler():void { @@ -224,21 +206,12 @@ package org.bigbluebutton.modules.phone.managers { custom_obj.onPlayStatus = playStatus; custom_obj.onMetadata = onMetadata; incomingStream.client = custom_obj; - _custom_obj = custom_obj; - if (mic != null) + if (listeningOnGlobal == false && mic != null) outgoingStream.client = custom_obj; } - - public function stopOutStream():void { - - outgoingStream.attachAudio(null); - //outgoingStream.close(); - mic = null; - //outgoingStream = null; - - } public function stopStreams():void { + LogUtil.debug("Stopping Stream(s)"); if(incomingStream != null) { LogUtil.debug("--Stopping Incoming Stream"); @@ -257,6 +230,7 @@ package org.bigbluebutton.modules.phone.managers { isCallConnected = false; LogUtil.debug("Stopped Stream(s)"); + } private function netStatus (evt:NetStatusEvent ):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml index f4e65cc723..ed6939e247 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml @@ -63,55 +63,52 @@ - + + + + + + - - + + + - + + + - - + + - - - - - - - - - + - - - + + - - - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as index d5d52cb32d..8f6fc47d71 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as @@ -26,15 +26,17 @@ package org.bigbluebutton.modules.phone.maps import org.bigbluebutton.core.BBB; import org.bigbluebutton.modules.phone.PhoneOptions; import org.bigbluebutton.modules.phone.views.components.ToolbarButton; - + import org.bigbluebutton.modules.phone.views.components.MuteButton; public class PhoneEventMapDelegate { private var phoneOptions:PhoneOptions; private var phoneButton:ToolbarButton; + private var soundButton:MuteButton; private var buttonOpen:Boolean = false; private var globalDispatcher:Dispatcher; public function PhoneEventMapDelegate() { phoneButton = new ToolbarButton(); + soundButton = new MuteButton(); globalDispatcher = new Dispatcher(); phoneOptions = new PhoneOptions(); var vxml:XML = BBB.getConfigForModule("PhoneModule"); @@ -56,6 +58,11 @@ package org.bigbluebutton.modules.phone.maps globalDispatcher.dispatchEvent(event); buttonOpen = true; } + + var event2:ToolbarButtonEvent = new ToolbarButtonEvent(ToolbarButtonEvent.ADD); + event2.button = soundButton; + globalDispatcher.dispatchEvent(event2); + } public function removeToolbarButton():void { @@ -78,7 +85,7 @@ package org.bigbluebutton.modules.phone.maps public function enableToolbarButton():void { phoneButton.selected = false; phoneButton.enabled = true; - phoneButton.userJoinedConference(false); + //phoneButton.userJoinedConference(false); } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/Images.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/Images.as index 8129528d58..51ed241e21 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/Images.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/Images.as @@ -30,6 +30,13 @@ package org.bigbluebutton.modules.phone.views.assets [Embed(source="images/headset_open.png")] public var headsetActiveIcon:Class; + + [Embed(source="images/sound.png")] + public var speakerActiveIcon:Class; + + [Embed(source="images/sound_mute.png")] + public var speakerInactiveIcon:Class; + } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/images/sound.png b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/images/sound.png new file mode 100644 index 0000000000000000000000000000000000000000..6056d234a9818d248987389d4a621e5c83ce0851 GIT binary patch literal 610 zcmV-o0-gPdP)FDRfPcVFW5d%9V=z{?A#;oriL5xO+n6O2X~nf!lQuE^VWXpgu83qI(qCF{ zS}dqc=wWy-JjhR6YYDxINHb)T^nMSh)vA20R`F7)lzCSCZF94My}d73T>N+m zpyXWPL`#FF;s+j3t(LL2R!6+EP98p9G9EaJe<5S)o@#CPu0JyV*YBbiNC<>y{C`3_2 zFc^fUC0P=`0GC2D0rmxry!i<{eh#|t2UjSV*w|QyY37m5W)KQZKoA6m%^;bK|K7sb zq~^Y!1U(%y>Cs5W^^bz?JUQeR7IK)M&$43OYdMwDJVcVBtSjl_Ar8Hmr2)a$eK-tv zNC4d)(7D`Piq~gVUR7m2k$BH5O6=$i%I6Kpa_sVNy!&j)9UKPT@*VWNNNm+UIUciF wPJ00!a`S;oH}3WS@hUTDnx*^y9@F3E2OYGed{u8eJ^%m!07*qoM6N<$f+a~A3jhEB literal 0 HcmV?d00001 diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/images/sound_mute.png b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/images/sound_mute.png new file mode 100644 index 0000000000000000000000000000000000000000..b652d2a71fc0e866d855c08f415b7ec057b3cee9 GIT binary patch literal 474 zcmV<00VV#4P)VI0N<*QWk}{)T2Jp~1;rnJ&N2haulNhlC*Od9Gf>KFEtyV>~T1KT( zMys`lcDs%9Y!**GpCvG7uAr)U^!sP%^?K-byD$s`r=o}<$KlrRw*+%D1$0-K<~|ff zfh@~77KHKSyI>I8i8yRaw2IR8ItU>!0|7iT3@*K1Y{mtMqF^t`<+5lr>Nw*0@#HI( zfyeDeD71=LjJFr0(_1)Hq)$07*qoM6N<$f*zgBZU6uP literal 0 HcmV?d00001 diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml new file mode 100644 index 0000000000..8fb61b9d46 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml @@ -0,0 +1,122 @@ + + + + + + + + + + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index 1e907b9f7b..b2e93c7990 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -27,9 +27,10 @@ toolTip="{ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.stop')}" implements="org.bigbluebutton.common.IBbbToolbarComponent"> - - - + + + + Date: Thu, 6 Dec 2012 15:20:15 -0200 Subject: [PATCH 05/28] Fixed multiclick on Toolbarbutton. Fixed mute using togglePause. Bug: Need to setup mic to play audio --- .../bigbluebutton/main/views/MicSettings.mxml | 21 ++++-- .../modules/phone/managers/PhoneManager.as | 8 ++ .../modules/phone/managers/StreamManager.as | 73 ++++++++++++++----- .../modules/phone/maps/PhoneEventMap.mxml | 32 +++++++- .../phone/maps/PhoneEventMapDelegate.as | 4 + .../phone/views/components/MuteButton.mxml | 4 +- .../phone/views/components/ToolbarButton.mxml | 37 ++++++++-- 7 files changed, 142 insertions(+), 37 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml index b33fb36d44..8dcb2e8de9 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml @@ -71,18 +71,27 @@ } private function onJoinClicked():void { + var e:BBBEvent = new BBBEvent("RESTORE_TO_ADJUST"); + dispatchEvent(e); cleanUp(); - var joinEvent:BBBEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); - joinEvent.payload['useMicrophone'] = true; - dispatchEvent(joinEvent); + //var joinEvent:BBBEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); + //joinEvent.payload['useMicrophone'] = true; + var askToChangeEvent:BBBEvent = new BBBEvent("ASK_TO_CHANGE_VOICE_CONFERENCE_EVENT"); + askToChangeEvent.payload["global"] = false; + dispatchEvent(askToChangeEvent); + PopUpManager.removePopUp(this); } private function onCancelClicked():void { + var e:BBBEvent = new BBBEvent("RESTORE_TO_ADJUST"); + dispatchEvent(e); + e = new BBBEvent("ENABLE_JOIN_BUTTON"); + dispatchEvent(e); cleanUp(); - var event:BBBEvent = new BBBEvent("MIC_SETTINGS_CLOSED"); - event.payload['clicked'] = "cancel"; - dispatchEvent(event); + //var event:BBBEvent = new BBBEvent("MIC_SETTINGS_CLOSED"); + //event.payload['clicked'] = "cancel"; + //dispatchEvent(event); PopUpManager.removePopUp(this); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as index c8c9cfee06..b43a452a5f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as @@ -186,6 +186,14 @@ package org.bigbluebutton.modules.phone.managers { streamManager.unmuteAudio(); } + public function saveAudio():void { + streamManager.saveAudio(); + } + + public function restoreAudio():void { + streamManager.restoreAudio(); + } + public function hangup():void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as index 8850c4e3a8..423f4f353f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as @@ -48,7 +48,9 @@ package org.bigbluebutton.modules.phone.managers { private var audioCodec:String = "SPEEX"; private var dispatcher:Dispatcher; private var listeningOnGlobal:Boolean; + private var savedAudio:Boolean = false; + public function StreamManager() { dispatcher = new Dispatcher(); } @@ -58,6 +60,7 @@ package org.bigbluebutton.modules.phone.managers { } public function initMicrophone():void { + LogUtil.debug("INIT O MIC"); mic = Microphone.getMicrophone(-1); if(mic == null){ initWithNoMicrophone(); @@ -83,6 +86,9 @@ package org.bigbluebutton.modules.phone.managers { options.echoPath = 128; options.nonLinearProcessing = true; mic['enhancedOptions'] = options; + + + } else { } @@ -123,17 +129,14 @@ package org.bigbluebutton.modules.phone.managers { } public function callConnected(playStreamName:String, publishStreamName:String, codec:String):void { - - LogUtil.debug("TOCANDO STREAM"); setupMicrophone(); - if(codec != null) + + + if(codec != "") audioCodec = codec; + isCallConnected = true; - if(incomingStream != null) { - stopStreams(); - incomingStream = null; - - } + setupIncomingStream(); if (publishStreamName != "") { @@ -143,7 +146,6 @@ package org.bigbluebutton.modules.phone.managers { } } else { - //mic = null; listeningOnGlobal = true; } setupPlayStatusHandler(); @@ -151,11 +153,16 @@ package org.bigbluebutton.modules.phone.managers { if (listeningOnGlobal == false && publishStreamName != null) { publish(publishStreamName); } - + + // Restore mute state when changing between global and normal + if(muted == true) { + muted = false; + muteAudio(); + } + } private function play(playStreamName:String):void { - LogUtil.debug("PLAY TO"); incomingStream.play(playStreamName); } @@ -184,20 +191,45 @@ package org.bigbluebutton.modules.phone.managers { } public function muteAudio():void { - if(incomingStream != null) - incomingStream.receiveAudio(false); + if(incomingStream != null && muted == false) { + incomingStream.togglePause(); + muted = true; + } + dispatcher.dispatchEvent(new BBBEvent("MUTE_AUDIO_VOICE_CONFERENCE_COMPLETE")); } public function unmuteAudio():void { - if(incomingStream != null) - incomingStream.receiveAudio(true); + if(incomingStream != null && muted == true) { + incomingStream.togglePause(); + muted = false; + } + dispatcher.dispatchEvent(new BBBEvent("UNMUTE_AUDIO_VOICE_CONFERENCE_COMPLETE")); + } + + public function saveAudio():void { + if(incomingStream != null && muted == false) { + savedAudio = true; + incomingStream.togglePause(); + LogUtil.debug("SAVED"); + } + else { + savedAudio = false; + } } + + public function restoreAudio():void { + setupMicrophone(); + if(savedAudio) { + LogUtil.debug("RESTORED"); + incomingStream.togglePause(); + } + } + private function setupOutgoingStream():void { outgoingStream = new NetStream(connection); outgoingStream.addEventListener(NetStatusEvent.NET_STATUS, netStatus); - outgoingStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); - setupMicrophone(); + outgoingStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); outgoingStream.attachAudio(mic); } @@ -216,6 +248,7 @@ package org.bigbluebutton.modules.phone.managers { if(incomingStream != null) { LogUtil.debug("--Stopping Incoming Stream"); incomingStream.play(false); + } else { LogUtil.debug("--Incoming Stream Null"); } @@ -224,10 +257,12 @@ package org.bigbluebutton.modules.phone.managers { LogUtil.debug("--Stopping Outgoing Stream"); outgoingStream.attachAudio(null); outgoingStream.close(); + } else { LogUtil.debug("--Outgoing Stream Null"); } - + incomingStream = null; + outgoingStream = null; isCallConnected = false; LogUtil.debug("Stopped Stream(s)"); @@ -262,7 +297,7 @@ package org.bigbluebutton.modules.phone.managers { } private function playStatus(event:Object):void { - // do nothing + // do nothing } private function onMetadata(event:Object):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml index ed6939e247..4397b7a387 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml @@ -80,6 +80,9 @@ + + + @@ -94,6 +97,20 @@ + + + + + + + + + + + + + + @@ -101,14 +118,25 @@ - + + + + - + + + + + + + + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as index 8f6fc47d71..3669846575 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as @@ -81,6 +81,10 @@ package org.bigbluebutton.modules.phone.maps phoneButton.enabled = true; phoneButton.userJoinedConference(true); } + + public function enableMuteButton():void { + soundButton.enabled = true; + } public function enableToolbarButton():void { phoneButton.selected = false; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml index 8fb61b9d46..a70d6c9932 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml @@ -85,14 +85,14 @@ public function muteLocalUser():void { var e:BBBEvent = new BBBEvent("MUTE_AUDIO_VOICE_CONFERENCE"); dispatcher.dispatchEvent(e); - this.enabled = true; } public function unmuteLocalUser():void{ var e:BBBEvent = new BBBEvent("UNMUTE_AUDIO_VOICE_CONFERENCE"); dispatcher.dispatchEvent(e); - this.enabled = true; } + + private function mouseOverHandler(event:MouseEvent):void { if(_currentState == LISTENING_STATE) phoneIcon = images.speakerInactiveIcon; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index b2e93c7990..279bdd387d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -60,13 +60,34 @@ private function startPhone():void { this.enabled = false; - var askToChangeEvent:BBBEvent; - askToChangeEvent = new BBBEvent("ASK_TO_CHANGE_VOICE_CONFERENCE_EVENT"); - if(_currentState == DEFAULT_STATE) - askToChangeEvent.payload["global"] = false; - else - askToChangeEvent.payload["global"] = true; - dispatcher.dispatchEvent(askToChangeEvent); + var vxml:XML = BBB.getConfigForModule("PhoneModule"); + var phoneOptions:PhoneOptions = new PhoneOptions(); + if (vxml != null) { + phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; + phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; + phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; + phoneOptions.joinGlobal = (vxml.@joinGlobal.toString().toUpperCase() == "TRUE") ? true : false; + } + if (noMicrophone() == false) { + var askToChangeEvent:BBBEvent; + askToChangeEvent = new BBBEvent("ASK_TO_CHANGE_VOICE_CONFERENCE_EVENT"); + if(_currentState == DEFAULT_STATE) { + if(phoneOptions.skipCheck) { + askToChangeEvent.payload["global"] = false; + } + else { + askToChangeEvent = new BBBEvent("SHOW_MIC_SETTINGS"); + } + } + else { + askToChangeEvent.payload["global"] = true; + } + dispatcher.dispatchEvent(askToChangeEvent); + } + + + + } private function mouseOverHandler(event:MouseEvent):void { @@ -99,7 +120,7 @@ phoneIcon = images.headsetDefaultIcon; this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start'); } - dispatcher.dispatchEvent(new BBBEvent("UNMUTE_AUDIO_VOICE_CONFERENCE")); + } From b8d43c1779a01d3dfe5eeac2f1cf4f0019f87ded Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Wed, 12 Dec 2012 14:42:40 -0200 Subject: [PATCH 06/28] Fixed missing codec using global audio. --- .../voiceconf/red5/ClientConnectionManager.java | 4 ++-- .../org/bigbluebutton/voiceconf/sip/CallAgent.java | 4 ++-- .../org/bigbluebutton/voiceconf/sip/GlobalCall.java | 12 +++++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java index bd44812f19..a5bdeec49b 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java @@ -45,11 +45,11 @@ public class ClientConnectionManager { } } - public void joinConferenceSuccessNew(String clientId, String listen) { + public void joinConferenceSuccessNew(String clientId, String listen, String codec) { ClientConnection cc = clients.get(clientId); if (cc != null) { System.out.println("String Global"); - cc.onJoinConferenceSuccess("", listen, ""); + cc.onJoinConferenceSuccess("", listen, codec); } } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java index 0dad5d9b0d..3959ef1dbc 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java @@ -266,7 +266,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver if(_callerName.contains("GLOBAL_AUDIO") == true) { //String room = _callerName.subSequence(13, _callerName.length()).toString(); - GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName()); + GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName(), sipCodec.getCodecName()); caToInit.returnGlobalStreamName(caToInit.getCallId(), _destination); talking = true; } @@ -307,7 +307,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver talking = false; _destination = destination; GlobalCall.addUser(_destination); - clientConnManager.joinConferenceSuccessNew(clientId, GlobalCall.getGlobalAudioStream(destination)); + clientConnManager.joinConferenceSuccessNew(clientId, GlobalCall.getGlobalAudioStream(destination), GlobalCall.getRoomCodec(destination)); } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java index 2ef96d0e6f..a0f2becec8 100644 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java @@ -9,14 +9,16 @@ public class GlobalCall { public static Map voiceConference = new ConcurrentHashMap(); public static Map numberOfUsers = new ConcurrentHashMap(); - + public static Map codecVoiceConference = new ConcurrentHashMap(); + public static boolean roomHasGlobalStream(String roomName) { return voiceConference.containsKey(roomName); } - public static void addGlobalAudioStream(String roomName, String globalAudioStreamName) { + public static void addGlobalAudioStream(String roomName, String globalAudioStreamName, String codecName) { voiceConference.put(roomName, globalAudioStreamName); + codecVoiceConference.put(roomName, codecName); numberOfUsers.put(roomName, 0); } @@ -28,7 +30,7 @@ public class GlobalCall { System.out.println("REMOVENDO A SALA "+roomName); voiceConference.remove(roomName); numberOfUsers.remove(roomName); - + codecVoiceConference.remove(roomName); } public static void addUser(String roomName) { @@ -51,5 +53,9 @@ public class GlobalCall { return numberOfUsers.get(roomName); } + public static String getRoomCodec(String roomName) { + return codecVoiceConference.get(roomName); + } + } From 1f162d9b1cdd6611985f6239f5b6dd8ca6068e71 Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Fri, 14 Dec 2012 09:04:31 -0200 Subject: [PATCH 07/28] Cleaning code. --- .../voiceconf/red5/ClientConnection.java | 5 +- .../bigbluebutton/voiceconf/red5/Service.java | 9 +- .../voiceconf/red5/media/CallStream.java | 6 - .../voiceconf/sip/CallAgent.java | 22 +-- .../bigbluebutton/voiceconf/sip/SipPeer.java | 6 +- .../service/voice/VoiceService.java | 16 +- .../red5/voice/ClientManager.java | 1 - .../main/views/MainApplicationShell.mxml | 2 +- .../modules/phone/PhoneOptions.as | 2 +- .../phone/managers/ConnectionManager.as | 176 +++++++++--------- .../modules/phone/managers/PhoneManager.as | 9 +- .../modules/phone/managers/StreamManager.as | 43 ++--- .../modules/phone/maps/PhoneEventMap.mxml | 3 +- .../phone/maps/PhoneEventMapDelegate.as | 2 +- .../phone/views/components/ToolbarButton.mxml | 11 +- 15 files changed, 130 insertions(+), 183 deletions(-) diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java index bc6c18ab03..3a963d2348 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java @@ -64,11 +64,8 @@ private static Logger log = Red5LoggerFactory.getLogger(ClientConnection.class, } public void onLeaveConference() { - System.out.println("ESTOU AQUI + " + username + userid); log.debug("Notify client that {} [{}] left the conference.", username, userid); if(connection != null && connection.isConnected()) connection.invoke("disconnectedFromJoinVoiceConferenceCallback", new Object[] {"onUaCallClosed"}); - - System.out.println("PASSEI PALA INVOCACAO"); - } + } } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java index 413900c5be..f4e19bbb64 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java @@ -34,8 +34,6 @@ public class Service { private SipPeerManager sipPeerManager; private MessageFormat callExtensionPattern = new MessageFormat("{0}"); - - public Boolean call(String peerId, String callerName, String destination, Boolean global) { @@ -68,12 +66,10 @@ public class Service { } public Boolean call(String peerId, String callerName, String destination) { - - String clientId = Red5.getConnectionLocal().getClient().getId(); + String clientId = Red5.getConnectionLocal().getClient().getId(); String userid = getUserId(); String username = getUsername(); - - log.debug("{} is requesting to join into the conference {}", username + "[uid=" + userid + "][clientid=" + clientId + "]", destination); + log.debug("{} is requesting to join into the conference {}", username + "[uid=" + userid + "][clientid=" + clientId + "]", destination); String extension = callExtensionPattern.format(new String[] { destination }); try { @@ -92,7 +88,6 @@ public class Service { String username = getUsername(); log.debug("{} is requesting to hang up from the conference.", username + "[uid=" + userid + "][clientid=" + clientId + "]"); try { - System.out.println("USUARIO " + username + " saiu da conferencia AKI OI OI OI"); sipPeerManager.hangup(peerId, getClientId()); return true; } catch (PeerNotFoundException e) { diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java index d4b5a21ef2..0f23612af1 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java @@ -32,8 +32,6 @@ import org.slf4j.Logger; import org.red5.logging.Red5LoggerFactory; import org.red5.server.api.IScope; import org.red5.server.api.stream.IBroadcastStream; -import java.net.DatagramSocket; - public class CallStream implements StreamObserver { private final static Logger log = Red5LoggerFactory.getLogger(CallStream.class, "sip"); @@ -75,10 +73,6 @@ public class CallStream implements StreamObserver { userListenStream.start(); userTalkStream = new FlashToSipAudioStream(flashToSipTranscoder, connInfo.getSocket(), connInfo); } - - public DatagramSocket getSocket() { - return connInfo.getSocket(); - } public String getTalkStreamName() { return userTalkStream.getStreamName(); diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java index 3959ef1dbc..91665d4845 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java @@ -62,7 +62,6 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver private Boolean talking = false; private Boolean socketGlobal = false; - private enum CallState { UA_IDLE(0), UA_INCOMING_CALL(1), UA_OUTGOING_CALL(2), UA_ONCALL(3); private final int state; @@ -83,7 +82,6 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver } public CallAgent(SipProvider sipProvider, SipPeerProfile userProfile, AudioConferenceProvider portProvider, String clientId) { - System.out.println("FUI CRIADO AGORA"); this.sipProvider = sipProvider; this.userProfile = userProfile; this.portProvider = portProvider; @@ -121,7 +119,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver return; } - setupCallerDisplayName(callerName, destination); + setupCallerDisplayName(callerName, destination); userProfile.initContactAddress(sipProvider); initSessionDescriptor(); @@ -134,9 +132,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver // In case of incomplete url (e.g. only 'user' is present), // try to complete it. destination = sipProvider.completeNameAddress(destination).toString(); - - - log.debug("call {}", destination); + log.debug("call {}", destination); if (userProfile.noOffer) { call.call(destination); } else { @@ -209,8 +205,6 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver } else { callState = CallState.UA_IDLE; - System.out.println("NAO ESTOU FALANDO"); - System.out.println(clientId + " eh o usuario que ta indo"); clientConnManager.leaveConference(clientId); } } @@ -314,7 +308,6 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver private void closeVoiceStreams() { log.debug("Shutting down the voice streams."); if (callStream != null) { - System.out.println("FECHANDO AS VOICE STREAMS"); callStream.stop(); callStream = null; } else { @@ -410,11 +403,9 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver notifyListenersOfOnIncomingCallCancelled(); } - - private void notifyListenersOnCallConnected(String talkStream, String listenStream) { log.debug("notifyListenersOnCallConnected for {}", clientId); - clientConnManager.joinConferenceSuccess(clientId, talkStream, listenStream, sipCodec.getCodecName()); + clientConnManager.joinConferenceSuccess(clientId, talkStream, listenStream, sipCodec.getCodecName()); } private void notifyListenersOnOutgoingCallFailed() { @@ -429,9 +420,9 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver } private void notifyListenersOfOnCallClosed() { - log.debug("notifyListenersOfOnCallClosed for {}", clientId); + log.debug("notifyListenersOfOnCallClosed for {}", clientId); clientConnManager.leaveConference(clientId); - cleanup(); + cleanup(); } private void cleanup() { @@ -440,9 +431,8 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver localSocket.close(); } } else { - log.debug("Trying to close un-allocated port {}", localSocket.getLocalPort()); + log.debug("Trying to close un-allocated port {}", localSocket.getLocalPort()); } - } /** Callback function called when arriving a BYE request */ diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java index fde2db7258..f682a06ba3 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java @@ -142,7 +142,7 @@ public class SipPeer implements SipRegisterAgentListener { SipPeerProfile callerProfile = SipPeerProfile.copy(registeredProfile); CallAgent ca = new CallAgent(sipProvider, callerProfile, audioconfProvider, clientId); - ca.setClientConnectionManager(clientConnManager); + ca.setClientConnectionManager(clientConnManager); ca.setCallStreamFactory(callStreamFactory); callManager.add(ca); ca.call(callerName, destination); @@ -172,6 +172,7 @@ public class SipPeer implements SipRegisterAgentListener { public void hangup(String clientId) { log.debug( "SIPUser hangup" ); + CallAgent ca = callManager.remove(clientId); String destination; if(ca != null) { @@ -199,8 +200,7 @@ public class SipPeer implements SipRegisterAgentListener { } } } - - } + } public void unregister() { log.debug( "SIPUser unregister" ); diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceService.java index 3b87d5fc1c..6364a29ebf 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceService.java @@ -20,20 +20,12 @@ * ===License Header=== */ package org.bigbluebutton.conference.service.voice; - -import org.slf4j.Logger; -import org.red5.server.api.Red5; -import org.bigbluebutton.conference.BigBlueButtonSession; -import org.bigbluebutton.conference.Constants; -import org.red5.logging.Red5LoggerFactory; -import org.bigbluebutton.webconference.voice.ConferenceService; -import java.util.ArrayList; -import java.util.HashMap; + import org.slf4j.Logger; import org.red5.server.api.Red5; import org.bigbluebutton.conference.BigBlueButtonSession; import org.bigbluebutton.conference.Constants; import org.red5.logging.Red5LoggerFactory; +import org.bigbluebutton.webconference.voice.ConferenceService; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.bigbluebutton.webconference.voice.Participant; - +import org.bigbluebutton.webconference.voice.Participant; public class VoiceService { private static Logger log = Red5LoggerFactory.getLogger( VoiceService.class, "bigbluebutton" ); @@ -52,7 +44,7 @@ public class VoiceService { participants.put("count", 0); } else { participants.put("count", p.size()); - if (p.size() > 0) { + if (p.size() > 0) { participants.put("participants", arrayListToMap(p)); } } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/red5/voice/ClientManager.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/red5/voice/ClientManager.java index a3b774698b..49fbfe4349 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/red5/voice/ClientManager.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/red5/voice/ClientManager.java @@ -63,7 +63,6 @@ public class ClientManager implements ClientNotifier { RoomInfo soi = voiceRooms.get(room); if (soi != null) { List list = new ArrayList(); - list.add(participant); list.add(name); list.add(name); diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index 482c427ecf..7d6be722bd 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -32,7 +32,7 @@ - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as index ff3d6bb15a..515d7989e6 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as @@ -16,4 +16,4 @@ package org.bigbluebutton.modules.phone [Bindable] public var joinGlobal:Boolean = true; } -} +} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as index c670d9419e..1eeeb8d806 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as @@ -17,40 +17,40 @@ * */ -package org.bigbluebutton.modules.phone.managers { - import com.asfusion.mate.events.Dispatcher; - import flash.events.AsyncErrorEvent; - import flash.events.Event; - import flash.events.IEventDispatcher; - import flash.events.NetStatusEvent; - import flash.events.SecurityErrorEvent; - import flash.external.*; - import flash.net.NetConnection; - import flash.net.NetStream; - import org.bigbluebutton.common.LogUtil; - import org.bigbluebutton.modules.phone.events.CallConnectedEvent; - import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent; - import org.bigbluebutton.modules.phone.events.ConnectionStatusEvent; - import org.bigbluebutton.modules.phone.events.RegistrationFailedEvent; - import org.bigbluebutton.modules.phone.events.RegistrationSuccessEvent; - - public class ConnectionManager { - - private var netConnection:NetConnection = null; - private var incomingNetStream:NetStream = null; - private var outgoingNetStream:NetStream = null; - private var username:String; - private var uri:String; - private var uid:String; - private var room:String; - - private var isConnected:Boolean = false; +package org.bigbluebutton.modules.phone.managers { + import com.asfusion.mate.events.Dispatcher; + import flash.events.AsyncErrorEvent; + import flash.events.Event; + import flash.events.IEventDispatcher; + import flash.events.NetStatusEvent; + import flash.events.SecurityErrorEvent; + import flash.external.*; + import flash.net.NetConnection; + import flash.net.NetStream; + import org.bigbluebutton.common.LogUtil; + import org.bigbluebutton.modules.phone.events.CallConnectedEvent; + import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent; + import org.bigbluebutton.modules.phone.events.ConnectionStatusEvent; + import org.bigbluebutton.modules.phone.events.RegistrationFailedEvent; + import org.bigbluebutton.modules.phone.events.RegistrationSuccessEvent; + + public class ConnectionManager { + + private var netConnection:NetConnection = null; + private var incomingNetStream:NetStream = null; + private var outgoingNetStream:NetStream = null; + private var username:String; + private var uri:String; + private var uid:String; + private var room:String; + + private var isConnected:Boolean = false; private var registered:Boolean = false; private var dispatcher:Dispatcher; public function ConnectionManager():void { - dispatcher = new Dispatcher(); + dispatcher = new Dispatcher(); } public function getConnection():NetConnection { @@ -60,31 +60,31 @@ package org.bigbluebutton.modules.phone.managers { public function getConnected():Boolean { return isConnected; } - + public function connect(uid:String, externUID:String, username:String, room:String, uri:String):void { if (isConnected) return; isConnected = true; - - this.uid = uid; - this.username = username; - this.room = room; + + this.uid = uid; + this.username = username; + this.room = room; this.uri = uri; - connectToServer(externUID, username); - } - - private function connectToServer(externUID:String, username:String):void { - NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0; - netConnection = new NetConnection(); - netConnection.client = this; - netConnection.addEventListener( NetStatusEvent.NET_STATUS , netStatus ); + connectToServer(externUID, username); + } + + private function connectToServer(externUID:String, username:String):void { + NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0; + netConnection = new NetConnection(); + netConnection.client = this; + netConnection.addEventListener( NetStatusEvent.NET_STATUS , netStatus ); netConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); - netConnection.connect(uri, externUID, username); - } - - public function disconnect():void { - netConnection.close(); - } - + netConnection.connect(uri, externUID, username); + } + + public function disconnect():void { + netConnection.close(); + } + private function netStatus (evt:NetStatusEvent ):void { if (evt.info.code == "NetConnection.Connect.Success") { var event:ConnectionStatusEvent = new ConnectionStatusEvent(); @@ -97,33 +97,33 @@ package org.bigbluebutton.modules.phone.managers { } else { LogUtil.info("Connection event info [" + evt.info.code + "]. Disconnecting."); disconnect(); - } - } - - private function asyncErrorHandler(event:AsyncErrorEvent):void { - LogUtil.debug("AsyncErrorEvent: " + event); - } - - private function securityErrorHandler(event:SecurityErrorEvent):void { - LogUtil.debug("securityErrorHandler: " + event); - } - + } + } + + private function asyncErrorHandler(event:AsyncErrorEvent):void { + LogUtil.debug("AsyncErrorEvent: " + event); + } + + private function securityErrorHandler(event:SecurityErrorEvent):void { + LogUtil.debug("securityErrorHandler: " + event); + } + public function call():void { LogUtil.debug("in call - Calling " + room); - doCall(room); - } - - //******************************************************************************************** - // - // CallBack Methods from Red5 - // + doCall(room); + } + + //******************************************************************************************** + // + // CallBack Methods from Red5 + // //******************************************************************************************** public function failedToJoinVoiceConferenceCallback(msg:String):* { LogUtil.debug("failedToJoinVoiceConferenceCallback " + msg); var event:CallDisconnectedEvent = new CallDisconnectedEvent(); dispatcher.dispatchEvent(event); isConnected = false; - } + } public function disconnectedFromJoinVoiceConferenceCallback(msg:String):* { LogUtil.debug("disconnectedFromJoinVoiceConferenceCallback " + msg); @@ -131,9 +131,9 @@ package org.bigbluebutton.modules.phone.managers { dispatcher.dispatchEvent(event); isConnected = false; } - - public function successfullyJoinedVoiceConferenceCallback(publishName:String, playName:String, codec:String):* { - LogUtil.debug("successfullyJoinedVoiceConferenceCallback " + publishName + " : " + playName + " : " + codec); + + public function successfullyJoinedVoiceConferenceCallback(publishName:String, playName:String, codec:String):* { + LogUtil.debug("successfullyJoinedVoiceConferenceCallback " + publishName + " : " + playName + " : " + codec); isConnected = true; var event:CallConnectedEvent = new CallConnectedEvent(); event.publishStreamName = publishName; @@ -141,29 +141,27 @@ package org.bigbluebutton.modules.phone.managers { event.codec = codec; dispatcher.dispatchEvent(event); } - - - - //******************************************************************************************** - // - // SIP Actions - // - //******************************************************************************************** + + //******************************************************************************************** + // + // SIP Actions + // + //******************************************************************************************** public function doCall(dialStr:String):void { - LogUtil.debug("in doCall - Calling " + dialStr); + LogUtil.debug("in doCall - Calling " + dialStr); netConnection.call("voiceconf.call", null, "default", username, dialStr, "false"); } public function doCallGlobal(dialStr:String):void { LogUtil.debug("in doCallGlobal - Calling " + dialStr + " " + username); netConnection.call("voiceconf.call", null, "default", username, dialStr, "true"); - } - - public function doHangUp():void { + } + + public function doHangUp():void { if (isConnected) { - netConnection.call("voiceconf.hangup", null, "default"); - isConnected = false; - } + netConnection.call("voiceconf.hangup", null, "default"); + isConnected = false; + } } public function onBWCheck(... rest):Number { @@ -175,6 +173,6 @@ package org.bigbluebutton.modules.phone.managers { // your application should do something here // when the bandwidth check is complete trace("bandwidth = " + p_bw + " Kbps."); - } - } -} + } + } +} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as index b43a452a5f..d6e1e8379a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as @@ -116,24 +116,21 @@ package org.bigbluebutton.modules.phone.managers { var uid:String = String(Math.floor(new Date().getTime())); var uname:String = encodeURIComponent(UserManager.getInstance().getConference().getMyUserId() + "-" + attributes.username); connectionManager.connect(uid, attributes.externUserID, uname , attributes.room, attributes.uri); - } - - public function rejoin():void { - if (!rejoining && !userHangup) { + // We got disconnected and it's not because the user requested it. Let's rejoin the conference. LogUtil.debug("Rejoining the conference"); rejoining = true; if(globalCall == false) { - joinVoice(true); + joinVoice(withMic); } else joinVoiceGlobal(); } } - + public function dialConference():void { if(globalCall == false) { LogUtil.debug("*** Talking/Listening ***"); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as index 423f4f353f..bde62e8f24 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as @@ -18,18 +18,18 @@ */ package org.bigbluebutton.modules.phone.managers { - import com.asfusion.mate.events.Dispatcher; - import flash.events.ActivityEvent; - import flash.events.AsyncErrorEvent; - import flash.events.IEventDispatcher; - import flash.events.NetStatusEvent; - import flash.events.StatusEvent; - import flash.media.Microphone; - import flash.media.MicrophoneEnhancedMode; - import flash.media.MicrophoneEnhancedOptions; - import flash.media.SoundCodec; - import flash.net.NetConnection; - import flash.net.NetStream; + import com.asfusion.mate.events.Dispatcher; + import flash.events.ActivityEvent; + import flash.events.AsyncErrorEvent; + import flash.events.IEventDispatcher; + import flash.events.NetStatusEvent; + import flash.events.StatusEvent; + import flash.media.Microphone; + import flash.media.MicrophoneEnhancedMode; + import flash.media.MicrophoneEnhancedOptions; + import flash.media.SoundCodec; + import flash.net.NetConnection; + import flash.net.NetStream; import org.bigbluebutton.common.LogUtil; import org.bigbluebutton.core.BBB; import org.bigbluebutton.main.events.BBBEvent; @@ -45,12 +45,11 @@ package org.bigbluebutton.modules.phone.managers { private var mic:Microphone = null; private var isCallConnected:Boolean = false; private var muted:Boolean = false; - private var audioCodec:String = "SPEEX"; - private var dispatcher:Dispatcher; + private var audioCodec:String = "SPEEX"; + private var dispatcher:Dispatcher; private var listeningOnGlobal:Boolean; private var savedAudio:Boolean = false; - public function StreamManager() { dispatcher = new Dispatcher(); } @@ -60,7 +59,6 @@ package org.bigbluebutton.modules.phone.managers { } public function initMicrophone():void { - LogUtil.debug("INIT O MIC"); mic = Microphone.getMicrophone(-1); if(mic == null){ initWithNoMicrophone(); @@ -86,9 +84,6 @@ package org.bigbluebutton.modules.phone.managers { options.echoPath = 128; options.nonLinearProcessing = true; mic['enhancedOptions'] = options; - - - } else { } @@ -162,7 +157,7 @@ package org.bigbluebutton.modules.phone.managers { } - private function play(playStreamName:String):void { + private function play(playStreamName:String):void { incomingStream.play(playStreamName); } @@ -243,12 +238,10 @@ package org.bigbluebutton.modules.phone.managers { } public function stopStreams():void { - LogUtil.debug("Stopping Stream(s)"); if(incomingStream != null) { LogUtil.debug("--Stopping Incoming Stream"); incomingStream.play(false); - } else { LogUtil.debug("--Incoming Stream Null"); } @@ -257,7 +250,6 @@ package org.bigbluebutton.modules.phone.managers { LogUtil.debug("--Stopping Outgoing Stream"); outgoingStream.attachAudio(null); outgoingStream.close(); - } else { LogUtil.debug("--Outgoing Stream Null"); } @@ -265,7 +257,6 @@ package org.bigbluebutton.modules.phone.managers { outgoingStream = null; isCallConnected = false; LogUtil.debug("Stopped Stream(s)"); - } private function netStatus (evt:NetStatusEvent ):void { @@ -297,11 +288,11 @@ package org.bigbluebutton.modules.phone.managers { } private function playStatus(event:Object):void { - // do nothing + // do nothing } private function onMetadata(event:Object):void { LogUtil.debug("Recieve ON METADATA from SIP"); } } -} +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml index 4397b7a387..6923828a84 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml @@ -63,7 +63,7 @@ - + @@ -113,6 +113,7 @@ + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as index 3669846575..bbfead7dd6 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as @@ -92,4 +92,4 @@ package org.bigbluebutton.modules.phone.maps //phoneButton.userJoinedConference(false); } } -} +} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index 279bdd387d..77899f9e90 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -59,6 +59,8 @@ [Bindable] public var phoneIcon:Class = images.headsetDefaultIcon; private function startPhone():void { + // Disable the button right away to prevent the user from clicking + // multiple times. this.enabled = false; var vxml:XML = BBB.getConfigForModule("PhoneModule"); var phoneOptions:PhoneOptions = new PhoneOptions(); @@ -84,10 +86,6 @@ } dispatcher.dispatchEvent(askToChangeEvent); } - - - - } private function mouseOverHandler(event:MouseEvent):void { @@ -105,8 +103,6 @@ } public function userJoinedConference(joined: Boolean):void { - - if (joined) { this.selected = true; this.enabled = true; @@ -120,9 +116,6 @@ phoneIcon = images.headsetDefaultIcon; this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start'); } - - - } private function noMicrophone():Boolean { From 41320e98a4f0ae33fd341177a691160b52a882e1 Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Mon, 7 Jan 2013 08:53:11 -0200 Subject: [PATCH 08/28] Bugfix config.xml now user always join in global-audio if global audio parameter is true. --- .../modules/phone/managers/PhoneManager.as | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as index d6e1e8379a..1eba3248bc 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as @@ -61,25 +61,23 @@ package org.bigbluebutton.modules.phone.managers { phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; phoneOptions.joinGlobal = (vxml.@joinGlobal.toString().toUpperCase() == "TRUE") ? true : false; } - - if (phoneOptions.autoJoin) { - if (phoneOptions.skipCheck) { - if (phoneOptions.joinGlobal) - joinVoiceGlobal(); - else if (noMicrophone()) { - joinVoice(false); - } else { - joinVoice(true); - } - } else { - if (phoneOptions.joinGlobal) - joinVoiceGlobal(); - else { - var dispatcher:Dispatcher = new Dispatcher(); - dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS")); - } - } + + if (phoneOptions.joinGlobal) { + joinVoiceGlobal(); } + else if (phoneOptions.autoJoin) + if (phoneOptions.skipCheck) + { + if (noMicrophone()) + joinVoice(false); + else + joinVoice(true); + } + else + { + var dispatcher:Dispatcher = new Dispatcher(); + dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS")); + } } private function noMicrophone():Boolean { From d8eaaba91e97a644e513f15bd9595da4118fa05a Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Mon, 7 Jan 2013 10:05:14 -0200 Subject: [PATCH 09/28] New template to global audio --- bigbluebutton-client/resources/config.xml.template | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-client/resources/config.xml.template b/bigbluebutton-client/resources/config.xml.template index 5fcc26e003..36d7c3b9c5 100755 --- a/bigbluebutton-client/resources/config.xml.template +++ b/bigbluebutton-client/resources/config.xml.template @@ -41,8 +41,9 @@ /> Date: Mon, 7 Jan 2013 10:05:48 -0200 Subject: [PATCH 10/28] translated specific strings to pt_BR --- .../locale/pt_BR/bbbResources.properties | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bigbluebutton-client/locale/pt_BR/bbbResources.properties b/bigbluebutton-client/locale/pt_BR/bbbResources.properties index 61f906a3f0..02e6b7ab69 100644 --- a/bigbluebutton-client/locale/pt_BR/bbbResources.properties +++ b/bigbluebutton-client/locale/pt_BR/bbbResources.properties @@ -129,9 +129,14 @@ bbb.desktopPublish.minimizeBtn.toolTip = Minimizar esta janela. bbb.desktopView.title = Compartilhamento de Tela bbb.desktopView.fitToWindow = Ajustar à Janela bbb.desktopView.actualSize = Exibir tamanho original -bbb.toolbar.phone.toolTip = Iniciar Meu Microfone -bbb.toolbar.deskshare.toolTip = Compartilhar Meu Desktop -bbb.toolbar.video.toolTip = Compartilhar Minha Câmera +bbb.toolbar.phone.toolTip.start = Ativar microfone +bbb.toolbar.phone.toolTip.stop = Desativar microfone +bbb.toolbar.phone.toolTip.mute = Parar de Ouvir a Conferência de Voz. +bbb.toolbar.phone.toolTip.unmute = Começar a Ouvir a Conferência de Voz. +bbb.toolbar.deskshare.toolTip.start = Compartilhar Meu Desktop +bbb.toolbar.deskshare.toolTip.stop = Finalizar compartilhamento de desktop +bbb.toolbar.video.toolTip.start = Ativar câmera +bbb.toolbar.video.toolTip.stop = Desativar câmera bbb.highlighter.toolbar.pencil = Caneta Marcatexto bbb.highlighter.toolbar.ellipse = Círculo bbb.highlighter.toolbar.rectangle = Retângulo From 5b3e702a584bfa349f92617e7031c83e7e90b347 Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Mon, 7 Jan 2013 10:06:51 -0200 Subject: [PATCH 11/28] Bugfix when localization is changed dynamically --- .../modules/phone/maps/PhoneEventMapDelegate.as | 4 ++-- .../phone/views/components/ToolbarButton.mxml | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as index bbfead7dd6..efcd1dc453 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as @@ -79,7 +79,7 @@ package org.bigbluebutton.modules.phone.maps public function disableToolbarButton():void { phoneButton.selected = true; phoneButton.enabled = true; - phoneButton.userJoinedConference(true); + //phoneButton.userJoinedConference(true); } public function enableMuteButton():void { @@ -92,4 +92,4 @@ package org.bigbluebutton.modules.phone.maps //phoneButton.userJoinedConference(false); } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index 77899f9e90..0123be48bd 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -24,7 +24,7 @@ icon="{phoneIcon}" click="startPhone()" mouseOver = "mouseOverHandler(event)" mouseOut = "mouseOutHandler(event)" - toolTip="{ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.stop')}" + toolTip="{ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start')}" implements="org.bigbluebutton.common.IBbbToolbarComponent"> @@ -109,6 +109,7 @@ _currentState = ACTIVE_STATE; phoneIcon = images.headsetActiveIcon; this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.stop'); + } else { this.selected = false; this.enabled = true; @@ -147,7 +148,14 @@ //For whatever reason the tooltip does not update when localization is changed dynamically. Overrideing it here override protected function resourcesChanged():void{ - this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start'); + if(_currentState == ACTIVE_STATE) { + phoneIcon = images.headsetActiveIcon; + this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.stop'); + } + else { + phoneIcon = images.headsetDefaultIcon; + this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start'); + } } public function getAlignment():String{ From b1fa4553032e917367480ad9bbd2edc41b9f08e0 Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Mon, 7 Jan 2013 13:43:48 -0200 Subject: [PATCH 12/28] revert some unwanted changes --- bbb-api-demo/src/main/webapp/mobile_conf.jsp | 2 +- bigbluebutton-client/resources/config.xml.template | 2 +- .../src/org/bigbluebutton/main/views/MainApplicationShell.mxml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bbb-api-demo/src/main/webapp/mobile_conf.jsp b/bbb-api-demo/src/main/webapp/mobile_conf.jsp index 6c6c77bb7d..7ee04df0ee 100644 --- a/bbb-api-demo/src/main/webapp/mobile_conf.jsp +++ b/bbb-api-demo/src/main/webapp/mobile_conf.jsp @@ -1,6 +1,6 @@ <%! // This is the mobile security salt that must be used to check the requests on mobile.jsp -String mobileSalt = "03b07"; +String mobileSalt = ""; %> diff --git a/bigbluebutton-client/resources/config.xml.template b/bigbluebutton-client/resources/config.xml.template index 36d7c3b9c5..ac8e5d6df9 100755 --- a/bigbluebutton-client/resources/config.xml.template +++ b/bigbluebutton-client/resources/config.xml.template @@ -41,7 +41,7 @@ /> - + From 2b736215963888a3300ce13bb890864cacad7c8a Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Fri, 1 Feb 2013 13:17:00 -0200 Subject: [PATCH 13/28] changed the window title from Listeners to Speakers (since those participants are speakers now) --- bigbluebutton-client/locale/ar_SY/bbbResources.properties | 1 - bigbluebutton-client/locale/az_AZ/bbbResources.properties | 1 - bigbluebutton-client/locale/bg_BG/bbbResources.properties | 1 - bigbluebutton-client/locale/bn_BN/bbbResources.properties | 1 - bigbluebutton-client/locale/ca_ES/bbbResources.properties | 1 - bigbluebutton-client/locale/cs_CZ/bbbResources.properties | 1 - bigbluebutton-client/locale/da_DK/bbbResources.properties | 1 - bigbluebutton-client/locale/de_DE/bbbResources.properties | 1 - bigbluebutton-client/locale/el_GR/bbbResources.properties | 1 - bigbluebutton-client/locale/en_US/bbbResources.properties | 2 +- bigbluebutton-client/locale/es_ES/bbbResources.properties | 1 - bigbluebutton-client/locale/es_LA/bbbResources.properties | 1 - bigbluebutton-client/locale/et_EE/bbbResources.properties | 1 - bigbluebutton-client/locale/eu_EU/bbbResources.properties | 1 - bigbluebutton-client/locale/fa_IR/bbbResources.properties | 1 - bigbluebutton-client/locale/fi_FI/bbbResources.properties | 1 - bigbluebutton-client/locale/fr_CA/bbbResources.properties | 1 - bigbluebutton-client/locale/fr_FR/bbbResources.properties | 1 - bigbluebutton-client/locale/he_IL/bbbResources.properties | 1 - bigbluebutton-client/locale/hr_HR/bbbResources.properties | 1 - bigbluebutton-client/locale/hu_HU/bbbResources.properties | 1 - bigbluebutton-client/locale/id_ID/bbbResources.properties | 1 - bigbluebutton-client/locale/it_IT/bbbResources.properties | 1 - bigbluebutton-client/locale/ja_JP/bbbResources.properties | 1 - bigbluebutton-client/locale/kk_KZ/bbbResources.properties | 1 - bigbluebutton-client/locale/km_KH/bbbResources.properties | 1 - bigbluebutton-client/locale/ko_KR/bbbResources.properties | 1 - bigbluebutton-client/locale/lt_LT/bbbResources.properties | 1 - bigbluebutton-client/locale/lv_LV/bbbResources.properties | 1 - bigbluebutton-client/locale/mn_MN/bbbResources.properties | 1 - bigbluebutton-client/locale/nb_NO/bbbResources.properties | 1 - bigbluebutton-client/locale/ne_NE/bbbResources.properties | 1 - bigbluebutton-client/locale/nl_NL/bbbResources.properties | 1 - bigbluebutton-client/locale/no_NO/bbbResources.properties | 1 - bigbluebutton-client/locale/pl_PL/bbbResources.properties | 1 - bigbluebutton-client/locale/pt_BR/bbbResources.properties | 2 +- bigbluebutton-client/locale/pt_PT/bbbResources.properties | 1 - bigbluebutton-client/locale/ro_RO/bbbResources.properties | 1 - bigbluebutton-client/locale/ru_RU/bbbResources.properties | 1 - bigbluebutton-client/locale/si_LK/bbbResources.properties | 1 - bigbluebutton-client/locale/sk_SK/bbbResources.properties | 1 - bigbluebutton-client/locale/sl_SL/bbbResources.properties | 1 - bigbluebutton-client/locale/sr_RS/bbbResources.properties | 1 - bigbluebutton-client/locale/sr_SR/bbbResources.properties | 1 - bigbluebutton-client/locale/sv_SE/bbbResources.properties | 1 - bigbluebutton-client/locale/th_TH/bbbResources.properties | 1 - bigbluebutton-client/locale/tr_TR/bbbResources.properties | 1 - bigbluebutton-client/locale/uk_UA/bbbResources.properties | 1 - bigbluebutton-client/locale/vi_VN/bbbResources.properties | 1 - bigbluebutton-client/locale/zh_CN/bbbResources.properties | 1 - bigbluebutton-client/locale/zh_TW/bbbResources.properties | 1 - 51 files changed, 2 insertions(+), 51 deletions(-) diff --git a/bigbluebutton-client/locale/ar_SY/bbbResources.properties b/bigbluebutton-client/locale/ar_SY/bbbResources.properties index 8d122a4094..09ae32cf37 100644 --- a/bigbluebutton-client/locale/ar_SY/bbbResources.properties +++ b/bigbluebutton-client/locale/ar_SY/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Private message awaiting * bbb.chat.privateChatSelect = Select a person to chat with privately bbb.chat.chatOptions = خيارات المحادثة bbb.chat.fontSize = حجم الخط -bbb.listeners.title = المستمعون {0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/az_AZ/bbbResources.properties b/bigbluebutton-client/locale/az_AZ/bbbResources.properties index fa3e4473b4..b122bbeff5 100644 --- a/bigbluebutton-client/locale/az_AZ/bbbResources.properties +++ b/bigbluebutton-client/locale/az_AZ/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Şəxsi Mesaj gözlənilir * bbb.chat.privateChatSelect = Yazışma üçün istifadəçini seçin bbb.chat.chatOptions = Sazlamalar bbb.chat.fontSize = Şrift ölçüsüe -bbb.listeners.title = Səsli - ({0}) qoşulanlar bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/bg_BG/bbbResources.properties b/bigbluebutton-client/locale/bg_BG/bbbResources.properties index c1726214f8..94d20eb2e7 100644 --- a/bigbluebutton-client/locale/bg_BG/bbbResources.properties +++ b/bigbluebutton-client/locale/bg_BG/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Ново Лично съобщение * bbb.chat.privateChatSelect = Избери лице за персонален чат bbb.chat.chatOptions = Чат опции bbb.chat.fontSize = Големина на шрифта -bbb.listeners.title = Слушатели {0} {1} bbb.listeners.pushToTalk.toolTip = Кликни за да говориш bbb.listeners.pushToMute.toolTip = Кликни за да заглушиш себе си bbb.listeners.talk = Говори diff --git a/bigbluebutton-client/locale/bn_BN/bbbResources.properties b/bigbluebutton-client/locale/bn_BN/bbbResources.properties index 080f432102..e3347efd3b 100644 --- a/bigbluebutton-client/locale/bn_BN/bbbResources.properties +++ b/bigbluebutton-client/locale/bn_BN/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * ব্যক্তিগত বার্তা bbb.chat.privateChatSelect = ব্যক্তিগতভাবে চ্যাট করতে একটি ব্যক্তি নির্বাচন করুন bbb.chat.chatOptions = চ্যাট অপশনস bbb.chat.fontSize = ফন্ট আকৃতি -bbb.listeners.title = শ্রোতা{0} {1} bbb.listeners.pushToTalk.toolTip = সরব করার জন্য ক্লিক করুন bbb.listeners.pushToMute.toolTip = আপনাকে নীরব করার জন্য ক্লিক করুন bbb.listeners.talk = সরব diff --git a/bigbluebutton-client/locale/ca_ES/bbbResources.properties b/bigbluebutton-client/locale/ca_ES/bbbResources.properties index 30f63fe658..7250d6099b 100644 --- a/bigbluebutton-client/locale/ca_ES/bbbResources.properties +++ b/bigbluebutton-client/locale/ca_ES/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 =  * Missatge privat pendent * bbb.chat.privateChatSelect =  Seleccioneu una persona per xerrar en privat bbb.chat.chatOptions =  Opcions de xat bbb.chat.fontSize =  Mida del text -bbb.listeners.title =  Parlant {0} {1} bbb.listeners.pushToTalk.toolTip =  Clica-hi per a parlar bbb.listeners.pushToMute.toolTip =  Clica-hi per a silenciar bbb.listeners.talk =  Parlar diff --git a/bigbluebutton-client/locale/cs_CZ/bbbResources.properties b/bigbluebutton-client/locale/cs_CZ/bbbResources.properties index 42e0b3ca1b..1c5a6024f6 100644 --- a/bigbluebutton-client/locale/cs_CZ/bbbResources.properties +++ b/bigbluebutton-client/locale/cs_CZ/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Čekání na soukromou zprávu * bbb.chat.privateChatSelect = Vyberte osobu, se kterou chcete chatovat soukromě bbb.chat.chatOptions = Nastavení chatu bbb.chat.fontSize = Velikost písma -bbb.listeners.title = Posluchači{0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/da_DK/bbbResources.properties b/bigbluebutton-client/locale/da_DK/bbbResources.properties index 6b0f7252a8..69afb29206 100644 --- a/bigbluebutton-client/locale/da_DK/bbbResources.properties +++ b/bigbluebutton-client/locale/da_DK/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Privat besked afventer * bbb.chat.privateChatSelect = Vælg en person at chatte med privat bbb.chat.chatOptions = Chatindstillinger bbb.chat.fontSize = Skriftstørrelse -bbb.listeners.title = Lyttere{0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/de_DE/bbbResources.properties b/bigbluebutton-client/locale/de_DE/bbbResources.properties index 294c00b061..bbe1b3b93f 100644 --- a/bigbluebutton-client/locale/de_DE/bbbResources.properties +++ b/bigbluebutton-client/locale/de_DE/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Private Nachricht eingetroffen * bbb.chat.privateChatSelect = Wählen Sie eine Person für den privaten Chat bbb.chat.chatOptions = Chat Optionen bbb.chat.fontSize = Schriftgröße -bbb.listeners.title = Sprache bbb.listeners.pushToTalk.toolTip = Klicken zum Sprechen bbb.listeners.pushToMute.toolTip = KLicken zum Stummschalten bbb.listeners.talk = sprechen diff --git a/bigbluebutton-client/locale/el_GR/bbbResources.properties b/bigbluebutton-client/locale/el_GR/bbbResources.properties index 2e62c60668..4dcfc8388d 100644 --- a/bigbluebutton-client/locale/el_GR/bbbResources.properties +++ b/bigbluebutton-client/locale/el_GR/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Αναμονή ιδιωτικού μηνύμα bbb.chat.privateChatSelect = Επιλέξτε ένα πρόσωπο για ιδιωτική συνομιλία bbb.chat.chatOptions = Επιλογές συνομιλίας bbb.chat.fontSize = Μέγεθος γραμματοσειράς -bbb.listeners.title = Ακροατές {0} {1} bbb.listeners.pushToTalk.toolTip = Κάντε κλικ για να συνομιλίσετε bbb.listeners.pushToMute.toolTip = Σίγαση του εαυτού μου bbb.listeners.talk = Συνομιλία diff --git a/bigbluebutton-client/locale/en_US/bbbResources.properties b/bigbluebutton-client/locale/en_US/bbbResources.properties index 4f84fa3ec8..ec4bba7f8c 100755 --- a/bigbluebutton-client/locale/en_US/bbbResources.properties +++ b/bigbluebutton-client/locale/en_US/bbbResources.properties @@ -89,7 +89,7 @@ bbb.chat.privateMsgAwaiting2 = * Private message awaiting * bbb.chat.privateChatSelect = Select a person to chat with privately bbb.chat.chatOptions = Chat Options bbb.chat.fontSize = Font Size -bbb.listeners.title = Listeners{0} {1} +bbb.listeners.title = Speakers{0} {1} bbb.listeners.pushToTalk.toolTip = Click to talk bbb.listeners.pushToMute.toolTip = Click to mute yourself bbb.listeners.talk = Unmute diff --git a/bigbluebutton-client/locale/es_ES/bbbResources.properties b/bigbluebutton-client/locale/es_ES/bbbResources.properties index 6a8c632625..0dccfa72b2 100644 --- a/bigbluebutton-client/locale/es_ES/bbbResources.properties +++ b/bigbluebutton-client/locale/es_ES/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Mensaje privado pendiente * bbb.chat.privateChatSelect = Seleccione una persona para charlar en privado bbb.chat.chatOptions = Opciones de charla bbb.chat.fontSize = Tamaño del texto -bbb.listeners.title = Hablando {0} {1} bbb.listeners.pushToTalk.toolTip = Clic para hablar bbb.listeners.pushToMute.toolTip = Clic para silenciarse bbb.listeners.talk = Hablar diff --git a/bigbluebutton-client/locale/es_LA/bbbResources.properties b/bigbluebutton-client/locale/es_LA/bbbResources.properties index 9eb395f80b..c75e7e53da 100644 --- a/bigbluebutton-client/locale/es_LA/bbbResources.properties +++ b/bigbluebutton-client/locale/es_LA/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Mensaje privado a la espera * bbb.chat.privateChatSelect = Seleccionar a una persona para iniciar un chat privado bbb.chat.chatOptions = Opciones de chat bbb.chat.fontSize = Tamaño de la letra -bbb.listeners.title = Participantes{0} {1} bbb.listeners.pushToTalk.toolTip = Click para hablar bbb.listeners.pushToMute.toolTip = Click para silenciarse. bbb.listeners.talk = Hablar diff --git a/bigbluebutton-client/locale/et_EE/bbbResources.properties b/bigbluebutton-client/locale/et_EE/bbbResources.properties index c05851dca5..44efa90cb2 100644 --- a/bigbluebutton-client/locale/et_EE/bbbResources.properties +++ b/bigbluebutton-client/locale/et_EE/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = bbb.chat.privateChatSelect = bbb.chat.chatOptions = bbb.chat.fontSize = -bbb.listeners.title = bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/eu_EU/bbbResources.properties b/bigbluebutton-client/locale/eu_EU/bbbResources.properties index 2004c18fab..7e084edcf5 100644 --- a/bigbluebutton-client/locale/eu_EU/bbbResources.properties +++ b/bigbluebutton-client/locale/eu_EU/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = *Mezu pribatua zain* bbb.chat.privateChatSelect = Aukeratu lagun bat harekin txatean pribatuan aritzeko bbb.chat.chatOptions = Txataren aukerak bbb.chat.fontSize = Letra-tamaina -bbb.listeners.title = Solasaldian {0} {1} bbb.listeners.pushToTalk.toolTip = Klik egin hitz egiteko bbb.listeners.pushToMute.toolTip = Zure burua mututzeko egin klik. bbb.listeners.talk = Hitz egin diff --git a/bigbluebutton-client/locale/fa_IR/bbbResources.properties b/bigbluebutton-client/locale/fa_IR/bbbResources.properties index e2c27e9275..45d1a10577 100644 --- a/bigbluebutton-client/locale/fa_IR/bbbResources.properties +++ b/bigbluebutton-client/locale/fa_IR/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * پیام های خصوصی در حال انتظ bbb.chat.privateChatSelect = کاربری را جهت گفتگوی خصوصی انتخاب کنید. bbb.chat.chatOptions = تنظیمات مربوط به گفتگو bbb.chat.fontSize = اندازه متن -bbb.listeners.title = شنوندگان{0} {1} bbb.listeners.pushToTalk.toolTip = برای صحبت کردن کلیک کنید bbb.listeners.pushToMute.toolTip = برای قطع صدای خود کلیک کنید bbb.listeners.talk = صحبت diff --git a/bigbluebutton-client/locale/fi_FI/bbbResources.properties b/bigbluebutton-client/locale/fi_FI/bbbResources.properties index ba09dd3ee9..3694dc5ae7 100644 --- a/bigbluebutton-client/locale/fi_FI/bbbResources.properties +++ b/bigbluebutton-client/locale/fi_FI/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Privaatti viesti odottaa * bbb.chat.privateChatSelect = Valitse henkilö jonka kanssa haluat keskustella privaatisti bbb.chat.chatOptions = Keskustelu Vaihtoehdot bbb.chat.fontSize = Fontin koko -bbb.listeners.title = Kuuntelijat{0} {1} bbb.listeners.pushToTalk.toolTip = Klikkaa puhuessasi bbb.listeners.pushToMute.toolTip = Klikkaalla mykistät itsesi bbb.listeners.talk = Puhu diff --git a/bigbluebutton-client/locale/fr_CA/bbbResources.properties b/bigbluebutton-client/locale/fr_CA/bbbResources.properties index 3d32ce75fb..c46fdf671f 100644 --- a/bigbluebutton-client/locale/fr_CA/bbbResources.properties +++ b/bigbluebutton-client/locale/fr_CA/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Message privé en attente * bbb.chat.privateChatSelect = Choississez un utilisateur avec qui discuter en privé bbb.chat.chatOptions = Options de discussions bbb.chat.fontSize = Taille de la police -bbb.listeners.title = Conférence voix bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/fr_FR/bbbResources.properties b/bigbluebutton-client/locale/fr_FR/bbbResources.properties index 5075064869..d0aa6c71c9 100644 --- a/bigbluebutton-client/locale/fr_FR/bbbResources.properties +++ b/bigbluebutton-client/locale/fr_FR/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Message privé en attente * bbb.chat.privateChatSelect = Choisissez un utilisateur avec qui discuter en privé bbb.chat.chatOptions = Options de discussions bbb.chat.fontSize = Taille de la police -bbb.listeners.title = Conférence vocale {0} {1} bbb.listeners.pushToTalk.toolTip = Cliquer pour parler bbb.listeners.pushToMute.toolTip = Cliquer pour couper le micro bbb.listeners.talk = Parler diff --git a/bigbluebutton-client/locale/he_IL/bbbResources.properties b/bigbluebutton-client/locale/he_IL/bbbResources.properties index 244b123c98..186fd28cd3 100644 --- a/bigbluebutton-client/locale/he_IL/bbbResources.properties +++ b/bigbluebutton-client/locale/he_IL/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * הודעה פרטית ממתינה * bbb.chat.privateChatSelect = בחר אדם איתו תרצה לשוחח באופן פרטי bbb.chat.chatOptions = אפשרויות צ'אט bbb.chat.fontSize = גודל טקסט -bbb.listeners.title = מאזינים{0}{1} bbb.listeners.pushToTalk.toolTip = לחץ על מנת לשוחח bbb.listeners.pushToMute.toolTip = לחץ על מנת להשתיק את עצמך bbb.listeners.talk = בטל השתקה diff --git a/bigbluebutton-client/locale/hr_HR/bbbResources.properties b/bigbluebutton-client/locale/hr_HR/bbbResources.properties index 15e18a7314..07ecf2406a 100644 --- a/bigbluebutton-client/locale/hr_HR/bbbResources.properties +++ b/bigbluebutton-client/locale/hr_HR/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Privatna poruka na čekanju * bbb.chat.privateChatSelect = Izaberite osobu sa kojom želite privatno ćaskati bbb.chat.chatOptions = Podešavanja ćaskanja bbb.chat.fontSize = Veličina fonta -bbb.listeners.title = Slušaoca {0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/hu_HU/bbbResources.properties b/bigbluebutton-client/locale/hu_HU/bbbResources.properties index 654f034826..4f55b9bc79 100644 --- a/bigbluebutton-client/locale/hu_HU/bbbResources.properties +++ b/bigbluebutton-client/locale/hu_HU/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Privát üzenetre várakozás * bbb.chat.privateChatSelect = Válassz felhasználót a privát chateléshez bbb.chat.chatOptions = Chat beállítások bbb.chat.fontSize = Betűméret -bbb.listeners.title = Beszélgetők {0} {1} bbb.listeners.pushToTalk.toolTip = Magamat kihangosít bbb.listeners.pushToMute.toolTip = Magamat némít bbb.listeners.talk = Hangosít diff --git a/bigbluebutton-client/locale/id_ID/bbbResources.properties b/bigbluebutton-client/locale/id_ID/bbbResources.properties index aa47bc141a..7f2f39a01b 100644 --- a/bigbluebutton-client/locale/id_ID/bbbResources.properties +++ b/bigbluebutton-client/locale/id_ID/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Pesan pribadi sedang menunggu * bbb.chat.privateChatSelect = Pilih seseorang untuk obrolan pribadi bbb.chat.chatOptions = Opsi Obrolan bbb.chat.fontSize = Ukuran Huruf -bbb.listeners.title = Pendengar{0} {1} bbb.listeners.pushToTalk.toolTip = Klik untuk bicara bbb.listeners.pushToMute.toolTip = Klik untuk membisukan diri anda sendiri bbb.listeners.talk = Bicara diff --git a/bigbluebutton-client/locale/it_IT/bbbResources.properties b/bigbluebutton-client/locale/it_IT/bbbResources.properties index ad1895d641..43ea9308de 100644 --- a/bigbluebutton-client/locale/it_IT/bbbResources.properties +++ b/bigbluebutton-client/locale/it_IT/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Messaggio privato in attesa * bbb.chat.privateChatSelect = Seleziona l'interlocutore per la conversazione privata bbb.chat.chatOptions = Opzioni chat bbb.chat.fontSize = Dimensione Font -bbb.listeners.title = Voce - ({0}) partecipanti bbb.listeners.pushToTalk.toolTip = Clicca per parlare bbb.listeners.pushToMute.toolTip = Clicca per metterti in mute bbb.listeners.talk = Parla diff --git a/bigbluebutton-client/locale/ja_JP/bbbResources.properties b/bigbluebutton-client/locale/ja_JP/bbbResources.properties index 4a40de3238..29a3549649 100644 --- a/bigbluebutton-client/locale/ja_JP/bbbResources.properties +++ b/bigbluebutton-client/locale/ja_JP/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * プライベートメッセージ待機中 * bbb.chat.privateChatSelect = プライベートにチャットする個人を選択 bbb.chat.chatOptions = チャットの設定 bbb.chat.fontSize = 文字の大きさ -bbb.listeners.title = リスナー{0} {1} bbb.listeners.pushToTalk.toolTip = クリックしてお話しください bbb.listeners.pushToMute.toolTip = クリックしてミュート(無音状態) bbb.listeners.talk = トーク diff --git a/bigbluebutton-client/locale/kk_KZ/bbbResources.properties b/bigbluebutton-client/locale/kk_KZ/bbbResources.properties index 59f25b3a6c..5e218471d3 100644 --- a/bigbluebutton-client/locale/kk_KZ/bbbResources.properties +++ b/bigbluebutton-client/locale/kk_KZ/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = bbb.chat.privateChatSelect = bbb.chat.chatOptions = bbb.chat.fontSize = -bbb.listeners.title = bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/km_KH/bbbResources.properties b/bigbluebutton-client/locale/km_KH/bbbResources.properties index c05851dca5..44efa90cb2 100644 --- a/bigbluebutton-client/locale/km_KH/bbbResources.properties +++ b/bigbluebutton-client/locale/km_KH/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = bbb.chat.privateChatSelect = bbb.chat.chatOptions = bbb.chat.fontSize = -bbb.listeners.title = bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/ko_KR/bbbResources.properties b/bigbluebutton-client/locale/ko_KR/bbbResources.properties index 130bbef434..dee8f113e4 100644 --- a/bigbluebutton-client/locale/ko_KR/bbbResources.properties +++ b/bigbluebutton-client/locale/ko_KR/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * 개인 메시지 대기중 * # * Private messag bbb.chat.privateChatSelect = 개별 채팅을 할 참석자를 선택 # Select a person to chat with privately bbb.chat.chatOptions = 채팅 옵션 # Chat Options bbb.chat.fontSize = 폰트 사이즈 # Font Size -bbb.listeners.title = 참석자 {0} {1} # Listeners{0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/lt_LT/bbbResources.properties b/bigbluebutton-client/locale/lt_LT/bbbResources.properties index 3968197460..939037ded3 100644 --- a/bigbluebutton-client/locale/lt_LT/bbbResources.properties +++ b/bigbluebutton-client/locale/lt_LT/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = bbb.chat.privateChatSelect = bbb.chat.chatOptions = bbb.chat.fontSize = -bbb.listeners.title = Balsas bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/lv_LV/bbbResources.properties b/bigbluebutton-client/locale/lv_LV/bbbResources.properties index 79dcd44548..4eb11ae879 100644 --- a/bigbluebutton-client/locale/lv_LV/bbbResources.properties +++ b/bigbluebutton-client/locale/lv_LV/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = Jauna priv?t? zi?a * bbb.chat.privateChatSelect = Izv?l?ties personu priv?tam ?atam bbb.chat.chatOptions = ?ata opcijas bbb.chat.fontSize = Šrifta izm?rs -bbb.listeners.title = Klaus?t?ji {0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/mn_MN/bbbResources.properties b/bigbluebutton-client/locale/mn_MN/bbbResources.properties index ce5ca8688a..544874a14e 100644 --- a/bigbluebutton-client/locale/mn_MN/bbbResources.properties +++ b/bigbluebutton-client/locale/mn_MN/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = Хувийн захидал хүлээж байн bbb.chat.privateChatSelect = Хувийн талаар чатлах хүнээ сонгоно уу bbb.chat.chatOptions = Чат тохиргоо bbb.chat.fontSize = Фонт хэмжээ -bbb.listeners.title = Сонсогчид {0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/nb_NO/bbbResources.properties b/bigbluebutton-client/locale/nb_NO/bbbResources.properties index 5e47a1a0c2..27d64c64a1 100644 --- a/bigbluebutton-client/locale/nb_NO/bbbResources.properties +++ b/bigbluebutton-client/locale/nb_NO/bbbResources.properties @@ -87,7 +87,6 @@ bbb.settings.java.command = Installer nyeste Java bbb.mainToolbar.logoutBtn = Logg ut bbb.chat.privateMsgAwaiting2 = * Privat melding venter * bbb.presentation.document.supported = Godkjent dokumenttype. Starter konvertering... -bbb.listeners.title = Lyttere{0} {1} bbb.fileupload.presentationNamesLbl = Presentasjoner som er lastet opp: bbb.pageTitle = BigBlueButton bbb.mainshell.resetLayoutBtn.toolTip = Nullstill oppsett diff --git a/bigbluebutton-client/locale/ne_NE/bbbResources.properties b/bigbluebutton-client/locale/ne_NE/bbbResources.properties index 33795a5f84..28b66fbd56 100644 --- a/bigbluebutton-client/locale/ne_NE/bbbResources.properties +++ b/bigbluebutton-client/locale/ne_NE/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = bbb.chat.privateChatSelect = bbb.chat.chatOptions = bbb.chat.fontSize = -bbb.listeners.title = bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/nl_NL/bbbResources.properties b/bigbluebutton-client/locale/nl_NL/bbbResources.properties index 80db29d6f1..bb27e2336e 100644 --- a/bigbluebutton-client/locale/nl_NL/bbbResources.properties +++ b/bigbluebutton-client/locale/nl_NL/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Nieuw publiek bericht * bbb.chat.privateChatSelect = Selecteer een persoon om een privé chat mee te starten bbb.chat.chatOptions = Chat opties bbb.chat.fontSize = Tekst grootte -bbb.listeners.title = Geluid deelnemers bbb.listeners.pushToTalk.toolTip = Klik om te praten bbb.listeners.pushToMute.toolTip = Klik om je microfoon te dempen bbb.listeners.talk = Praat diff --git a/bigbluebutton-client/locale/no_NO/bbbResources.properties b/bigbluebutton-client/locale/no_NO/bbbResources.properties index 9a017e9b16..554d5eb251 100644 --- a/bigbluebutton-client/locale/no_NO/bbbResources.properties +++ b/bigbluebutton-client/locale/no_NO/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Privat melding venter * bbb.chat.privateChatSelect = Velg person til privat prat bbb.chat.chatOptions = Innstillinger for prat bbb.chat.fontSize = Fontstørrelse -bbb.listeners.title = Lyttere{0} {1} bbb.listeners.pushToTalk.toolTip = Klikk for å snakke bbb.listeners.pushToMute.toolTip = Klikk for å slå av lyd bbb.listeners.talk = Slå på lyd diff --git a/bigbluebutton-client/locale/pl_PL/bbbResources.properties b/bigbluebutton-client/locale/pl_PL/bbbResources.properties index 56911540bf..0af70bb362 100644 --- a/bigbluebutton-client/locale/pl_PL/bbbResources.properties +++ b/bigbluebutton-client/locale/pl_PL/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Oczekuje prywatna wiadomość * bbb.chat.privateChatSelect = Wybierz osobę do rozmowy prywatnej bbb.chat.chatOptions = Opcje czatu bbb.chat.fontSize = Rozmiar czcionki -bbb.listeners.title = Słuchacze {0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/pt_BR/bbbResources.properties b/bigbluebutton-client/locale/pt_BR/bbbResources.properties index 02e6b7ab69..66c0c25230 100644 --- a/bigbluebutton-client/locale/pt_BR/bbbResources.properties +++ b/bigbluebutton-client/locale/pt_BR/bbbResources.properties @@ -89,7 +89,7 @@ bbb.chat.privateMsgAwaiting2 = * Aguardando mensagem privada * bbb.chat.privateChatSelect = Selecionar uma pessoa para bate-papo privado bbb.chat.chatOptions = Opções de Bate-papo bbb.chat.fontSize = Tamanho da Fonte -bbb.listeners.title = Ouvintes{0} {1} +bbb.listeners.title = Interlocutores{0} {1} bbb.listeners.pushToTalk.toolTip = Clique para falar bbb.listeners.pushToMute.toolTip = Clique para colocar-se em mudo bbb.listeners.talk = Falar diff --git a/bigbluebutton-client/locale/pt_PT/bbbResources.properties b/bigbluebutton-client/locale/pt_PT/bbbResources.properties index 444016b94d..c7b346baaa 100644 --- a/bigbluebutton-client/locale/pt_PT/bbbResources.properties +++ b/bigbluebutton-client/locale/pt_PT/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Mensagem privada a aguardar * bbb.chat.privateChatSelect = Seleccione uma pessoa para conversar em privado bbb.chat.chatOptions = Opções de conversação bbb.chat.fontSize = Tamanho da fonte -bbb.listeners.title = Ouvintes {0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/ro_RO/bbbResources.properties b/bigbluebutton-client/locale/ro_RO/bbbResources.properties index a62680a952..e1f350b92b 100644 --- a/bigbluebutton-client/locale/ro_RO/bbbResources.properties +++ b/bigbluebutton-client/locale/ro_RO/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = *Mesaj privat în aşteptare * bbb.chat.privateChatSelect = Selectaţi o persoana cu care sa discutaţi în privat bbb.chat.chatOptions = Opţiuni Chat bbb.chat.fontSize = Dimensiune Font -bbb.listeners.title = Voce bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/ru_RU/bbbResources.properties b/bigbluebutton-client/locale/ru_RU/bbbResources.properties index 950e6fe27f..5dd276964b 100644 --- a/bigbluebutton-client/locale/ru_RU/bbbResources.properties +++ b/bigbluebutton-client/locale/ru_RU/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Новое личное сообщение * bbb.chat.privateChatSelect = Выберите пользователя для отправки личного сообщения bbb.chat.chatOptions = Настройка чата bbb.chat.fontSize = Размер шрифта -bbb.listeners.title = Аудиоконференция: {0} участников bbb.listeners.pushToTalk.toolTip = Нажмите для разговора bbb.listeners.pushToMute.toolTip = Нажмите для отключения своего микрофона bbb.listeners.talk = Вкл. мик. diff --git a/bigbluebutton-client/locale/si_LK/bbbResources.properties b/bigbluebutton-client/locale/si_LK/bbbResources.properties index 001bd94259..0fc1fe344b 100644 --- a/bigbluebutton-client/locale/si_LK/bbbResources.properties +++ b/bigbluebutton-client/locale/si_LK/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = bbb.chat.privateChatSelect = bbb.chat.chatOptions = bbb.chat.fontSize = අකුරු ප්‍රමානය -bbb.listeners.title = අසන්නන් {0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = නිශ්ශබ්ද කරීම ඉවත්කරන්න diff --git a/bigbluebutton-client/locale/sk_SK/bbbResources.properties b/bigbluebutton-client/locale/sk_SK/bbbResources.properties index 81cda1ea0d..c02a1dc571 100644 --- a/bigbluebutton-client/locale/sk_SK/bbbResources.properties +++ b/bigbluebutton-client/locale/sk_SK/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Čakajúca Súkromná správa * bbb.chat.privateChatSelect = Označte osobu s ktorou chcete zaviesť osobný Pokec. bbb.chat.chatOptions = Možnosti Pokecu bbb.chat.fontSize = Veľkosť písma -bbb.listeners.title = Poslucháči{0} {1} bbb.listeners.pushToTalk.toolTip = Kliknite pre diskusiu bbb.listeners.pushToMute.toolTip = Kliknite pre stlmenie vášho mikrofónu bbb.listeners.talk = Diskutovať diff --git a/bigbluebutton-client/locale/sl_SL/bbbResources.properties b/bigbluebutton-client/locale/sl_SL/bbbResources.properties index a8fe3d3dba..1fcafee479 100644 --- a/bigbluebutton-client/locale/sl_SL/bbbResources.properties +++ b/bigbluebutton-client/locale/sl_SL/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Čakajoče zasebno sporočilo * bbb.chat.privateChatSelect = Izberite osebo, s katero želite zasebno klepetati bbb.chat.chatOptions = Možnosti klepeta bbb.chat.fontSize = Velikost pisave -bbb.listeners.title = Poslušalci{0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/sr_RS/bbbResources.properties b/bigbluebutton-client/locale/sr_RS/bbbResources.properties index e5c30ebad3..030ba5276a 100644 --- a/bigbluebutton-client/locale/sr_RS/bbbResources.properties +++ b/bigbluebutton-client/locale/sr_RS/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Privatna poruka na čekanju * bbb.chat.privateChatSelect = Izaberite osobu sa kojom želite privatno ćaskati bbb.chat.chatOptions = Podešavanja ćaskanja bbb.chat.fontSize = Veličina fonta -bbb.listeners.title = Slušaoca {0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/sr_SR/bbbResources.properties b/bigbluebutton-client/locale/sr_SR/bbbResources.properties index 796752cbaa..3fa4d90ad0 100644 --- a/bigbluebutton-client/locale/sr_SR/bbbResources.properties +++ b/bigbluebutton-client/locale/sr_SR/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Нова приватна порука * bbb.chat.privateChatSelect = Изаберите особу да причате приватно bbb.chat.chatOptions = Опције ћаскања bbb.chat.fontSize = Величина фонта -bbb.listeners.title = Слушаоца {0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/sv_SE/bbbResources.properties b/bigbluebutton-client/locale/sv_SE/bbbResources.properties index d73b2cc325..66da140231 100644 --- a/bigbluebutton-client/locale/sv_SE/bbbResources.properties +++ b/bigbluebutton-client/locale/sv_SE/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Privat meddelande v bbb.chat.privateChatSelect = V bbb.chat.chatOptions = Chat alternativ bbb.chat.fontSize = Textstorlek -bbb.listeners.title = bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/th_TH/bbbResources.properties b/bigbluebutton-client/locale/th_TH/bbbResources.properties index 6cf0fa8871..98c5a4a8f4 100644 --- a/bigbluebutton-client/locale/th_TH/bbbResources.properties +++ b/bigbluebutton-client/locale/th_TH/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = *แจ้งเตือนว่าเมื่ bbb.chat.privateChatSelect = เลือกบุคคลเพื่อสนทนาแบบส่วนตัว bbb.chat.chatOptions = ตัวเลือกในการสนทนา bbb.chat.fontSize = ขนาดอักษร -bbb.listeners.title = ผู้ฟัง{0} {1} bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/tr_TR/bbbResources.properties b/bigbluebutton-client/locale/tr_TR/bbbResources.properties index db8bb69da9..bf9bde9005 100644 --- a/bigbluebutton-client/locale/tr_TR/bbbResources.properties +++ b/bigbluebutton-client/locale/tr_TR/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Özel mesaj bekleniyor * bbb.chat.privateChatSelect = Özel görüşme yapacağınız kişiyi seçin bbb.chat.chatOptions = Sohbet Seçenekleri bbb.chat.fontSize = Font Büyüklüğü -bbb.listeners.title = Dinleyicler{0} {1} bbb.listeners.pushToTalk.toolTip = Konuşmak için tıklayın bbb.listeners.pushToMute.toolTip = Kendinizi sessiz yapmak için tıklayın bbb.listeners.talk = Konuşun diff --git a/bigbluebutton-client/locale/uk_UA/bbbResources.properties b/bigbluebutton-client/locale/uk_UA/bbbResources.properties index 618a4c7cd9..c762cfc648 100644 --- a/bigbluebutton-client/locale/uk_UA/bbbResources.properties +++ b/bigbluebutton-client/locale/uk_UA/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Нове приватне повідомлен bbb.chat.privateChatSelect = Вибрати учасника для надсилання приватного повідомлення bbb.chat.chatOptions = Налаштування чату bbb.chat.fontSize = Розмір шрифту -bbb.listeners.title = Слухачі:{0} {1} bbb.listeners.pushToTalk.toolTip = Натисніть, щоб розмовляти bbb.listeners.pushToMute.toolTip = Натисніть, щоб вимкнути мікрофон bbb.listeners.talk = Вкл. мік. diff --git a/bigbluebutton-client/locale/vi_VN/bbbResources.properties b/bigbluebutton-client/locale/vi_VN/bbbResources.properties index c63b1881d3..094c884b31 100644 --- a/bigbluebutton-client/locale/vi_VN/bbbResources.properties +++ b/bigbluebutton-client/locale/vi_VN/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * Thông điệp riêng đang đợi * bbb.chat.privateChatSelect = Hãy chọn một người để nói chuyện riêng bbb.chat.chatOptions = Tuỳ chọn Trò chuyện bbb.chat.fontSize = Kích thước Phông -bbb.listeners.title = Danh sách Thành viên Nghe bbb.listeners.pushToTalk.toolTip = bbb.listeners.pushToMute.toolTip = bbb.listeners.talk = diff --git a/bigbluebutton-client/locale/zh_CN/bbbResources.properties b/bigbluebutton-client/locale/zh_CN/bbbResources.properties index 1e4105ee52..3c5402b66a 100644 --- a/bigbluebutton-client/locale/zh_CN/bbbResources.properties +++ b/bigbluebutton-client/locale/zh_CN/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * 等待私聊消息 * bbb.chat.privateChatSelect = 选择私聊对象 bbb.chat.chatOptions = 聊天选项 bbb.chat.fontSize = 字体大小 -bbb.listeners.title = 听众{0} {1} bbb.listeners.pushToTalk.toolTip = 点击讲话 bbb.listeners.pushToMute.toolTip = 点击静音 bbb.listeners.talk = 讲话 diff --git a/bigbluebutton-client/locale/zh_TW/bbbResources.properties b/bigbluebutton-client/locale/zh_TW/bbbResources.properties index ea6aa8f5be..2c30149c2d 100644 --- a/bigbluebutton-client/locale/zh_TW/bbbResources.properties +++ b/bigbluebutton-client/locale/zh_TW/bbbResources.properties @@ -89,7 +89,6 @@ bbb.chat.privateMsgAwaiting2 = * 等待私聊訊息 * bbb.chat.privateChatSelect = 選擇私聊對象 bbb.chat.chatOptions = 聊天選項 bbb.chat.fontSize = 字體大小 -bbb.listeners.title = 聽眾{0} {1} bbb.listeners.pushToTalk.toolTip = 點擊講話 bbb.listeners.pushToMute.toolTip = 點擊靜音 bbb.listeners.talk = 講話 From 08312165e3ec57565545985afd881310411aa93a Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Wed, 6 Feb 2013 08:47:24 -0200 Subject: [PATCH 14/28] Add KeepGlobalAudioAlive to prevent freeswitch from kicking out global audio from voice conference. The time from sending the keepAlive is in milliseconds and is inside KeepGlobalAudioAlive.java --- .../voiceconf/sip/CallAgent.java | 6 +- .../voiceconf/sip/GlobalCall.java | 13 +- .../voiceconf/sip/KeepGlobalAudioAlive.java | 130 ++++++++++++++++++ 3 files changed, 143 insertions(+), 6 deletions(-) create mode 100644 bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/KeepGlobalAudioAlive.java diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java index 91665d4845..1a74310a45 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java @@ -257,12 +257,14 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver callStream = callStreamFactory.createCallStream(sipCodec, connInfo); callStream.addCallStreamObserver(this); callStream.start(); - if(_callerName.contains("GLOBAL_AUDIO") == true) { //String room = _callerName.subSequence(13, _callerName.length()).toString(); - GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName(), sipCodec.getCodecName()); + KeepGlobalAudioAlive globalAudioKeepAlive = new KeepGlobalAudioAlive(connInfo.getSocket(), connInfo, callStream.sipCodec.getCodecId()); + GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName(), sipCodec.getCodecName(), globalAudioKeepAlive); caToInit.returnGlobalStreamName(caToInit.getCallId(), _destination); talking = true; + + } else { talking = true; diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java index a0f2becec8..85d052ade1 100644 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java @@ -10,16 +10,18 @@ public class GlobalCall { public static Map voiceConference = new ConcurrentHashMap(); public static Map numberOfUsers = new ConcurrentHashMap(); public static Map codecVoiceConference = new ConcurrentHashMap(); - + public static Map globalAudioKeepAliverMap = new ConcurrentHashMap(); public static boolean roomHasGlobalStream(String roomName) { return voiceConference.containsKey(roomName); } - public static void addGlobalAudioStream(String roomName, String globalAudioStreamName, String codecName) { + public static void addGlobalAudioStream(String roomName, String globalAudioStreamName, String codecName, KeepGlobalAudioAlive globalAudioKeepAlive) { voiceConference.put(roomName, globalAudioStreamName); codecVoiceConference.put(roomName, codecName); numberOfUsers.put(roomName, 0); + globalAudioKeepAliverMap.put(roomName,globalAudioKeepAlive); + globalAudioKeepAlive.start(); } public static String getGlobalAudioStream(String roomName) { @@ -27,10 +29,13 @@ public class GlobalCall { } public static void removeRoom(String roomName) { - System.out.println("REMOVENDO A SALA "+roomName); + System.out.println("REMOVING GLOBAL AUDIO FROM ROOM "+roomName); voiceConference.remove(roomName); numberOfUsers.remove(roomName); codecVoiceConference.remove(roomName); + KeepGlobalAudioAlive globalAudioKeepAlive = globalAudioKeepAliverMap.get(roomName); + globalAudioKeepAlive.halt(); + globalAudioKeepAliverMap.remove(roomName); } public static void addUser(String roomName) { @@ -45,7 +50,7 @@ public class GlobalCall { int nUsers = numberOfUsers.get(roomName); nUsers-=1; numberOfUsers.put(roomName, nUsers); - System.out.println("REMOVENDO USUARIO: numero eh de " + nUsers); + System.out.println("REMOVING USER: Number of users left is " + nUsers); } } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/KeepGlobalAudioAlive.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/KeepGlobalAudioAlive.java new file mode 100644 index 0000000000..0f9b0bcb58 --- /dev/null +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/KeepGlobalAudioAlive.java @@ -0,0 +1,130 @@ +/** +* +* 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 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License along +* with BigBlueButton; if not, see . +* +**/ +package org.bigbluebutton.voiceconf.sip; + +import java.io.IOException; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Random; +import org.bigbluebutton.voiceconf.red5.media.*; +import org.slf4j.Logger; +import org.bigbluebutton.voiceconf.red5.media.net.RtpPacket; +import org.bigbluebutton.voiceconf.red5.media.net.RtpSocket; +import org.bigbluebutton.voiceconf.sip.SipConnectInfo; +import org.bigbluebutton.voiceconf.util.StackTraceUtil; +import org.red5.logging.Red5LoggerFactory; +import java.lang.InterruptedException; + + +public class KeepGlobalAudioAlive extends Thread { + // Time is in milliseconds + // This time should be less than rtp-timeout-sec to prevent freeswitch from kicking out + // the global audio + private static final long DELTA_TIME_TO_SEND_KEEPALIVE = 60000; + + private static final int RTP_HEADER_SIZE = 12; + private RtpSocket rtpSocket = null; + private int sequenceNum = 0; + private final DatagramSocket srcSocket; + private final SipConnectInfo connInfo; + private boolean marked = false; + private long startTimestamp = 0; + boolean stop=false; + int codecId; + private static Logger log = Red5LoggerFactory.getLogger(KeepGlobalAudioAlive.class, "sip"); + + + public KeepGlobalAudioAlive(DatagramSocket srcSocket, SipConnectInfo connInfo, int codecId) { + this.srcSocket = srcSocket; + this.connInfo = connInfo; + this.codecId = codecId; + + connect(); + } + + public void connect() { + try { + rtpSocket = new RtpSocket(srcSocket, InetAddress.getByName(connInfo.getRemoteAddr()), connInfo.getRemotePort()); + Random rgen = new Random(); + sequenceNum = rgen.nextInt(); + } catch (UnknownHostException e) { + log.error("Failed to connect to {}", connInfo.getRemoteAddr()); + log.error(StackTraceUtil.getStackTrace(e)); + log.error("Rtp sender failed to connect to " + connInfo.getRemoteAddr() + "."); + } + } + + public void run() { + try + { + while(!stop) + { + byte array[]= new byte[]{0,0,0,0}; + sendAudio(array, startTimestamp); + startTimestamp++; + Thread.sleep(DELTA_TIME_TO_SEND_KEEPALIVE); + + } + } + catch (InterruptedException e) { + log.error("Failed to sleep time in keepAlive"); + } + } + + public void halt() + { + stop=true; + } + + + public void sendAudio(byte[] audioData, long timestamp) { + byte[] transcodedAudioDataBuffer = new byte[audioData.length + RTP_HEADER_SIZE]; + System.arraycopy(audioData, 0, transcodedAudioDataBuffer, RTP_HEADER_SIZE, audioData.length); + RtpPacket rtpPacket = new RtpPacket(transcodedAudioDataBuffer, transcodedAudioDataBuffer.length); + if (!marked) { + rtpPacket.setMarker(true); + marked = true; + startTimestamp = System.currentTimeMillis(); + } + rtpPacket.setPadding(false); + rtpPacket.setExtension(false); + rtpPacket.setPayloadType(codecId); + rtpPacket.setSeqNum(sequenceNum++); + rtpPacket.setTimestamp(timestamp); + rtpPacket.setPayloadLength(audioData.length); + try { + rtpSocketSend(rtpPacket); + } catch (StreamException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + log.error("Failed to send data to server."); + } + } + + private synchronized void rtpSocketSend(RtpPacket rtpPacket) throws StreamException { + try { + + rtpSocket.send(rtpPacket); + } catch (IOException e) { + throw new StreamException("Failed to send data to server."); + } + } +} From 8be5384c1f25e36ee38f4c826783eefa08a868e5 Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Wed, 6 Feb 2013 09:08:48 -0200 Subject: [PATCH 15/28] Fixed error in field. --- .../org/bigbluebutton/voiceconf/red5/media/CallStream.java | 6 +++++- .../java/org/bigbluebutton/voiceconf/sip/CallAgent.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java index 0f23612af1..6c59e4a1bb 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/media/CallStream.java @@ -38,7 +38,7 @@ public class CallStream implements StreamObserver { private FlashToSipAudioStream userTalkStream; private SipToFlashAudioStream userListenStream; - private final Codec sipCodec; + public final Codec sipCodec; private final SipConnectInfo connInfo; private final IScope scope; private CallStreamObserver callStreamObserver; @@ -81,6 +81,10 @@ public class CallStream implements StreamObserver { public String getListenStreamName() { return userListenStream.getStreamName(); } + + public Codec getSipCodec() { + return sipCodec; + } public void startTalkStream(IBroadcastStream broadcastStream, IScope scope) throws StreamException { log.debug("userTalkStream setup"); diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java index 1a74310a45..c1f326d79c 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java @@ -259,7 +259,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver callStream.start(); if(_callerName.contains("GLOBAL_AUDIO") == true) { //String room = _callerName.subSequence(13, _callerName.length()).toString(); - KeepGlobalAudioAlive globalAudioKeepAlive = new KeepGlobalAudioAlive(connInfo.getSocket(), connInfo, callStream.sipCodec.getCodecId()); + KeepGlobalAudioAlive globalAudioKeepAlive = new KeepGlobalAudioAlive(connInfo.getSocket(), connInfo, sipCodec.getCodecId()); GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName(), sipCodec.getCodecName(), globalAudioKeepAlive); caToInit.returnGlobalStreamName(caToInit.getCallId(), _destination); talking = true; From 98f8b9be4ffa7deed3d76002b20cb433027896ac Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Thu, 21 Mar 2013 13:45:32 -0300 Subject: [PATCH 16/28] Fixed concurrency bug that could create multiple global_audio to one conference. --- .../bigbluebutton/voiceconf/red5/Service.java | 2 +- .../voiceconf/sip/CallAgent.java | 16 +++++++++---- .../voiceconf/sip/GlobalCall.java | 24 +++++++++++++------ 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java index f4e19bbb64..accf581804 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java @@ -40,7 +40,7 @@ public class Service { if(global == true) { - if(GlobalCall.roomHasGlobalStream(destination) == false) { + if(GlobalCall.reservePlaceToCreateGlobal(destination) == true) { String extension = callExtensionPattern.format(new String[] { destination }); try { sipPeerManager.callGlobal(peerId, destination, "GLOBAL_AUDIO_" + destination, getClientId(), callerName, extension); diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java index c1f326d79c..4379cc568a 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java @@ -258,17 +258,13 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver callStream.addCallStreamObserver(this); callStream.start(); if(_callerName.contains("GLOBAL_AUDIO") == true) { - //String room = _callerName.subSequence(13, _callerName.length()).toString(); KeepGlobalAudioAlive globalAudioKeepAlive = new KeepGlobalAudioAlive(connInfo.getSocket(), connInfo, sipCodec.getCodecId()); GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName(), sipCodec.getCodecName(), globalAudioKeepAlive); caToInit.returnGlobalStreamName(caToInit.getCallId(), _destination); talking = true; - - } else { talking = true; - notifyListenersOnCallConnected(callStream.getTalkStreamName(), callStream.getListenStreamName()); } @@ -302,8 +298,18 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver public void returnGlobalStreamName(String clientId, String destination) { talking = false; _destination = destination; + String globalAudioStreamName = GlobalCall.getGlobalAudioStream(destination); + while(globalAudioStreamName.equals("reserved")) { + try { + Thread.sleep(100); + } + catch (Exception e) { + + } + globalAudioStreamName = GlobalCall.getGlobalAudioStream(destination); + } GlobalCall.addUser(_destination); - clientConnManager.joinConferenceSuccessNew(clientId, GlobalCall.getGlobalAudioStream(destination), GlobalCall.getRoomCodec(destination)); + clientConnManager.joinConferenceSuccessNew(clientId, globalAudioStreamName, GlobalCall.getRoomCodec(destination)); } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java index 85d052ade1..53b0b7d021 100644 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java @@ -12,11 +12,21 @@ public class GlobalCall { public static Map codecVoiceConference = new ConcurrentHashMap(); public static Map globalAudioKeepAliverMap = new ConcurrentHashMap(); - public static boolean roomHasGlobalStream(String roomName) { + public static synchronized boolean roomHasGlobalStream(String roomName) { return voiceConference.containsKey(roomName); } - public static void addGlobalAudioStream(String roomName, String globalAudioStreamName, String codecName, KeepGlobalAudioAlive globalAudioKeepAlive) { + public static synchronized boolean reservePlaceToCreateGlobal(String roomName) { + if(voiceConference.containsKey(roomName) == false) { + voiceConference.put(roomName, "reserved"); + return true; + } + else { + return false; + } + } + + public static synchronized void addGlobalAudioStream(String roomName, String globalAudioStreamName, String codecName, KeepGlobalAudioAlive globalAudioKeepAlive) { voiceConference.put(roomName, globalAudioStreamName); codecVoiceConference.put(roomName, codecName); numberOfUsers.put(roomName, 0); @@ -24,11 +34,11 @@ public class GlobalCall { globalAudioKeepAlive.start(); } - public static String getGlobalAudioStream(String roomName) { + public static synchronized String getGlobalAudioStream(String roomName) { return voiceConference.get(roomName); } - public static void removeRoom(String roomName) { + public static synchronized void removeRoom(String roomName) { System.out.println("REMOVING GLOBAL AUDIO FROM ROOM "+roomName); voiceConference.remove(roomName); numberOfUsers.remove(roomName); @@ -38,13 +48,13 @@ public class GlobalCall { globalAudioKeepAliverMap.remove(roomName); } - public static void addUser(String roomName) { + public static synchronized void addUser(String roomName) { int nUsers = numberOfUsers.get(roomName); nUsers+=1; numberOfUsers.put(roomName, nUsers); } - public static void removeUser(String roomName) { + public static synchronized void removeUser(String roomName) { if(numberOfUsers.containsKey(roomName)) { int nUsers = numberOfUsers.get(roomName); @@ -54,7 +64,7 @@ public class GlobalCall { } } - public static int getNumberOfUsers(String roomName) { + public static synchronized int getNumberOfUsers(String roomName) { return numberOfUsers.get(roomName); } From e5a604bf17f620fe63b6135ad9d9bb25339a504b Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Sat, 4 May 2013 21:35:25 -0300 Subject: [PATCH 17/28] added a new attribute for the PhoneModule definition on config.xml to enable only the presenter to share the microphone - it fits perfectly on the global audio stream feature for webinars; refactored a little the PhoneOptions class to parse the options directly in a single place --- .../resources/config.xml.template | 1 + .../listeners/views/ListenersWindow.mxml | 8 +++--- .../modules/phone/PhoneOptions.as | 16 +++++++++++ .../modules/phone/managers/PhoneManager.as | 6 ----- .../modules/phone/maps/PhoneEventMap.mxml | 8 ++++++ .../phone/maps/PhoneEventMapDelegate.as | 14 +++++----- .../phone/views/components/ToolbarButton.mxml | 27 +++++++++++++------ .../videoconf/views/ToolbarButton.mxml | 1 + 8 files changed, 56 insertions(+), 25 deletions(-) diff --git a/bigbluebutton-client/resources/config.xml.template b/bigbluebutton-client/resources/config.xml.template index ac8e5d6df9..6100f834c5 100755 --- a/bigbluebutton-client/resources/config.xml.template +++ b/bigbluebutton-client/resources/config.xml.template @@ -44,6 +44,7 @@ uri="rtmp://HOST/sip" autoJoin="false" joinGlobal="true" + presenterShareOnly="false" skipCheck="false" showButton="true" enabledEchoCancel="true" diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenersWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenersWindow.mxml index c2b7b8a535..b674558724 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenersWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/views/ListenersWindow.mxml @@ -60,8 +60,8 @@ private var _xPosition:int; private var _yPosition:int; - [Bindable] private var muteAllIcon:Class = images.sound_mute; - [Bindable] private var unmuteAllIcon:Class = images.sound_none; + [Bindable] private var muteIcon:Class = images.sound_mute; + [Bindable] private var unmuteIcon:Class = images.sound_none; [Bindable] private var kickIcon:Class = images.eject_user; [Bindable] public var listeners:ArrayCollection = new ArrayCollection(); [Bindable] public var moderator:Boolean; @@ -128,11 +128,9 @@ if (mute){ muteAllBtn.toolTip = ResourceUtil.getInstance().getString('bbb.listeners.unmuteAllBtn.toolTip'); muteAllBtn.selected = true; - muteAllIcon = images.sound_mute; } else{ muteAllBtn.toolTip = ResourceUtil.getInstance().getString('bbb.listeners.muteAllBtn.toolTip'); muteAllBtn.selected = false; - muteAllIcon = images.sound_none; } } @@ -214,7 +212,7 @@ toolTip="{UserManager.getInstance().getConference().voiceMuted ? ResourceUtil.getInstance().getString('bbb.listeners.pushToTalk.toolTip') : ResourceUtil.getInstance().getString('bbb.listeners.pushToMute.toolTip')}" click="toggleMuteMeState()" height="30" maxWidth="180"> - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as index 515d7989e6..966c7c1c0c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as @@ -1,5 +1,7 @@ package org.bigbluebutton.modules.phone { + import org.bigbluebutton.core.BBB; + public class PhoneOptions { [Bindable] public var showButton:Boolean = true; @@ -15,5 +17,19 @@ package org.bigbluebutton.modules.phone [Bindable] public var joinGlobal:Boolean = true; + + [Bindable] + public var presenterShareOnly:Boolean = false; + + public function PhoneOptions() { + var vxml:XML = BBB.getConfigForModule("PhoneModule"); + if (vxml != null) { + this.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; + this.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; + this.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; + this.joinGlobal = (vxml.@joinGlobal.toString().toUpperCase() == "TRUE") ? true : false; + this.presenterShareOnly = (vxml.@presenterShareOnly.toString().toUpperCase() == "TRUE") ? true : false; + } + } } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as index 1eba3248bc..5ae3516653 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as @@ -55,12 +55,6 @@ package org.bigbluebutton.modules.phone.managers { this.attributes = attributes; var vxml:XML = BBB.getConfigForModule("PhoneModule"); phoneOptions = new PhoneOptions(); - if (vxml != null) { - phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; - phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; - phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; - phoneOptions.joinGlobal = (vxml.@joinGlobal.toString().toUpperCase() == "TRUE") ? true : false; - } if (phoneOptions.joinGlobal) { joinVoiceGlobal(); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml index 6923828a84..34065dc7f4 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml @@ -24,6 +24,7 @@ xmlns:mx="http://www.adobe.com/2006/mxml"> + + + + + + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as index efcd1dc453..7e9a6e8ed7 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as @@ -39,12 +39,6 @@ package org.bigbluebutton.modules.phone.maps soundButton = new MuteButton(); globalDispatcher = new Dispatcher(); phoneOptions = new PhoneOptions(); - var vxml:XML = BBB.getConfigForModule("PhoneModule"); - if (vxml != null) { - phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; - phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; - phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; - } } public function addToolbarButton():void { @@ -91,5 +85,13 @@ package org.bigbluebutton.modules.phone.maps phoneButton.enabled = true; //phoneButton.userJoinedConference(false); } + + public function switchToPresenter():void { + phoneButton.setPresenter(true); + } + + public function switchToViewer():void { + phoneButton.setPresenter(false); + } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index 0123be48bd..54e286ecfb 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -24,9 +24,18 @@ icon="{phoneIcon}" click="startPhone()" mouseOver = "mouseOverHandler(event)" mouseOut = "mouseOutHandler(event)" + visible = "{amIPresenter || !phoneOptions.presenterShareOnly}" + includeInLayout = "{amIPresenter || !phoneOptions.presenterShareOnly}" toolTip="{ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start')}" implements="org.bigbluebutton.common.IBbbToolbarComponent"> - + + @@ -38,6 +47,7 @@ import org.bigbluebutton.common.LogUtil; import org.bigbluebutton.core.BBB; + import org.bigbluebutton.core.managers.UserManager import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.main.views.MainToolbar; import org.bigbluebutton.modules.phone.PhoneOptions; @@ -48,7 +58,10 @@ private var images:Images = new Images(); private var dispatcher:Dispatcher = new Dispatcher(); - + [Bindable] + private var phoneOptions:PhoneOptions = new PhoneOptions(); + [Bindable] + private var amIPresenter:Boolean = UserManager.getInstance().getConference().amIPresenter(); public const DEFAULT_STATE:Number = 0; public const ACTIVE_STATE:Number = 1; @@ -64,12 +77,6 @@ this.enabled = false; var vxml:XML = BBB.getConfigForModule("PhoneModule"); var phoneOptions:PhoneOptions = new PhoneOptions(); - if (vxml != null) { - phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; - phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; - phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; - phoneOptions.joinGlobal = (vxml.@joinGlobal.toString().toUpperCase() == "TRUE") ? true : false; - } if (noMicrophone() == false) { var askToChangeEvent:BBBEvent; askToChangeEvent = new BBBEvent("ASK_TO_CHANGE_VOICE_CONFERENCE_EVENT"); @@ -161,6 +168,10 @@ public function getAlignment():String{ return MainToolbar.ALIGN_LEFT; } + + public function setPresenter(value:Boolean):void { + amIPresenter = value; + } ]]> diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/ToolbarButton.mxml index 014d0b7628..1bd4617a43 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/ToolbarButton.mxml @@ -27,6 +27,7 @@ mouseOut = "mouseOutHandler(event)" toolTip="{ResourceUtil.getInstance().getString('bbb.toolbar.video.toolTip.start')}" visible="{isPresenter}" + includeInLayout="{isPresenter}" implements="org.bigbluebutton.common.IBbbToolbarComponent"> From 87093309f38de661e100b6ab086813c2763c485d Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Thu, 16 May 2013 13:59:02 -0300 Subject: [PATCH 18/28] Fixed bug that Listen only mode didn't work if the user didn't have a microphone connected. The problem was an unchecked null reference on microphone. fixes #765 --- .../locale/en_US/bbbResources.properties | 1 + .../modules/phone/managers/StreamManager.as | 77 ++++++++--------- .../phone/maps/PhoneEventMapDelegate.as | 8 +- .../phone/views/components/ToolbarButton.mxml | 83 ++++++++++++++----- 4 files changed, 112 insertions(+), 57 deletions(-) diff --git a/bigbluebutton-client/locale/en_US/bbbResources.properties b/bigbluebutton-client/locale/en_US/bbbResources.properties index ec4bba7f8c..db2cee53ce 100755 --- a/bigbluebutton-client/locale/en_US/bbbResources.properties +++ b/bigbluebutton-client/locale/en_US/bbbResources.properties @@ -133,6 +133,7 @@ bbb.toolbar.phone.toolTip.start = Share My Microphone bbb.toolbar.phone.toolTip.stop = Stop Sharing My Microphone bbb.toolbar.phone.toolTip.mute = Stop Listening Voice Conference bbb.toolbar.phone.toolTip.unmute = Start Listening Voice Conference +bbb.toolbar.phone.toolTip.nomic = You don't have a Microphone bbb.toolbar.deskshare.toolTip.start = Share My Desktop bbb.toolbar.deskshare.toolTip.stop = Stop Sharing My Desktop bbb.toolbar.video.toolTip.start = Share My Camera diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as index bde62e8f24..2f97ae5ba1 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as @@ -18,18 +18,18 @@ */ package org.bigbluebutton.modules.phone.managers { - import com.asfusion.mate.events.Dispatcher; - import flash.events.ActivityEvent; - import flash.events.AsyncErrorEvent; - import flash.events.IEventDispatcher; - import flash.events.NetStatusEvent; - import flash.events.StatusEvent; - import flash.media.Microphone; - import flash.media.MicrophoneEnhancedMode; - import flash.media.MicrophoneEnhancedOptions; - import flash.media.SoundCodec; - import flash.net.NetConnection; - import flash.net.NetStream; + import com.asfusion.mate.events.Dispatcher; + import flash.events.ActivityEvent; + import flash.events.AsyncErrorEvent; + import flash.events.IEventDispatcher; + import flash.events.NetStatusEvent; + import flash.events.StatusEvent; + import flash.media.Microphone; + import flash.media.MicrophoneEnhancedMode; + import flash.media.MicrophoneEnhancedOptions; + import flash.media.SoundCodec; + import flash.net.NetConnection; + import flash.net.NetStream; import org.bigbluebutton.common.LogUtil; import org.bigbluebutton.core.BBB; import org.bigbluebutton.main.events.BBBEvent; @@ -45,8 +45,8 @@ package org.bigbluebutton.modules.phone.managers { private var mic:Microphone = null; private var isCallConnected:Boolean = false; private var muted:Boolean = false; - private var audioCodec:String = "SPEEX"; - private var dispatcher:Dispatcher; + private var audioCodec:String = "SPEEX"; + private var dispatcher:Dispatcher; private var listeningOnGlobal:Boolean; private var savedAudio:Boolean = false; @@ -78,31 +78,34 @@ package org.bigbluebutton.modules.phone.managers { if ((BBB.getFlashPlayerVersion() >= 10.3) && (phoneOptions.enabledEchoCancel)) { LogUtil.debug("Using acoustic echo cancellation."); mic = Microphone(Microphone["getEnhancedMicrophone"]()); - var options:MicrophoneEnhancedOptions = new MicrophoneEnhancedOptions(); - options.mode = MicrophoneEnhancedMode.FULL_DUPLEX; - options.autoGain = false; - options.echoPath = 128; - options.nonLinearProcessing = true; - mic['enhancedOptions'] = options; + if(mic != null) { + var options:MicrophoneEnhancedOptions = new MicrophoneEnhancedOptions(); + options.mode = MicrophoneEnhancedMode.FULL_DUPLEX; + options.autoGain = false; + options.echoPath = 128; + options.nonLinearProcessing = true; + mic['enhancedOptions'] = options; + } } else { } - - mic.setUseEchoSuppression(true); - mic.setLoopBack(false); - mic.setSilenceLevel(0,20000); - if (audioCodec == "SPEEX") { - mic.encodeQuality = 6; - mic.codec = SoundCodec.SPEEX; - mic.framesPerPacket = 1; - mic.rate = 16; - LogUtil.debug("Using SPEEX whideband codec."); - } else { - mic.codec = SoundCodec.NELLYMOSER; - mic.rate = 8; - LogUtil.debug("Using Nellymoser codec."); - } - mic.gain = 60; + if(mic != null) { + mic.setUseEchoSuppression(true); + mic.setLoopBack(false); + mic.setSilenceLevel(0,20000); + if (audioCodec == "SPEEX") { + mic.encodeQuality = 6; + mic.codec = SoundCodec.SPEEX; + mic.framesPerPacket = 1; + mic.rate = 16; + LogUtil.debug("Using SPEEX whideband codec."); + } else { + mic.codec = SoundCodec.NELLYMOSER; + mic.rate = 8; + LogUtil.debug("Using Nellymoser codec."); + } + mic.gain = 60; + } } public function initWithNoMicrophone(): void { @@ -295,4 +298,4 @@ package org.bigbluebutton.modules.phone.managers { LogUtil.debug("Recieve ON METADATA from SIP"); } } -} +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as index efcd1dc453..e02146b725 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as @@ -27,6 +27,7 @@ package org.bigbluebutton.modules.phone.maps import org.bigbluebutton.modules.phone.PhoneOptions; import org.bigbluebutton.modules.phone.views.components.ToolbarButton; import org.bigbluebutton.modules.phone.views.components.MuteButton; + public class PhoneEventMapDelegate { private var phoneOptions:PhoneOptions; private var phoneButton:ToolbarButton; @@ -49,7 +50,9 @@ package org.bigbluebutton.modules.phone.maps public function addToolbarButton():void { phoneButton.toggle = true; - + if(phoneButton.noMicrophone()) + phoneButton.disableButton(); + if (phoneOptions.showButton) { // Use the GLobal Dispatcher so that this message will be heard by the // main application. @@ -62,6 +65,9 @@ package org.bigbluebutton.modules.phone.maps var event2:ToolbarButtonEvent = new ToolbarButtonEvent(ToolbarButtonEvent.ADD); event2.button = soundButton; globalDispatcher.dispatchEvent(event2); + + + } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index 0123be48bd..1deb769b43 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -54,6 +54,7 @@ public const ACTIVE_STATE:Number = 1; private var _currentState:Number = DEFAULT_STATE; private var _changeState:Boolean = false; + private var stopChangingIcon:Boolean = false; [Bindable] public var phoneIcon:Class = images.headsetDefaultIcon; @@ -86,40 +87,77 @@ } dispatcher.dispatchEvent(askToChangeEvent); } + if(stopChangingIcon) { + disableButton(); + } } private function mouseOverHandler(event:MouseEvent):void { - if(_currentState == ACTIVE_STATE) - phoneIcon = images.headsetInactiveIcon; - else - phoneIcon = images.headsetActiveIcon; + if(stopChangingIcon) { + disableButton(); + } + else { + if(stopChangingIcon == false) { + if(_currentState == ACTIVE_STATE) + phoneIcon = images.headsetInactiveIcon; + else + phoneIcon = images.headsetActiveIcon; + } + else { + phoneIcon = images.headsetDefaultIcon; + } + } } private function mouseOutHandler(event:MouseEvent):void { - if(_currentState == ACTIVE_STATE) - phoneIcon = images.headsetActiveIcon; - else - phoneIcon = images.headsetDefaultIcon; + if(stopChangingIcon) { + disableButton(); + } + else { + if(_currentState == ACTIVE_STATE) + phoneIcon = images.headsetActiveIcon; + else + phoneIcon = images.headsetDefaultIcon; + } + } + + public function disableButton():void { + LogUtil.debug("TESTE TESTE DESATIVA DESATIVA"); + this.selected = false; + this.enabled = false; + stopChangingIcon = true; + phoneIcon = images.headsetDefaultIcon; + this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.nomic'); } public function userJoinedConference(joined: Boolean):void { if (joined) { - this.selected = true; - this.enabled = true; - _currentState = ACTIVE_STATE; - phoneIcon = images.headsetActiveIcon; - this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.stop'); + if(stopChangingIcon) { + disableButton(); + } + else { + this.selected = true; + this.enabled = true; + _currentState = ACTIVE_STATE; + phoneIcon = images.headsetActiveIcon; + this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.stop'); + } } else { - this.selected = false; - this.enabled = true; - _currentState = DEFAULT_STATE; - phoneIcon = images.headsetDefaultIcon; - this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start'); + if(stopChangingIcon) { + disableButton(); + } + else { + this.selected = false; + this.enabled = true; + _currentState = DEFAULT_STATE; + phoneIcon = images.headsetDefaultIcon; + this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start'); + } } } - private function noMicrophone():Boolean { + public function noMicrophone():Boolean { return ((Microphone.getMicrophone() == null) || (Microphone.names.length == 0) || ((Microphone.names.length == 1) && (Microphone.names[0] == "Unknown Microphone"))); } @@ -130,6 +168,10 @@ _currentState = DEFAULT_STATE; phoneIcon = images.headsetDefaultIcon; this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start'); + if(stopChangingIcon) { + disableButton(); + } + } @@ -156,6 +198,9 @@ phoneIcon = images.headsetDefaultIcon; this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start'); } + if(stopChangingIcon) { + disableButton(); + } } public function getAlignment():String{ From 590ec2e58e25ce15178b20c29167d433d6e1ec7d Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Thu, 16 May 2013 15:07:20 -0300 Subject: [PATCH 19/28] Removed debug message --- .../modules/phone/views/components/ToolbarButton.mxml | 1 - 1 file changed, 1 deletion(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index 0e874ddee9..8474c48d39 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -129,7 +129,6 @@ } public function disableButton():void { - LogUtil.debug("TESTE TESTE DESATIVA DESATIVA"); this.selected = false; this.enabled = false; stopChangingIcon = true; From c8e7b52f5249f27b78255a248bd41b1ca510fc00 Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Mon, 8 Jul 2013 11:56:09 -0300 Subject: [PATCH 20/28] Fixed new callerName --- .../bigbluebutton/main/views/MicSettings.mxml | 24 ++++++++++++------- .../modules/phone/managers/PhoneManager.as | 8 +++---- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml index f2bd69b55e..dc208df547 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml @@ -26,7 +26,7 @@ with BigBlueButton; if not, see . showCloseButton="false" close="onCancelClicked()" keyDown="handleKeyDown(event)"> - + . } private function onJoinClicked():void { + var e:BBBEvent = new BBBEvent("RESTORE_TO_ADJUST"); + dispatchEvent(e); cleanUp(); - var joinEvent:BBBEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); - joinEvent.payload['useMicrophone'] = true; - dispatchEvent(joinEvent); + var askToChangeEvent:BBBEvent = new BBBEvent("ASK_TO_CHANGE_VOICE_CONFERENCE_EVENT"); + askToChangeEvent.payload["global"] = false; + dispatchEvent(askToChangeEvent); PopUpManager.removePopUp(this); } private function onCancelClicked():void { + var e:BBBEvent = new BBBEvent("RESTORE_TO_ADJUST"); + dispatchEvent(e); + e = new BBBEvent("ENABLE_JOIN_BUTTON"); + dispatchEvent(e); cleanUp(); - var event:BBBEvent = new BBBEvent(BBBEvent.MIC_SETTINGS_CLOSED); - event.payload['clicked'] = "cancel"; - dispatchEvent(event); PopUpManager.removePopUp(this); + //cleanUp(); + //var event:BBBEvent = new BBBEvent(BBBEvent.MIC_SETTINGS_CLOSED); + //event.payload['clicked'] = "cancel"; + //dispatchEvent(event); + //PopUpManager.removePopUp(this); } private function cleanUp():void { @@ -189,7 +197,7 @@ with BigBlueButton; if not, see . - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as index 71a45c5737..26138e17d3 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as @@ -127,8 +127,8 @@ package org.bigbluebutton.modules.phone.managers { userHangup = false; globalCall = true; var uid:String = String(Math.floor(new Date().getTime())); - var uname:String = encodeURIComponent(UserManager.getInstance().getConference().getMyUserId() + "-" + attributes.username); - connectionManager.connect(uid, attributes.externUserID, uname , attributes.room, attributes.uri); + var uname:String = encodeURIComponent(UsersUtil.getMyExternalUserID() + "-bbbID-" + attributes.username); + connectionManager.connect(uid, attributes.internalUserID, uname , attributes.room, attributes.uri); } @@ -138,8 +138,8 @@ package org.bigbluebutton.modules.phone.managers { globalCall = false; setupMic(autoJoin); var uid:String = String(Math.floor(new Date().getTime())); - var uname:String = encodeURIComponent(UserManager.getInstance().getConference().getMyUserId() + "-" + attributes.username); - connectionManager.connect(uid, attributes.externUserID, uname , attributes.room, attributes.uri); + var uname:String = encodeURIComponent(UsersUtil.getMyExternalUserID() + "-bbbID-" + attributes.username); + connectionManager.connect(uid, attributes.internalUserID, uname , attributes.room, attributes.uri); var dispatcher:Dispatcher = new Dispatcher(); dispatcher.dispatchEvent(new BBBEvent(BBBEvent.JOIN_VOICE_FOCUS_HEAD)); } From 9c1c8eecfc733af02316a3aee41380b2369d87eb Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Tue, 9 Jul 2013 09:34:43 -0300 Subject: [PATCH 21/28] - Added shortcut to mute button - Fixed joinGlobal bug --- bigbluebutton-client/locale/en_US/bbbResources.properties | 6 ++++-- bigbluebutton-client/src/BigBlueButton.mxml | 1 + .../src/org/bigbluebutton/main/events/ShortcutEvent.as | 7 ++++--- .../src/org/bigbluebutton/main/model/ShortcutOptions.as | 5 ++++- .../bigbluebutton/modules/phone/managers/PhoneManager.as | 2 +- .../modules/phone/views/components/MuteButton.mxml | 8 ++++++++ 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/bigbluebutton-client/locale/en_US/bbbResources.properties b/bigbluebutton-client/locale/en_US/bbbResources.properties index f64480a76f..79a39ebfdb 100755 --- a/bigbluebutton-client/locale/en_US/bbbResources.properties +++ b/bigbluebutton-client/locale/en_US/bbbResources.properties @@ -294,7 +294,7 @@ bbb.shortcutkey.focus.video.function = Move focus to the Video dock bbb.shortcutkey.focus.presentation = 51 bbb.shortcutkey.focus.presentation.function = Move focus to the Presentation window bbb.shortcutkey.focus.chat = 52 - bbb.shortcutkey.focus.chat.function = Move focus to the Chat window +bbb.shortcutkey.focus.chat.function = Move focus to the Chat window bbb.shortcutkey.focus.pollingCreate = 67 bbb.shortcutkey.focus.pollingCreate.function = Move focus to the Poll Creation window, if it is open. bbb.shortcutkey.focus.pollingStats = 83 @@ -306,6 +306,8 @@ bbb.shortcutkey.share.desktop = 68 bbb.shortcutkey.share.desktop.function = Open desktop sharing window bbb.shortcutkey.share.microphone = 79 bbb.shortcutkey.share.microphone.function = Open microphone settings window +bbb.shortcutkey.share.pauseRemoteStream = 80 +bbb.shortcutkey.share.pauseRemoteStream.function = Pause Remote Audio bbb.shortcutkey.share.webcam = 66 bbb.shortcutkey.share.webcam.function = Open webcam sharing window @@ -473,4 +475,4 @@ bbb.shortcutkey.specialKeys.right = Right Arrow bbb.shortcutkey.specialKeys.up = Up Arrow bbb.shortcutkey.specialKeys.down = Down Arrow bbb.shortcutkey.specialKeys.plus = Plus -bbb.shortcutkey.specialKeys.minus = Minus \ No newline at end of file +bbb.shortcutkey.specialKeys.minus = Minus diff --git a/bigbluebutton-client/src/BigBlueButton.mxml b/bigbluebutton-client/src/BigBlueButton.mxml index 5c442d39e4..f724845109 100755 --- a/bigbluebutton-client/src/BigBlueButton.mxml +++ b/bigbluebutton-client/src/BigBlueButton.mxml @@ -154,6 +154,7 @@ with BigBlueButton; if not, see . } if (ShortcutOptions.audioActive){ keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.share.microphone') as String)] = ShortcutEvent.SHARE_MICROPHONE; + keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.share.pauseRemoteStream') as String)] = ShortcutEvent.PAUSE_REMOTE_STREAM; } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/events/ShortcutEvent.as b/bigbluebutton-client/src/org/bigbluebutton/main/events/ShortcutEvent.as index 81c12ab799..32dfc7b248 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/events/ShortcutEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/events/ShortcutEvent.as @@ -50,6 +50,7 @@ package org.bigbluebutton.main.events { public static const SHARE_DESKTOP:String = 'SHARE_DESKTOP'; public static const SHARE_MICROPHONE:String = 'SHARE_MICROPHONE'; public static const SHARE_WEBCAM:String = 'SHARE_WEBCAM'; + public static const PAUSE_REMOTE_STREAM:String = 'PAUSE_REMOTE_STREAM'; public static const REMOTE_FOCUS_DESKTOP:String = 'REMOTE_FOCUS_DESKTOP'; public static const REMOTE_FOCUS_WEBCAM:String = 'REMOTE_FOCUS_WEBCAM'; @@ -70,9 +71,9 @@ package org.bigbluebutton.main.events { public static const FOCUS_CHAT_BOX:String = 'FOCUS_CHAT_BOX'; public static const CHANGE_FONT_COLOUR:String = 'CHANGE_FONT_COLOUR'; public static const SEND_MESSAGE:String = 'SEND_MESSAGE'; - - public static const FOCUS_SHORTCUT_BUTTON:String = 'FOCUS_SHORTCUT_BUTTON'; - public static const MUTE_ALL_BUT_PRES:String = 'MUTE_ALL_BUT_PRES'; + + public static const FOCUS_SHORTCUT_BUTTON:String = 'FOCUS_SHORTCUT_BUTTON'; + public static const MUTE_ALL_BUT_PRES:String = 'MUTE_ALL_BUT_PRES'; public static const CLOSE_POLL_STATS:String = 'CLOSE_POLL_STATS'; public static const FOCUS_MULT_CHECK:String = 'FOCUS_MULT_CHECK'; diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/ShortcutOptions.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/ShortcutOptions.as index af1e73c2c4..638a1226c6 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/ShortcutOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/ShortcutOptions.as @@ -88,7 +88,10 @@ package org.bigbluebutton.main.model generalResource.push('bbb.shortcutkey.focus.voting'); } - if (audio){generalResource.push('bbb.shortcutkey.share.microphone');} + if (audio){ + generalResource.push('bbb.shortcutkey.share.microphone'); + generalResource.push('bbb.shortcutkey.share.pauseRemoteStream'); + } if (deskshare){generalResource.push('bbb.shortcutkey.share.desktop');} if (webcam){generalResource.push('bbb.shortcutkey.share.webcam');} if (polling){generalResource.push('bbb.shortcutkey.polling.buttonClick');} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as index 26138e17d3..0856498341 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as @@ -67,7 +67,7 @@ package org.bigbluebutton.modules.phone.managers { if (phoneOptions.joinGlobal) { joinVoiceGlobal(); } - else if (phoneOptions.autoJoin) { + if (phoneOptions.autoJoin) { if (phoneOptions.skipCheck) { if(noMicrophone()) joinVoice(false); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml index a70d6c9932..9b094d0d87 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/MuteButton.mxml @@ -28,6 +28,7 @@ toolTip="{ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.mute')}" implements="org.bigbluebutton.common.IBbbToolbarComponent"> + Date: Tue, 9 Jul 2013 09:57:25 -0300 Subject: [PATCH 22/28] Add new locale resources to pt-br and en-us --- bigbluebutton-client/locale/en_US/bbbResources.properties | 5 ++++- bigbluebutton-client/locale/pt_BR/bbbResources.properties | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bigbluebutton-client/locale/en_US/bbbResources.properties b/bigbluebutton-client/locale/en_US/bbbResources.properties index 79a39ebfdb..9cf3ef84c0 100755 --- a/bigbluebutton-client/locale/en_US/bbbResources.properties +++ b/bigbluebutton-client/locale/en_US/bbbResources.properties @@ -176,6 +176,9 @@ bbb.desktopView.maximizeRestoreBtn.accessibilityName = Maximize the Desktop Shar bbb.desktopView.closeBtn.accessibilityName = Close the Desktop Sharing View Window bbb.toolbar.phone.toolTip.start = Share My Microphone bbb.toolbar.phone.toolTip.stop = Stop Sharing My Microphone +bbb.toolbar.phone.toolTip.mute = Stop listening the conference +bbb.toolbar.phone.toolTip.unmute = Start listening the conference +bbb.toolbar.phone.toolTip.nomic = No microphone detected bbb.toolbar.deskshare.toolTip.start = Share My Desktop bbb.toolbar.deskshare.toolTip.stop = Stop Sharing My Desktop bbb.toolbar.video.toolTip.start = Share My Camera @@ -307,7 +310,7 @@ bbb.shortcutkey.share.desktop.function = Open desktop sharing window bbb.shortcutkey.share.microphone = 79 bbb.shortcutkey.share.microphone.function = Open microphone settings window bbb.shortcutkey.share.pauseRemoteStream = 80 -bbb.shortcutkey.share.pauseRemoteStream.function = Pause Remote Audio +bbb.shortcutkey.share.pauseRemoteStream.function = Start/Stop listening the conference bbb.shortcutkey.share.webcam = 66 bbb.shortcutkey.share.webcam.function = Open webcam sharing window diff --git a/bigbluebutton-client/locale/pt_BR/bbbResources.properties b/bigbluebutton-client/locale/pt_BR/bbbResources.properties index 5aad6097b3..acd488eccf 100644 --- a/bigbluebutton-client/locale/pt_BR/bbbResources.properties +++ b/bigbluebutton-client/locale/pt_BR/bbbResources.properties @@ -174,6 +174,9 @@ bbb.desktopView.maximizeRestoreBtn.accessibilityName = Maximizar janela do compa bbb.desktopView.closeBtn.accessibilityName = Fechar janela do compartilhamento de tela bbb.toolbar.phone.toolTip.start = Transmitir meu microfone bbb.toolbar.phone.toolTip.stop = Interromper transmissão do meu microfone +bbb.toolbar.phone.toolTip.mute = Parar de ouvir a conferência +bbb.toolbar.phone.toolTip.unmute = Começar a ouvir a conferência +bbb.toolbar.phone.toolTip.nomic = Nenhum microfone foi detectado bbb.toolbar.deskshare.toolTip.start = Compartilhar minha tela bbb.toolbar.deskshare.toolTip.stop = Interromper compartilhamento de tela bbb.toolbar.video.toolTip.start = Transmitir minha câmera @@ -286,6 +289,8 @@ bbb.shortcutkey.share.desktop = 68 bbb.shortcutkey.share.desktop.function = Abrir janela de compartilhamento de tela bbb.shortcutkey.share.microphone = 79 bbb.shortcutkey.share.microphone.function = Abrir janela de configuração de microfone +bbb.shortcutkey.share.pauseRemoteStream = 80 +bbb.shortcutkey.share.pauseRemoteStream.function = Começar/Parar a ouvir a conferência bbb.shortcutkey.share.webcam = 66 bbb.shortcutkey.share.webcam.function = Abrir janela de transmissão da câmera bbb.shortcutkey.shortcutWindow = 72 From 5e97768e2215175bbf132380c1ccd63f11962381 Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Tue, 9 Jul 2013 11:05:37 -0300 Subject: [PATCH 23/28] Removed old code --- .../phone/views/components/ToolbarButton.mxml | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index 0ebd2a1b7c..3b5d5b83a5 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -74,6 +74,7 @@ with BigBlueButton; if not, see . this.enabled = false; var vxml:XML = BBB.getConfigForModule("PhoneModule"); var phoneOptions:PhoneOptions = new PhoneOptions(); + if (noMicrophone() == false) { var askToChangeEvent:BBBEvent; askToChangeEvent = new BBBEvent("ASK_TO_CHANGE_VOICE_CONFERENCE_EVENT"); @@ -100,26 +101,6 @@ with BigBlueButton; if not, see . startPhone(); } - private function micStatusEventHandler(event:StatusEvent):void { - var joinEvent:BBBEvent; - switch(event.code) { - case "Microphone.Muted": - LogUtil.warn("Access to microphone has been denied."); - joinEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); - joinEvent.payload['useMicrophone'] = false; - dispatcher.dispatchEvent(joinEvent); - break; - case "Microphone.Unmuted": - LogUtil.debug("Access to the microphone has been allowed."); - joinEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); - joinEvent.payload['useMicrophone'] = true; - dispatcher.dispatchEvent(joinEvent); - break; - default: - LogUtil.debug("unknown micStatusHandler event: " + event); - } - } - private function mouseOverHandler(event:MouseEvent):void { if(stopChangingIcon) { disableButton(); From 37d67f1854c2d5c2efb67dc555d0436ab77e9b04 Mon Sep 17 00:00:00 2001 From: Hugo Lazzari Date: Fri, 12 Jul 2013 11:31:04 -0300 Subject: [PATCH 24/28] Fixed bugs when listenOnlyMode was false, add new icons depending on listenOnlyMode changed joingGlobal to listenOnlyMode Removed old debug messages --- .../red5/ClientConnectionManager.java | 1 - .../voiceconf/sip/KeepAliveUdp.java | 4 +- .../bigbluebutton/voiceconf/sip/SipPeer.java | 3 - .../resources/config.xml.template | 3 +- .../main/views/MainApplicationShell.mxml | 385 +++++++++--------- .../bigbluebutton/main/views/MicSettings.mxml | 40 +- .../modules/phone/PhoneOptions.as | 8 +- .../phone/managers/ConnectionManager.as | 172 ++++---- .../modules/phone/managers/PhoneManager.as | 34 +- .../modules/phone/maps/PhoneEventMap.mxml | 2 +- .../phone/maps/PhoneEventMapDelegate.as | 28 +- .../modules/phone/views/assets/Images.as | 14 +- .../phone/views/components/ToolbarButton.mxml | 84 +++- 13 files changed, 433 insertions(+), 345 deletions(-) diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java index 5d5d619328..bd0b7ca5fd 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java @@ -47,7 +47,6 @@ public class ClientConnectionManager { public void joinConferenceSuccessNew(String clientId, String listen, String codec) { ClientConnection cc = clients.get(clientId); if (cc != null) { - System.out.println("String Global"); cc.onJoinConferenceSuccess("", listen, codec); } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/KeepAliveUdp.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/KeepAliveUdp.java index a0550a6b9a..9d05eeee05 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/KeepAliveUdp.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/KeepAliveUdp.java @@ -145,13 +145,11 @@ public class KeepAliveUdp extends Thread { try { while(!stop) { sendToken(); - //System.out.print("."); Thread.sleep(delta_time); if (expire>0 && System.currentTimeMillis()>expire) halt(); } } catch (Exception e) { e.printStackTrace(); } - //System.out.println("o"); udp_socket=null; } @@ -165,4 +163,4 @@ public class KeepAliveUdp extends Thread return str+" ("+delta_time+"ms)"; } -} \ No newline at end of file +} diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java index 35600f2fd0..d999b4c644 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java @@ -185,15 +185,12 @@ public class SipPeer implements SipRegisterAgentListener { if(ca != null) { if(ca.isTalking()) { - System.out.println("CA ESTA FALANDO"); ca.hangup(); } else { - System.out.println("REMOVE USER"); GlobalCall.removeUser(destination); ca.hangup(); if(GlobalCall.roomHasGlobalStream(destination) && GlobalCall.getNumberOfUsers(destination) <= 0) { - System.out.println("REMOVE GLOBAL"); CallAgent caGlobal = callManager.removeGlobal(destination); GlobalCall.removeRoom(destination); caGlobal.hangup(); diff --git a/bigbluebutton-client/resources/config.xml.template b/bigbluebutton-client/resources/config.xml.template index e8b8cad64e..fba4909d5b 100755 --- a/bigbluebutton-client/resources/config.xml.template +++ b/bigbluebutton-client/resources/config.xml.template @@ -42,10 +42,11 @@ diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index 5dbec787a6..b73f9d79e2 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -33,7 +33,7 @@ with BigBlueButton; if not, see . - + @@ -83,128 +83,128 @@ with BigBlueButton; if not, see . import org.bigbluebutton.main.model.LayoutOptions; import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent; import org.bigbluebutton.util.i18n.ResourceUtil; - import org.bigbluebutton.util.logging.Logger; - - private var globalDispatcher:Dispatcher; - private var dispState:String; //full-screen? - private var images:Images = new Images(); - private var stoppedModules:ArrayCollection; - private var logs:Logger = new Logger(); + import org.bigbluebutton.util.logging.Logger; + + private var globalDispatcher:Dispatcher; + private var dispState:String; //full-screen? + private var images:Images = new Images(); + private var stoppedModules:ArrayCollection; + private var logs:Logger = new Logger(); private var logWindow:LogWindow; - private var scWindow:ShortcutHelpWindow; - private var logoutWindow:LoggedOutWindow; + private var scWindow:ShortcutHelpWindow; + private var logoutWindow:LoggedOutWindow; private var connectionLostWindow:ConnectionLostWindow; - [Bindable] private var baseIndex:int = 100000; - - // LIVE or PLAYBACK - private var _mode:String = 'LIVE'; - [Bindable] public var appVersion:String = ' '; - private var localeVersion:String = 'old'; - [Bindable] public var numberOfModules:int = 0; - - [Bindable] private var fullscreen_icon:Class = images.full_screen; - [Bindable] private var logs_icon:Class = images.table; - [Bindable] private var reset_layout_icon:Class = images.layout; + [Bindable] private var baseIndex:int = 100000; + + // LIVE or PLAYBACK + private var _mode:String = 'LIVE'; + [Bindable] public var appVersion:String = ' '; + private var localeVersion:String = 'old'; + [Bindable] public var numberOfModules:int = 0; + + [Bindable] private var fullscreen_icon:Class = images.full_screen; + [Bindable] private var logs_icon:Class = images.table; + [Bindable] private var reset_layout_icon:Class = images.layout; [Bindable] private var statsIcon:Class = images.bandwidth; - - private var receivedConfigLocaleVer:Boolean = false; + + private var receivedConfigLocaleVer:Boolean = false; private var receivedResourceLocaleVer:Boolean = false; - - public function get mode():String { - return _mode; - } - - [Bindable] private var layoutOptions:LayoutOptions; - - [Bindable] private var showToolbarOpt:Boolean = true; + + public function get mode():String { + return _mode; + } + + [Bindable] private var layoutOptions:LayoutOptions; + + [Bindable] private var showToolbarOpt:Boolean = true; [Bindable] private var toolbarHeight:Number = 30; [Bindable] private var toolbarPaddingTop:Number = 4; [Bindable] private var showFooterOpt:Boolean = true; [Bindable] private var footerHeight:Number = 20; [Bindable] private var isTunneling:Boolean = false; - - public function initOptions(e:Event):void { - layoutOptions = new LayoutOptions(); - layoutOptions.parseOptions(); - showToolbarOpt = layoutOptions.showToolbar; + + public function initOptions(e:Event):void { + layoutOptions = new LayoutOptions(); + layoutOptions.parseOptions(); + showToolbarOpt = layoutOptions.showToolbar; if (!showToolbarOpt) { toolbarHeight = 0; toolbarPaddingTop = 0; - } + } toolbar.displayToolbar(); showFooterOpt = layoutOptions.showFooter; if (!showFooterOpt) { footerHeight = 0; - } + } - } - - protected function initializeShell():void { - globalDispatcher = new Dispatcher(); - } - - protected function initFullScreen():void { - /* Set up full screen handler. */ - stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenHandler); - dispState = stage.displayState; - } - - private var sendStartModulesEvent:Boolean = true; - - private function handleApplicationVersionEvent(event:AppVersionEvent):void { - if (event.configLocaleVersion == true) { - receivedConfigLocaleVer = true; - appVersion = event.appVersion; - localeVersion = event.localeVersion; -// LogUtil.debug("Received locale version fron config.xml"); - } else { - receivedResourceLocaleVer = true; - LogUtil.debug("Received locale version fron locale file."); - } - - if (receivedConfigLocaleVer && receivedResourceLocaleVer) { - LogUtil.debug("Comparing locale versions."); - if (!event.suppressLocaleWarning) checkLocaleVersion(localeVersion); + } + + protected function initializeShell():void { + globalDispatcher = new Dispatcher(); + } + + protected function initFullScreen():void { + /* Set up full screen handler. */ + stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenHandler); + dispState = stage.displayState; + } + + private var sendStartModulesEvent:Boolean = true; + + private function handleApplicationVersionEvent(event:AppVersionEvent):void { + if (event.configLocaleVersion == true) { + receivedConfigLocaleVer = true; + appVersion = event.appVersion; + localeVersion = event.localeVersion; +// LogUtil.debug("Received locale version fron config.xml"); + } else { + receivedResourceLocaleVer = true; + LogUtil.debug("Received locale version fron locale file."); + } + + if (receivedConfigLocaleVer && receivedResourceLocaleVer) { + LogUtil.debug("Comparing locale versions."); + if (!event.suppressLocaleWarning) checkLocaleVersion(localeVersion); if (sendStartModulesEvent) { - - sendStartModulesEvent = false; - sendStartAllModulesEvent(); - } - } - } - - public function sendStartAllModulesEvent():void{ - LogUtil.debug("Sending start all modules event"); - var dispatcher:Dispatcher = new Dispatcher(); - dispatcher.dispatchEvent(new ModuleLoadEvent(ModuleLoadEvent.START_ALL_MODULES)); - } - - private function fullScreenHandler(evt:FullScreenEvent):void { - dispState = stage.displayState + " (fullScreen=" + evt.fullScreen.toString() + ")"; - if (evt.fullScreen) { - LogUtil.debug("Switching to full screen"); - /* Do something specific here if we switched to full screen mode. */ - - } else { - LogUtil.debug("Switching to normal screen"); - /* Do something specific here if we switched to normal mode. */ - } - } - - private function openLogWindow():void { - if (logWindow == null){ - logWindow = new LogWindow(); - logWindow.logs = logs; - } - mdiCanvas.windowManager.add(logWindow); - mdiCanvas.windowManager.absPos(logWindow, 50, 50); - logWindow.width = mdiCanvas.width - 100; - logWindow.height = mdiCanvas.height - 100; - } + + sendStartModulesEvent = false; + sendStartAllModulesEvent(); + } + } + } + + public function sendStartAllModulesEvent():void{ + LogUtil.debug("Sending start all modules event"); + var dispatcher:Dispatcher = new Dispatcher(); + dispatcher.dispatchEvent(new ModuleLoadEvent(ModuleLoadEvent.START_ALL_MODULES)); + } + + private function fullScreenHandler(evt:FullScreenEvent):void { + dispState = stage.displayState + " (fullScreen=" + evt.fullScreen.toString() + ")"; + if (evt.fullScreen) { + LogUtil.debug("Switching to full screen"); + /* Do something specific here if we switched to full screen mode. */ + + } else { + LogUtil.debug("Switching to normal screen"); + /* Do something specific here if we switched to normal mode. */ + } + } + + private function openLogWindow():void { + if (logWindow == null){ + logWindow = new LogWindow(); + logWindow.logs = logs; + } + mdiCanvas.windowManager.add(logWindow); + mdiCanvas.windowManager.absPos(logWindow, 50, 50); + logWindow.width = mdiCanvas.width - 100; + logWindow.height = mdiCanvas.height - 100; + } public function openShortcutHelpWindow(e:Event = null):void{ if (scWindow == null) { @@ -224,68 +224,69 @@ with BigBlueButton; if not, see . scWindow.focusHead(); } - - private function toggleFullScreen():void{ - LogUtil.debug("Toggling fullscreen"); - try { - switch (stage.displayState) { - case StageDisplayState.FULL_SCREEN: - LogUtil.debug("full screen mode"); - // If already in full screen mode, switch to normal mode. - stage.displayState = StageDisplayState.NORMAL; - break; - default: - LogUtil.debug("Normal screen mode"); - // If not in full screen mode, switch to full screen mode. - stage.displayState = StageDisplayState.FULL_SCREEN; - break; - } - } catch (err:SecurityError) { - // ignore - } - } - - private function handleOpenWindowEvent(event:OpenWindowEvent):void { - isTunneling = BBB.initConnectionManager().isTunnelling; - var window:IBbbModuleWindow = event.window; - mdiCanvas.addWindow(window); - } - - private function handleCloseWindowEvent(event:CloseWindowEvent):void { - var window:IBbbModuleWindow = event.window; - mdiCanvas.removeWindow(window); - } - - private function resetLayout():void{ - mdiCanvas.resetWindowLayout(); - } - - private function addComponentToCanvas(e:AddUIComponentToMainCanvas):void{ - mdiCanvas.addChild(e.component); - } - - public function checkLocaleVersion(localeVersion:String):void { - Alert.okLabel ="OK"; - var version:String = "old-locales"; - version = ResourceUtil.getInstance().getString('bbb.mainshell.locale.version'); - LogUtil.debug("Locale from config=" + localeVersion + ", from locale file=" + version); - - if ((version == "old-locales") || (version == "") || (version == null)) { - wrongLocaleVersion(); - } else { - if (version != localeVersion) wrongLocaleVersion(); - } - } - - private function showMicSettings(event:BBBEvent):void { - var micSettings:MicSettings = MicSettings(PopUpManager.createPopUp(mdiCanvas, MicSettings, true)); - var point1:Point = new Point(); - // Calculate position of TitleWindow in Application's coordinates. - point1.x = width/2; - point1.y = height/2; - micSettings.x = point1.x - (micSettings.width/2); - micSettings.y = point1.y - (micSettings.height/2); - } + + private function toggleFullScreen():void{ + LogUtil.debug("Toggling fullscreen"); + try { + switch (stage.displayState) { + case StageDisplayState.FULL_SCREEN: + LogUtil.debug("full screen mode"); + // If already in full screen mode, switch to normal mode. + stage.displayState = StageDisplayState.NORMAL; + break; + default: + LogUtil.debug("Normal screen mode"); + // If not in full screen mode, switch to full screen mode. + stage.displayState = StageDisplayState.FULL_SCREEN; + break; + } + } catch (err:SecurityError) { + // ignore + } + } + + private function handleOpenWindowEvent(event:OpenWindowEvent):void { + isTunneling = BBB.initConnectionManager().isTunnelling; + var window:IBbbModuleWindow = event.window; + mdiCanvas.addWindow(window); + } + + private function handleCloseWindowEvent(event:CloseWindowEvent):void { + var window:IBbbModuleWindow = event.window; + mdiCanvas.removeWindow(window); + } + + private function resetLayout():void{ + mdiCanvas.resetWindowLayout(); + } + + private function addComponentToCanvas(e:AddUIComponentToMainCanvas):void{ + mdiCanvas.addChild(e.component); + } + + public function checkLocaleVersion(localeVersion:String):void { + Alert.okLabel ="OK"; + var version:String = "old-locales"; + version = ResourceUtil.getInstance().getString('bbb.mainshell.locale.version'); + LogUtil.debug("Locale from config=" + localeVersion + ", from locale file=" + version); + + if ((version == "old-locales") || (version == "") || (version == null)) { + wrongLocaleVersion(); + } else { + if (version != localeVersion) wrongLocaleVersion(); + } + } + + private function showMicSettings(event:BBBEvent):void { + var micSettings:MicSettings = MicSettings(PopUpManager.createPopUp(mdiCanvas, MicSettings, true)); + micSettings.listenOnlyMode = event.payload.listenOnlyMode; + var point1:Point = new Point(); + // Calculate position of TitleWindow in Application's coordinates. + point1.x = width/2; + point1.y = height/2; + micSettings.x = point1.x - (micSettings.width/2); + micSettings.y = point1.y - (micSettings.height/2); + } private function openVideoPreviewWindow(event:BBBEvent):void { var camSettings:CameraDisplaySettings = CameraDisplaySettings(PopUpManager.createPopUp(mdiCanvas, CameraDisplaySettings, true)); @@ -299,33 +300,33 @@ with BigBlueButton; if not, see . camSettings.x = point1.x - (camSettings.width/2); camSettings.y = point1.y - (camSettings.height/2); } - - private function wrongLocaleVersion():void { - var localeWindow:OldLocaleWarnWindow = OldLocaleWarnWindow(PopUpManager.createPopUp(mdiCanvas, OldLocaleWarnWindow, false)); - - var point1:Point = new Point(); - // Calculate position of TitleWindow in Application's coordinates. - point1.x = width/2; - point1.y = height/2; - localeWindow.x = point1.x - (localeWindow.width/2); - localeWindow.y = point1.y - (localeWindow.height/2); - } - - private function handleLogout(e:ConnectionFailedEvent):void { - if (layoutOptions.showLogoutWindow) { - if (logoutWindow != null) return; - logoutWindow = LoggedOutWindow(PopUpManager.createPopUp( mdiCanvas, LoggedOutWindow, false)); - - var point1:Point = new Point(); - // Calculate position of TitleWindow in Application's coordinates. - point1.x = width/2; - point1.y = height/2; - logoutWindow.x = point1.x - (logoutWindow.width/2); - logoutWindow.y = point1.y - (logoutWindow.height/2); - - if (e is ConnectionFailedEvent) logoutWindow.setReason((e as ConnectionFailedEvent).type); - else logoutWindow.setReason("You have logged out of the conference"); - + + private function wrongLocaleVersion():void { + var localeWindow:OldLocaleWarnWindow = OldLocaleWarnWindow(PopUpManager.createPopUp(mdiCanvas, OldLocaleWarnWindow, false)); + + var point1:Point = new Point(); + // Calculate position of TitleWindow in Application's coordinates. + point1.x = width/2; + point1.y = height/2; + localeWindow.x = point1.x - (localeWindow.width/2); + localeWindow.y = point1.y - (localeWindow.height/2); + } + + private function handleLogout(e:ConnectionFailedEvent):void { + if (layoutOptions.showLogoutWindow) { + if (logoutWindow != null) return; + logoutWindow = LoggedOutWindow(PopUpManager.createPopUp( mdiCanvas, LoggedOutWindow, false)); + + var point1:Point = new Point(); + // Calculate position of TitleWindow in Application's coordinates. + point1.x = width/2; + point1.y = height/2; + logoutWindow.x = point1.x - (logoutWindow.width/2); + logoutWindow.y = point1.y - (logoutWindow.height/2); + + if (e is ConnectionFailedEvent) logoutWindow.setReason((e as ConnectionFailedEvent).type); + else logoutWindow.setReason("You have logged out of the conference"); + mdiCanvas.removeAllWindows(); } else { mdiCanvas.removeAllWindows(); @@ -412,9 +413,9 @@ with BigBlueButton; if not, see . - + - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml index dc208df547..66b97558c2 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MicSettings.mxml @@ -54,6 +54,8 @@ with BigBlueButton; if not, see . private var playingAudio:Boolean = false; private var images:Images = new Images(); [Bindable] private var cancelIcon:Class = images.cancel; + + public var listenOnlyMode:Boolean = true; override public function move(x:Number, y:Number):void { @@ -137,27 +139,37 @@ with BigBlueButton; if not, see . } private function onJoinClicked():void { - var e:BBBEvent = new BBBEvent("RESTORE_TO_ADJUST"); - dispatchEvent(e); cleanUp(); - var askToChangeEvent:BBBEvent = new BBBEvent("ASK_TO_CHANGE_VOICE_CONFERENCE_EVENT"); - askToChangeEvent.payload["global"] = false; - dispatchEvent(askToChangeEvent); + if(listenOnlyMode) { + var e:BBBEvent = new BBBEvent("RESTORE_TO_ADJUST"); + dispatchEvent(e); + var askToChangeEvent:BBBEvent = new BBBEvent("ASK_TO_CHANGE_VOICE_CONFERENCE_EVENT"); + askToChangeEvent.payload["global"] = false; + dispatchEvent(askToChangeEvent); + } + else { + var joinEvent:BBBEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); + joinEvent.payload['useMicrophone'] = true; + dispatchEvent(joinEvent); + } + PopUpManager.removePopUp(this); } private function onCancelClicked():void { - var e:BBBEvent = new BBBEvent("RESTORE_TO_ADJUST"); - dispatchEvent(e); - e = new BBBEvent("ENABLE_JOIN_BUTTON"); - dispatchEvent(e); cleanUp(); + if(listenOnlyMode) { + var e:BBBEvent = new BBBEvent("RESTORE_TO_ADJUST"); + dispatchEvent(e); + e = new BBBEvent("ENABLE_JOIN_BUTTON"); + dispatchEvent(e); + } + else { + var event:BBBEvent = new BBBEvent(BBBEvent.MIC_SETTINGS_CLOSED); + event.payload['clicked'] = "cancel"; + dispatchEvent(event); + } PopUpManager.removePopUp(this); - //cleanUp(); - //var event:BBBEvent = new BBBEvent(BBBEvent.MIC_SETTINGS_CLOSED); - //event.payload['clicked'] = "cancel"; - //dispatchEvent(event); - //PopUpManager.removePopUp(this); } private function cleanUp():void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as index a21382a068..801c8c2527 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as @@ -34,19 +34,23 @@ package org.bigbluebutton.modules.phone public var enabledEchoCancel:Boolean = false; [Bindable] - public var joinGlobal:Boolean = true; + public var listenOnlyMode:Boolean = true; [Bindable] public var presenterShareOnly:Boolean = false; + [Bindable] + public var showSpeakerButton:Boolean = true; + public function PhoneOptions() { var vxml:XML = BBB.getConfigForModule("PhoneModule"); if (vxml != null) { this.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; this.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; this.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; - this.joinGlobal = (vxml.@joinGlobal.toString().toUpperCase() == "TRUE") ? true : false; + this.listenOnlyMode = (vxml.@listenOnlyMode.toString().toUpperCase() == "TRUE") ? true : false; this.presenterShareOnly = (vxml.@presenterShareOnly.toString().toUpperCase() == "TRUE") ? true : false; + this.showSpeakerButton = (vxml.@showSpeakerButton.toString().toUpperCase() == "TRUE") ? true : false; } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as index 11e7a0a8a5..d6dcdb4cf8 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as @@ -17,40 +17,40 @@ * */ -package org.bigbluebutton.modules.phone.managers { - import com.asfusion.mate.events.Dispatcher; - import flash.events.AsyncErrorEvent; - import flash.events.Event; - import flash.events.IEventDispatcher; - import flash.events.NetStatusEvent; - import flash.events.SecurityErrorEvent; - import flash.external.*; - import flash.net.NetConnection; - import flash.net.NetStream; - import org.bigbluebutton.common.LogUtil; - import org.bigbluebutton.modules.phone.events.CallConnectedEvent; - import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent; - import org.bigbluebutton.modules.phone.events.ConnectionStatusEvent; - import org.bigbluebutton.modules.phone.events.RegistrationFailedEvent; - import org.bigbluebutton.modules.phone.events.RegistrationSuccessEvent; - - public class ConnectionManager { - - private var netConnection:NetConnection = null; - private var incomingNetStream:NetStream = null; - private var outgoingNetStream:NetStream = null; - private var username:String; - private var uri:String; - private var uid:String; - private var room:String; - - private var isConnected:Boolean = false; +package org.bigbluebutton.modules.phone.managers { + import com.asfusion.mate.events.Dispatcher; + import flash.events.AsyncErrorEvent; + import flash.events.Event; + import flash.events.IEventDispatcher; + import flash.events.NetStatusEvent; + import flash.events.SecurityErrorEvent; + import flash.external.*; + import flash.net.NetConnection; + import flash.net.NetStream; + import org.bigbluebutton.common.LogUtil; + import org.bigbluebutton.modules.phone.events.CallConnectedEvent; + import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent; + import org.bigbluebutton.modules.phone.events.ConnectionStatusEvent; + import org.bigbluebutton.modules.phone.events.RegistrationFailedEvent; + import org.bigbluebutton.modules.phone.events.RegistrationSuccessEvent; + + public class ConnectionManager { + + private var netConnection:NetConnection = null; + private var incomingNetStream:NetStream = null; + private var outgoingNetStream:NetStream = null; + private var username:String; + private var uri:String; + private var uid:String; + private var room:String; + + private var isConnected:Boolean = false; private var registered:Boolean = false; private var dispatcher:Dispatcher; public function ConnectionManager():void { - dispatcher = new Dispatcher(); + dispatcher = new Dispatcher(); } public function getConnection():NetConnection { @@ -60,31 +60,31 @@ package org.bigbluebutton.modules.phone.managers { public function getConnected():Boolean { return isConnected; } - + public function connect(uid:String, externUID:String, username:String, room:String, uri:String):void { if (isConnected) return; isConnected = true; - - this.uid = uid; - this.username = username; - this.room = room; + + this.uid = uid; + this.username = username; + this.room = room; this.uri = uri; - connectToServer(externUID, username); - } - - private function connectToServer(externUID:String, username:String):void { - NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0; - netConnection = new NetConnection(); - netConnection.client = this; - netConnection.addEventListener( NetStatusEvent.NET_STATUS , netStatus ); + connectToServer(externUID, username); + } + + private function connectToServer(externUID:String, username:String):void { + NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0; + netConnection = new NetConnection(); + netConnection.client = this; + netConnection.addEventListener( NetStatusEvent.NET_STATUS , netStatus ); netConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); - netConnection.connect(uri, externUID, username); - } - - public function disconnect():void { - netConnection.close(); - } - + netConnection.connect(uri, externUID, username); + } + + public function disconnect():void { + netConnection.close(); + } + private function netStatus (evt:NetStatusEvent ):void { if (evt.info.code == "NetConnection.Connect.Success") { var event:ConnectionStatusEvent = new ConnectionStatusEvent(); @@ -97,33 +97,33 @@ package org.bigbluebutton.modules.phone.managers { } else { LogUtil.info("Connection event info [" + evt.info.code + "]. Disconnecting."); disconnect(); - } - } - - private function asyncErrorHandler(event:AsyncErrorEvent):void { - LogUtil.debug("AsyncErrorEvent: " + event); - } - - private function securityErrorHandler(event:SecurityErrorEvent):void { - LogUtil.debug("securityErrorHandler: " + event); - } - + } + } + + private function asyncErrorHandler(event:AsyncErrorEvent):void { + LogUtil.debug("AsyncErrorEvent: " + event); + } + + private function securityErrorHandler(event:SecurityErrorEvent):void { + LogUtil.debug("securityErrorHandler: " + event); + } + public function call():void { LogUtil.debug("in call - Calling " + room); - doCall(room); - } - - //******************************************************************************************** - // - // CallBack Methods from Red5 - // + doCall(room); + } + + //******************************************************************************************** + // + // CallBack Methods from Red5 + // //******************************************************************************************** public function failedToJoinVoiceConferenceCallback(msg:String):* { LogUtil.debug("failedToJoinVoiceConferenceCallback " + msg); var event:CallDisconnectedEvent = new CallDisconnectedEvent(); dispatcher.dispatchEvent(event); isConnected = false; - } + } public function disconnectedFromJoinVoiceConferenceCallback(msg:String):* { LogUtil.debug("disconnectedFromJoinVoiceConferenceCallback " + msg); @@ -131,9 +131,9 @@ package org.bigbluebutton.modules.phone.managers { dispatcher.dispatchEvent(event); isConnected = false; } - - public function successfullyJoinedVoiceConferenceCallback(publishName:String, playName:String, codec:String):* { - LogUtil.debug("successfullyJoinedVoiceConferenceCallback " + publishName + " : " + playName + " : " + codec); + + public function successfullyJoinedVoiceConferenceCallback(publishName:String, playName:String, codec:String):* { + LogUtil.debug("successfullyJoinedVoiceConferenceCallback " + publishName + " : " + playName + " : " + codec); isConnected = true; var event:CallConnectedEvent = new CallConnectedEvent(); event.publishStreamName = publishName; @@ -141,27 +141,27 @@ package org.bigbluebutton.modules.phone.managers { event.codec = codec; dispatcher.dispatchEvent(event); } - - //******************************************************************************************** - // - // SIP Actions - // - //******************************************************************************************** + + //******************************************************************************************** + // + // SIP Actions + // + //******************************************************************************************** public function doCall(dialStr:String):void { - LogUtil.debug("in doCall - Calling " + dialStr); + LogUtil.debug("in doCall - Calling " + dialStr); netConnection.call("voiceconf.call", null, "default", username, dialStr, "false"); } public function doCallGlobal(dialStr:String):void { LogUtil.debug("in doCallGlobal - Calling " + dialStr + " " + username); netConnection.call("voiceconf.call", null, "default", username, dialStr, "true"); - } - - public function doHangUp():void { + } + + public function doHangUp():void { if (isConnected) { - netConnection.call("voiceconf.hangup", null, "default"); - isConnected = false; - } + netConnection.call("voiceconf.hangup", null, "default"); + isConnected = false; + } } public function onBWCheck(... rest):Number { @@ -173,6 +173,6 @@ package org.bigbluebutton.modules.phone.managers { // your application should do something here // when the bandwidth check is complete trace("bandwidth = " + p_bw + " Kbps."); - } - } + } + } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as index 0856498341..46e62bcae8 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as @@ -45,7 +45,7 @@ package org.bigbluebutton.modules.phone.managers { private var rejoining:Boolean = false; // User has requested to leave the voice conference. private var userHangup:Boolean = false; - private var globalCall:Boolean = true; + private var listenOnlyCall:Boolean = true; private var userRequestedToChange:Boolean = false; private var userRequestedToChangeToGlobal:Boolean = true; private var mic:Microphone; @@ -59,13 +59,9 @@ package org.bigbluebutton.modules.phone.managers { this.attributes = attributes; var vxml:XML = BBB.getConfigForModule("PhoneModule"); phoneOptions = new PhoneOptions(); - if (vxml != null) { - phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; - phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; - phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; - } - if (phoneOptions.joinGlobal) { - joinVoiceGlobal(); + + if (phoneOptions.listenOnlyMode) { + joinVoiceListenOnlyMode(); } if (phoneOptions.autoJoin) { if (phoneOptions.skipCheck) { @@ -123,9 +119,9 @@ package org.bigbluebutton.modules.phone.managers { streamManager.setConnection(connectionManager.getConnection()); } - public function joinVoiceGlobal():void { + public function joinVoiceListenOnlyMode():void { userHangup = false; - globalCall = true; + listenOnlyCall = true; var uid:String = String(Math.floor(new Date().getTime())); var uname:String = encodeURIComponent(UsersUtil.getMyExternalUserID() + "-bbbID-" + attributes.username); connectionManager.connect(uid, attributes.internalUserID, uname , attributes.room, attributes.uri); @@ -135,7 +131,7 @@ package org.bigbluebutton.modules.phone.managers { public function joinVoice(autoJoin:Boolean):void { userHangup = false; - globalCall = false; + listenOnlyCall = false; setupMic(autoJoin); var uid:String = String(Math.floor(new Date().getTime())); var uname:String = encodeURIComponent(UsersUtil.getMyExternalUserID() + "-bbbID-" + attributes.username); @@ -149,16 +145,16 @@ package org.bigbluebutton.modules.phone.managers { // We got disconnected and it's not because the user requested it. Let's rejoin the conference. LogUtil.debug("Rejoining the conference"); rejoining = true; - if(globalCall == false) { + if(listenOnlyCall == false) { joinVoice(withMic); } else - joinVoiceGlobal(); + joinVoiceListenOnlyMode(); } } public function dialConference():void { - if(globalCall == false) { + if(listenOnlyCall == false) { LogUtil.debug("*** Talking/Listening ***"); connectionManager.doCall(attributes.webvoiceconf); } @@ -177,7 +173,7 @@ package org.bigbluebutton.modules.phone.managers { rejoining = false; userHangup = false; var dispatcher:Dispatcher = new Dispatcher(); - if(globalCall) + if(listenOnlyCall) dispatcher.dispatchEvent(new BBBEvent("LISTENING_ONLY")); else dispatcher.dispatchEvent(new BBBEvent("SPEAKING_AND_LISTENING")); @@ -224,12 +220,18 @@ package org.bigbluebutton.modules.phone.managers { streamManager.stopStreams(); connectionManager.doHangUp(); onCall = false; + if(phoneOptions.listenOnlyMode == false) { + var event:BBBEvent = new BBBEvent("ENABLE_JOIN_BUTTON"); + event.payload["leaveVoiceConference"] = true; + var dispatcher:Dispatcher = new Dispatcher(); + dispatcher.dispatchEvent(event); + } } else { if(userRequestedToChange) { userRequestedToChange = false; if(userRequestedToChangeToGlobal) - joinVoiceGlobal(); + joinVoiceListenOnlyMode(); else joinVoice(withMic); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml index 239997500a..27d6b9c571 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml @@ -131,7 +131,7 @@ with BigBlueButton; if not, see . - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as index ef39e45898..c740899979 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as @@ -27,6 +27,7 @@ package org.bigbluebutton.modules.phone.maps import org.bigbluebutton.modules.phone.PhoneOptions; import org.bigbluebutton.modules.phone.views.components.ToolbarButton; import org.bigbluebutton.modules.phone.views.components.MuteButton; + import org.bigbluebutton.main.events.BBBEvent; public class PhoneEventMapDelegate { private var phoneOptions:PhoneOptions; @@ -36,10 +37,15 @@ package org.bigbluebutton.modules.phone.maps private var globalDispatcher:Dispatcher; public function PhoneEventMapDelegate() { - phoneButton = new ToolbarButton(); - soundButton = new MuteButton(); - globalDispatcher = new Dispatcher(); phoneOptions = new PhoneOptions(); + phoneButton = new ToolbarButton(); + if(phoneOptions.showSpeakerButton == true) { + soundButton = new MuteButton(); + } + else + soundButton = null; + globalDispatcher = new Dispatcher(); + } public function addToolbarButton():void { @@ -56,9 +62,11 @@ package org.bigbluebutton.modules.phone.maps buttonOpen = true; } - var event2:ToolbarButtonEvent = new ToolbarButtonEvent(ToolbarButtonEvent.ADD); - event2.button = soundButton; - globalDispatcher.dispatchEvent(event2); + if(phoneOptions.showSpeakerButton == true) { + var event2:ToolbarButtonEvent = new ToolbarButtonEvent(ToolbarButtonEvent.ADD); + event2.button = soundButton; + globalDispatcher.dispatchEvent(event2); + } @@ -83,13 +91,15 @@ package org.bigbluebutton.modules.phone.maps } public function enableMuteButton():void { - soundButton.enabled = true; + if(soundButton != null) + soundButton.enabled = true; } - public function enableToolbarButton():void { + public function enableToolbarButton(event:BBBEvent = null):void { phoneButton.selected = false; phoneButton.enabled = true; - //phoneButton.userJoinedConference(false); + if(event != null && event.payload.leaveVoiceConference == true) + phoneButton.userJoinedConference(false); } public function switchToPresenter():void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/Images.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/Images.as index 7bce4b5cd6..9ed7c5f04c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/Images.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/assets/Images.as @@ -22,8 +22,9 @@ package org.bigbluebutton.modules.phone.views.assets [Bindable] public class Images { - [Embed(source="images/headset.png")] - public var headsetDefaultIcon:Class; + + [Embed(source="images/headset.png")] + public var headsetDefaultIcon:Class; [Embed(source="images/headset_close.png")] public var headsetInactiveIcon:Class; @@ -31,6 +32,15 @@ package org.bigbluebutton.modules.phone.views.assets [Embed(source="images/headset_open.png")] public var headsetActiveIcon:Class; + [Embed(source="images/headset.png")] + public var listenOnlyDefaultIcon:Class; + + [Embed(source="images/headset_close.png")] + public var listenOnlyInactiveIcon:Class; + + [Embed(source="images/headset_open.png")] + public var listenOnlyActiveIcon:Class; + [Embed(source="images/sound.png")] public var speakerActiveIcon:Class; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index 3b5d5b83a5..667eb10570 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -27,6 +27,7 @@ with BigBlueButton; if not, see . visible = "{amIPresenter || !phoneOptions.presenterShareOnly}" includeInLayout = "{amIPresenter || !phoneOptions.presenterShareOnly}" toolTip="{ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start')}" + creationComplete="initPhone()" implements="org.bigbluebutton.common.IBbbToolbarComponent"> @@ -34,6 +35,7 @@ with BigBlueButton; if not, see . + @@ -66,7 +68,11 @@ with BigBlueButton; if not, see . private var stopChangingIcon:Boolean = false; - [Bindable] public var phoneIcon:Class = images.headsetDefaultIcon; + [Bindable] public var phoneIcon:Class; + + private function initPhone():void { + phoneIcon = getDefaultIcon(); + } private function startPhone():void { // Disable the button right away to prevent the user from clicking @@ -75,7 +81,7 @@ with BigBlueButton; if not, see . var vxml:XML = BBB.getConfigForModule("PhoneModule"); var phoneOptions:PhoneOptions = new PhoneOptions(); - if (noMicrophone() == false) { + if(phoneOptions.listenOnlyMode) { var askToChangeEvent:BBBEvent; askToChangeEvent = new BBBEvent("ASK_TO_CHANGE_VOICE_CONFERENCE_EVENT"); if(_currentState == DEFAULT_STATE) { @@ -84,6 +90,7 @@ with BigBlueButton; if not, see . } else { askToChangeEvent = new BBBEvent("SHOW_MIC_SETTINGS"); + askToChangeEvent.payload["listenOnlyMode"] = true; } } else { @@ -91,11 +98,52 @@ with BigBlueButton; if not, see . } dispatcher.dispatchEvent(askToChangeEvent); } + else { + if(_currentState == ACTIVE_STATE) { + var leaveEvent:BBBEvent = new BBBEvent("LEAVE_VOICE_CONFERENCE_EVENT"); + leaveEvent.payload["userRequested"] = true; + dispatcher.dispatchEvent(leaveEvent); + } + else { + if(phoneOptions.skipCheck) { + var joinEvent:BBBEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); + joinEvent.payload['useMicrophone'] = !noMicrophone(); + dispatcher.dispatchEvent(joinEvent); + } + else { + var showMicSettings:BBBEvent = new BBBEvent("SHOW_MIC_SETTINGS"); + showMicSettings.payload["listenOnlyMode"] = false; + dispatcher.dispatchEvent(showMicSettings); + } + } + } + if(stopChangingIcon) { disableButton(); } } + private function getActiveIcon():Class { + if(phoneOptions.listenOnlyMode) + return images.listenOnlyActiveIcon; + else + return images.headsetActiveIcon; + } + + private function getInactiveIcon():Class { + if(phoneOptions.listenOnlyMode) + return images.listenOnlyInactiveIcon; + else + return images.headsetInactiveIcon; + } + + private function getDefaultIcon():Class { + if(phoneOptions.listenOnlyMode) + return images.listenOnlyDefaultIcon; + else + return images.headsetDefaultIcon; + } + public function remoteClick(event:ShortcutEvent):void{ this.selected = true; startPhone(); @@ -108,25 +156,31 @@ with BigBlueButton; if not, see . else { if(stopChangingIcon == false) { if(_currentState == ACTIVE_STATE) - phoneIcon = images.headsetInactiveIcon; - else - phoneIcon = images.headsetActiveIcon; + phoneIcon = getInactiveIcon(); + else + phoneIcon = getActiveIcon(); } else { - phoneIcon = images.headsetDefaultIcon; - } + phoneIcon = getDefaultIcon(); + } + } } + private function handleMicSettingsClosedEvent(event:BBBEvent):void { + userJoinedConference(false); + this.setFocus(); + } + private function mouseOutHandler(event:MouseEvent):void { if(stopChangingIcon) { disableButton(); } else { if(_currentState == ACTIVE_STATE) - phoneIcon = images.headsetActiveIcon; + phoneIcon = getActiveIcon(); else - phoneIcon = images.headsetDefaultIcon; + phoneIcon = getDefaultIcon(); } } @@ -134,7 +188,7 @@ with BigBlueButton; if not, see . this.selected = false; this.enabled = false; stopChangingIcon = true; - phoneIcon = images.headsetDefaultIcon; + phoneIcon = getDefaultIcon(); this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.nomic'); } @@ -147,7 +201,7 @@ with BigBlueButton; if not, see . this.selected = true; this.enabled = true; _currentState = ACTIVE_STATE; - phoneIcon = images.headsetActiveIcon; + phoneIcon = getActiveIcon(); this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.stop'); } @@ -159,7 +213,7 @@ with BigBlueButton; if not, see . this.selected = false; this.enabled = true; _currentState = DEFAULT_STATE; - phoneIcon = images.headsetDefaultIcon; + phoneIcon = getDefaultIcon(); this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start'); } } @@ -176,7 +230,7 @@ with BigBlueButton; if not, see . this.selected = false; this.enabled = true; _currentState = DEFAULT_STATE; - phoneIcon = images.headsetDefaultIcon; + phoneIcon = getDefaultIcon(); this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start'); if(stopChangingIcon) { disableButton(); @@ -201,11 +255,11 @@ with BigBlueButton; if not, see . //For whatever reason the tooltip does not update when localization is changed dynamically. Overrideing it here override protected function resourcesChanged():void{ if(_currentState == ACTIVE_STATE) { - phoneIcon = images.headsetActiveIcon; + phoneIcon = getActiveIcon(); this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.stop'); } else { - phoneIcon = images.headsetDefaultIcon; + phoneIcon = getDefaultIcon(); this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start'); } if(stopChangingIcon) { From 4d49b6f0f4509549c15af4a4baf13169321bce60 Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Tue, 22 Apr 2014 18:13:18 -0300 Subject: [PATCH 25/28] trying to deal with the webrtc connection failed --- .../src/org/bigbluebutton/main/api/ExternalApiCallbacks.as | 3 ++- .../modules/phone/events/WebRtcEchoTestFailedEvent.as | 4 +++- .../modules/phone/managers/WebRtcCallManager.as | 5 +++++ .../org/bigbluebutton/modules/phone/maps/WebRtcEventMap.mxml | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCallbacks.as b/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCallbacks.as index f9b8a7367d..56fee96722 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCallbacks.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCallbacks.as @@ -45,6 +45,7 @@ package org.bigbluebutton.main.api import org.bigbluebutton.modules.phone.events.WebRtcCallStartedEvent; import org.bigbluebutton.modules.phone.events.WebRtcConfCallEndedEvent; import org.bigbluebutton.modules.phone.events.WebRtcConfCallStartedEvent; + import org.bigbluebutton.modules.phone.events.WebRtcEchoTestFailedEvent; import org.bigbluebutton.modules.present.events.GetListOfPresentationsRequest; import org.bigbluebutton.modules.present.events.RemovePresentationEvent; import org.bigbluebutton.modules.present.events.UploadEvent; @@ -413,7 +414,7 @@ package org.bigbluebutton.main.api private function handleWebRtcEchoTestFailed(cause:String):void { trace(LOG + "handleWebRtcEchoTestFailed: cause=[" + cause + "]"); -// _dispatcher.dispatchEvent(new WebRtcCallFailedEvent(reason)); + _dispatcher.dispatchEvent(new WebRtcEchoTestFailedEvent(cause)); } private function handleWebRtcEchoTestEnded(cause:String):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/WebRtcEchoTestFailedEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/WebRtcEchoTestFailedEvent.as index a4233e2623..7897fa2d7c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/WebRtcEchoTestFailedEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/WebRtcEchoTestFailedEvent.as @@ -5,10 +5,12 @@ package org.bigbluebutton.modules.phone.events public class WebRtcEchoTestFailedEvent extends Event { public static const WEBRTC_ECHO_TEST_FAILED:String = "webrtc echo test failed event"; + public var reason:String; - public function WebRtcEchoTestFailedEvent() + public function WebRtcEchoTestFailedEvent(reason:String) { super(WEBRTC_ECHO_TEST_FAILED, true, false); + this.reason = reason; } } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRtcCallManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRtcCallManager.as index 835e1fa1b1..6b6f2dd2e0 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRtcCallManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRtcCallManager.as @@ -126,5 +126,10 @@ package org.bigbluebutton.modules.phone.managers usingWebRtc = false; hangup(); } + + public function handleWebrtcEchoTestFailedEvent(reason:String):void { + endEchoTest(); + hideMicPermission(); + } } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/WebRtcEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/WebRtcEventMap.mxml index adceefe345..57e1917145 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/WebRtcEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/WebRtcEventMap.mxml @@ -36,6 +36,7 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.phone.events.WebRtcCallStartedEvent; import org.bigbluebutton.modules.phone.events.WebRtcConfCallEndedEvent; import org.bigbluebutton.modules.phone.events.WebRtcConfCallStartedEvent; + import org.bigbluebutton.modules.phone.events.WebRtcEchoTestFailedEvent; import org.bigbluebutton.modules.phone.events.WebRtcEchoTestHasAudioEvent; import org.bigbluebutton.modules.phone.events.WebRtcEchoTestNoAudioEvent; import org.bigbluebutton.modules.phone.events.WebRtcUserChangedMicEvent; @@ -101,5 +102,9 @@ with BigBlueButton; if not, see . + + + + From 19e3a4b3f0290664104e947a67254478796a2a0a Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Thu, 24 Apr 2014 19:41:22 -0300 Subject: [PATCH 26/28] client side implementation is done, but having issues because the server calls three times disconnectedFromJoinVoiceConferenceCallback when the user leaves the listen only stream (need a server-side refactoring) --- .../modules/phone/PhoneOptions.as | 42 +++--- .../phone/events/FlashCallConnectedEvent.as | 2 + ...ashJoinedListenOnlyVoiceConferenceEvent.as | 14 ++ .../phone/managers/ConnectionManager.as | 6 +- .../phone/managers/FlashCallManager.as | 129 ++++++++++++++---- .../modules/phone/managers/StreamManager.as | 17 ++- .../phone/managers/WebRtcCallManager.as | 14 +- .../modules/phone/maps/PhoneEventMap.mxml | 2 +- .../phone/maps/PhoneEventMapDelegate.as | 8 +- .../phone/views/components/ToolbarButton.mxml | 1 + 10 files changed, 170 insertions(+), 65 deletions(-) create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/FlashJoinedListenOnlyVoiceConferenceEvent.as diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as index a40a9d9b0f..d775f689e6 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as @@ -38,17 +38,17 @@ package org.bigbluebutton.modules.phone [Bindable] public var useWebrtcIfAvailable:Boolean = true; - [Bindable] - public var echoTestApp:String = "9196"; - - [Bindable] - public var listenOnlyMode:Boolean = true; + [Bindable] + public var echoTestApp:String = "9196"; - [Bindable] - public var presenterShareOnly:Boolean = false; + [Bindable] + public var listenOnlyMode:Boolean = true; - [Bindable] - public var showSpeakerButton:Boolean = true; + [Bindable] + public var presenterShareOnly:Boolean = false; + + [Bindable] + public var showSpeakerButton:Boolean = true; public function PhoneOptions() { parseOptions(); @@ -75,18 +75,18 @@ package org.bigbluebutton.modules.phone if (vxml.@useWebrtcIfAvailable != undefined) { useWebrtcIfAvailable = (vxml.@useWebrtcIfAvailable.toString().toUpperCase() == "TRUE"); } - if (vxml.@echoTestApp != undefined) { - echoTestApp = vxml.@echoTestApp.toString(); - } - if (vxml.@listenOnlyMode != undefined) { - listenOnlyMode = (vxml.@listenOnlyMode.toString().toUpperCase() == "TRUE"); - } - if (vxml.@presenterShareOnly != undefined) { - presenterShareOnly = (vxml.@presenterShareOnly.toString().toUpperCase() == "TRUE"); - } - if (vxml.@showSpeakerButton != undefined) { - showSpeakerButton = (vxml.@showSpeakerButton.toString().toUpperCase() == "TRUE"); - } + if (vxml.@echoTestApp != undefined) { + echoTestApp = vxml.@echoTestApp.toString(); + } + if (vxml.@listenOnlyMode != undefined) { + listenOnlyMode = (vxml.@listenOnlyMode.toString().toUpperCase() == "TRUE"); + } + if (vxml.@presenterShareOnly != undefined) { + presenterShareOnly = (vxml.@presenterShareOnly.toString().toUpperCase() == "TRUE"); + } + if (vxml.@showSpeakerButton != undefined) { + showSpeakerButton = (vxml.@showSpeakerButton.toString().toUpperCase() == "TRUE"); + } } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/FlashCallConnectedEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/FlashCallConnectedEvent.as index 050118f34b..665a41004f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/FlashCallConnectedEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/FlashCallConnectedEvent.as @@ -27,6 +27,7 @@ package org.bigbluebutton.modules.phone.events public var publishStreamName:String; public var playStreamName:String; public var codec:String; + public var listenOnlyCall:Boolean; public function FlashCallConnectedEvent(publishStream:String, playStream:String, vcodec:String) { @@ -34,6 +35,7 @@ package org.bigbluebutton.modules.phone.events this.publishStreamName = publishStream; this.playStreamName = playStream; this.codec = vcodec; + this.listenOnlyCall = !(publishStreamName != null && publishStreamName.length > 0); } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/FlashJoinedListenOnlyVoiceConferenceEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/FlashJoinedListenOnlyVoiceConferenceEvent.as new file mode 100644 index 0000000000..df2095693d --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/events/FlashJoinedListenOnlyVoiceConferenceEvent.as @@ -0,0 +1,14 @@ +package org.bigbluebutton.modules.phone.events +{ + import flash.events.Event; + + public class FlashJoinedListenOnlyVoiceConferenceEvent extends Event + { + public static const JOINED_LISTEN_ONLY_VOICE_CONFERENCE:String = "flash joined listen only voice conference event"; + + public function FlashJoinedListenOnlyVoiceConferenceEvent() + { + super(JOINED_LISTEN_ONLY_VOICE_CONFERENCE, true, false); + } + } +} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as index d060cbdb68..68246466c7 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as @@ -159,12 +159,12 @@ package org.bigbluebutton.modules.phone.managers { // SIP Actions // //******************************************************************************************** - public function doCall(dialStr:String):void { - trace(LOG + "in doCall - Calling " + dialStr); - netConnection.call("voiceconf.call", null, "default", username, dialStr); } public function doHangUp():void { + public function doCall(dialStr:String, listenOnly:Boolean = false):void { + trace(LOG + "in doCall - Calling " + dialStr + (listenOnly? " *listen only*": "")); + netConnection.call("voiceconf.call", null, "default", username, dialStr, listenOnly.toString()); if (isConnected()) { trace(LOG + "hanging up call"); netConnection.call("voiceconf.hangup", null, "default"); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/FlashCallManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/FlashCallManager.as index c8add35dd6..2cd0760511 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/FlashCallManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/FlashCallManager.as @@ -14,6 +14,7 @@ import org.bigbluebutton.modules.phone.events.FlashEchoTestStoppedEvent; import org.bigbluebutton.modules.phone.events.FlashErrorEvent; import org.bigbluebutton.modules.phone.events.FlashJoinVoiceConferenceCommand; + import org.bigbluebutton.modules.phone.events.FlashJoinedListenOnlyVoiceConferenceEvent; import org.bigbluebutton.modules.phone.events.FlashJoinedVoiceConferenceEvent; import org.bigbluebutton.modules.phone.events.FlashLeaveVoiceConferenceCommand; import org.bigbluebutton.modules.phone.events.FlashLeftVoiceConferenceEvent; @@ -36,7 +37,11 @@ private static const CALLING_INTO_CONFERENCE:String = "calling into conference state"; private static const IN_CONFERENCE:String = "in conference state"; private static const STOP_ECHO_THEN_JOIN_CONF:String = "stop echo then join conf state"; - + + private static const CALL_TO_LISTEN_ONLY_STREAM:String = "call to listen only stream"; + private static const CONNECTING_TO_LISTEN_ONLY_STREAM:String = "connecting to listen only stream"; + private static const ON_LISTEN_ONLY_STREAM:String = "on listen only stream"; + private var state:String = INITED; private var options:PhoneOptions; @@ -83,7 +88,12 @@ } private function startCall():void { - if (options.skipCheck || echoTestDone) { + /** + * For echo test even if user has done echo test. This way, user is able to change mics + * after. (richard mar 28, 2014) + */ + // if (options.skipCheck || echoTestDone) { + if (options.skipCheck) { trace(LOG + "Calling into voice conference. skipCheck=[" + options.skipCheck + "] echoTestDone=[" + echoTestDone + "]"); callIntoVoiceConference(); } else { @@ -99,6 +109,39 @@ } } + private function joinListenOnlyCall():void { + if (options.listenOnlyMode) { + trace(LOG + "Joining listen only call"); + callToListenOnlyStream(); + } + } + + private function leaveListenOnlyCall():void { + if (state == ON_LISTEN_ONLY_STREAM) { + trace(LOG + "Leaving listen only call"); + hangup(); + } + } + + private function callToListenOnlyStream():void { + if (isConnected()) { + var destination:String = UsersUtil.getVoiceBridge(); + + if (destination != null && destination != "") { + trace(LOG + "Connecting to listen only stream =[" + destination + "]"); + state = CONNECTING_TO_LISTEN_ONLY_STREAM; + connectionManager.doCall(destination, true); + } else { + trace(LOG + "Invalid voice conference [" + destination + "]"); + dispatcher.dispatchEvent(new FlashErrorEvent(FlashErrorEvent.INVALID_VOICE_DESTINATION)); + } + } else { + trace(LOG + "Need to connect before we can join the voice conference."); + state = CALL_TO_LISTEN_ONLY_STREAM; + connect(); + } + } + private function callIntoVoiceConference():void { if (isConnected()) { var destination:String = UsersUtil.getVoiceBridge(); @@ -143,7 +186,8 @@ } public function userRequestedHangup():void { - if (usingFlash) { + trace(LOG + "userRequestedHangup, current state: " + state); + if (usingFlash || state == ON_LISTEN_ONLY_STREAM) { streamManager.stopStreams(); connectionManager.disconnect(true); } @@ -158,14 +202,17 @@ usingFlash = true; autoJoin(); } + joinListenOnlyCall(); } private function hangup():void { + trace(LOG + "hangup, current state: " + state); streamManager.stopStreams(); connectionManager.doHangUp(); } private function hangupEchoThenJoinVoiceConference():void { + trace(LOG + "hangup EchoThenJoinVoiceConference, current state: " + state); state = STOP_ECHO_THEN_JOIN_CONF; hangup(); } @@ -180,28 +227,24 @@ } public function handleFlashStopEchoTestCommand(event:FlashStopEchoTestCommand):void { - trace(LOG + "handling FlashStopEchoTestCommand."); + trace(LOG + "handling FlashStopEchoTestCommand, current state: " + state); if (state == IN_ECHO_TEST) { hangup(); } } public function handleFlashEchoTestHasAudioEvent(event:FlashEchoTestHasAudioEvent):void { - trace(LOG + "handling handleFlashEchoTestHasAudioEvent."); + trace(LOG + "handling handleFlashEchoTestHasAudioEvent, current state: " + state); if (state == IN_ECHO_TEST) { hangupEchoThenJoinVoiceConference(); } else { callIntoVoiceConference(); } - /** - * For echo test even if user has done echo test. This way, user is able to change mics - * after. (richard mar 28, 2014) - */ -// echoTestDone = true; + echoTestDone = true; } public function handleFlashEchoTestNoAudioEvent(event:FlashEchoTestNoAudioEvent):void { - trace(LOG + "handling FlashEchoTestNoAudioEvent."); + trace(LOG + "handling FlashEchoTestNoAudioEvent, current state: " + state); if (state == IN_ECHO_TEST) { hangup(); } @@ -209,35 +252,52 @@ } public function handleFlashCallConnectedEvent(event:FlashCallConnectedEvent):void { + trace(LOG + "handling FlashCallConnectedEvent, current state: " + state); switch (state) { case CALLING_INTO_CONFERENCE: trace(LOG + "Successfully joined the voice conference."); state = IN_CONFERENCE; dispatcher.dispatchEvent(new FlashJoinedVoiceConferenceEvent()); - streamManager.callConnected(event.playStreamName, event.publishStreamName, event.codec); + streamManager.callConnected(event.playStreamName, event.publishStreamName, event.codec, event.listenOnlyCall); + break; + case CONNECTING_TO_LISTEN_ONLY_STREAM: + trace(LOG + "Successfully connected to the listen only stream."); + state = ON_LISTEN_ONLY_STREAM; + dispatcher.dispatchEvent(new FlashJoinedListenOnlyVoiceConferenceEvent()); + streamManager.callConnected(event.playStreamName, event.publishStreamName, event.codec, event.listenOnlyCall); break; case CALLING_INTO_ECHO_TEST: state = IN_ECHO_TEST; trace(LOG + "Successfully called into the echo test application. [" + event.publishStreamName + "] : [" + event.playStreamName + "] : [" + event.codec + "]"); - streamManager.callConnected(event.playStreamName, event.publishStreamName, event.codec); + streamManager.callConnected(event.playStreamName, event.publishStreamName, event.codec, event.listenOnlyCall); trace(LOG + "Successfully called into the echo test application."); dispatcher.dispatchEvent(new FlashEchoTestStartedEvent()); break; } } - + public function handleFlashCallDisconnectedEvent(event:FlashCallDisconnectedEvent):void { - // The connection fires a disconnected event when connection closes. - // Ignore if we are not joined into the conference using Flash (richard mar 28, 2014) - if (!usingFlash) return; - - trace(LOG + "Flash call disconnected."); + trace(LOG + "Flash call disconnected, current state: " + state); switch (state) { case IN_CONFERENCE: state = INITED; trace(LOG + "Flash user left voice conference."); dispatcher.dispatchEvent(new FlashLeftVoiceConferenceEvent()); + + trace(LOG + "Flash connecting to listen only voice conference"); + joinListenOnlyCall(); + + break; + case ON_LISTEN_ONLY_STREAM: + state = INITED; + trace(LOG + "Flash user left the listen only stream."); + + if (usingFlash) { + trace(LOG + "Flash reconnecting to the voice conference"); + startCall(); + } + break; case IN_ECHO_TEST: state = INITED; @@ -245,24 +305,34 @@ dispatcher.dispatchEvent(new FlashEchoTestStoppedEvent()); break; case STOP_ECHO_THEN_JOIN_CONF: - trace(LOG + "Flash echo test stopped."); - dispatcher.dispatchEvent(new FlashEchoTestStoppedEvent()); + trace(LOG + "Flash echo test stopped, now joining the voice conference."); callIntoVoiceConference(); break; } } public function handleJoinVoiceConferenceCommand(event:JoinVoiceConferenceCommand):void { - if (!usingFlash) return; - - trace(LOG + "handling JoinVoiceConferenceCommand."); - startCall(); + trace(LOG + "Handling JoinVoiceConferenceCommand."); + switch(state) { + case ON_LISTEN_ONLY_STREAM: + leaveListenOnlyCall(); + break; + case INITED: + if (usingFlash) { + startCall(); + } + break; + } } public function handleLeaveVoiceConferenceCommand(event:LeaveVoiceConferenceCommand):void { - if (!usingFlash) return; - - trace(LOG + "handling LeaveVoiceConferenceCommand."); + trace(LOG + "Handling LeaveVoiceConferenceCommand, current state: " + state + ", using flash: " + usingFlash); + if (!usingFlash) { + // this is the case when the user was connected to webrtc and then leaves the conference + joinListenOnlyCall(); + return; + } + hangup(); } @@ -276,6 +346,9 @@ case DO_ECHO_TEST: callIntoEchoTest(); break; + case CALL_TO_LISTEN_ONLY_STREAM: + callToListenOnlyStream(); + break; } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as index 6a8b2fed8b..35a0b7b50f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as @@ -133,19 +133,25 @@ package org.bigbluebutton.modules.phone.managers { } } - public function callConnected(playStreamName:String, publishStreamName:String, codec:String):void { + public function callConnected(playStreamName:String, publishStreamName:String, codec:String, listenOnlyCall:Boolean):void { trace(LOG + "setting up streams. [" + playStreamName + "] : [" + publishStreamName + "] : [" + codec + "]"); isCallConnected = true; audioCodec = codec; setupIncomingStream(); - if (mic != null) { + if (mic != null && !listenOnlyCall) { setupOutgoingStream(); + } else { + trace(LOG + "not setting up an outgoing stream because I'm in listen only mode"); } setupPlayStatusHandler(); play(playStreamName); - publish(publishStreamName); + if (!listenOnlyCall) { + publish(publishStreamName); + } else { + trace(LOG + "not publishing any stream because I'm in listen only mode"); + } } private function play(playStreamName:String):void { @@ -193,8 +199,9 @@ package org.bigbluebutton.modules.phone.managers { custom_obj.onPlayStatus = playStatus; custom_obj.onMetadata = onMetadata; incomingStream.client = custom_obj; - if (mic != null) - outgoingStream.client = custom_obj; + if (mic != null && outgoingStream != null) { + outgoingStream.client = custom_obj; + } } public function stopStreams():void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRtcCallManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRtcCallManager.as index 6b6f2dd2e0..8e07b8ad8f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRtcCallManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRtcCallManager.as @@ -41,8 +41,13 @@ package org.bigbluebutton.modules.phone.managers options = new PhoneOptions(); if (options.useWebrtcIfAvailable && isWebRtcSupported()) { usingWebRtc = true; - startWebRtcEchoTest(); - askMicPermission(); + autoJoin(); + } + } + + private function autoJoin():void { + if (options.autoJoin) { + handleJoinVoiceConferenceCommand(); } } @@ -109,11 +114,12 @@ package org.bigbluebutton.modules.phone.managers public function handleJoinVoiceConferenceCommand():void { if (!usingWebRtc) return; - if (echoTestDone) { + if (options.skipCheck || echoTestDone) { joinVoiceConference(); } else { startWebRtcEchoTest(); - } + askMicPermission(); + } } public function handleLeaveVoiceConferenceCommand():void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml index 5481b071b7..8fb263f9b5 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMap.mxml @@ -60,7 +60,7 @@ with BigBlueButton; if not, see . - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as index fde7eff7a8..da1bd76a92 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as @@ -60,9 +60,11 @@ package org.bigbluebutton.modules.phone.maps } } - public function disableToolbarButton():void { - phoneButton.selected = true; - phoneButton.enabled = true; + public function disableToolbarButton(listenOnlyCall:Boolean):void { + if (!listenOnlyCall) { + phoneButton.selected = true; + phoneButton.enabled = true; + } } public function enableToolbarButton():void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index ffbc1b7f23..1c739b1ddf 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -24,6 +24,7 @@ with BigBlueButton; if not, see . icon="{phoneIcon}" click="startPhone()" mouseOver = "mouseOverHandler(event)" mouseOut = "mouseOutHandler(event)" + height="24" toolTip="{ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start')}" implements="org.bigbluebutton.common.IBbbToolbarComponent"> From eb0a56bb1329ecf64bd07ae798efab1e5e587fdf Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Sun, 11 May 2014 22:31:35 -0300 Subject: [PATCH 27/28] refactoring part of the global audio server-side implementation --- .../red5/ClientConnectionManager.java | 8 ---- .../bigbluebutton/voiceconf/red5/Service.java | 21 +++----- .../voiceconf/sip/CallAgent.java | 2 +- .../voiceconf/sip/GlobalCall.java | 13 +++-- .../bigbluebutton/voiceconf/sip/SipPeer.java | 48 +++++++++---------- .../voiceconf/sip/SipPeerManager.java | 10 ++-- .../phone/managers/ConnectionManager.as | 6 +-- 7 files changed, 44 insertions(+), 64 deletions(-) diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java index bd0b7ca5fd..36dd978362 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnectionManager.java @@ -43,14 +43,6 @@ public class ClientConnectionManager { log.debug("Removed client {} from ConnectionManager.", id); } } - - public void joinConferenceSuccessNew(String clientId, String listen, String codec) { - ClientConnection cc = clients.get(clientId); - if (cc != null) { - cc.onJoinConferenceSuccess("", listen, codec); - } - - } public void joinConferenceSuccess(String clientId, String usertalkStream, String userListenStream, String codec) { ClientConnection cc = clients.get(clientId); diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java index 18e71c73f2..b230052d01 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java @@ -34,34 +34,27 @@ public class Service { private MessageFormat callExtensionPattern = new MessageFormat("{0}"); - public Boolean call(String peerId, String callerName, String destination, Boolean global) { - - - - if(global == true) { - if(GlobalCall.reservePlaceToCreateGlobal(destination) == true) { + public Boolean call(String peerId, String callerName, String destination, Boolean listenOnly) { + if (listenOnly) { + if (GlobalCall.reservePlaceToCreateGlobal(destination)) { String extension = callExtensionPattern.format(new String[] { destination }); try { - sipPeerManager.callGlobal(peerId, destination, "GLOBAL_AUDIO_" + destination, getClientId(), callerName, extension); + sipPeerManager.callGlobal(peerId, getClientId(), callerName, extension, destination, "GLOBAL_AUDIO_" + destination); Red5.getConnectionLocal().setAttribute("VOICE_CONF_PEER", peerId); } catch (PeerNotFoundException e) { log.error("PeerNotFound {}", peerId); return false; - } - } - else { + } + } else { sipPeerManager.returnGlobalStream(peerId, getClientId(), destination); Red5.getConnectionLocal().setAttribute("VOICE_CONF_PEER", peerId); } - } - else { + } else { Boolean result = call(peerId, callerName, destination); return result; } return true; - - } public Boolean call(String peerId, String callerName, String destination) { diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java index da08ef06c6..62f3ee3133 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java @@ -310,7 +310,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver globalAudioStreamName = GlobalCall.getGlobalAudioStream(destination); } GlobalCall.addUser(_destination); - clientConnManager.joinConferenceSuccessNew(clientId, globalAudioStreamName, GlobalCall.getRoomCodec(destination)); + clientConnManager.joinConferenceSuccess(clientId, "", globalAudioStreamName, GlobalCall.getRoomCodec(destination)); } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java index 53b0b7d021..42545cc7c8 100644 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java @@ -17,13 +17,12 @@ public class GlobalCall { } public static synchronized boolean reservePlaceToCreateGlobal(String roomName) { - if(voiceConference.containsKey(roomName) == false) { - voiceConference.put(roomName, "reserved"); - return true; - } - else { - return false; - } + if (voiceConference.containsKey(roomName)) { + return false; + } else { + voiceConference.put(roomName, "reserved"); + return true; + } } public static synchronized void addGlobalAudioStream(String roomName, String globalAudioStreamName, String codecName, KeepGlobalAudioAlive globalAudioKeepAlive) { diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java index d999b4c644..ad1bfb6938 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java @@ -98,8 +98,9 @@ public class SipPeer implements SipRegisterAgentListener { log.debug( "SIPUser register : {}", fromURL ); log.debug( "SIPUser register : {}", registeredProfile.contactUrl ); } - public void callGlobal(String clientIdGlobal, String callerNameGlobal, String clientId, String callerName, String destination) { - if (!registered) { + + public void callGlobal(String clientId, String callerName, String destination,String clientIdGlobal, String callerNameGlobal) { + if (!registered) { /* * If we failed to register with FreeSWITCH, reject all calls right away. * This way the user will know that there is a problem as quickly as possible. @@ -110,20 +111,12 @@ public class SipPeer implements SipRegisterAgentListener { log.warn("We are not registered to FreeSWITCH. However, we will allow {} to call {}.", callerName, destination); // return; } - SipPeerProfile callerProfile = SipPeerProfile.copy(registeredProfile); - SipPeerProfile callerProfileGlobal = SipPeerProfile.copy(registeredProfile); - - CallAgent ca = new CallAgent(this.clientRtpIp, sipProvider, callerProfile, audioconfProvider, clientId); - ca.setLocalSocketRelatedToGlobal(); - CallAgent caGlobal = new CallAgent(this.clientRtpIp, sipProvider, callerProfileGlobal, audioconfProvider, clientIdGlobal); - ca.setClientConnectionManager(clientConnManager); - ca.setCallStreamFactory(callStreamFactory); - caGlobal.setClientConnectionManager(clientConnManager); - caGlobal.setCallStreamFactory(callStreamFactory); + CallAgent ca = createCallAgent(clientId); + ca.setLocalSocketRelatedToGlobal(); + + CallAgent caGlobal = createCallAgent(clientIdGlobal); - callManager.add(ca); - callManager.addGlobal(caGlobal); caGlobal.callGlobal(callerNameGlobal, destination, ca); } @@ -139,24 +132,27 @@ public class SipPeer implements SipRegisterAgentListener { log.warn("We are not registered to FreeSWITCH. However, we will allow {} to call {}.", callerName, destination); // return; } - + + CallAgent ca = createCallAgent(clientId); + + ca.call(callerName, destination); + } + + public void returnGlobalStream(String clientId, String destination) { + CallAgent ca = createCallAgent(clientId); + + ca.returnGlobalStreamName(clientId, destination); + } + + private CallAgent createCallAgent(String clientId) { SipPeerProfile callerProfile = SipPeerProfile.copy(registeredProfile); CallAgent ca = new CallAgent(this.clientRtpIp, sipProvider, callerProfile, audioconfProvider, clientId); ca.setClientConnectionManager(clientConnManager); ca.setCallStreamFactory(callStreamFactory); callManager.add(ca); - ca.call(callerName, destination); - } - public void returnGlobalStream(String clientId, String destination) { - SipPeerProfile callerProfile = SipPeerProfile.copy(registeredProfile); - CallAgent ca = new CallAgent(this.clientRtpIp, sipProvider, callerProfile, audioconfProvider, clientId); - ca.setClientConnectionManager(clientConnManager); - ca.setCallStreamFactory(callStreamFactory); - callManager.add(ca); - ca.returnGlobalStreamName(clientId, destination); - - } + return ca; + } public void close() { log.debug("SIPUser close1"); diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java index 9dd534004c..4f2b02c01b 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java @@ -66,12 +66,12 @@ public final class SipPeerManager { sipPeer.call(clientId, callerName, destination); } - public void callGlobal(String peerId, String GlobalClientId, String GlobalCallerName, String clientId, String callerName, String destination) throws PeerNotFoundException { - SipPeer sipPeer = sipPeers.get(peerId); - if (sipPeer == null) throw new PeerNotFoundException("Can't find sip peer " + peerId); - sipPeer.callGlobal(GlobalClientId, GlobalCallerName, clientId, callerName, destination); + public void callGlobal(String peerId, String clientId, String callerName, String destination, String clientIdGlobal, String callerNameGlobal) throws PeerNotFoundException { + SipPeer sipPeer = sipPeers.get(peerId); + if (sipPeer == null) throw new PeerNotFoundException("Can't find sip peer " + peerId); + sipPeer.callGlobal(clientId, callerName, destination, clientIdGlobal, callerNameGlobal); } - + public void unregister(String userid) { SipPeer sipUser = sipPeers.get(userid); if (sipUser != null) { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as index 68246466c7..1266ba3473 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as @@ -159,12 +159,12 @@ package org.bigbluebutton.modules.phone.managers { // SIP Actions // //******************************************************************************************** - } - - public function doHangUp():void { public function doCall(dialStr:String, listenOnly:Boolean = false):void { trace(LOG + "in doCall - Calling " + dialStr + (listenOnly? " *listen only*": "")); netConnection.call("voiceconf.call", null, "default", username, dialStr, listenOnly.toString()); + } + + public function doHangUp():void { if (isConnected()) { trace(LOG + "hanging up call"); netConnection.call("voiceconf.hangup", null, "default"); From c5da1134f06ed48b88aefd0b7e515654055ce522 Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Mon, 12 May 2014 00:54:02 -0300 Subject: [PATCH 28/28] more cleanup and refactoring; global audio is still buggy - at some point it duplicates a global audio consumer internally, and when the consumer disconnects, bbb-voice sends him two disconnects, which breaks the logic inside the phone module; also, when it happens, the global audio stream is never closed anymore --- .../voiceconf/red5/ClientConnection.java | 26 ++-- .../bigbluebutton/voiceconf/red5/Service.java | 10 +- .../voiceconf/sip/CallAgent.java | 145 ++++++------------ .../voiceconf/sip/CallManager.java | 22 +-- .../voiceconf/sip/GlobalCall.java | 81 +++++----- .../bigbluebutton/voiceconf/sip/SipPeer.java | 72 +++------ .../voiceconf/sip/SipPeerManager.java | 12 +- 7 files changed, 122 insertions(+), 246 deletions(-) diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java index 2aa0657589..bdb1f20948 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/ClientConnection.java @@ -29,7 +29,6 @@ private static Logger log = Red5LoggerFactory.getLogger(ClientConnection.class, private final String connId; private final String userid; private final String username; - private String roomName; public ClientConnection(String connId, String userid, String username, IServiceCapableConnection connection) { this.connection = connection; @@ -37,14 +36,6 @@ private static Logger log = Red5LoggerFactory.getLogger(ClientConnection.class, this.userid = userid; this.username = username; } - - public void setRoomName(String roomName) { - this.roomName = roomName; - } - - public String getRoomName() { - return roomName; - } public String getConnId() { return connId; @@ -52,19 +43,22 @@ private static Logger log = Red5LoggerFactory.getLogger(ClientConnection.class, public void onJoinConferenceSuccess(String publishName, String playName, String codec) { log.debug("Notify client that {} [{}] has joined the conference.", username, userid); - if(connection.isConnected()) - connection.invoke("successfullyJoinedVoiceConferenceCallback", new Object[] {publishName, playName, codec}); + if (connection.isConnected()) { + connection.invoke("successfullyJoinedVoiceConferenceCallback", new Object[] {publishName, playName, codec}); + } } public void onJoinConferenceFail() { log.debug("Notify client that {} [{}] failed to join the conference.", username, userid); - if(connection.isConnected()) - connection.invoke("failedToJoinVoiceConferenceCallback", new Object[] {"onUaCallFailed"}); + if (connection.isConnected()) { + connection.invoke("failedToJoinVoiceConferenceCallback", new Object[] {"onUaCallFailed"}); + } } public void onLeaveConference() { log.debug("Notify client that {} [{}] left the conference.", username, userid); - if(connection != null && connection.isConnected()) - connection.invoke("disconnectedFromJoinVoiceConferenceCallback", new Object[] {"onUaCallClosed"}); - } + if (connection.isConnected()) { + connection.invoke("disconnectedFromJoinVoiceConferenceCallback", new Object[] {"onUaCallClosed"}); + } + } } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java index b230052d01..cc439b4a95 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/red5/Service.java @@ -39,22 +39,20 @@ public class Service { if (GlobalCall.reservePlaceToCreateGlobal(destination)) { String extension = callExtensionPattern.format(new String[] { destination }); try { - sipPeerManager.callGlobal(peerId, getClientId(), callerName, extension, destination, "GLOBAL_AUDIO_" + destination); + sipPeerManager.call(peerId, destination, "GLOBAL_AUDIO_" + destination, extension); Red5.getConnectionLocal().setAttribute("VOICE_CONF_PEER", peerId); } catch (PeerNotFoundException e) { log.error("PeerNotFound {}", peerId); return false; } - } else { - sipPeerManager.returnGlobalStream(peerId, getClientId(), destination); - Red5.getConnectionLocal().setAttribute("VOICE_CONF_PEER", peerId); } + sipPeerManager.connectToGlobalStream(peerId, getClientId(), destination); + Red5.getConnectionLocal().setAttribute("VOICE_CONF_PEER", peerId); + return true; } else { Boolean result = call(peerId, callerName, destination); return result; } - - return true; } public Boolean call(String peerId, String callerName, String destination) { diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java index 62f3ee3133..33700f3334 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallAgent.java @@ -55,12 +55,10 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver private ClientConnectionManager clientConnManager; private final String clientId; private final AudioConferenceProvider portProvider; - private DatagramSocket localSocket = null; - public String _callerName; + private DatagramSocket localSocket; + private String _callerName; private String _destination; - private CallAgent caToInit = null; - private Boolean talking = false; - private Boolean socketGlobal = false; + private Boolean listeningToGlobal = false; private enum CallState { UA_IDLE(0), UA_INCOMING_CALL(1), UA_OUTGOING_CALL(2), UA_ONCALL(3); @@ -69,18 +67,12 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver private int getState() {return state;} } - private CallState callState; - - public void setLocalSocketRelatedToGlobal() { - this.socketGlobal = true; - } - + private CallState callState; public String getDestination() { - return _destination; + return _destination; } - public CallAgent(String sipClientRtpIp, SipProvider sipProvider, SipPeerProfile userProfile, AudioConferenceProvider portProvider, String clientId) { this.sipProvider = sipProvider; this.clientRtpIp = sipClientRtpIp; @@ -94,7 +86,7 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver } private void initSessionDescriptor() { - log.debug("initSessionDescriptor"); + log.debug("initSessionDescriptor"); SessionDescriptor newSdp = SdpUtils.createInitialSdp(userProfile.username, this.clientRtpIp, userProfile.audioPort, userProfile.videoPort, userProfile.audioCodecsPrecedence ); @@ -102,15 +94,14 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver log.debug("localSession Descriptor = " + localSession ); } - public Boolean isTalking() { - return talking; + public Boolean isListeningToGlobal() { + return listeningToGlobal; } - public void callGlobal(String callerName, String destination, CallAgent ca) { - caToInit = ca; - _callerName = callerName; - _destination = destination; - log.debug("{} making a call to {}", callerName, destination); + public void call(String callerName, String destination) { + _callerName = callerName; + _destination = destination; + log.debug("{} making a call to {}", callerName, destination); try { localSocket = getLocalAudioSocket(); userProfile.audioPort = localSocket.getLocalPort(); @@ -139,50 +130,6 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver } else { call.call(destination, localSession); } - - - - } - - public void call(String callerName, String destination) { - _callerName = callerName; - _destination = destination; - log.debug("{} making a call to {}", callerName, destination); - try { - localSocket = getLocalAudioSocket(); - userProfile.audioPort = localSocket.getLocalPort(); - } catch (Exception e) { - log.debug("{} failed to allocate local port for call to {}. Notifying client that call failed.", callerName, destination); - notifyListenersOnOutgoingCallFailed(); - return; - } - - setupCallerDisplayName(callerName, destination); - userProfile.initContactAddress(sipProvider); - initSessionDescriptor(); - - callState = CallState.UA_OUTGOING_CALL; - - call = new ExtendedCall(sipProvider, userProfile.fromUrl, - userProfile.contactUrl, userProfile.username, - userProfile.realm, userProfile.passwd, this); - - // In case of incomplete url (e.g. only 'user' is present), - // try to complete it. - destination = sipProvider.completeNameAddress(destination).toString(); - - - log.debug("call {}", destination); - if (userProfile.noOffer) { - call.call(destination); - } else { - call.call(destination, localSession); - } - - - - - } private void setupCallerDisplayName(String callerName, String destination) { @@ -198,16 +145,15 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver /** Closes an ongoing, incoming, or pending call */ public void hangup() { log.debug("hangup"); - if(talking) { + if (listeningToGlobal) { + callState = CallState.UA_IDLE; + clientConnManager.leaveConference(clientId); + } else { if (callState == CallState.UA_IDLE) return; closeVoiceStreams(); if (call != null) call.hangup(); callState = CallState.UA_IDLE; - } - else { - callState = CallState.UA_IDLE; - clientConnManager.leaveConference(clientId); - } + } } private DatagramSocket getLocalAudioSocket() throws Exception { @@ -258,17 +204,12 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver callStream = callStreamFactory.createCallStream(sipCodec, connInfo); callStream.addCallStreamObserver(this); callStream.start(); - if(_callerName.contains("GLOBAL_AUDIO") == true) { + if (_callerName.startsWith("GLOBAL_AUDIO_")) { KeepGlobalAudioAlive globalAudioKeepAlive = new KeepGlobalAudioAlive(connInfo.getSocket(), connInfo, sipCodec.getCodecId()); - GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName(), sipCodec.getCodecName(), globalAudioKeepAlive); - caToInit.returnGlobalStreamName(caToInit.getCallId(), _destination); - talking = true; - } - else { - talking = true; + GlobalCall.addGlobalAudioStream(_destination, callStream.getListenStreamName(), sipCodec.getCodecName(), globalAudioKeepAlive); + } else { notifyListenersOnCallConnected(callStream.getTalkStreamName(), callStream.getListenStreamName()); } - } catch (Exception e) { log.error("Failed to create Call Stream."); System.out.println(StackTraceUtil.getStackTrace(e)); @@ -296,23 +237,22 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver } } - public void returnGlobalStreamName(String clientId, String destination) { - talking = false; - _destination = destination; - String globalAudioStreamName = GlobalCall.getGlobalAudioStream(destination); - while(globalAudioStreamName.equals("reserved")) { - try { - Thread.sleep(100); - } - catch (Exception e) { - - } - globalAudioStreamName = GlobalCall.getGlobalAudioStream(destination); - } - GlobalCall.addUser(_destination); - clientConnManager.joinConferenceSuccess(clientId, "", globalAudioStreamName, GlobalCall.getRoomCodec(destination)); + public void connectToGlobalStream(String clientId, String destination) { + listeningToGlobal = true; + _destination = destination; - } + String globalAudioStreamName = GlobalCall.getGlobalAudioStream(destination); + while (globalAudioStreamName.equals("reserved")) { + try { + Thread.sleep(100); + } catch (Exception e) { + } + globalAudioStreamName = GlobalCall.getGlobalAudioStream(destination); + } + + GlobalCall.addUser(_destination); + clientConnManager.joinConferenceSuccess(clientId, "", globalAudioStreamName, GlobalCall.getRoomCodec(destination)); + } private void closeVoiceStreams() { log.debug("Shutting down the voice streams."); @@ -435,13 +375,14 @@ public class CallAgent extends CallListenerAdapter implements CallStreamObserver } private void cleanup() { - if (localSocket != null) { - if(talking == true) { - localSocket.close(); - } - } else { - log.debug("Trying to close un-allocated port {}", localSocket.getLocalPort()); - } + log.debug("Closing local audio port {}", localSocket.getLocalPort()); + if (localSocket != null) { + if (!listeningToGlobal) { + localSocket.close(); + } + } else { + log.debug("Trying to close un-allocated port {}", localSocket.getLocalPort()); + } } /** Callback function called when arriving a BYE request */ diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallManager.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallManager.java index 4a0213e0bd..109988a853 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallManager.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/CallManager.java @@ -25,40 +25,20 @@ import java.util.concurrent.ConcurrentHashMap; public class CallManager { private final Map calls = new ConcurrentHashMap(); - private final Map callsGlobal = new ConcurrentHashMap(); public CallAgent add(CallAgent ca) { return calls.put(ca.getCallId(), ca); } - - public CallAgent addGlobal(CallAgent ca) { - return callsGlobal.put(ca.getCallId(), ca); - } - + public CallAgent remove(String id) { return calls.remove(id); } - public CallAgent removeGlobal(String id) { - return callsGlobal.remove(id); - } - - public CallAgent get(String id) { return calls.get(id); } - public CallAgent getGlobal(String id) { - return callsGlobal.get(id); - } - public Collection getAll() { return calls.values(); } - - public Collection getAllGlobal() { - return callsGlobal.values(); - } - - } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java index 42545cc7c8..9f44a784f4 100644 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/GlobalCall.java @@ -4,72 +4,77 @@ package org.bigbluebutton.voiceconf.sip; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.net.DatagramSocket; +import org.red5.logging.Red5LoggerFactory; +import org.slf4j.Logger; public class GlobalCall { - - public static Map voiceConference = new ConcurrentHashMap(); + private static final Logger log = Red5LoggerFactory.getLogger( GlobalCall.class, "sip" ); + + public static Map roomToStreamMap = new ConcurrentHashMap(); public static Map numberOfUsers = new ConcurrentHashMap(); - public static Map codecVoiceConference = new ConcurrentHashMap(); + public static Map roomToCodecMap = new ConcurrentHashMap(); public static Map globalAudioKeepAliverMap = new ConcurrentHashMap(); - public static synchronized boolean roomHasGlobalStream(String roomName) { - return voiceConference.containsKey(roomName); + private static boolean roomHasGlobalStream(String roomName) { + return roomToStreamMap.containsKey(roomName); } public static synchronized boolean reservePlaceToCreateGlobal(String roomName) { - if (voiceConference.containsKey(roomName)) { + if (roomToStreamMap.containsKey(roomName)) { return false; } else { - voiceConference.put(roomName, "reserved"); + roomToStreamMap.put(roomName, "reserved"); return true; } } public static synchronized void addGlobalAudioStream(String roomName, String globalAudioStreamName, String codecName, KeepGlobalAudioAlive globalAudioKeepAlive) { - voiceConference.put(roomName, globalAudioStreamName); - codecVoiceConference.put(roomName, codecName); - numberOfUsers.put(roomName, 0); - globalAudioKeepAliverMap.put(roomName,globalAudioKeepAlive); - globalAudioKeepAlive.start(); + roomToStreamMap.put(roomName, globalAudioStreamName); + roomToCodecMap.put(roomName, codecName); + numberOfUsers.put(roomName, 0); + globalAudioKeepAliverMap.put(roomName,globalAudioKeepAlive); + globalAudioKeepAlive.start(); } public static synchronized String getGlobalAudioStream(String roomName) { - return voiceConference.get(roomName); + return roomToStreamMap.get(roomName); + } + + public static synchronized boolean removeRoomIfUnused(String roomName) { + if (numberOfUsers.containsKey(roomName) && numberOfUsers.get(roomName) <= 0) { + removeRoom(roomName); + return true; + } else { + return false; + } } - public static synchronized void removeRoom(String roomName) { - System.out.println("REMOVING GLOBAL AUDIO FROM ROOM "+roomName); - voiceConference.remove(roomName); - numberOfUsers.remove(roomName); - codecVoiceConference.remove(roomName); - KeepGlobalAudioAlive globalAudioKeepAlive = globalAudioKeepAliverMap.get(roomName); - globalAudioKeepAlive.halt(); - globalAudioKeepAliverMap.remove(roomName); + private static void removeRoom(String roomName) { + log.debug("REMOVING GLOBAL AUDIO FROM ROOM " + roomName); + roomToStreamMap.remove(roomName); + numberOfUsers.remove(roomName); + roomToCodecMap.remove(roomName); + KeepGlobalAudioAlive globalAudioKeepAlive = globalAudioKeepAliverMap.get(roomName); + globalAudioKeepAlive.halt(); + globalAudioKeepAliverMap.remove(roomName); } public static synchronized void addUser(String roomName) { - int nUsers = numberOfUsers.get(roomName); - nUsers+=1; - numberOfUsers.put(roomName, nUsers); + int nUsers = numberOfUsers.get(roomName); + nUsers += 1; + numberOfUsers.put(roomName, nUsers); } public static synchronized void removeUser(String roomName) { - - if(numberOfUsers.containsKey(roomName)) { - int nUsers = numberOfUsers.get(roomName); - nUsers-=1; - numberOfUsers.put(roomName, nUsers); - System.out.println("REMOVING USER: Number of users left is " + nUsers); - } - } - - public static synchronized int getNumberOfUsers(String roomName) { - return numberOfUsers.get(roomName); + if (numberOfUsers.containsKey(roomName)) { + int nUsers = numberOfUsers.get(roomName); + nUsers -=1; + numberOfUsers.put(roomName, nUsers); + log.debug("REMOVING USER: Number of users left is " + nUsers); + } } public static String getRoomCodec(String roomName) { - return codecVoiceConference.get(roomName); + return roomToCodecMap.get(roomName); } - - } diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java index ad1bfb6938..90efdd41f5 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeer.java @@ -99,27 +99,6 @@ public class SipPeer implements SipRegisterAgentListener { log.debug( "SIPUser register : {}", registeredProfile.contactUrl ); } - public void callGlobal(String clientId, String callerName, String destination,String clientIdGlobal, String callerNameGlobal) { - if (!registered) { - /* - * If we failed to register with FreeSWITCH, reject all calls right away. - * This way the user will know that there is a problem as quickly as possible. - * If we pass the call, it take more that 30seconds for the call to timeout - * (in case FS is offline) and the user will be kept wondering why the call - * isn't going through. - */ - log.warn("We are not registered to FreeSWITCH. However, we will allow {} to call {}.", callerName, destination); -// return; - } - - CallAgent ca = createCallAgent(clientId); - ca.setLocalSocketRelatedToGlobal(); - - CallAgent caGlobal = createCallAgent(clientIdGlobal); - - caGlobal.callGlobal(callerNameGlobal, destination, ca); - } - public void call(String clientId, String callerName, String destination) { if (!registered) { /* @@ -138,14 +117,14 @@ public class SipPeer implements SipRegisterAgentListener { ca.call(callerName, destination); } - public void returnGlobalStream(String clientId, String destination) { + public void connectToGlobalStream(String clientId, String destination) { CallAgent ca = createCallAgent(clientId); - ca.returnGlobalStreamName(clientId, destination); + ca.connectToGlobalStream(clientId, destination); } private CallAgent createCallAgent(String clientId) { - SipPeerProfile callerProfile = SipPeerProfile.copy(registeredProfile); + SipPeerProfile callerProfile = SipPeerProfile.copy(registeredProfile); CallAgent ca = new CallAgent(this.clientRtpIp, sipProvider, callerProfile, audioconfProvider, clientId); ca.setClientConnectionManager(clientConnManager); ca.setCallStreamFactory(callStreamFactory); @@ -167,31 +146,24 @@ public class SipPeer implements SipRegisterAgentListener { } public void hangup(String clientId) { - log.debug( "SIPUser hangup" ); + log.debug( "SIPUser hangup" ); - CallAgent ca = callManager.remove(clientId); - String destination; - if(ca != null) { - destination = ca.getDestination(); - } - else { - destination = clientId; - } + CallAgent ca = callManager.remove(clientId); + if (ca != null) { + if (ca.isListeningToGlobal()) { + String destination = ca.getDestination(); + GlobalCall.removeUser(destination); + ca.hangup(); - if(ca != null) { - if(ca.isTalking()) { - ca.hangup(); - } - else { - GlobalCall.removeUser(destination); - ca.hangup(); - if(GlobalCall.roomHasGlobalStream(destination) && GlobalCall.getNumberOfUsers(destination) <= 0) { - CallAgent caGlobal = callManager.removeGlobal(destination); - GlobalCall.removeRoom(destination); - caGlobal.hangup(); - } - } + boolean roomRemoved = GlobalCall.removeRoomIfUnused(destination); + if (roomRemoved) { + CallAgent caGlobal = callManager.remove(destination); + caGlobal.hangup(); + } + } else { + ca.hangup(); + } } } @@ -203,14 +175,6 @@ public class SipPeer implements SipRegisterAgentListener { CallAgent ca = (CallAgent) iter.next(); ca.hangup(); } - - calls = callManager.getAllGlobal(); - for (Iterator iter = calls.iterator(); iter.hasNext();) { - CallAgent ca = (CallAgent) iter.next(); - ca.hangup(); - } - - if (registerAgent != null) { registerAgent.unregister(); diff --git a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java index 4f2b02c01b..5a69eb9289 100755 --- a/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java +++ b/bbb-voice/src/main/java/org/bigbluebutton/voiceconf/sip/SipPeerManager.java @@ -66,12 +66,6 @@ public final class SipPeerManager { sipPeer.call(clientId, callerName, destination); } - public void callGlobal(String peerId, String clientId, String callerName, String destination, String clientIdGlobal, String callerNameGlobal) throws PeerNotFoundException { - SipPeer sipPeer = sipPeers.get(peerId); - if (sipPeer == null) throw new PeerNotFoundException("Can't find sip peer " + peerId); - sipPeer.callGlobal(clientId, callerName, destination, clientIdGlobal, callerNameGlobal); - } - public void unregister(String userid) { SipPeer sipUser = sipPeers.get(userid); if (sipUser != null) { @@ -106,10 +100,10 @@ public final class SipPeerManager { sipPeers.remove(userid); } - public void returnGlobalStream(String peerId, String clientId, String destination) { - SipPeer sipUser = sipPeers.get(peerId); + public void connectToGlobalStream(String peerId, String clientId, String destination) { + SipPeer sipUser = sipPeers.get(peerId); if (sipUser != null) { - sipUser.returnGlobalStream(clientId, destination); + sipUser.connectToGlobalStream(clientId, destination); } }