Audrey caller ID 1.1

This application displays names and phone numbers of incoming calls.
It can use the Audrey's builtin modem to monitor calls, and it can
broadcast the caller information over the network to both Audreys and
Windows PCs.  It can also receive call notifications from a PC with
a caller ID modem.  The software on the PC side, and the inspiration
for this program, is Jeff Kohn's "CallerID Sentry," which you'll find at:

http://home.houston.rr.com/jeffkohn/callerid_sentry.htm

You need to subscribe to caller ID service from your phone company for
this to work.  Most phone companies do not include caller ID as part
of basic phone service.


INSTALLATION/USAGE:

Put callerid in your favorite binaries directory, such as /nto/bin.

You'll probably want to run it in one of your system start scripts,
such as /kojak/go.  Make sure you don't run it until after your network
filesystems are mounted, if you've put it on another computer.  The
following command line options are supported (you can get this list
by running "use callerid"):

   -c host
	Acts as a network client.  The modem is not used when this
	option is specified.  Connects to the specified hostname at
	the port number specified by the "-p" option.
   -f dbfile
	Uses a phone number database.  The file should be a textfile
	with one entry per line.  Each entry is a phone number (no
	spaces or dashes or parentheses), whitespace, and the name
	to display when a call comes in from the number.  For example,
		4159821001	Joe's Pizza Parlor
	If an incoming phone number isn't listed in the database file,
	the name from the caller ID message is used.
   -l logfile
	Logs incoming calls to the specified file.  If the filename
	is "-", logs to standard output.  Default is to not log calls.
	This option may be specified along with "-w" to both pop up
	a window and log to a file.
   -m modem
	Uses a modem device other than the default of /dev/modem1.
   -p port
	Listens on a UDP port other than the default of 4550 when
	acting as a server.  When acting as a client, this is the port
	number to connect to on the server.
   -r secs
	Reconnects to the server at the specified interval.  Only
	meaningful in client mode.  If you don't specify this and the
	server is restarted, your client won't notice and will never
	receive any call notifications.  Unless it's critical to never
	miss a call, set this to something like 300 (5 minutes).
   -v
	Spits out verbose status information.
   -w
	Pops up a window, flashes the Audrey's LEDs, and turns off the
	screensaver when a call comes in.  Valid in both server and
	client mode.  Without this option, a message is output to the
	terminal for each call.

A few examples should cover most usage cases.

Pop up a window whenever a call comes in on the local Audrey's modem:
	callerid -w
The same, but look incoming calls up in a phone database:
	callerid -w -f /my/phone/database.txt
Act as a server, no popups or logging:
	callerid
Act as a client (either a PC or an Audrey can be the server), popping up
a window when a new call comes in:
	callerid -c serverHostname -w -r 300
Act as a server, logging to a file when a call comes in:
	callerid -l /my/phone/log

If the -l option is specified, calls are output to the log (or the terminal
if the filename is "-") in the following format:

1122 1448 INCOMING CALL: name 'grimm steven   ' number '(408) 111-2222'

The first two fields are the date and time from the caller ID message.
Standard output is flushed after each incoming call, so if you want to
redirect cidserver's output to a file, you should be able to monitor it
with "tail -f" or "less" and see calls as they come in.  You could also
pipe it to another program to display the calls in a prettier format.

The Audrey's caller ID, on my phone line, is slightly less reliable than
the caller ID on my phone.  Sometimes a call will come in and the phone
will ID the caller but the Audrey won't.  I've found that plugging a
phone into the Audrey (so I have two phone cords plugged into it, one to
the wall and the other to a phone) greatly increases the Audrey's success
rate.  Why that'd be, I don't know.


AUTHOR

Steven Grimm, koreth-audrey@midwinter.com


HOME PAGE

http://culdesac.midwinter.com:8009/audrey/
(Not pretty, but you'll find the latest version there.)


BUGS

The network protocol doesn't include timestamps on calls, so the code uses
the current time when it receives a call message.  That means that if a
second call comes in while the code is waiting for you to dismiss a popup
window, the timestamp on the second call will be wrong.  A workaround is
to log your calls on the server side; then you can look at the log if you
need to know when a call came in.


TO DO

Populate the phone number table from the Audrey's address book database as
well as the text file.


HISTORY

2001/11/24	Version 1.0 released.

2001/11/25	Added -l option.  Added local timestamping of network
		calls.  Version 1.1 released.

2001/11/29	Integrated change from davinci27 to flash LED and turn
		off screen saver when a call comes in if -w is specified.

		Made modem initialization a bit more robust so the app
		should start more reliably.

		Restructured modem input code path a bit so we can handle
		getting a NAME without a NMBR or vice versa.  Previously
		the code silently ignored calls that didn't contain both.

		Version 1.2 released.
