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) {
deviceInfo = {
["device_id"]: this.options.ownDeviceId,
["session_id"]: this.options.sessionId,
feeds: [{purpose: "m.usermedia"}]
};
devicesInfo.push(deviceInfo);

View File

@ -138,6 +138,11 @@ export class Member {
/** @internal */
handleDeviceMessage(message: SignallingMessage<MGroupCallBase>, deviceId: string, syncLog: ILogItem) {
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) {
this.peerCall = this._createPeerCall(message.content.call_id);
}