festival with weather_metar.agi

Asterisk say real time weather condition in your town.

Today, 2006-01-20 we have -29C in Vilnius, Lithuania.
I write weather_metar.agi in 15 min, please check for errors before use.
But it very simple, and work fine for me.

1) Install Asterisk :)

2) Install Festival (http://www.voip-info.org/wiki-Asterisk+festival+installation)

3) Install metar (apt-get install metar) other (http://packages.debian.org/unstable/utils/metar)

4) Get sh-agi.inc from LCDial.sh package http://www.voip-info.org/wiki/view/LCDial.sh+AGI+script (Thanks Enzo Michelangeli <enzomich (at) gmail.com>)

5) Put weather_metar.agi and sh-agi.inc in /var/lib/asterisk/agi-bin

6) Make integration in dial plan:
Sample for Lithuania, Vilnius (METAR code "eyvi"):
exten => 699,1,AGI(weather_metar.agi,eyvi)
exten => 699,2,Hangup()

7) Test it (dial 699). If all OK find your METAR town code in http://weather.noaa.gov/international.html

8) Enjoy!


  1. !/bin/sh
  2. weather_metar.agi V-0.1a
  3. Writen by Marat Gulevich <gool (at) gool.dyndns.biz> JAN 2006
  4. Say weather report for your town.
  5. Dependences:
  6. 1) Asterisk (http://www.asterisk.org) + Festival
  7. 2) sh-agi.inc (Thanks Enzo Michelangeli <enzomich (at) gmail.com>) from LCDial.sh package http://www.voip-info.org/wiki/view/LCDial.sh+AGI+script
  8. 3) metar utility (For Debian distr.: apt-get install metar)
  9. 4) METAR town code (See: http://weather.noaa.gov/international.html)
  10. Sample for Lithuania, Vilnius (METAR code "eyvi") in extensions.conf
  11. exten => 699,1,AGI(weather_metar.agi,eyvi)
  12. exten => 699,2,Hangup()
. /var/lib/asterisk/agi-bin/sh-agi.inc
WEATHER=$(metar -d $1)
T1=$(echo $WEATHER | cut -d ":" -f10 | sed 's/ Dewpoint/,/' | sed 's/C/celsium degree/')
T2=$(echo $WEATHER | cut -d ":" -f14 | sed 's/ //')
sh_agi_log "$SP"
sh_agi_cmd EXEC Festival "$SP"

Created by: gool, Last modification: Fri 05 of Nov, 2010 (09:29 UTC) by admin
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+