Add more logging for high level calling operations
This commit is contained in:
parent
58af7adeaa
commit
80fe9b97d0
1 changed files with 20 additions and 0 deletions
|
@ -90,6 +90,8 @@ export class CallingClass {
|
||||||
conversation: ConversationModelType,
|
conversation: ConversationModelType,
|
||||||
isVideoCall: boolean
|
isVideoCall: boolean
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
window.log.info('CallingClass.startOutgoingCall()');
|
||||||
|
|
||||||
if (!this.uxActions) {
|
if (!this.uxActions) {
|
||||||
window.log.error('Missing uxActions, new call not allowed.');
|
window.log.error('Missing uxActions, new call not allowed.');
|
||||||
return;
|
return;
|
||||||
|
@ -107,6 +109,8 @@ export class CallingClass {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.log.info('CallingClass.startOutgoingCall(): Getting call settings');
|
||||||
|
|
||||||
const callSettings = await this.getCallSettings(conversation);
|
const callSettings = await this.getCallSettings(conversation);
|
||||||
|
|
||||||
// Check state after awaiting to debounce call button.
|
// Check state after awaiting to debounce call button.
|
||||||
|
@ -115,6 +119,8 @@ export class CallingClass {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.log.info('CallingClass.startOutgoingCall(): Starting in RingRTC');
|
||||||
|
|
||||||
// We could make this faster by getting the call object
|
// We could make this faster by getting the call object
|
||||||
// from the RingRTC before we lookup the ICE servers.
|
// from the RingRTC before we lookup the ICE servers.
|
||||||
const call = RingRTC.startOutgoingCall(
|
const call = RingRTC.startOutgoingCall(
|
||||||
|
@ -135,6 +141,8 @@ export class CallingClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
async accept(callId: CallId, asVideoCall: boolean): Promise<void> {
|
async accept(callId: CallId, asVideoCall: boolean): Promise<void> {
|
||||||
|
window.log.info('CallingClass.accept()');
|
||||||
|
|
||||||
const haveMediaPermissions = await this.requestPermissions(asVideoCall);
|
const haveMediaPermissions = await this.requestPermissions(asVideoCall);
|
||||||
if (haveMediaPermissions) {
|
if (haveMediaPermissions) {
|
||||||
await this.startDeviceReselectionTimer();
|
await this.startDeviceReselectionTimer();
|
||||||
|
@ -148,10 +156,14 @@ export class CallingClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
decline(callId: CallId): void {
|
decline(callId: CallId): void {
|
||||||
|
window.log.info('CallingClass.decline()');
|
||||||
|
|
||||||
RingRTC.decline(callId);
|
RingRTC.decline(callId);
|
||||||
}
|
}
|
||||||
|
|
||||||
hangup(callId: CallId): void {
|
hangup(callId: CallId): void {
|
||||||
|
window.log.info('CallingClass.hangup()');
|
||||||
|
|
||||||
RingRTC.hangup(callId);
|
RingRTC.hangup(callId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,6 +400,8 @@ export class CallingClass {
|
||||||
envelope: EnvelopeClass,
|
envelope: EnvelopeClass,
|
||||||
callingMessage: CallingMessageClass
|
callingMessage: CallingMessageClass
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
window.log.info('CallingClass.handleCallingMessage()');
|
||||||
|
|
||||||
const enableIncomingCalls = await window.getIncomingCallNotification();
|
const enableIncomingCalls = await window.getIncomingCallNotification();
|
||||||
if (callingMessage.offer && !enableIncomingCalls) {
|
if (callingMessage.offer && !enableIncomingCalls) {
|
||||||
// Drop offers silently if incoming call notifications are disabled.
|
// Drop offers silently if incoming call notifications are disabled.
|
||||||
|
@ -427,6 +441,8 @@ export class CallingClass {
|
||||||
|
|
||||||
const messageAgeSec = envelope.messageAgeSec ? envelope.messageAgeSec : 0;
|
const messageAgeSec = envelope.messageAgeSec ? envelope.messageAgeSec : 0;
|
||||||
|
|
||||||
|
window.log.info('CallingClass.handleCallingMessage(): Handling in RingRTC');
|
||||||
|
|
||||||
RingRTC.handleCallingMessage(
|
RingRTC.handleCallingMessage(
|
||||||
remoteUserId,
|
remoteUserId,
|
||||||
remoteDeviceId,
|
remoteDeviceId,
|
||||||
|
@ -544,6 +560,8 @@ export class CallingClass {
|
||||||
|
|
||||||
// If we return null here, we hang up the call.
|
// If we return null here, we hang up the call.
|
||||||
private async handleIncomingCall(call: Call): Promise<CallSettings | null> {
|
private async handleIncomingCall(call: Call): Promise<CallSettings | null> {
|
||||||
|
window.log.info('CallingClass.handleIncomingCall()');
|
||||||
|
|
||||||
if (!this.uxActions || !this.localDeviceId) {
|
if (!this.uxActions || !this.localDeviceId) {
|
||||||
window.log.error('Missing required objects, ignoring incoming call.');
|
window.log.error('Missing required objects, ignoring incoming call.');
|
||||||
return null;
|
return null;
|
||||||
|
@ -587,6 +605,8 @@ export class CallingClass {
|
||||||
callDetails: this.getUxCallDetails(conversation, call),
|
callDetails: this.getUxCallDetails(conversation, call),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.log.info('CallingClass.handleIncomingCall(): Proceeding');
|
||||||
|
|
||||||
return await this.getCallSettings(conversation);
|
return await this.getCallSettings(conversation);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
window.log.error(`Ignoring incoming call: ${err.stack}`);
|
window.log.error(`Ignoring incoming call: ${err.stack}`);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue