Add more logs for call disposition
This commit is contained in:
parent
81e1357723
commit
81fc9ff94d
4 changed files with 25 additions and 2 deletions
|
@ -3227,6 +3227,9 @@ export class ConversationModel extends window.Backbone
|
|||
|
||||
switch (callHistoryDetails.callMode) {
|
||||
case CallMode.Direct: {
|
||||
log.info(
|
||||
`addCallHistory: Adding direct call to history (Call ID ${callHistoryDetails.callId})`
|
||||
);
|
||||
const resolvedTime =
|
||||
callHistoryDetails.acceptedTime ?? callHistoryDetails.endedTime;
|
||||
assertDev(resolvedTime, 'Direct call must have accepted or ended time');
|
||||
|
@ -3267,6 +3270,9 @@ export class ConversationModel extends window.Backbone
|
|||
callHistoryDetails.callId
|
||||
);
|
||||
if (messageId != null) {
|
||||
log.info(
|
||||
`addCallHistory: Found existing call history message (Call ID ${callHistoryDetails.callId}, Message ID: ${messageId})`
|
||||
);
|
||||
message.id = messageId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1942,7 +1942,18 @@ export class CallingClass {
|
|||
if (call.state === CallState.Accepted) {
|
||||
acceptedTime = acceptedTime || Date.now();
|
||||
} else if (call.state === CallState.Ended) {
|
||||
await this.addCallHistoryForEndedCall(conversation, call, acceptedTime);
|
||||
try {
|
||||
await this.addCallHistoryForEndedCall(
|
||||
conversation,
|
||||
call,
|
||||
acceptedTime
|
||||
);
|
||||
} catch (error) {
|
||||
log.error(
|
||||
'Failed to add call history for ended call',
|
||||
Errors.toLogFormat(error)
|
||||
);
|
||||
}
|
||||
this.stopDeviceReselectionTimer();
|
||||
this.lastMediaDeviceSettings = undefined;
|
||||
delete this.callsByConversation[conversation.id];
|
||||
|
|
|
@ -727,7 +727,9 @@ function callStateChange(
|
|||
|
||||
if (isIncomingRemoteHangup) {
|
||||
// This is considered just another "missed" event
|
||||
log.info('callStateChange: not syncing hangup from self');
|
||||
log.info(
|
||||
`callStateChange: not syncing hangup from self (Call ID: ${callId}))`
|
||||
);
|
||||
} else if (
|
||||
isOutgoingRemoteAccept ||
|
||||
isIncomingLocalAccept ||
|
||||
|
@ -735,6 +737,7 @@ function callStateChange(
|
|||
isIncomingLocalHangup ||
|
||||
isOutgoingRemoteHangup
|
||||
) {
|
||||
log.info(`callStateChange: syncing call event (Call ID: ${callId})`);
|
||||
try {
|
||||
await singleProtoJobQueue.add(
|
||||
MessageSender.getCallEventSync(
|
||||
|
|
|
@ -27,6 +27,9 @@ export async function onCallEventSync(
|
|||
return;
|
||||
}
|
||||
|
||||
log.info(
|
||||
`onCallEventSync: Queuing job to add call history (Call ID: ${callId})`
|
||||
);
|
||||
await conversation.queueJob('onCallEventSync', async () => {
|
||||
await conversation.addCallHistory(
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue