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
30 lines
774 B
JSON
30 lines
774 B
JSON
{
|
|
"name": "@selfphoneng/api",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"license": "AGPL-3.0-or-later",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "node --watch --env-file-if-exists=../../.env --conditions=source src/index.ts",
|
|
"build": "tsc -p tsconfig.build.json",
|
|
"typecheck": "tsc --noEmit",
|
|
"db:generate": "drizzle-kit generate"
|
|
},
|
|
"dependencies": {
|
|
"@fastify/cookie": "^11.1.3",
|
|
"@fastify/static": "^10.1.6",
|
|
"@fastify/websocket": "^11.3.4",
|
|
"@node-rs/argon2": "^2.2.2",
|
|
"@selfphoneng/shared": "workspace:*",
|
|
"drizzle-orm": "^0.45.4",
|
|
"fastify": "^5.12.7",
|
|
"pg": "^8.23.1",
|
|
"zod": "^4.6.7"
|
|
},
|
|
"devDependencies": {
|
|
"@types/pg": "^8.23.1",
|
|
"@types/ws": "^8.18.2",
|
|
"drizzle-kit": "^0.31.11"
|
|
}
|
|
}
|