[Tutor] How to detect an incoming phone call?

Brad Chandler mbc2@netdoor.com
Mon, 4 Dec 2000 08:54:17 -0600


I'd like to write a program that can detect an incoming phone call and then
make some kind of sound. The reason behind this is that I only want to hear
the phone ring during certain times of the day (i.e. no 2:00 am phone
calls!). If I can get that to work, then later I'd also like to add some
type of caller id capability, but first things first.

I'm using Linux, USR 56k data/fax modem, and Python 2.0.  How do I listen
for an incoming call? I'm assuming there's a Linux program that will listen
for an incoming call but how do I get my python program to work with that?

Also, is there already a program that will do this? The closest thing I've
found so far is a caller id program written in TCL called Marina, but I
can't seem to get that to work.