use session id from member event, and also send it for other party

This commit is contained in:
Bruno Windels 2022-04-11 13:39:18 +02:00
parent 1b0abebe8f
commit 302d4bc02d
2 changed files with 6 additions and 0 deletions

View file

@ -330,6 +330,7 @@ export class GroupCall extends EventEmitter<{change: never}> {
if (!deviceInfo) { if (!deviceInfo) {
deviceInfo = { deviceInfo = {
["device_id"]: this.options.ownDeviceId, ["device_id"]: this.options.ownDeviceId,
["session_id"]: this.options.sessionId,
feeds: [{purpose: "m.usermedia"}] feeds: [{purpose: "m.usermedia"}]
}; };
devicesInfo.push(deviceInfo); devicesInfo.push(deviceInfo);

View file

@ -138,6 +138,11 @@ export class Member {
/** @internal */ /** @internal */
handleDeviceMessage(message: SignallingMessage<MGroupCallBase>, deviceId: string, syncLog: ILogItem) { handleDeviceMessage(message: SignallingMessage<MGroupCallBase>, deviceId: string, syncLog: ILogItem) {
syncLog.refDetached(this.logItem); syncLog.refDetached(this.logItem);
const destSessionId = message.content.dest_session_id;
if (destSessionId !== this.options.sessionId) {
this.logItem.log({l: "ignoring to_device event with wrong session_id", destSessionId, type: message.type});
return;
}
if (message.type === EventType.Invite && !this.peerCall) { if (message.type === EventType.Invite && !this.peerCall) {
this.peerCall = this._createPeerCall(message.content.call_id); this.peerCall = this._createPeerCall(message.content.call_id);
} }