From 2f4a5fe5f9b3fa81c8e05f237a20ce4c556d5e62 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 2 Dec 2020 00:26:46 -0500 Subject: [PATCH] add ami --- src/class/Util.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/class/Util.ts b/src/class/Util.ts index b54a386..85d1c88 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -3,6 +3,7 @@ import nodemailer from 'nodemailer'; import GoogleTTS, { TextToSpeechClient } from '@google-cloud/text-to-speech'; import childProcess from 'child_process'; import ARIClient from 'ari-client'; +import AMIClient from 'asterisk-manager'; import signale from 'signale'; import { Member, Message, Guild, PrivateChannel, GroupChannel, Role, AnyGuildChannel, WebhookPayload } from 'eris'; import { Client, Command, Moderation, PBX, RichEmbed } from '.'; @@ -21,6 +22,8 @@ export default class Util { public ari: ARIClient.Client; + public ami: any; + public tts: TextToSpeechClient; constructor(client: Client) { @@ -45,6 +48,8 @@ export default class Util { this.ari = await ARIClient.connect('http://10.8.0.1:8088/ari', 'cr0', this.client.config.ariClientKey); this.ari.start(['cr-zero', 'page-dtmf']); + this.ami = new AMIClient(5038, '10.8.0.1', this.client.config.amiClientKey); + process.env.GOOGLE_APPLICATION_CREDENTIALS = `${__dirname}/../../google.json`; this.tts = new GoogleTTS.TextToSpeechClient();