import fs from "node:fs"; import fsp from "node:fs/promises"; import path from "node:path"; import { CallRecordSchema, TerminalStates, type CallId, type CallRecord } from "../types.js";
const pendingPersistWrites = new Set<Promise<void>>();
const callMap = new Map<CallId, CallRecord>(); for (const line of lines) { if (!line.trim()) { continue;
} try { const call = CallRecordSchema.parse(JSON.parse(line));
callMap.set(call.callId, call);
} catch { // Skip invalid lines.
}
}
const activeCalls = new Map<CallId, CallRecord>(); const providerCallIdMap = new Map<string, CallId>(); const processedEventIds = new Set<string>(); const rejectedProviderCallIds = new Set<string>();
for (const [callId, call] of callMap) { for (const eventId of call.processedEventIds) {
processedEventIds.add(eventId);
} if (TerminalStates.has(call.state)) { continue;
}
activeCalls.set(callId, call); if (call.providerCallId) {
providerCallIdMap.set(call.providerCallId, callId);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.