[comp.sys.att] Checking the phone/Screen

michael@maui.cs.ucla.edu (06/24/89)

I want the Unix-PC to beep whenever line one rings (for example,
if I'm using line 2). If I can read the contents of /dev/w2 (the
phone manager's window), this would be easy; just read it and look
for "RING".
 
Alternativly, if I could find out when the phone is ringing, without
interfearing with the current phone manager, then I could do it.

Does anyone know how to do either of these, or if not, another
way to accomplish this beeping?
			Michael

todd@ivucsb.sba.ca.us (Todd Day) (06/25/89)

In article <25203@shemp.CS.UCLA.EDU> michael@CS.UCLA.EDU (michael gersten) writes:
~I want the Unix-PC to beep whenever line one rings (for example,
~if I'm using line 2). If I can read the contents of /dev/w2 (the
~phone manager's window), this would be easy; just read it and look
~for "RING".
~ 
~Alternativly, if I could find out when the phone is ringing, without
~interfearing with the current phone manager, then I could do it.

What I had to do was actually modify the kernel (3.50) temporarily
so that I could gain control of SIGPHONE.  It seems that SIGPHONE
only gets sent to the process that opens the phone device first.
Since phone manager is the first to do this, no other process
can get ahold of it.  Basically, my patch to the kernel simply
NOPS the code that checks to see if the phone device is already
open.  Then, the address of my process is set up for the signal.
This removes the signal going to the phone manager, however, so
every time I get the signal, I do a kill(-1, SIGPHONE) so SIGPHONE
gets sent to everyone!  However, since the default for SIGPHONE is
SIGIGN, you don't have to worry.

Why did I have to do the modification in the first place?  Why doesn't
the kernal send SIGPHONE to all processes that want it?  Anyone?

Someday when I finish unpacking all my stuff, I'll bind up my
ringdaemon and send it to the net.

-- 

Todd Day | todd@ivucsb.sba.ca.us | ivucsb!todd@anise.acc.com
"All theory, no practice.  That's the story of my life."