From 66a705a87d6faa75f413d871434c425735fd48fd Mon Sep 17 00:00:00 2001 From: Chad Pilkey Date: Fri, 22 Nov 2019 13:48:46 -0800 Subject: [PATCH 1/2] hangup the sip.js call when a timeout hits --- .../imports/api/audio/client/bridge/sip.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/api/audio/client/bridge/sip.js b/bigbluebutton-html5/imports/api/audio/client/bridge/sip.js index fe4151d65f..12a0ee40b4 100755 --- a/bigbluebutton-html5/imports/api/audio/client/bridge/sip.js +++ b/bigbluebutton-html5/imports/api/audio/client/bridge/sip.js @@ -14,7 +14,7 @@ const CALL_HANGUP_MAX_RETRIES = MEDIA.callHangupMaximumRetries; const RELAY_ONLY_ON_RECONNECT = MEDIA.relayOnlyOnReconnect; const IPV4_FALLBACK_DOMAIN = Meteor.settings.public.app.ipv4FallbackDomain; const ICE_NEGOTIATION_FAILED = ['iceConnectionFailed']; -const CALL_CONNECT_TIMEOUT = 15000; +const CALL_CONNECT_TIMEOUT = 20000; const ICE_NEGOTIATION_TIMEOUT = 20000; const AUDIO_SESSION_NUM_KEY = 'AudioSessionNumber'; @@ -122,6 +122,9 @@ class SIPSession { error: 1008, bridgeError: 'Timeout on call transfer', }); + + this.exitAudio(); + reject(this.baseErrorCodes.REQUEST_TIMEOUT); }, CALL_TRANSFER_TIMEOUT); @@ -338,6 +341,8 @@ class SIPSession { error: 1006, bridgeError: `Call timed out on start after ${CALL_CONNECT_TIMEOUT / 1000}s`, }); + + this.exitAudio(); }, CALL_CONNECT_TIMEOUT); let iceNegotiationTimeout; @@ -355,6 +360,8 @@ class SIPSession { error: 1010, bridgeError: `ICE negotiation timeout after ${ICE_NEGOTIATION_TIMEOUT / 1000}s`, }); + + this.exitAudio(); }, ICE_NEGOTIATION_TIMEOUT); } }; From e2eabfb44fd5108c5b289f41d4fca50c371e9c4f Mon Sep 17 00:00:00 2001 From: Chad Pilkey Date: Fri, 22 Nov 2019 13:55:26 -0800 Subject: [PATCH 2/2] attempt to stop accidental audio join double clicks --- .../audio/audio-modal/component.jsx | 41 +++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx index 4538c3a357..6517ae540a 100755 --- a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx @@ -206,6 +206,7 @@ class AudioModal extends Component { this.setState({ content: null, hasError: true, + disableActions: false, }); } @@ -249,20 +250,29 @@ class AudioModal extends Component { joinEchoTest, } = this.props; + const { + disableActions, + } = this.state; + + if (disableActions) return; + this.setState({ hasError: false, + disableActions: true, }); return joinEchoTest().then(() => { - console.log(inputDeviceId, outputDeviceId); + //console.log(inputDeviceId, outputDeviceId); this.setState({ content: 'echoTest', + disableActions: false, }); }).catch((err) => { if (err.type === 'MEDIA_ERROR') { this.setState({ content: 'help', errCode: err.code, + disableActions: false, }); } }); @@ -273,7 +283,21 @@ class AudioModal extends Component { joinListenOnly, } = this.props; - return joinListenOnly().catch((err) => { + const { + disableActions, + } = this.state; + + if (disableActions) return; + + this.setState({ + disableActions: true, + }); + + return joinListenOnly().then(() => { + this.setState({ + disableActions: false, + }); + }).catch((err) => { if (err.type === 'MEDIA_ERROR') { this.setState({ content: 'help', @@ -287,11 +311,22 @@ class AudioModal extends Component { joinMicrophone, } = this.props; + const { + disableActions, + } = this.state; + + if (disableActions) return; + this.setState({ hasError: false, + disableActions: true, }); - joinMicrophone().catch(this.handleGoToAudioOptions); + joinMicrophone().then(() => { + this.setState({ + disableActions: false, + }); + }).catch(this.handleGoToAudioOptions); } skipAudioOptions() {