The xringd Linux extended Ring server will listen on a modem device for specific ring-delay patterns (sequences). Each sequence, when fully recognised, will execute a command you have chosen (subject to usual unix permissions). Delays are in fact delay ranges. Sequences and commands are read from a a configuration file. xringd does not disturb your other modem programs, not even your getty. It coexists with them. xringd probes (asynchronously) for the actual RING signal on the serial line.
R secs[-secs] [ R secs[-secs] ] ... : command
Each line is related to a sequence(pattern) that can be potentially matched. The command at the end gets executed if the sequence was fully matched. A full match is found if the delays between the rings are within the delay ranges given in the configuration line of a sequence. A full match will also reset the state machine. It will start accepting new rings as when run the first time. R means ring and it should always be the first symbol in a sequence.
Comment lines start with a ``#'' symbol at the beginning of the line. Empty lines are ignored.
Note that command lines options can also be included in the config file. A line should start with the '-' of an option. See example below. Options -c and -n are ignored in the config file. Options in the configuration file take precedence over the ones in the command line.
# xringd configuration file -- sample # -a /usr/local/audio/bin/play /usr/local/lib/sounds/ring.au -l 100 # # 2 rings 10-16 sec apart followed by 30 secs silence R 10-16 R 30 : /etc/ppp/ppp.start office1 # 3 rings 10-20 sec apart followed by 20 secs silence R 10-20 R 10-20 R 20 : /etc/ppp/ppp.start office2 # 2 nearish rings then 1 ring after 20-26 secs, silence for 30 secs R 1-5 R 20-26 R 30 : /usr/local/bin/turn-heater on
You have to use a proper serial cable for this to work. A cable with all pins properly connected to your modem (especially the RI line for this program!) and serial port will save you any trouble. Internal modems should normally work.
If you activate a program which uses the modem after ringd it should normally flush the input buffer. In many cases you will have a few "RING" strings in your serial tty buffer that will most likely confuse a dialup script (eg. chat).
The richness of the ring-delay pattern "language" is not great. However, you certainly have many possibilities. Beware of overlaps though, and always have something that will "unlock" any current sequence (eq. 4 consecutive rings that safely exit from any current state).
If someone calls in while you are on the delay phase of your "pattern" then you are obviously out of luck.
Only tone dialing phones allow quick dial that can meet short timing restrictions possibly imposed by your configuration file. Make sure you use the redial button on the calling phone if there is one - you will be able to "dial" in about a second. Pulse dialers may introduce unexpected delays. If they are your only choice, use longer delays and wider delay ranges.
It was reported by a user that the "rings" you hear on the calling handset do not directly correspond to the ones actually heard on the receiving end. In the tests done with xringd in a few countries, the number of rings remained the same on calling and called set. Just leave each one of the rings you hear on the calling end to "settle" (do not break them before they finish). A delay between a ring heard on the caller set and the equivalent one on the called one was noticed but causes no problem for xringd. Feel free to send me your comments on this.
Many getty-like programs may be configured to pick up the phone on the first ring. Obviously, this will make xringd minimally useful. Make your getty to reply after 2-4 rings so that you have many possibilities open for xringd.
pppd (and probably some other programs) like to hold a tty in exclusive mode. Make sure you start xringd before such programs, otherwise it won't be allowed to open the modem device. Also, when such a program closes it may leave the line hung up. You need to restart (kill -HUP) xringd in such a case. It does not make sense to run xringd on a line which is permanently used for PPP/SLIP - such a line never "rings"!
Spurious interrupts (and thus pseudo-RINGs) may occur during modem switch on/off; run xringd after your modem is switched on.
It is highly recommended - for security reasons - to make the configuration file inaccessible (even for read) to anything but xringd. Treat it as a shadow-password-like file. It is very easy for anyone to call your number and activate a command, if they know a RING-delay sequence "password". So try not to disarm your home-alarm via it. You have been warned!