Add MVP call signaling API and browser call flow

This commit is contained in:
ai5590
2026-04-15 09:33:37 +03:00
parent 1ee2a1cf62
commit eaad476bf5
12 changed files with 665 additions and 2 deletions
+10
View File
@@ -2,6 +2,7 @@ import { navigate, getRoute, PRE_AUTH_PAGES } from './router.js';
import { renderToolbar } from './components/toolbar.js';
import { captureClientError, setClientErrorTransport } from './services/client-error-reporter.js';
import { initPwaPush } from './services/pwa-push-service.js';
import { handleIncomingCallInvite, handleIncomingCallSignal } from './services/call-service.js';
import {
authService,
authorizeSession,
@@ -223,6 +224,15 @@ async function init() {
try { await authService.ackIncomingMessage(eventId, messageId); } catch {}
}
});
authService.onEvent('IncomingCallInvite', async (evt) => {
try { await handleIncomingCallInvite(evt); } catch {}
});
authService.onEvent('IncomingCallSignal', async (evt) => {
try { await handleIncomingCallSignal(evt); } catch {}
});
await tryAutoLogin();
if (state.session.isAuthorized) {
await initPwaPush({ authService });