Connecting to an analog dial-in PSTN terminal without a PSTN line

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.


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.