voicemail: mailbox config, voicemail on no-answer/busy, *97/*98, MWI

Generate voicemail_selfphoneng.conf (03 §7) with one mailbox per extension
that has voicemail on, turn on ARG3 in sp-sub-user, and add *97/*98 to
sp-featurecodes (which replaces the pending placeholder). Endpoints with a
mailbox get mwi_subscribe_replaces_unsolicited so phones that SUBSCRIBE for
MWI aren't refused with a 500. A new test:asterisk check leaves a message,
sees MWI on a baresip phone, plays it with *97 and sees MWI turn off.

Task: M4-T1
This commit is contained in:
iamdoubz committed 2026-10-17 22:21:53 -05:00
1 parent 1e50d12c6e
commit 0d29131d18
31 files changed
+588 -48

No files matched your search

+8 -2
View File
@@ -26,7 +26,9 @@ function expectations(dir) {
const endpoints = [...pjsip.matchAll(/^\[([^\]]+)\]\ntype = endpoint$/gm)].map((m) => m[1]);
const ext = readFileSync(join(dir, 'extensions_selfphoneng.conf'), 'utf8');
const contexts = [...ext.matchAll(/^\[([^\]]+)\]$/gm)].map((m) => m[1]);
return { endpoints, contexts };
const vm = readFileSync(join(dir, 'voicemail_selfphoneng.conf'), 'utf8');
const mailboxes = [...vm.matchAll(/^(\d+) =>/gm)].map((m) => m[1]);
return { endpoints, contexts, mailboxes };
}
async function check(name) {
@@ -55,7 +57,7 @@ async function check(name) {
if (!booted) problems.push('Asterisk did not finish booting');
await sleep(500);
const { endpoints, contexts } = expectations(tmp);
const { endpoints, contexts, mailboxes } = expectations(tmp);
const shown = cli('pjsip show endpoints').out;
for (const e of endpoints)
if (!new RegExp(`Endpoint:\\s+${e}[\\s/]`).test(shown))
@@ -64,6 +66,10 @@ async function check(name) {
const d = cli(`dialplan show ${c}`).out;
if (!d.includes(`'${c}'`)) problems.push(`context ${c} not loaded`);
}
const users = cli('voicemail show users').out;
for (const m of mailboxes)
if (!new RegExp(`^default\\s+${m}\\s`, 'm').test(users))
problems.push(`mailbox ${m} not loaded`);
// Asterisk colors its log: strip the escape codes before looking for ERROR[.
// eslint-disable-next-line no-control-regex -- matching ANSI escapes is the point
const log = docker('logs', NAME).out.replace(/\x1b\[[0-9;]*m/g, '');