forked from vxmppb/vxmppb
Compare commits
No commits in common. "4045b29b721251b8e4535c58bf86478c13b89883" and "d62efc18bfee2d5d8bcaae0b8ab79e6265ae67fa" have entirely different histories.
4045b29b72
...
d62efc18bf
|
@ -1,11 +1,11 @@
|
||||||
debug =
|
debug =
|
||||||
|
calls =
|
||||||
|
|
||||||
[asterisk]
|
[asterisk]
|
||||||
callfrom =
|
callfrom =
|
||||||
callto =
|
callto =
|
||||||
callerID =
|
callerID =
|
||||||
context =
|
context =
|
||||||
enabled =
|
|
||||||
host =
|
host =
|
||||||
password =
|
password =
|
||||||
port =
|
port =
|
||||||
|
@ -18,22 +18,19 @@ password =
|
||||||
port =
|
port =
|
||||||
|
|
||||||
[gotify]
|
[gotify]
|
||||||
api_url =
|
|
||||||
enabled =
|
|
||||||
key =
|
key =
|
||||||
message =
|
message =
|
||||||
priority =
|
priority =
|
||||||
title =
|
title =
|
||||||
|
api_url =
|
||||||
|
|
||||||
[mastodon]
|
[mastodon]
|
||||||
token =
|
token =
|
||||||
toot =
|
toot =
|
||||||
api_url =
|
api_url =
|
||||||
user =
|
user =
|
||||||
enabled =
|
|
||||||
|
|
||||||
[mqtt]
|
[mqtt]
|
||||||
enabled =
|
|
||||||
message =
|
message =
|
||||||
password =
|
password =
|
||||||
server =
|
server =
|
||||||
|
|
11
index.js
11
index.js
|
@ -16,13 +16,14 @@ try {
|
||||||
const config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'));
|
const config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'));
|
||||||
// check if user debugging is enabled
|
// check if user debugging is enabled
|
||||||
const debugging = config.debug;
|
const debugging = config.debug;
|
||||||
|
// check if user wants phone calls with commands are run
|
||||||
|
const calls_enabled = config.calls;
|
||||||
|
|
||||||
// Asterisk config
|
// Asterisk config
|
||||||
const asterisk_callfrom = config.asterisk.callfrom;
|
const asterisk_callfrom = config.asterisk.callfrom;
|
||||||
const asterisk_callerID = config.asterisk.callerID;
|
const asterisk_callerID = config.asterisk.callerID;
|
||||||
const asterisk_callto = config.asterisk.callerto;
|
const asterisk_callto = config.asterisk.callerto;
|
||||||
const asterisk_context = config.asterisk.context;
|
const asterisk_context = config.asterisk.context;
|
||||||
const calls_enabled = config.asterisk.enabled;
|
|
||||||
const asterisk_host = config.asterisk.host;
|
const asterisk_host = config.asterisk.host;
|
||||||
const asterisk_password = config.asterisk.password;
|
const asterisk_password = config.asterisk.password;
|
||||||
const asterisk_port = config.asterisk.port;
|
const asterisk_port = config.asterisk.port;
|
||||||
|
@ -36,7 +37,6 @@ try {
|
||||||
|
|
||||||
// Gotify config
|
// Gotify config
|
||||||
const gotify_api_url = config.gotify.api_url;
|
const gotify_api_url = config.gotify.api_url;
|
||||||
const gotify_enabled = config.gotify.enabled;
|
|
||||||
const gotify_key = config.gotify.key;
|
const gotify_key = config.gotify.key;
|
||||||
const gotify_message = config.gotify.message;
|
const gotify_message = config.gotify.message;
|
||||||
const gotify_priority = config.gotify.priority;
|
const gotify_priority = config.gotify.priority;
|
||||||
|
@ -44,13 +44,11 @@ try {
|
||||||
|
|
||||||
// Mastodon config
|
// Mastodon config
|
||||||
const mastodon_api_url = config.mastodon.api_url;
|
const mastodon_api_url = config.mastodon.api_url;
|
||||||
const mastodon_enabled = config.mastodon.enabled;
|
|
||||||
const mastodon_token = config.mastodon.token;
|
const mastodon_token = config.mastodon.token;
|
||||||
const mastodon_toot = config.mastodon.toot;
|
const mastodon_toot = config.mastodon.toot;
|
||||||
const mastodon_user = config.mastodon.user;
|
const mastodon_user = config.mastodon.user;
|
||||||
|
|
||||||
// MQTT config
|
// MQTT config
|
||||||
const mqtt_enabled = config.mqtt.enabled;
|
|
||||||
const mqtt_message = config.mqtt.message;
|
const mqtt_message = config.mqtt.message;
|
||||||
const mqtt_password = config.mqtt.password;
|
const mqtt_password = config.mqtt.password;
|
||||||
const mqtt_server = config.mqtt.server;
|
const mqtt_server = config.mqtt.server;
|
||||||
|
@ -132,11 +130,12 @@ try {
|
||||||
// send mqtt online message
|
// send mqtt online message
|
||||||
client.publish(mqtt_topic, mqtt_message);
|
client.publish(mqtt_topic, mqtt_message);
|
||||||
// toot online message
|
// toot online message
|
||||||
if (mastodon_toots_enabled === "1"){
|
/*
|
||||||
M.post('statuses', {
|
M.post('statuses', {
|
||||||
status: `${mastodon_toot}`
|
status: `${mastodon_toot}`
|
||||||
});
|
});
|
||||||
}
|
*/
|
||||||
|
|
||||||
});
|
});
|
||||||
// wait for incoming messages
|
// wait for incoming messages
|
||||||
xmpp.on('chat', function (from, message) {
|
xmpp.on('chat', function (from, message) {
|
||||||
|
|
Reference in New Issue
Block a user