more logging of callId and sessionIds

This commit is contained in:
Bruno Windels 2022-04-29 14:57:45 +01:00
parent 9938071e1c
commit c1c08e9eb0
3 changed files with 8 additions and 1 deletions

View file

@ -105,6 +105,7 @@ export class PeerCall implements IDisposable {
private readonly options: Options, private readonly options: Options,
private readonly logItem: ILogItem, private readonly logItem: ILogItem,
) { ) {
logItem.log({l: "create PeerCall", callId});
this._remoteMedia = new RemoteMedia(); this._remoteMedia = new RemoteMedia();
this.peerConnection = options.webRTC.createPeerConnection(this.options.forceTURN, this.options.turnServers, 0); this.peerConnection = options.webRTC.createPeerConnection(this.options.forceTURN, this.options.turnServers, 0);
@ -299,7 +300,7 @@ export class PeerCall implements IDisposable {
} }
handleIncomingSignallingMessage<B extends MCallBase>(message: SignallingMessage<B>, partyId: PartyId): Promise<void> { handleIncomingSignallingMessage<B extends MCallBase>(message: SignallingMessage<B>, partyId: PartyId): Promise<void> {
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) { switch (message.type) {
case EventType.Invite: case EventType.Invite:
if (this.callId !== message.content.call_id) { if (this.callId !== message.content.call_id) {
@ -323,6 +324,7 @@ export class PeerCall implements IDisposable {
break; break;
case EventType.Hangup: case EventType.Hangup:
// TODO: this is a bit hacky, double check its what we need // 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); this.terminate(CallParty.Remote, message.content.reason ?? CallErrorCode.UserHangup, log);
break; break;
default: default:

View file

@ -242,6 +242,7 @@ export class GroupCall extends EventEmitter<{change: never}> {
if (member && sessionIdChanged) { if (member && sessionIdChanged) {
log.set("removedSessionId", member.sessionId); log.set("removedSessionId", member.sessionId);
member.disconnect(false); member.disconnect(false);
member.dispose();
this._members.remove(memberKey); this._members.remove(memberKey);
member = undefined; member = undefined;
} }

View file

@ -130,6 +130,10 @@ export class Member {
}); });
} }
dispose() {
this.logItem.finish();
}
/** @internal */ /** @internal */
updateCallInfo(callDeviceMembership: CallDeviceMembership, log: ILogItem) { updateCallInfo(callDeviceMembership: CallDeviceMembership, log: ILogItem) {
log.wrap({l: "updateing device membership", deviceId: this.deviceId}, log => { log.wrap({l: "updateing device membership", deviceId: this.deviceId}, log => {