From 8f597b9f96a593149574cbcf8085e703d3948a55 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sun, 21 Jun 2026 06:39:50 -0600 Subject: [PATCH] Blegh 4 --- index.js | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/index.js b/index.js index 9395c74..99f6ed9 100644 --- a/index.js +++ b/index.js @@ -10,19 +10,16 @@ x.on('call', async (call) => { call.on("error", (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.Answer(); - console.log("answered") - await call.Wait(3); - console.log("waited") - await call.SayDigits("1234"); - console.log("said digits") - await call.Playback('beep') - console.log("played") - const test = await call.Read("beep", 1) - console.log("read", test) - await call.Hangup() - console.log("hung up") + await call.Playback("beep"); + while (true) { + await call.ReadExten("EXTEN_INPUT", "beep"); + const exten = await call.getVariable("EXTEN_INPUT"); + console.log(`Got ${exten}`); + if (!exten) break; + } + await call.Playback("goodbye"); + await call.Hangup(); }) \ No newline at end of file