This commit is contained in:
Christopher Cookman 2025-01-11 02:05:58 -07:00
parent acc4fa5022
commit 3fa6a199ee

View file

@ -38,13 +38,13 @@ function parseVoicemailData(data) {
} }
function getUsers() { function getUsers() {
var vmData = fs.readFileSync(process.env.DEV == "true" ? "./dev/voicemail.conf" : "/etc/asterisk/voicemail.conf").toString() var vmData = fs.readFileSync(process.env.DEV ? "./dev/voicemail.conf" : "/etc/asterisk/voicemail.conf").toString()
voicemailData = parseVoicemailData(extractTextFromRawText(vmData)); voicemailData = parseVoicemailData(extractTextFromRawText(vmData));
return voicemailData; return voicemailData;
} }
function getEndpoints() { function getEndpoints() {
if (!process.env.DEV == "true") { if (!process.env.DEV) {
const currentEndpoint = execSync('asterisk -x "pjsip show endpoints"').toString(); const currentEndpoint = execSync('asterisk -x "pjsip show endpoints"').toString();
const endpoints = currentEndpoint.split("\n"); const endpoints = currentEndpoint.split("\n");
return endpoints; return endpoints;
@ -142,7 +142,7 @@ function renderStatusPage() {
if (err) { if (err) {
console.error(err); console.error(err);
} else { } else {
fs.writeFileSync(process.env.DEV == "true" ? "./dev/index.html" : "/var/www/html/status/index.html", str); fs.writeFileSync(process.env.DEV ? "./dev/index.html" : "/var/www/html/status/index.html", str);
} }
}); });
} }
@ -155,7 +155,7 @@ client.on("ready", () => {
setInterval(renderStatusPage, 5*1000); setInterval(renderStatusPage, 5*1000);
}); });
if (process.env.DEV == "true") { if (process.env.DEV) {
console.log("DEV") console.log("DEV")
renderStatusPage(); renderStatusPage();
notifyNew(); notifyNew();