Compare commits

...

5 Commits

Author SHA1 Message Date
Stephen Vanderwarker 4f8d74c7e3
Adding enable/disable calls to config.ini.dist 2022-04-29 17:23:21 -04:00
Stephen Vanderwarker ac0338d220
Adding config to enable/disable calls. 2022-04-29 17:22:57 -04:00
Stephen Vanderwarker fae2c435ad
!! 2022-04-27 16:38:16 -04:00
Stephen Vanderwarker 1259729c91
Removing wmc, renamed wmc in asterisk call to wm.
Re-enabled call asterisk for weather report.
2022-04-27 16:35:53 -04:00
Stephen Vanderwarker 1af04358d2
Re-adding docker badge 2022-04-27 15:22:52 -04:00
3 changed files with 8 additions and 6 deletions

View File

@ -7,6 +7,8 @@ Vanderwarker Family XMPP Bot.
[![NPM](https://nodei.co/npm/vxmppb.png?compact=true)](https://nodei.co/npm/vxmppb/)
[![Known Vulnerabilities](https://snyk.io/test/npm/vxmppb/badge.svg)](https://snyk.io/test/npm/vxmppb)
![docker](https://img.shields.io/docker/pulls/vxmppb/vxmppb.svg)
![npm](https://img.shields.io/npm/dt/vxmppb)

View File

@ -1,4 +1,5 @@
debug =
calls =
[asterisk]
callfrom =

View File

@ -16,6 +16,8 @@ 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 callme = config.calls;
// Asterisk config
const asterisk_callfrom = config.asterisk.callfrom;
@ -396,9 +398,7 @@ try {
console.log('error:', err);
} else {
let w = JSON.parse(body);
let wm = weather_city_name + " Weather: \r\n Tempature: " + w.main.temp + " degrees. \r\n Conditions: " + w.weather[0].main + "\r\n Pressure: " +
w.main.pressure + " \r\n Wind Direction: " + getDirection(w.wind.deg) + "\r\n Wind Speed: " + w.wind.speed + " m.p.h. \r\n";
let wmc = weather_city_name + " Weather: Tempature: " + w.main.temp + " degrees. Conditions: " + w.weather[0].main + ". Pressure: " +
let wm = weather_city_name + " Weather: Tempature: " + w.main.temp + " degrees. Conditions: " + w.weather[0].main + ". Pressure: " +
w.main.pressure + ". Wind Direction: " + getDirection(w.wind.deg) + ". Wind Speed: " + w.wind.speed + " miles per hour \r\n";
// send weather to mqtt
client.publish('weather/temp', '' + w.main.temp + '');
@ -409,16 +409,15 @@ try {
// send weather to xmpp admin
xmpp.send(from, wm);
// call admin with latest weather report
/*
ami.action({
'action':'originate',
'channel':'SIP/' + asterisk_callfrom,
'context': asterisk_context,
'callerID' : asterisk_callerID,
'data': 'googletts.agi,' + wmc,
'data': 'googletts.agi,' + wm,
'application': 'agi'
});
*/
}
});
debug();