[comp.sys.att] Call monitoring by UNIXPC

todd@ivucsb.UUCP (Todd Day) (03/07/89)

In article <92@ihtlt.UUCP> tlt@ihtlt.UUCP (T. L. Todd) writes:
~I would like to connect the line 1 jack to the phone
~line in my house.  I would like to connect the jack labeled phone to
~all the telephones in my house.  In other words the UNIX PC would be
~connected serially in line with all the telephones we use.  I would
~like to monitor all calls made from those phones, not calls made
~through the telephone manager.  

I've done just that.  Originally, I had only the internal modem, so
hooking all the phone lines thru the computer prevented people from
picking up the phone while I was modeming.  The UNIXPC disconnects the
other phone lines from the line while the modem is operating.  When I
got an external modem, people could interrupt my modeming, because the
UNIXPC only disconnected the phones if the internal modem was in use.
I did some kernel hacking, and wrote a couple of programs for external
phone management.  Let me show you a diagram of my setup:

phone line <-> external modem <-> UNIXPC line 1 <-> phones in house

I tried writing programs that did ioctls and tried trapping SIGPHONE, but
to no avail.  Every time the phone was placed off hook, the UNIXPC internal
hookswitch relay would connect the phone.  After doing some kernel hacking,
I found that there was really no way to shut it off, especially since I
wanted to keep the phone manager running.  First, I wrote a program that
opens /dev/kmem and writes NOPs into a few places in the phone monitoring
section of the kernel.  You have the option of disconnecting the outside
lines completely (i.e., UNIXPC never connects the phone), or turning off
the ring to the outside lines, but still let calls be made at any time.

Next, I wrote a ringback monitor.  It monitors the phone line, looking for
single rings.  It will eat the first ring.  If it gets a second ring, it
will connect the outside lines, and the ring goes thru.  If it doesn't get
the second ring, it will set up the modem for autoanswer and put a getty
on /dev/tty001.  The getty will die in 30 seconds if no one logins in, and
the program gets respawned by init and resets the modem.

To trap SIGPHONE, I had to do some kernel hacking, because I wanted to keep
the phone manager alive.  It seems the SIGPHONE only gets sent to the first
process that open /dev/ph0.  Since I wanted to keep the phone manager alive,
I temporarily patch the kernel allowing me to take SIGPHONE.  Then, every
time SIGPHONE gets trapped, I do a kill(-1, SIGPHONE).  This sends the
SIGPHONE to the phone manager, allowing it to do its work properly.

BTW, the way I have it set up, phone mangager logs all incoming and out-
going voice calls, but only records the number dialed if it was dialed
from the phone manager.

If anyone is interested in the above hacks, I could mail them to them.
The patches are for 3.50, but it would be very easy to find the addresses
for other versions by using "sdb /unix" and using the unix.sym table in
/etc/lddrv.
-- 
-Todd Day-
Internet: todd%ivucsb.UUCP@anise.acc.com
    UUCP: {pyramid, ucbvax}!ucsbcsl!nessus!ivucsb!todd
   Other: todd@ivucsb.UUCP may not work yet.

richard@uhccux.uhcc.hawaii.edu (Richard Foulk) (03/12/89)

} ~I would like to connect the line 1 jack to the phone
} ~line in my house.  I would like to connect the jack labeled phone to
} ~all the telephones in my house.  In other words the UNIX PC would be
} ~connected serially in line with all the telephones we use.  I would
} ~like to monitor all calls made from those phones, not calls made
} ~through the telephone manager.  
} 
} I've done just that.  [...]

Sounds like some useful stuff but I think there's a nasty problem
with the unix-pc that kind of screws things up...

When I first played with the phone-manager stuff I found that if
I connected my phone through the 'pc that if I had to shut it down
for some reason, that the phone would not function.

As long as power to the computer was off the phone would not ring,
dial or anything -- it was completely dead.


Richard		richard@uhccux.uhcc.hawaii.edu

todd@ivucsb.UUCP (Todd Day) (03/14/89)

In article <3449@uhccux.uhcc.hawaii.edu> richard@uhccux.UUCP (Richard Foulk) writes:
~When I first played with the phone-manager stuff I found that if
~I connected my phone through the 'pc that if I had to shut it down
~for some reason, that the phone would not function.
~
~As long as power to the computer was off the phone would not ring,
~dial or anything -- it was completely dead.

Hmmmmm... that's funny.  With my UNIXPC, when the computer is off, the
handset relay is CLOSED.
-- 
-Todd Day-
Internet: todd%ivucsb.UUCP@anise.acc.com
    UUCP: {pyramid, ucbvax}!ucsbcsl!nessus!ivucsb!todd
   Other: todd@ivucsb.UUCP may not work yet.

hartman@abacab.UUCP (Mark A. Hartman) (03/15/89)

In article <3449@uhccux.uhcc.hawaii.edu>, richard@uhccux.uhcc.hawaii.edu (Richard Foulk) writes:
>
> When I first played with the phone-manager stuff I found that if
> I connected my phone through the 'pc that if I had to shut it down
> for some reason, that the phone would not function.
> 
> As long as power to the computer was off the phone would not ring,
> dial or anything -- it was completely dead.

Phones connected to either of my 3B1's work fine when the computer is
shut down.  You may have some hardware problems...

#include <standard disclaimer>

-- 
Mark Hartman			{att,obdient}!abacab!hartman