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

+5
View File
@@ -26,11 +26,14 @@ export type SnapExtension = {
isAdmin: boolean; // the extension's user is an admin (time-condition override codes)
};
export type SnapDid = { id: string; number: string };
export type Snapshot = {
/** "YYYY-MM-DD" in general.timezone; render() never reads the clock. */
today: string;
settings: Awaited<ReturnType<typeof getAllSettings>>;
extensions: SnapExtension[];
dids: SnapDid[]; // M3 adds routing fields
};
export function todayIn(timezone: string, now = new Date()): string {
@@ -54,9 +57,11 @@ export async function loadSnapshot(db: Db, now = new Date()): Promise<Snapshot>
.leftJoin(outDid, eq(outDid.id, extensions.outboundCallerIdDidId))
.leftJoin(e911Did, eq(e911Did.id, extensions.emergencyCallerIdDidId));
const didRows = await db.select({ id: dids.id, number: dids.number }).from(dids);
return {
today: todayIn(settings['general.timezone'], now),
settings,
dids: didRows,
extensions: rows.map(({ ext, role, outCid, e911Cid }) => ({
id: ext.id,
number: ext.number,