he Calling Number Delivery (CND) service, commonly known as caller ID, allows phone users who have caller ID-compatible equipment to receive identification information about incoming calls, including the calling party's directory number, the calling party’s name, and the date and time of the call.
Many modems on the market today offer caller ID support, allowing a computer to consume caller ID information just like a phone or caller ID box might. In the Java world, the Java Telephony API (JTAPI) was meant to process caller ID information, as well as address other telephony-related programmatic needs. Unfortunately, the JTAPI documentation for consuming caller ID information is practically non-existent.
|Figure 1. YAC Residing in the Tray Notification Area|
While trying to figure out how to accomplish this task, I came across a Windows program named YAC, a software-based caller ID system that makes consumption of caller ID information using Javaand virtually any other programming language via which you can listen to socketsstraightforward.
YAC stands for "Yet Another Caller ID Program." Jensen Harris wrote the source code in C++, and he distributes it under the GNU General Public License. This tutorial uses YAC to send caller ID information to a Java consumer and then leverages the JavaMail API to distribute the information to users via email. Fortunately, you don’t have to use the Java Native Interface (JNI) to do this, as YAC allows you to consume caller ID data via sockets.
Screen Calls on Your PC
Go ahead and download YAC
. Look for the download labeled "YAC for Windows (includes Server and Listener)". At the time of this article’s writing, YAC was in version 0.16.
|Figure 2. YAC Notifying Listeners of Incoming Calls and Their Caller ID Information|
To report caller ID information, YAC requires that you have a caller ID-compatible modem installed and that you are subscribed to receive caller ID information from your telephone service provider. YAC uses a client/server setup to notify "YAC Listeners" on a network about incoming calls. So with the YAC server installed on a machine with a caller ID modem, you can send caller ID information received to registered YAC clients. I personally use YAC to send caller ID information to my laptop wirelessly, so I can screen my calls (my place is usually too much of a mess to find the phone and see who is calling!).
If you are interested in simply having a Windows program that displays caller ID information, YAC works great. Simply unzip the YAC zip file you downloaded and run the setup program. The setup is pretty straightforward. Upon your first invocation of YAC, you will be asked to choose the modem to which YAC will listen. After that, YAC places an icon in your tray notification area (see Figure 1).
YAC sits in your tray notification area and acts as a daemon, waiting for incoming calls. When you receive a call, you should see a notification reporting the caller ID information (see Figure 2).
Of course, this article is about consuming caller ID information via Java. So let’s get back to that.