diff --git a/src/domain/Phone/WebRTCPhone.ts b/src/domain/Phone/WebRTCPhone.ts index 972e06be..6fb94bde 100644 --- a/src/domain/Phone/WebRTCPhone.ts +++ b/src/domain/Phone/WebRTCPhone.ts @@ -1577,17 +1577,26 @@ export default class WebRTCPhone extends Emitter implements Phone { this.client.on(this.client.ON_PROGRESS, session => { logger.info('WebRTC progess (180)'); - this.eventEmitter.emit(ON_PROGRESS, this._createCallSession(session, null, { + const callSession = this._createCallSession(session, null, { incoming: false, ringing: true, - }), this.audioOutputDeviceId, this.audioOutputVolume); + }); + + callSession.callId = this.getSipSessionId(session); + + this.eventEmitter.emit(ON_PROGRESS, callSession, this.audioOutputDeviceId, this.audioOutputVolume); }); this.client.on(this.client.ON_EARLY_MEDIA, session => { logger.info('WebRTC early media'); - const callSession = this._createCallSession(session); + const callSession = this._createCallSession(session, null, { + incoming: false, + ringing: true, + }); + + callSession.callId = this.getSipSessionId(session); - this.eventEmitter.emit(ON_EARLY_MEDIA, callSession); + this.eventEmitter.emit(ON_EARLY_MEDIA, callSession, this.audioOutputDeviceId, this.audioOutputVolume); }); this.client.on(this.client.REGISTERED, () => { logger.info('WebRTC registered', {