Skip to content

Commit

Permalink
Merge pull request #740 from wazo-platform/wda_2283_fix_accepted_doub…
Browse files Browse the repository at this point in the history
…le_call

[WDA-2283] Hold other call when another call is accepted
  • Loading branch information
manuquentin authored Dec 13, 2023
2 parents 512036b + 8595407 commit 0ce088e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/domain/Phone/WebRTCPhone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,15 @@ export default class WebRTCPhone extends Emitter implements Phone {

const callSession = this._createAcceptedCallSession(sipSession, cameraEnabled);

if (this.currentSipSession && !this.isCurrentCallSipSession(callSession)) {
logger.info('WebRTC phone - on call accepted with another ongoing call, holding it', {
sipId: sipSession.id,
cameraEnabled,
});

this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
}

this.currentSipSession = sipSession;
this.currentCallSession = callSession;
this.eventEmitter.emit(ON_TERMINATE_SOUND, callSession, 'call accepted');
Expand Down

0 comments on commit 0ce088e

Please sign in to comment.