[Tutor] How to detect an incoming phone call?

Tim Condit timc@ans.net
Mon, 4 Dec 2000 12:07:57 -0500 (EST)


Hi, 

This is OT. More Linux than Python.

Are you using the modem as a way of diverting the signal? (I'm
terminology impaired; hope that makes sense. :) I'm trying to set
up my Linux box at home as a dialup server, and just yesterday ran
across part of the puzzle, anyway.

[I apologize if this part is a bit confusing. I'm still trying to
sort it out myself..]

To get Linux to listen for an incoming call on a modem, you need
to identify the modem (or more specifically it's port assignment)  
to Linux. Set one of the gettys (mgetty?) in /etc/inittab to point
to your modem. It might be something like /dev/modem, which itself
is a symbolic link to your modem's "real" name as listed in /dev
directory. You only want the (port?) name, NOT the full pathname.
For example, if your modem uses the second serial port, you'd
enter 'ttyS1', not '/dev/ttyS1'.

Use the example at the end of the /etc/inittab file as a hint. But
be sure to back up that file first, and don't reboot your machine
until you're done experimenting with the phone/modem! Probably
nothing too drastic will happen, if you leave the rest of the file
alone, but if you reset the runlevels or something in there, you
may have trouble.

Sorry, can't help you on the question of how to find your device
name for the modem. It's probably not too difficult, though. If
you're using it for dialout, you've probably got a chat script or
similar in /etc (or maybe /etc/ppp/ ) directory that will identify
the modem for you.

That's not the whole job though, as your modem itself may need
some configuration to tell it to accept incoming calls. That's
vendor specific, I suspect. 

Here's a link to the Linux Dialin Server Setup Guide: 
http://www.linuxgazette.com/issue38/gentry.html


HTH,
Tim 


On Mon, 4 Dec 2000, Brad Chandler wrote:

> 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.
> 
> 
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://www.python.org/mailman/listinfo/tutor
> 

-- 
Tim Condit                                    tcondit@uu.net
UUNet Network Quality Services                  734-214-7548

.. I said that the only thing that would change that is if we didn't
report up the same chain of management .. he said that wasn't gonna
happen .. and I said .. then I don't know what you're gonna do.