diff --git a/ts/services/calling.ts b/ts/services/calling.ts index 0eb8585ca..ec16d6a23 100644 --- a/ts/services/calling.ts +++ b/ts/services/calling.ts @@ -90,6 +90,8 @@ export class CallingClass { conversation: ConversationModelType, isVideoCall: boolean ): Promise { + window.log.info('CallingClass.startOutgoingCall()'); + if (!this.uxActions) { window.log.error('Missing uxActions, new call not allowed.'); return; @@ -107,6 +109,8 @@ export class CallingClass { return; } + window.log.info('CallingClass.startOutgoingCall(): Getting call settings'); + const callSettings = await this.getCallSettings(conversation); // Check state after awaiting to debounce call button. @@ -115,6 +119,8 @@ export class CallingClass { return; } + window.log.info('CallingClass.startOutgoingCall(): Starting in RingRTC'); + // We could make this faster by getting the call object // from the RingRTC before we lookup the ICE servers. const call = RingRTC.startOutgoingCall( @@ -135,6 +141,8 @@ export class CallingClass { } async accept(callId: CallId, asVideoCall: boolean): Promise { + window.log.info('CallingClass.accept()'); + const haveMediaPermissions = await this.requestPermissions(asVideoCall); if (haveMediaPermissions) { await this.startDeviceReselectionTimer(); @@ -148,10 +156,14 @@ export class CallingClass { } decline(callId: CallId): void { + window.log.info('CallingClass.decline()'); + RingRTC.decline(callId); } hangup(callId: CallId): void { + window.log.info('CallingClass.hangup()'); + RingRTC.hangup(callId); } @@ -388,6 +400,8 @@ export class CallingClass { envelope: EnvelopeClass, callingMessage: CallingMessageClass ): Promise { + window.log.info('CallingClass.handleCallingMessage()'); + const enableIncomingCalls = await window.getIncomingCallNotification(); if (callingMessage.offer && !enableIncomingCalls) { // Drop offers silently if incoming call notifications are disabled. @@ -427,6 +441,8 @@ export class CallingClass { const messageAgeSec = envelope.messageAgeSec ? envelope.messageAgeSec : 0; + window.log.info('CallingClass.handleCallingMessage(): Handling in RingRTC'); + RingRTC.handleCallingMessage( remoteUserId, remoteDeviceId, @@ -544,6 +560,8 @@ export class CallingClass { // If we return null here, we hang up the call. private async handleIncomingCall(call: Call): Promise { + window.log.info('CallingClass.handleIncomingCall()'); + if (!this.uxActions || !this.localDeviceId) { window.log.error('Missing required objects, ignoring incoming call.'); return null; @@ -587,6 +605,8 @@ export class CallingClass { callDetails: this.getUxCallDetails(conversation, call), }); + window.log.info('CallingClass.handleIncomingCall(): Proceeding'); + return await this.getCallSettings(conversation); } catch (err) { window.log.error(`Ignoring incoming call: ${err.stack}`);