This commit is contained in:
Christopher Cookman 2026-06-21 06:39:50 -06:00
parent f52e98fc8e
commit 8f597b9f96

View file

@ -11,18 +11,15 @@ x.on('call', async (call) => {
console.error(`ERROR: ${remoteServer}/${channel}: ${err}`); console.error(`ERROR: ${remoteServer}/${channel}: ${err}`);
}); });
console.log(`Call from ${callerid} (${calleridname}) to ${extension} in context ${context} on channel ${channel} with uniqueid ${uniqueid}`);
console.log(JSON.stringify(call)) await call.Playback("beep");
await call.Answer(); while (true) {
console.log("answered") await call.ReadExten("EXTEN_INPUT", "beep");
await call.Wait(3); const exten = await call.getVariable("EXTEN_INPUT");
console.log("waited") console.log(`Got ${exten}`);
await call.SayDigits("1234"); if (!exten) break;
console.log("said digits") }
await call.Playback('beep') await call.Playback("goodbye");
console.log("played") await call.Hangup();
const test = await call.Read("beep", 1)
console.log("read", test)
await call.Hangup()
console.log("hung up")
}) })