MT#56085 Reply with 486 from WebRTC when the user is busy in another conversation

Change-Id: I3eea53440fe14452e0abe8d873f6ac99961e45f6
(cherry picked from commit 175c344157)
mr10.5.5
Hugo Zigha 2 years ago committed by Marco Capetta
parent e954ecf933
commit 75a6cbd1e2

@ -134,6 +134,12 @@ export function callRegister ({ instanceId }) {
delegateEvent('registrationFailed')
$userAgent.on('newRTCSession', (event) => {
if (event.originator === 'remote') {
if ($incomingRtcSession || $outgoingRtcSession) {
event.session.terminate({
status_code: 486,
reason_phrase: 'Busy'
})
} else {
$incomingRtcSession = event.session
$incomingRtcSession.on('peerconnection', () => {
$incomingRtcSession.connection.ontrack = handleRemoteMediaStream
@ -147,6 +153,7 @@ export function callRegister ({ instanceId }) {
})
callEvent.emit('incoming', $incomingRtcSession)
}
}
})
$userAgent.start()
}

@ -77,6 +77,7 @@ export default {
context.commit('hangUpCall')
} else if (options.cause && !errorVisibilityTimer) {
context.commit('endCall', options.cause)
if (options.cause !== 'Busy') {
errorVisibilityTimer = setTimeout(() => {
if (context.state.callState === 'ended') {
context.commit('hangUpCall')
@ -84,6 +85,7 @@ export default {
errorVisibilityTimer = null
}, errorVisibilityTimeout)
}
}
},
sendDTMF (context, tone) {
callSendDTMF(tone)

Loading…
Cancel
Save