Uk Weather – Function *61

Ok I wanted a Uk weather report but have been having trouble finding one for the uk that worked. after a bit of searching around I have come up with this solution made from bits of information from various locations on the web. Login to your asterisk box and from the command line type the following mcedit /var/lib/asterisk/agi-bin/weather.sh then enter the following [code] #!/bin/sh cd /var/lib/asterisk/sounds curl “http://weather.yahoo.com/forecast/UKXX0025_c.html” 2>/dev/null | (sed -n ‘/

/,/

/p’)|sed -e :a -e ‘s/<[^>]*>//g;/ sox wx.tmp.wav -r 8000 -c 1 wx.tmp.gsm mv wx.tmp.gsm wx.gsm;rm -rf wx.tmp.wav[/code] Then save

once you have saved type the following on the command line chmod 777 /var/lib/asterisk/agi-bin/weather.sh Then edit your extensions_custom.conf and change the following [code]exten => *61,1,Answer exten => *61,2,AGI(weather.agi) exten => *61,3,Hangup [/code] to [code];exten => *61,1,Answer ;exten => *61,2,AGI(weather.agi) ;exten => *61,3,Hangup[/code] Then add the following [code]exten => *61,1,Answer exten => *61,2,AGI(festival-script.pl|Please hold a moment while we contact the Weather Service for your report) exten => *61,3,AGI(weather.sh) exten => *61,4,Playback(wx) exten => *61,5,Hangup [/code] restart asterisk you should now have a weather report for the bristol area to change to you area vist this link http://weather.yahoo.com/forecast/UKXX0025_c.html find your area and then change the line in weather.sh to match Here is an example config file weather.zip

Author: admin