IVR Script Install

How would I install the following script on freePBX? What are the file paths I would install the dial plan under?

One method I use in (USA )

install jq . using your latitude and longitude

curl "https://api.weather.gov/points/{lat},{lon}"

Use TTS of your choice, feed it with

curl -sf "https://api.weather.gov/gridpoints/{ABC/100,50/forecast"|jq -r '.properties.periods[0].detailedForecast'

Not in US, same concept

https://openweathermap.org/api

I’m trying to install this premade script on freepbx but I’m not sure how to set https://github.com/sammichaels/Asterisk-Weather-AGI

That script is 7 years old, weather.gov now provides a cleaner and quicker solution using api.weather.gov which is cleaner and quicker than w1.weather.gov which needs an unnecessary ‘scrape’ of the site.

I suggest you just try my recipe if you want a quick synopsis of the current weather wherever you are.

Here’s one that is 7 days old, not 7 years Speaking Clock +

@lgaetz Lovely script as ever from @billsimon , but can easily be expanded to provide forecast/current weather, even burgeoning ‘alerts’ and not just time and temperature . apart from wttr, wego (the go program that wttr is based on) and ‘curling’ openweathermap.org/api, api.weather.gov as a source all provide json results that are richer in content, just replace saynumber() with any usable TTS for a ‘natural language’ version.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.