Modem control program

John B. Milton jbm at uncle.UUCP
Tue Sep 13 11:43:44 AEST 1988


Below is the text of a posting I just made to comp.sys.pyramid and
comp.dcom.modems. I should have cross posted...
--
I modified a program that was posted to the net a while back "modem-ctl". I am
using this program on a UNIXpc connected to a TB. I did not know about the
+128 tty device until after I finished. All the line access is done by opening
the line with O_NDELAY, doing an ioctl() with CLOCAL turned on, then a fcntl()
to turn off O_NDELAY so things work right again. Neat trick.

This program is run by init. It talks to the modem to set it up to answer a
call, right now using HAYES commands. It spends most of it's time hanging in
a read waiting for "RING". After each character it reads, it does an access()
to check for the lock file. If it sees a lock file, it immediately exits.
There are a few side effects to this. As long as this program has the line
open, any other program can come along and open the line, a uucico for
example. When the program exits, init repawns it, and it comes back and finds
a lock file. This time it just waits for the lock file to go away, opens the
line, talk to the modem and waits.

If it gets the RING, it sends ATA to answer the phone, waits a while for
CONNECT xxx, then the fun part. Based on the xxx, it fork() & exec()s an:
/etc/getty -h xxx /dev/ttyzzz
The /etc/gettydefs needs to adjusted a little. As you Bezerkers can tell this
was written for SYSV. What I have seen of BSD termio(7) would make this easier.

A while ago I promissed to post this unix-pc.sources, but what I think I want
to do now is a beta test. All volunteers e-mail me.

Describe your hardware (# of ttys,etc.)
Phone lines (direct, PBX, Datakit, etc.)
Modems (HAYES, TB, etc.)
OS (SYSV, XENIX, BSD)
Typical users (kind, load)
Current setup (weirdness you use for two-way lines)
How much time you have to goof around with it
Whether or not you have a diff that can produce -c (context) diffs
A good e-mail address

I will try to select a good test cross section (or all of you if I only get a
few :). I have a few things to clean up, so I should be ready by the time I get
replies.

If anyone out there has experience with modem-ctl, even if you're not interested
in participating, please drop me a line. BTW the name of the program will (so
far) be prtty (pre tty) I was going to call it pretty, but there is already
a program in the archives by that name.

John
-- 
John Bly Milton IV, jbm at uncle.UUCP, n8emr!uncle!jbm at osu-cis.cis.ohio-state.edu
home: (614) 294-4823, work: (614) 459-7641; CP/M to MP/M, MS-DOS to OS/2



More information about the Comp.sys.att mailing list