;# // BEGIN Weather by ZIP
exten => 947,1,Answer
exten => 947,2,Wait(1)
exten => 947,3,Set(TIMEOUT(digit)=7)
exten => 947,4,Set(TIMEOUT(response)=10)
;exten => 947,5,agi(googletts.agi,"Hello. This is Sally at the Ward Mundy Telephone Company. At the beep enter the five digit zip code for the weather report you wish to retrieve.")
exten => 947,5,Flite("This is Jason at the Ward Mundy Telephone Company. At the beep enter the five digit zip code for the weather report you wish to retrieve.")
exten => 947,6,Read(ZIPCODE,beep,5)
;exten => 947,7,agi(googletts.agi,"Please hold a moment while we contact the National Weather Service for your report.")
exten => 947,7,Flite("Please hold a moment while we contact the National Weather Service for your report.")
exten => 947,8,AGI(nv-weather-zip.php,${ZIPCODE})
exten => 947,9,NoOp(Wave file: ${TMPWAVE})
;exten => 947,9,Set(foo=${FILE(/tmp/weather.txt)})
;exten => 947,10,agi(googletts.agi,'"${foo}"')
exten => 947,10,Playback(${TMPWAVE})
exten => 947,11,Hangup
;# // END Weather by ZIP
$msg = chr(34) . "Your report was successfully downloaded. Please stand bye." . chr(34) ;
execute_agi('EXEC $tts $msg') ;
//$retcode2 = system ("flite -f $tmptext -o $tmpwave") ;
$retcode2 = system ("cp $tmptext /tmp/weather.txt") ;
$retcode2 = system ("$tts -f $tmptext -o $tmpwave") ;
Update has been pushed out to all Incredible PBX servers.
Give me the ZIP code you are using so I can try it.
Update has been pushed out toallmost Incredible PBX servers. See below.
[2015-04-05 16:23:39] VERBOSE[18195][C-0000000e] res_agi.c: -- Launched AGI Script /var/lib/asterisk/agi-bin/nv-weather-zip.php
[2015-04-05 16:23:40] VERBOSE[18195][C-0000000e] res_agi.c: -- <SIP/49701-00000021>AGI Script nv-weather-zip.php completed, returning 0
[2015-04-05 16:23:40] VERBOSE[18195][C-0000000e] pbx.c: -- Executing [947@from-internal:9] NoOp("SIP/49701-00000021", "Wave file: ") in new stack
[2015-04-05 16:23:40] VERBOSE[18195][C-0000000e] pbx.c: -- Executing [947@from-internal:10] Playback("SIP/49701-00000021", "") in new stack
[2015-04-05 16:23:40] WARNING[18195][C-0000000e] app_playback.c: Playback requires an argument (filename)
cd /var/lib/asterisk/agi-bin
rm -f nv-weather-zip.*
wget http://nerdvittles.com/trixbox123/nv-weather-zip.zip
unzip nv-weather-zip.zip
rm -f nv-weather-zip.zip
chown asterisk:asterisk nv-weather-zip.php
chmod 775 nv-weather-zip.php
Link up your team and customers Phone System Live Chat Video Conferencing
Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.
Check your inbox!
We’ve sent you an email. Click on the button in the email body to verify your email address – (if you can not find it, check your spam folder).
Upon verification you will be directed to the 3CX setup wizard.