softphone: People panel with presence, click-to-call
ci / images (push) Canceled after 0s
ci / check (push) Canceled after 4s

People lists every extension with its status dot and a search box: a
right-hand column on wide screens, /me/people on small ones. Call uses the
browser softphone when it's on, else POST /api/me/click-to-call, which
originates to the user's desk phone first (409 if none is registered).
During a call: Transfer (blind), Talk first (consult), or drag the call
card onto a person; a held call card offers Complete transfer whenever
another call is active. useSoftphone moved to its own module.

e2e m5-t3: the dot changes ~30 ms after Asterisk's hint; click-to-call
rings 174 before 172. cdp click() takes a scope (People also has
Call/Transfer buttons). trunk-test ignores the RTCP-at-teardown EPERM
error seen once.

Task: M5-T3
This commit is contained in:
iamdoubz committed 2026-10-18 10:06:28 -05:00
1 parent c7fd4df77c
commit 609965bba5
16 files changed
+452 -33

No files matched your search

+7 -5
View File
@@ -18,6 +18,8 @@ const AST = 'sp-live-ast';
const PHONE = 'sp-live-phone171';
const USER = { email: 'web@example.com', password: 'web-new-password-123' };
const SECONDS = 8;
/** The softphone's own buttons (People rows also have Call/Transfer). */
const SP = '[aria-label=Softphone]';
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
const docker = (...a) => {
const r = spawnSync('docker', a, { encoding: 'utf8' });
@@ -165,14 +167,14 @@ try {
await p.shot('m5-t1-01-ready');
// Browser → desk phone.
await p.click('Keypad');
await p.click('Keypad', SP);
await p.fill('Number to call', '171');
await p.click('Call');
await p.click('Call', SP);
await p.waitFor(`document.body.innerText.includes('On call')`, 'outgoing call answered', 15_000);
await sleep(SECONDS * 1000);
await p.shot('m5-t1-02-outgoing');
assertTwoWay('browser → desk');
await p.click('Hang up');
await p.click('Hang up', SP);
await p.waitFor(`!document.body.innerText.includes('On call')`, 'hung up');
await hangupAll();
@@ -180,11 +182,11 @@ try {
cli(`channel originate PJSIP/171 extension 170@sp-from-ext`);
await p.waitFor(`document.body.innerText.includes('Incoming call')`, 'incoming call', 15_000);
await p.shot('m5-t1-03-incoming');
await p.click('Answer');
await p.click('Answer', SP);
await p.waitFor(`document.body.innerText.includes('On call')`, 'incoming answered', 10_000);
await sleep(SECONDS * 1000);
assertTwoWay('desk → browser');
await p.click('Hang up');
await p.click('Hang up', SP);
await p.waitFor(`!document.body.innerText.includes('On call')`, 'hung up');
await hangupAll();