import { TeleQuickClient } from "@telequick/sdk";
import {{ readFile }} from "node:fs/promises";
const client = new TeleQuickClient("quic://engine.telequick.dev:9090", credsPath);
await client.connect();
await client.dial({{ to: "sip:+15551234567@…", trunkId: "default" }});
// Read a pre-recorded prompt and send it in 20 ms PCMU chunks.
const buf = await readFile("./prompt.alaw");
const FRAME = 160; // 20 ms * 8 kHz
let seq = 0;
for (let i = 0; i < buf.length; i += FRAME) {{
const slice = buf.subarray(i, i + FRAME);
await client.pushAudio("the-call-sid", slice, "PCMU", seq++, false);
await new Promise((r) => setTimeout(r, 20));
}}