#!/bin/bash mkdir weatherworld cd weatherworld #cd /var/lib/asterisk/agi-bin wget http://nerdvittles.com/trixbox123/nv-weather-world.zip unzip nv-weather-world.zip rm -f nv-weather-world.zip cp nv-weather-world.php /var/lib/asterisk/agi-bin/nv-weather-world.php chmod 775 /var/lib/asterisk/agi-bin/nv-weather-world.php chown asterisk:asterisk /var/lib/asterisk/agi-bin/nv-weather-world.php mkdir /var/lib/asterisk/sounds/tts chown asterisk:asterisk /var/lib/asterisk/sounds/tts chmod 777 /var/lib/asterisk/sounds/tts sed -i ' /cron.monthly/ { a\ \ 03 0 * * * root rm -f /var/lib/asterisk/sounds/tts/tts* }' /etc/crontab sed -i ' /\[from-internal-custom\]/ { a\ exten => 612,1,Answer\ exten => 612,2,Wait(1)\ exten => 612,3,Set(TIMEOUT(digit)=7)\ exten => 612,4,Set(TIMEOUT(response)=10)\ exten => 612,5,Flite("At the beep enter the code for the weather report you wish to retrieve.")\ ;exten => 612,5,Swift("At the beep enter the code for the weather report you wish to retrieve.")\ exten => 612,6,Read(APCODE,beep,1)\ exten => 612,7,Flite("Please hold a moment while we retrieve your report.")\ ;exten => 612,7,Swift("Please hold a moment while we retrieve your report.")\ exten => 612,8,AGI(nv-weather-world.php|${APCODE})\ exten => 612,9,NoOp(Wave file: ${TMPWAVE})\ exten => 612,10,Playback(${TMPWAVE})\ exten => 612,11,Hangup\ }' /etc/asterisk/extensions_custom.conf echo Worldwide Weather Forecasts installation completed. To use, dial 612. Before first use, execute this command: amportal restart