Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ee/packages/media-calls/src/internal/SignalProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ export class GlobalSignalProcessor {

// If this user's side of the call has already been signed
if (actor.contractId) {
// If it's signed to the same session that is now registering
// Or it was signed by a session that the current session is replacing (as in a browser refresh)
if (actor.contractId === signal.contractId || actor.contractId === signal.oldContractId) {
// If it was signed by a session that the current session is replacing (as in a browser refresh)
if (actor.contractId === signal.oldContractId) {
logger.info({ msg: 'Server detected a client refresh for a session with an active call.', callId: call._id });
await mediaCallDirector.hangupDetachedCall(call, { endedBy: { ...actor, contractId: signal.contractId }, reason: 'unknown' });
return;
Expand Down
3 changes: 2 additions & 1 deletion packages/media-signaling/src/lib/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type MediaSignalingEvents = {

export type MediaSignalingSessionConfig = {
userId: string;
mobileDeviceId?: string;
oldSessionId?: string;
logger?: IMediaSignalLogger;
processorFactories: IServiceProcessorFactoryList;
Expand Down Expand Up @@ -74,7 +75,7 @@ export class MediaSignalingSession extends Emitter<MediaSignalingEvents> {
constructor(private config: MediaSignalingSessionConfig) {
super();
this._userId = config.userId;
this._sessionId = config.randomStringFactory();
this._sessionId = config.mobileDeviceId || config.randomStringFactory();
this.recurringStateReportHandler = null;
this.knownCalls = new Map<string, ClientMediaCall>();
this.ignoredCalls = new Set<string>();
Expand Down
Loading