Compare commits

...

2 Commits

Author SHA1 Message Date
Stephen Vanderwarker 4045b29b72
moving calls to asterisk.enabled
abc, enable flag gotify
enable flag mastodon
enable flag mqtt
2022-05-07 21:01:35 -04:00
Stephen Vanderwarker 92ecfeed1a
changing formatting for asterisk calls config
config.ini.dist changes asterisk, adds mastodon, mqtt, and gotify enable flags
check if mastodon send toots enabled for on.connect
2022-05-07 20:59:41 -04:00
2 changed files with 14 additions and 10 deletions

View File

@ -1,11 +1,11 @@
debug =
calls =
[asterisk]
callfrom =
callto =
callerID =
context =
enabled =
host =
password =
port =
@ -18,19 +18,22 @@ password =
port =
[gotify]
api_url =
enabled =
key =
message =
priority =
title =
api_url =
[mastodon]
token =
toot =
api_url =
user =
enabled =
[mqtt]
enabled =
message =
password =
server =

View File

@ -16,14 +16,13 @@ try {
const config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'));
// check if user debugging is enabled
const debugging = config.debug;
// check if user wants phone calls with commands are run
const calls_enabled = config.calls;
// Asterisk config
const asterisk_callfrom = config.asterisk.callfrom;
const asterisk_callerID = config.asterisk.callerID;
const asterisk_callto = config.asterisk.callerto;
const asterisk_context = config.asterisk.context;
const calls_enabled = config.asterisk.enabled;
const asterisk_host = config.asterisk.host;
const asterisk_password = config.asterisk.password;
const asterisk_port = config.asterisk.port;
@ -37,6 +36,7 @@ try {
// Gotify config
const gotify_api_url = config.gotify.api_url;
const gotify_enabled = config.gotify.enabled;
const gotify_key = config.gotify.key;
const gotify_message = config.gotify.message;
const gotify_priority = config.gotify.priority;
@ -44,11 +44,13 @@ try {
// Mastodon config
const mastodon_api_url = config.mastodon.api_url;
const mastodon_enabled = config.mastodon.enabled;
const mastodon_token = config.mastodon.token;
const mastodon_toot = config.mastodon.toot;
const mastodon_user = config.mastodon.user;
// MQTT config
const mqtt_enabled = config.mqtt.enabled;
const mqtt_message = config.mqtt.message;
const mqtt_password = config.mqtt.password;
const mqtt_server = config.mqtt.server;
@ -130,12 +132,11 @@ try {
// send mqtt online message
client.publish(mqtt_topic, mqtt_message);
// toot online message
/*
M.post('statuses', {
status: `${mastodon_toot}`
});
*/
if (mastodon_toots_enabled === "1"){
M.post('statuses', {
status: `${mastodon_toot}`
});
}
});
// wait for incoming messages
xmpp.on('chat', function (from, message) {