generator: base dialplan, globals and sp-local-numbers with hints

Static sp-sub-* helpers and sp-from-ext from 03 §6.2 (with __SP_ variable
names), globals (default and E911 caller ID, per-extension class and admin
flags), and every user in sp-local-numbers with a PJSIP/<n>[&PJSIP/<n>-web]
hint. Voicemail stays off (ARG3=0) until M4. Contexts that later milestones
fill (emergency, feature codes, outbound routes) get a placeholder so
Asterisk doesn't warn about missing includes. Empty ccss.conf for the next
image build.

Task: M2-T4
This commit is contained in:
iamdoubz committed 2026-10-17 16:28:13 -05:00
1 parent 06ac99b9f4
commit a4da81cf8f
16 files changed
+673 -1

No files matched your search

+6
View File
@@ -10,6 +10,9 @@ import { generatorRuns } from '../db/schema.ts';
import { getSetting, setSetting } from '../services/settings.ts';
import { loadSnapshot, type Snapshot } from './load.ts';
import { renderPjsip, renderRtp, renderTransports } from './pjsip.ts';
import { STATIC_DIALPLAN } from './dialplan/static.ts';
import { renderGlobals, renderLocalNumbers } from './dialplan/local.ts';
import { PENDING_CONTEXTS } from './dialplan/pending.ts';
export { renderTransports };
@@ -35,6 +38,9 @@ export type RenderedFiles = Record<GeneratedFileName, string>;
const BODIES: Partial<Record<GeneratedFileName, (snap: Snapshot) => string>> = {
'pjsip_selfphoneng.conf': renderPjsip,
'rtp_selfphoneng.conf': renderRtp,
'extensions_globals_selfphoneng.conf': renderGlobals,
'extensions_selfphoneng.conf': (snap) =>
`${STATIC_DIALPLAN}\n${renderLocalNumbers(snap)}\n${PENDING_CONTEXTS}`,
};
/** PURE: no I/O, no clock, no randomness. Same snapshot → byte-identical files. */