Add simple debug program
This commit is contained in:
parent
5dd4476f6a
commit
a87e1c92d5
28
debug.js
Normal file
28
debug.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
require("dotenv").config();
|
||||
const cron = require("node-cron")
|
||||
const fs = require('fs');
|
||||
const mariadb = require("mariadb");
|
||||
const pool = mariadb.createPool({
|
||||
host: process.env.DB_HOST,
|
||||
port: process.env.DB_PORT || 3306,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASS,
|
||||
database: "asterisk",
|
||||
connectionLimit: 5,
|
||||
});
|
||||
|
||||
const FreepbxManager = require("./freepbx");
|
||||
const fpbx = new FreepbxManager({
|
||||
url: process.env.FREEPBX_URL,
|
||||
clientId: process.env.FREEPBX_CLIENT_ID,
|
||||
clientSecret: process.env.FREEPBX_CLIENT_SECRET,
|
||||
dbPool: pool,
|
||||
});
|
||||
|
||||
fpbx.listExtensions()
|
||||
.then((extensions) => {
|
||||
console.log(extensions);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
Loading…
Reference in a new issue