Subj : syncWXremix and Dial-up
To   : KenDB3
From : Digital Man
Date : Wed Jan 06 2016 10:12 pm

 Re: syncWXremix and Dial-up
 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 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 the
>  DM> IP address of the BBS computer, or possibly 127.0.0.1 (I forget which).
>  DM> You can programatically detect a SEXPOTS/dial-up connection by checking
>  DM> if user.connection is a number (e.g. "28800") rather than a protocol
>  DM> 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 know
>  DM> 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/astronomy/
> 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).

For a dial-up connection (via SEXPOTS), the user.ip_address property could
either the caller-ID information (if provided by the modem) or the IP address
of the SEXPOTS proxy (e.g. 127.0.0.1).

Is dialup not being set to true (in your code) for the dial-up connection?

Some more debug-level log output could help identify exactly what's happening
here.

                                           digital man

Synchronet "Real Fact" #66:
SEXYZ is as a 32-bit replacement for [F]DSZ, CE-XYZ and other protocol drivers.
Norco, CA WX: 48.0�F, 92.0% humidity, 0 mph WNW wind, 0.60 inches rain/24hrs

---
� Synchronet � Vertrauen � Home of Synchronet � telnet://vert.synchro.net