SOLVED Weather By Zip "Improved" Again

Trimline2

Guru
Joined
May 23, 2013
Messages
524
Reaction score
96
Appears that the Weather by Zip has been broken again due to NWS page changes. Has anyone else noticed?
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,202
Reaction score
5,224
Trimline2: Fixed...

Code:
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
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,202
Reaction score
5,224
Update has been pushed out to all most Incredible PBX servers. See below.
 

Trimline2

Guru
Joined
May 23, 2013
Messages
524
Reaction score
96
Ward - Here's a twist. You can toggle between Flite (Jason) and Googlettes (Sally).

For extensions_custom.conf:

Code:
;# // 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

You do need to add to nv-weather.weather.zip after line 465 - "$retcode2 = system ("cp $tmptext /tmp/weather.txt") ;"

Code:
$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") ;

This simply adds the extracted weather report to the /tmp file for Googlettes to read. Toogle back and forth by commenting/uncommenting the reporter... :)
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,202
Reaction score
5,224
jrglass: Forgot we had moved to SQLite 3 as a test. Here's the fix, and we'll push it out...
Code:
sed -i 's|nv-weather-zip-sqlite3.php|nv-weather-zip.php|' /etc/asterisk/extensions_custom.conf
asterisk -rx "dialplan reload"
 

Trimline2

Guru
Joined
May 23, 2013
Messages
524
Reaction score
96
Update has been pushed out to all most Incredible PBX servers. See below.

Sigh, today I see the below. I wonder if changes to the pages have happened yet again...

Code:
[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)

I do see in the log the zip and city is correct, but no /.../tts wave file is created.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,202
Reaction score
5,224
Trimline2: NWS is getting uglier. Not sure why a public weather site funded by taxpayer money would go to such extreme lengths to blow us out of the water, but that's exactly what they did. Somebody seems to have forgotten what the 'S' in NWS stands for. :001 9898:

Going forward, they'll have to break Google Chrome compatibility or rewrite their code (which takes much longer and is more expensive) to keep us out. Of course, these clowns have nothing better to do, but at least they won't detect our TTS access any more. Now we look just like any other Chrome browser session.

New fix is posted and we'll push it out. Or you can grab it yourself:
Code:
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
 

Jay Deal

Phhhhhhhhttttttt :)
Joined
Dec 26, 2013
Messages
267
Reaction score
85
They would say "We're here to help you"........

Why is it in this world now, everything useful you come to count on goes to :001 9898:? I just want to know.
 

Members online

Forum statistics

Threads
25,816
Messages
167,785
Members
19,246
Latest member
rahee
Get 3CX - Absolutely Free!

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.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top