SHA256
Звонки: выбор одной callee-сессии и авто-закрытие входящего на других устройствах
This commit is contained in:
@@ -1366,7 +1366,51 @@ export async function handleIncomingCallSignal(evt) {
|
||||
|
||||
const call = getCall(callId);
|
||||
if (!call) return;
|
||||
if (!call.remoteSessionId) call.remoteSessionId = fromSessionId;
|
||||
if (call.direction === 'out') {
|
||||
if (type === TYPES.RINGING) {
|
||||
if (!call.remoteSessionId && fromSessionId) {
|
||||
call.remoteSessionId = fromSessionId;
|
||||
}
|
||||
if (call.remoteSessionId && fromSessionId && call.remoteSessionId !== fromSessionId) {
|
||||
await emitDebug(
|
||||
call,
|
||||
'info',
|
||||
'ringing_from_non_selected_session_ignored',
|
||||
`selected=${call.remoteSessionId}; from=${fromSessionId}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
} else if (type === TYPES.ACCEPT) {
|
||||
if (fromSessionId) {
|
||||
if (!call.remoteSessionId || !call.initialOfferSent) {
|
||||
call.remoteSessionId = fromSessionId;
|
||||
} else if (call.remoteSessionId !== fromSessionId) {
|
||||
await emitDebug(
|
||||
call,
|
||||
'warn',
|
||||
'accept_from_non_selected_session_ignored',
|
||||
`selected=${call.remoteSessionId}; from=${fromSessionId}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (call.remoteSessionId && fromSessionId && call.remoteSessionId !== fromSessionId) {
|
||||
await emitDebug(
|
||||
call,
|
||||
'info',
|
||||
'signal_from_non_selected_session_ignored',
|
||||
`type=${type}; selected=${call.remoteSessionId}; from=${fromSessionId}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!call.remoteSessionId && fromSessionId) {
|
||||
call.remoteSessionId = fromSessionId;
|
||||
}
|
||||
}
|
||||
} else if (!call.remoteSessionId) {
|
||||
call.remoteSessionId = fromSessionId;
|
||||
}
|
||||
|
||||
if (type === TYPES.RINGING) {
|
||||
if (call.direction === 'out' && call.phase === 'searching') {
|
||||
|
||||
Reference in New Issue
Block a user