generator: PJSIP transports, extension endpoints and rtp config
Golden cases empty, one-user, webrtc-disabled and hostile-names; each also renders identically from shuffled input. pnpm test:asterisk boots the asterisk image with every golden case and fails on a missing endpoint or context or any ERROR log line (checked against a deliberately broken case). On 24.0.0-rc2: 101 and 101-web load with every set_var. Task: M2-T3
This commit is contained in:
1 parent
a5de247948
commit
06ac99b9f4
44 files changed
+1040
-12
No files matched your search
@@ -9,6 +9,9 @@ import type { Db } from '../db/client.ts';
|
||||
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';
|
||||
|
||||
export { renderTransports };
|
||||
|
||||
export const HEADER = '; GENERATED BY SelfPhoneNG — DO NOT EDIT. Changes will be overwritten.\n';
|
||||
|
||||
@@ -29,7 +32,10 @@ export const GENERATED_FILES = Object.keys(RELOADS) as GeneratedFileName[];
|
||||
export type RenderedFiles = Record<GeneratedFileName, string>;
|
||||
|
||||
// Each file's body; tasks fill these in (M2-T3 pjsip/rtp, M2-T4 dialplan, ...).
|
||||
const BODIES: Partial<Record<GeneratedFileName, (snap: Snapshot) => string>> = {};
|
||||
const BODIES: Partial<Record<GeneratedFileName, (snap: Snapshot) => string>> = {
|
||||
'pjsip_selfphoneng.conf': renderPjsip,
|
||||
'rtp_selfphoneng.conf': renderRtp,
|
||||
};
|
||||
|
||||
/** PURE: no I/O, no clock, no randomness. Same snapshot → byte-identical files. */
|
||||
export function render(snap: Snapshot): RenderedFiles {
|
||||
@@ -38,11 +44,6 @@ export function render(snap: Snapshot): RenderedFiles {
|
||||
) as RenderedFiles;
|
||||
}
|
||||
|
||||
/** The transport block: [global], [system] and every type=transport section (03 §3). */
|
||||
export function renderTransports(_snap: Snapshot): string {
|
||||
return ''; // M2-T3
|
||||
}
|
||||
|
||||
export type ApplyResult = {
|
||||
ok: boolean;
|
||||
error: string | null;
|
||||
|
||||
Reference in new issue
Block a user