Synchronizing Phone Numbers

4 January 2000

I got tired of maintaining addresses and phone numbers in several different locations - home computer, work computer, home phone speed-dial buttons, work phone speed-dial buttons, palm III, cell phone.  So I decided to do what I could to minimize the number of  things I have to maintain.

The most current list is always on the palm III, so that is treated as the master source.  I wrote a perl filter for the output of the 'addresses' program from the pilot-link package.  This filter produces  an HTML file with a table that contains one column for each of: name, home phone, work phone,  mobile phone, and email address.  This file is placed on a web server that requires a password for access (so that I'm not exposing my list of addresses and phone numbers to the whole world), and uses OpenSSL to protect the password  (so that snoopers can't get it).

If you click on the home phone  number or work phone number, the link associated with these is of the form https://localhost/cgi-bin/dial.cgi?number.  This  allows a remote web server to invoke a local dialer.  Unfortunately, netscape on UNIX doesn't allow me to define handlers for new URI types;  if it did, I would have used a tel: URL.
Naturally the email address link is to a mailto: URI.

The dialer itself uses an ordinary modem with an AT command-set.  It uses the 'chat' program supplied with NetBSD to tell the modem to dial a number, stay off hook for a few seconds, and then hang up.  Unfortunately, 'chat' wouldn't work by itself to talk to the modem, because of modem control wierdness.  So I wrote a program called 'ttychat' which sets up the terminal properly and then calls 'chat' with the right arguments.  The whole thing is enclosed in dial.cgi , which is a shell script that does the appropriate prefix munging for the phone number and then dials it.

The way I use this is I have the modem wired to the same circuit as an ordinary phone with a speakerphone button.  I press the speakerphone button, then click on the link.  The computer dials the number.
 

Software:

get-addresses.perl
ttychat.c
dial.cgi
411 (see below)
 

Future plans:

The web interface is a bit awkward - in order to use it I may have to: (1) fire up a web browser, (2) visit the addresses.html page, (3) type in a password, (4) find the appropriate entry, (5) hit the speakerphone button, and finally (6) click on the appropriate phone number.  So it would be nice to streamline this.

For years I have had a file called PhoneBook in my home directory in a very simple format: a new entry starts with a nonblank character in column 1.  The first line of an entry is of the form

name                home-phone        work-phone        email-address
with other information (snail-mail address, etc) on subsequent lines.  Then there is a simple script called '411' that searches this  file for any entries matching a name and prints out the entire entry.    It should be simple to write a perl script to convert the output of 'addresses' to this format, then I would have way to sync the palm III's address book with my familiar command-line interface.   And I could write another small script which would dial the home or work phone number of the matching entry.  (e.g. 'phone -home Jim')   Since I spend most of my time typing to shells rather than clicking on browsers, this would be nice.

The current setup essentially gives me an easy way to replicate the phone number database from the palm III to my home computer and work computer.  If I uses the autodialer on each of these computers, I don't use the speed dial buttons on the phones.  So this covers most of the bases.  But I would also like to have a program that downloads this to my cell phone.  This would be a bit tricky, because for the cell phone people's names would need to be abbreviated, and it would have to create multiple entries for home, work, and mobile as opposed to having multiple links in the same entry.  Also, there's not enough room in the cell phone to store all of the numbers that are in the palm III, so I'd have to have some way of  deciding which ones to include.  And the cell phone it's fairly important to have certain phone numbers associated with certain speed dial numbers (e.g. '1' is used to forward my home phone to my cell phone, '4' is to call my mother, etc.).   Probably I'd have to usurp one of the 'other' fields in my palm's address book to have a way of indicating whether to include this entry in my cell phone, how to abbreviate the name, and which speed dial number to use.  And of course I'd have to write some software to download this to my cell phone.