Subj : syncWXremix and Dial-up To : Digital Man From : KenDB3 Date : Thu Jan 07 2016 01:22 am Re: syncWXremix and Dial-up By: Digital Man to KenDB3 on Wed Jan 06 2016 10:12 pm DM> Re: syncWXremix and Dial-up DM> By: KenDB3 to Digital Man on Wed Jan 06 2016 10:23 pm > DM>> Re: Re: Sync Weather App - syncWXremix > DM>> By: KenDB3 to tbirdsradio on Fri Jan 01 2016 08:11 am > >>> Re: Re: Sync Weather App - syncWXremix > >>> By: tbirdsradio to KenDB3 on Thu Dec 31 2015 09:34 am > > tb>>> Once again i got ahead of myself. Dial up user phoned in and > > tb>>> received this error: > > tb>>> "Error in weather.js api.underground.com returned a > > tb>>> 'querynotfound' error with this description. 'No cities match > > tb>>> your >> search query'." > > tb>>> Do i have the above right? > >>> That's all correct. I just didn't account for dial-up users. Mainly > >>> because I don't have any dial-up access, it didn't really dawn on me. > >>> Can anyone shed some light on how I might test for this scenario? > >>> I'm guessing the user's IP comes up as undefined in this case? > DM>> Assuming the BBS is using SEXPOTS, the user's IP address should be > DM>> the IP address of the BBS computer, or possibly 127.0.0.1 (I > DM>> forget which). You can programatically detect a SEXPOTS/dial-up > DM>> connection by checking if user.connection is a number (e.g. > DM>> "28800") rather than a protocol string (e.g. "Telnet"). > DM>> Something like this: > DM>> var dialup = (parseInt(user.connection) > 0); > DM>> At least, I think would work (without actually trying it). Let me > DM>> know how it works for you, >> DM, I was hoping you might be able to help point me in the right >> direction on this. tbirdsradio had a chance to try out the new >> version from GitHub that used >> this bit of code (but had no luck): >> var dialup = (parseInt(user.connection) > 0); >> function getQuerySuffix() { >> var qs; >> if (dialup === 'true') >> { >> if (fallback_type == 'nonip') { >> qs = fallback + '.json'; >> } else { >> qs = 'autoip.json?geo_ip=' + resolve_ip(system.inet_addr); >> } >> } else if (user.ip_address.search( >> /(^127\.)|(^192\.168\.)|(^10\.)|(^172 >> \.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1] >> \.)|(^169\.254\.)|(^::1$)|(^[fF][cCdD])/ ) > -1 >> ) { >> if (fallback_type == 'nonip') { >> qs = fallback + '.json'; >> } else { >> if (client.protocol === 'Telnet') { >> qs = wstsGetIPAddress(); >> } else if (bbs.sys_status&SS_RLOGIN) { >> qs = wsrsGetIPAddress(); >> } >> if (typeof qs === 'undefined') qs = resolve_ip(system.inet_addr); >> qs = 'autoip.json?geo_ip=' + qs; >> } >> } else { >> qs = 'autoip.json?geo_ip=' + user.ip_address; >> } >> return qs; >> } >> var wungrndQuery = getQuerySuffix(); >> ********** >> However, tbird is still seeing an error when the app is launched at >> Logon and also as a Door/External for his dial-up user. >> DEBUG for weather.js API call looked like this at the time of error: >> http:// >> api.wunderground.com/api/XXXXXXXXXXXXXXXX/conditions/forecast/astronom y/ alerts/q/autoip.json?geo_ip=812XXXXXXX >> (Blocked out API and last 7 of phone number). >> Any thoughts as to why I am missing catching this scenario? It's got >> me boggled >> and I can't really see it. >> Thanks for any help you can lend (and sorry for the long post). DM> For a dial-up connection (via SEXPOTS), the user.ip_address property could DM> either the caller-ID information (if provided by the modem) or the IP DM> address of the SEXPOTS proxy (e.g. 127.0.0.1). DM> Is dialup not being set to true (in your code) for the dial-up connection? DM> Some more debug-level log output could help identify exactly what's DM> happening here. Good point, I don't know what's happening to "dialup" during this process. I do know that the phone number is being dropped into user.ip_address and that's where the query string is failing. I'm just not catching it. I'll add some DEBUG to grab "dialup" and I think user.connection as well. Thanks DM! ~KenDB3 --- þ Synchronet þ KD3net-Rhode Island's only BBS about nothing. http://bbs.kd3.us .