forked from vxmppb/vxmppb
Compare commits
5 Commits
daaebbd507
...
4f8d74c7e3
Author | SHA1 | Date |
---|---|---|
Stephen Vanderwarker | 4f8d74c7e3 | |
Stephen Vanderwarker | ac0338d220 | |
Stephen Vanderwarker | fae2c435ad | |
Stephen Vanderwarker | 1259729c91 | |
Stephen Vanderwarker | 1af04358d2 |
|
@ -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)
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
debug =
|
||||
calls =
|
||||
|
||||
[asterisk]
|
||||
callfrom =
|
||||
|
|
11
index.js
11
index.js
|
@ -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();
|
||||
|
|
Reference in New Issue