8

there's a computer ("server") that has no Internet connection, and it is located in a place with no GSM signal. The only way to get connection to it is an analog modem (US Robotics 56Kbit/s). This modem is connected to a national PSTN line with a geographical number, and the server (running a modern Linux distribution) is configured to offer a dial-in serial terminal. To clarify, when you phone to this PSTN line, the modem handshakes (I think it's the V90 protocol), then you're presented with the login and then you are in on ttyS0. There's no IP/PPP protocol stack, just the serial terminal.

I would like to connect to this server in any way that does not require me to carry around a physical analog modem and (what's worse) finding around a physical PSTN line which is really a scarce resource at least in business context here in Italy. To clarify: the PSTN line on the server side is the only way through, but I would like to be able to connect to it without a physical PSTN line on the client side.

Some ideas that came through my mind but I do not know if they can be really implemented or not:

  • Having a mobile phone connected through bluetooth/USB. Old phones exported a ttyUSB that handled AT commands, but then there was no way (AFAICT) to get the audio stream. I don't know if it's technically possible to write an Android app that makes a phone call, then encodes the audio into a semi-raw UDP stream.

  • Routing the call through VOIP. Googling around, some people seems to have had mixed success with doing analog modem calls through a VOIP termination with g711 (uLaw/aLaw). It looks like it is possible to get at least 9600bps, which is enough for me.

  • Even if one of the above is possible, is there any software available that emulates the full V90 protocol/handshake/whatever and en/decodes audio into bytes?

  • Is there any online service that offers a battery of analog modems to subscribers? Doesn't sound a business I would personally invest on, but you never know :)

  • Is there any physical object that is the modern UMTS equivalent of an analog modem, like a box connected through USB where you put the SIM inside, it does all the magic, and gives you a ttyUSB on your PC?

  • Assuming that I can physically access the server just once, is there anything I can install (either hardware or software) on the server and that would make my life easier? The only requisite is that must go through a standard national PSTN line (dual twisted copper), there's no other way to get any other signal. The modem looked like the best option, at first, but you never know.

Thanks!

Giovanni Bajo
  • 405
  • 3
  • 9

3 Answers3

4

I suspect there are lots of ways to do this. One that comes to mind is callback.

You register a dialin ISP account for the modem on the server; that's simple enough, and non-contentious. You will need an ISP that will allocate you a static address; if this costs extra, pay it.

You then configure something like diald to bring the link up and down on demand. Then write a little script, perhaps using swatch, to detect "RING" messages appearing in the modem logfiles, and when it sees them, to generate traffic that diald considers "interesting" - ie, traffic that causes it to bring up the line.

When you want to connect to the server over the regular internet, you call the phone line attached to the server, from any landline or GSM phone. The script on the server detects the phone RINGing, and generates interesting traffic for diald. Diald brings up the PPP connection, at which point the server is available on the known, static IP address.

You, using regular internet tools, connect in via SSH (or any other IP protocol or combination thereof which pleases you), until you're done. When you're done, you drop all these connections, and after a short while diald realises the line is idle and hangs up the modem.

Rinse. Repeat.

Possible enhancements: if you can't get an ISP service that does static addresses, you could configure diald so that the first thing that happens after the internet link comes up is that it emails it's current IP address to a pre-arranged address, or in some other way communicates it to the internet. That way you can find out what dynamic address it's got each time the line comes up, so you can talk to it. But a static address would be easier.

Alternative suggestion: consider that most GSM phones will happily make a PPP connection to any old POTS number, to establish the terminal session. I wrote this technote some years ago on the nuts and bolts of getting a GSM phone with a modem that honoured the AT command set (which is most of them) to dial in to an ISP.

It's completely legal to have the GSM phone dial a standard landline instead of the magic "bring up GPRS" number, just replace

atd*99***1#

with

atd0039nnnnnnnn

in /etc/ppp/chat-gprs, where nnnnnnnn is your server's landline number. Note this will only work with GPRS, and maybe EDGE. 3G is a whole different protocol accessed in different ways, so you'll only get a slow (20kb/s or so) connection this way. But for a straight terminal session, that may be enough.

MadHatter
  • 78,442
  • 20
  • 178
  • 229
  • Thank you, I managed to login through a GSM phone (even if not the first one I tried).The callback approach is also interesting even if I am not sure I can actually *make* calls through that landline (will have to check for the billing, etc:), as most (all?) dialup ISP in Italy nowadays directly bills through special phone numbers, sometimes without even requiring a registration. – Giovanni Bajo Sep 05 '11 at 11:01
3

There are a variety of terminal servers on the market -- you telnet/ssh to them and upon connection, you can interact with one or more serial ports on the console server, which are typically hooked via a null-modem cable to other servers. If the server has a serial port, this is the best way to go. You can then use a mobile broadband device to get a connection, and add some dynamic DNS or VPN magic to deal with changes of the IP.

Older GPRS/EDGE USB modules (or handsets with USB) would present as a serial device (ttyUSB or ttyACM) in Linux; it should be possible to switch the server's inittab to bind the getty to that. I've done this in the past with an external (actual-serial-port connected) GSM modem; I'd imagine it should work with USB as well.

If the server has an internal modem, not a serial port, and you can't replace it, things get more complicated. VoIP might work -- the closer to raw PCM, the better the odds are. Fixed wireless terminals (basically a cell phone but with an FXS port instead of a speaker/mic/keypad) might work as well, but are likely to have the same issues as VoIP.

techieb0y
  • 4,161
  • 16
  • 17
  • There's no way to get into the server if not the PSTN line; there's no Internet connection and no GSM signal. – Giovanni Bajo Sep 03 '11 at 07:21
  • Ah, now I understand. The USB stick or phone sugguestion still stands; if you have GSM service where you are, if you treat it just like a normal modem (ATDT phonenumber), it should make a data connection (with the actual modem parts happening within your mobile carrier.) – techieb0y Sep 03 '11 at 14:37
  • +1. Drop a terminal server with a modem and a phone line in your office, with remote access, to dial the server. – petrus Dec 29 '12 at 14:58
0

I'm no t sure I completely understand your requirements. I'll type what I think you are asking and go from there:

1) There's a server with only a pstn line conected to an analog modem. 2) You want to free the phone line (for other uses) and want to keep having accesss to the server.

Iff 1 & 2 are correct, then I don't see other choice but to use some form of internet connection, an USB 3G stick should give you a connection you can tap on via ssh to make any administrative task you may need.

You could also install some sort of xDSL line, that will free your pstn line to use as regular phone and give you internet access at the same time.

MAT
  • 11
  • 2
  • No, I want to still use the PSTN line on the server side (because it's the only thing I can use, there's not GSM signal where the server is located), but I want to be able to connect to it without a physical PSTN line on my side, since I can be anywhere and PSTN lines are scarces. – Giovanni Bajo Sep 03 '11 at 07:21