From: Lonnie A. <li...@lo...> - 2007-01-06 19:39:30
|
Hi, I have written a AGI (weather.agi) for my net4801 AstLinux box's. The goal is an extremely low overhead, XML -> voice, to speak the current weather conditions. Only what is happing now, no forecast. The result is a short and sweet (approx. 15 second) current weather conditions. Of course no speech synthesis, (ie. festival) just asterisk "extras" sounds. We have an IP phone on the way out to the garage, standard practice now is to dial extension "1199" (your choosing) and just walk away to hear if your coat is thick enough or if your shorts are short enough. OK, on with the details... The bash AGI can be found here: http://lonnie.abelbeck.com/share/weather.agi.txt FTP the weather.agi.txt file to a writable AstLinux partition, and then SSH into your box. The only thing you might need to change is the location of your "extras" sound files, the following snippet in the weather.agi bash script. # # Define the location of the "extras" sound files. # Use an empty string (EXTRAS="") if they are not in a separate directory. # A person could also define a custom set of sounds just for weather.agi. EXTRAS="extras/" # If you don't have the "extras" sounds installed, look at the less than 25 sound files that are required and copy them over to your system. Install the AGI bash script by... $ mount -o rw,remount / $ cp weather.agi.txt /var/lib/asterisk/agi-bin/weather.agi $ chmod 755 /var/lib/asterisk/agi-bin/weather.agi $ mount -o ro,remount / In your extensions.conf file you will need to define a local extension, 1199 is used here as an example. ; Usage: (Replace "KMLE" using http://www.weather.gov/data/current_obs/) exten => 1199,1,Answer exten => 1199,n,Playback(extras/weather) exten => 1199,n,AGI(weather.agi,http://www.weather.gov/data/ current_obs/KMLE.xml) exten => 1199,n,Hangup You will want to replace the above "KMLE" with an observation point closer to your home. The good news is this data seems to be updated about every 20 minutes, much fresher data then some weather sources. Sorry to those non-USA readers, the data comes from the US National Weather Service. Comments and suggestions are welcome. The information contained herein, can also be found at: http://lonnie.abelbeck.com/share/weather.info.txt Lonnie |