etVoiceModemCallerID Sample Program

TeleTools

The etVoiceModemCallerID program allows the user to detect the name and phone number of the originator of a call on the selected device. The etLine control is used to capture the CallerID information.

This program is designed specifically to work with voice modems and differs significantly to the etCallerID sample program.  etCallerID is designed to work with more sophisticated telephony devices such as the Hi-Phone, Dialogic cards and PBX's.

Click here for more information about CallerID.

Requirements
Using This Sample Program
Download this Sample Program 
How this Sample Program Works
Source Code
Release Notes

Development Environment Technical Information
Telephony Hardware Technical Information

 

Requirements

You will need the following to utilize this sample program:

  • A voice modem that supports capturing CallerID.

  • CallerID service from your phone company or your telephone system.

Using This Sample Program

When this program starts it use the list box to select a voice modem.

Make a telephone call to the device.  Once the CallerID information becomes available it will be displayed. If you are not getting caller ID information check this FAQ for more information.

In most situations the CallerID information is delivered to the telephony device between the first and second ring.  In this case the etLine.OnCallerID event will fire and the name and number will be displayed.

 

Download this Sample Program

For Use TeleTools v3.7

File

Purpose

EXE Ready to run!
Borland Delphi 5,6,7 Source code and wave files
Visual Basic 5,6 Source code and wave files
Tell us what you need? Click here and tell us what you need!

 

How this Sample Program Works

This program differs from the etCallerID sample program in that it overcomes three issues related to voice modems. 

  • The first has to do with a delay of end of call notification. 

  • The second has to do with the method that voice modems report Blocked (Private) and Out of Area CallerID information. 

  • The third issue is that voice modems case the etLine.OnCallerID event to first an additional time when the call is Blocked or Out of Area.

The delay of end of call notification is a problem because most modems have a delay of 15-30 seconds (or more) after a call has ended before it is ready to detect the next call.  In those cases the CallerID information is not detected.  This is overcome by calculating the time between rings and then setting a timer.  The etLine.OnRing event fires with each detected ring.  This event handler routine resets the timer.  The timer will fire if a ring is not detected in time.  The timer fires because it is safe to assumed that the caller has hung up or the line has been answered.

Voice modems do not set the etLine1.CallCallerIDFlags properly.  They show both Blocked and Out of Area calls as Out of Area.  However they do set the etLine.Call.CallerID.Name property with a "P" or "O" to indicate if they are Private (Blocked) or Out of Area.  The logic for this workaround can be seen in the etLine.OnCallerID event handler routine.

Multiple firings of the etLine.OnCallerID event are handled with a simple "If" statement in the etLine.OnCallerID event handler routine checking to see if the TextCallerIDName property has been set.

When this program starts ComboDevice is filled with all of the available telephony devices.  When a device is selected it is check to make sure that it is a voice modem then the device is activated.

The etLine.OnOffering event fires when an inbound call is detected.  The TextCallerIDName and TextCallerIDNumber controls are cleared.  The dtRingDuration date/time variable is checked to see if dtFirstRing needs to be reset. 

When the TAPI line device indicates that the CallerID information has changed the etLine.OnCallerID event will fire causing the etLine1_OnCallerID event handler routine to be executed.  This routine checks the CallerID flags and displays the available information.

When the application is closed the Form_Unload event handler routine is executed.  This routine deactivates the TAPI line device.

Control

Description

ComboDevice

list and select all available TAPI line devices

TextCallerIDName

Display the CallerID Name 

TextCallerIDNumber

Display the CallerID Number

etLine

TeleTools etLine control used to access the TAPI line device.

TimerCallAnswered_Timer Fires 1/4 of a second after a ring was expected then resets the device

 

Event Handler Routine

Description

ComboDevice_Click Check the TAPI line device when clicked
etLine1_OnCallerID Display the CallerID information when the device indicates the information has changed.
etLine1_OnOffering Detects a new call and resets the callerID display boxes and the ring counters
etLine1_OnRing Detects a ring event and starts a timer to find out when a ring is misse
Form_Load Get a list of the available TAPI Line devices and select and activate the first device
Form_Unload Deactivate the the TAPI line device
TimerCallAnswered_Timer Fires 1/4 of a second after a ring is missed indicating a call was answered or disconnected

 

Subroutine

Description

IsOnlyDataModem Function checks parameters and returns true if device is a datamodem
IsVoiceModem Function checks parameters and returns true if device is a voicemodem

 

Release Notes

May 1, 2003

Published