Blegh 4
This commit is contained in:
parent
f52e98fc8e
commit
8f597b9f96
25
index.js
25
index.js
|
|
@ -10,19 +10,16 @@ x.on('call', async (call) => {
|
||||||
call.on("error", (err) => {
|
call.on("error", (err) => {
|
||||||
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}`);
|
||||||
|
|
||||||
|
await call.Playback("beep");
|
||||||
console.log(JSON.stringify(call))
|
while (true) {
|
||||||
await call.Answer();
|
await call.ReadExten("EXTEN_INPUT", "beep");
|
||||||
console.log("answered")
|
const exten = await call.getVariable("EXTEN_INPUT");
|
||||||
await call.Wait(3);
|
console.log(`Got ${exten}`);
|
||||||
console.log("waited")
|
if (!exten) break;
|
||||||
await call.SayDigits("1234");
|
}
|
||||||
console.log("said digits")
|
await call.Playback("goodbye");
|
||||||
await call.Playback('beep')
|
await call.Hangup();
|
||||||
console.log("played")
|
|
||||||
const test = await call.Read("beep", 1)
|
|
||||||
console.log("read", test)
|
|
||||||
await call.Hangup()
|
|
||||||
console.log("hung up")
|
|
||||||
})
|
})
|
||||||
Loading…
Reference in a new issue