Mr Fab wrote:
> Recently my ISP got mad at me for leaving my computer connected all the time and
> I was forced to go to a dial on demand set-up. This is no problem when I am at
> home and need to connect, but when I am out and about I have no way to get to
> my computer without calling home and having someone ping or something. Anyway,
> I thought it would be cool to have a program, probably started by the ip-down
> script, that would listen to the modem and when it detected the ring it would
> answer and quickly hang up, next ping or something to get the network up, then
> exit. Then when the internet connection timed out and disconnected, the ip-down
> script would start it again and wait for the call. I guess that for connecting
> manually while sitting at the machine, you could tell the program to exit in the
> ip-up script. This setup would probably only be useful for people with a line
> dedicated to their machine that they can't stay connected on all the time.
I'm fairly sure that someone's already implemented this, although I
don't have any references to hand.
> Anyway, I was just looking for some thoughts on how to implement this. I am a
> novice C programmer at best and any ideas would be greatly appreciated.
Open the appropriate /dev/tty* device (or arrange to have it opened
and passed as stdin) and set the appropriate line settings. Send it an
appropriate init string (i.e. disable auto-answer and enable status
reporting). Then just read from it; you should get the string "RING"
when a call is made.
--
Glynn Clements <[EMAIL PROTECTED]>