attempt #1 fix pbx issue

pull/29/head
Matthew 2020-12-25 21:55:51 -05:00
parent e0d7feb183
commit 02c5932c86
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 4 additions and 3 deletions

View File

@ -24,14 +24,15 @@ export default class PageDTMF extends Handler {
const pagerNumber: string[] = [];
const pagerCode: string[] = [];
channel.answer();
const pnPlayback = await channel.play({
const pnPlaybackC = this.pbx.ari.Playback();
channel.play({
media: 'sound:please-enter-the-pn',
}, undefined);
}, pnPlaybackC);
channel.on('ChannelDtmfReceived', async (ev) => {
if (!channel.connected) return;
if (status === 0) {
if (ev.digit === '#') {
await pnPlayback.stop();
await pnPlaybackC.stop();
await channel.play({
media: 'sound:please-enter-the-pc',
}, undefined);