Merge pull request #8358 from capilkey/audio-improvements
Hangup sip.js on timeout and stop audio join double click
This commit is contained in:
commit
4ccec9203f
@ -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);
|
||||
}
|
||||
};
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user