Skip to content

Commit

Permalink
Hold other call when another call is accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
manuquentin committed Dec 11, 2023
1 parent 512036b commit 8595407
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 8595407

Please sign in to comment.