live: AMI-fed live state, /api/live WebSocket, dashboard and status dots
LiveState loads extension states and registered devices from Asterisk on every AMI connect and follows ExtensionStatus/ContactStatus; the hub sends a snapshot then deltas batched every 250 ms (devices for admins only), pings every 30 s and closes unauthenticated sockets with 4401. The web UI keeps one reconnecting socket in a zustand store, shows a Reconnecting banner, a Dashboard (online, on a call, telephony engine) and status dots. Fix: Asterisk 24 has no 'pjsip reload'; reload with 'module reload res_pjsip.so'. AMI errors now carry the CLI output. Milestone check, automated: call-test.ts registers two baresip phones and holds a 30 s call with RTP both ways (pnpm test:asterisk); the recorded session drives the live-state tests. scripts/e2e/m2-live.mjs runs api + Asterisk + phones + browser on a private Docker network: a new extension is live in Asterisk in ~1.3 s, the dashboard shows 2/2 online and red dots during the call. Task: M2-T6
This commit is contained in:
1 parent
1cfc13ead3
commit
c0c4036887
31 files changed
+4810
-28
No files matched your search
@@ -20,7 +20,7 @@ export const HEADER = '; GENERATED BY SelfPhoneNG — DO NOT EDIT. Changes will
|
||||
|
||||
/** Generated file → the AMI Command that makes Asterisk load it (03 §3). Order = reload order. */
|
||||
export const RELOADS = {
|
||||
'pjsip_selfphoneng.conf': 'pjsip reload',
|
||||
'pjsip_selfphoneng.conf': 'module reload res_pjsip.so',
|
||||
'rtp_selfphoneng.conf': 'module reload res_rtp_asterisk.so',
|
||||
'extensions_globals_selfphoneng.conf': 'dialplan reload',
|
||||
'extensions_selfphoneng.conf': 'dialplan reload',
|
||||
@@ -161,7 +161,7 @@ export function createGenerator(deps: GeneratorDeps) {
|
||||
|
||||
const reloadFor = force ? GENERATED_FILES : r.filesChanged;
|
||||
const commands = [...new Set(reloadFor.map((f) => RELOADS[f]))].filter(
|
||||
(c) => !(transportsChanged && c === 'pjsip reload'),
|
||||
(c) => !(transportsChanged && c === 'module reload res_pjsip.so'),
|
||||
);
|
||||
// TODO(M8): after `queue reload all`, re-send QueuePause for paused members (03 §1 step 9).
|
||||
const { sent, error } = await sendReloads(commands);
|
||||
|
||||
Reference in new issue
Block a user