From c1c08e9eb0f58ac808fd9405804b46b62e4cf656 Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Fri, 29 Apr 2022 14:57:45 +0100 Subject: [PATCH] more logging of callId and sessionIds --- src/matrix/calls/PeerCall.ts | 4 +++- src/matrix/calls/group/GroupCall.ts | 1 + src/matrix/calls/group/Member.ts | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/matrix/calls/PeerCall.ts b/src/matrix/calls/PeerCall.ts index d69cafa6..edc245a4 100644 --- a/src/matrix/calls/PeerCall.ts +++ b/src/matrix/calls/PeerCall.ts @@ -105,6 +105,7 @@ export class PeerCall implements IDisposable { private readonly options: Options, private readonly logItem: ILogItem, ) { + logItem.log({l: "create PeerCall", callId}); this._remoteMedia = new RemoteMedia(); this.peerConnection = options.webRTC.createPeerConnection(this.options.forceTURN, this.options.turnServers, 0); @@ -299,7 +300,7 @@ export class PeerCall implements IDisposable { } handleIncomingSignallingMessage(message: SignallingMessage, partyId: PartyId): Promise { - return this.logItem.wrap({l: "receive", id: message.type, partyId}, async log => { + return this.logItem.wrap({l: "receive", id: message.type, callId: message.content.call_id}, async log => { switch (message.type) { case EventType.Invite: if (this.callId !== message.content.call_id) { @@ -323,6 +324,7 @@ export class PeerCall implements IDisposable { break; case EventType.Hangup: // TODO: this is a bit hacky, double check its what we need + log.set("reason", message.content.reason); this.terminate(CallParty.Remote, message.content.reason ?? CallErrorCode.UserHangup, log); break; default: diff --git a/src/matrix/calls/group/GroupCall.ts b/src/matrix/calls/group/GroupCall.ts index 707188f7..12d0be51 100644 --- a/src/matrix/calls/group/GroupCall.ts +++ b/src/matrix/calls/group/GroupCall.ts @@ -242,6 +242,7 @@ export class GroupCall extends EventEmitter<{change: never}> { if (member && sessionIdChanged) { log.set("removedSessionId", member.sessionId); member.disconnect(false); + member.dispose(); this._members.remove(memberKey); member = undefined; } diff --git a/src/matrix/calls/group/Member.ts b/src/matrix/calls/group/Member.ts index 28190967..bed1af94 100644 --- a/src/matrix/calls/group/Member.ts +++ b/src/matrix/calls/group/Member.ts @@ -130,6 +130,10 @@ export class Member { }); } + dispose() { + this.logItem.finish(); + } + /** @internal */ updateCallInfo(callDeviceMembership: CallDeviceMembership, log: ILogItem) { log.wrap({l: "updateing device membership", deviceId: this.deviceId}, log => {