etCallWaiting Sample Program


The etCallWaiting sample program demonstrates how to answer multiple calls, capture Call Waiting CallerID and swap between calls (swap hold).

This program is designed to work with telephony devices that support multiple calls.  If you have a voice modem the use the etVoiceModemCallWaiting sample program.

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



  • TeleTools 3.7 or above if you wish to compile it yourself

  • The program was written to use a Way2Call Hi-Phone however it will work with any device that can answer, play wave files, monitor for digits and hang-up.

  • You can use this sample with any of the following Editions of TeleTools v3.7

    • TeleTools Standard

    • TeleTools Professional

    • TeleTools Enterprise

  • A telephony device that supports Call Waiting 
    (at least one call on hold).

  • A way to make 2 incoming calls

The application works very well with PBX's!

Using This Sample Program

  1. Start the etCallWaiting program.

  2. Using the list box select a telephony device that supports Call Waiting.
    You will be informed if the device you select does not support Call Waiting.

  3. Make a call into the device 

  4. Answer the call by clicking the "Answer" button.
    Notice that the button's function change as its state changes.

  5. Make a second call into the device.

  6. Answer the call by clicking the "Answer" button. 

  7. Click the Swap Hold button to place the second call on hold and retrieve the first call.

If you are using a PBX that supplies their own Telephony Service Provider (TSP) chances are that you can set up the calls prior to executing the program.  When etCallWaiting is started it will see the calls and set up the display and buttons properly.

Double click on the etLine control to display the TeleScope.

Download this Sample Program

For Use TeleTools v3.7



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


How this Sample Program Works

The TAPI telephony device is selected using the TeleTools etLine.DeviceID property to fill the device combobox with devices.  Once you select your device, we automatically try to activate it with etLine.DeviceActive = True and determine the capabilities of the device.  The IsDataModem function and IsVoiceModem function test to see if the device is a datamodem or a voicemodem.  Only voicemodems and more robust devices can work with TAPI telephony and support call waiting.

When you place an incoming call, we use the UpdateCallDisplay subroutine to check callstates such as LINECALLSTATE_IDLE, LINECALLSTATE_OFFERING, LINECALLSTATE_CONNECTED, and LINECALLSTATE_ONHOLD to detect the state of the incoming call. We change the captions on the buttons to allow you to answer, hangup, and swap calls.  We also update the callerID and status text boxes. 

When a call is "offered", we detect the new call and change the appropriate button to "answer", update the call counter, and allow you to answer the call.  When the second call comes in, the call-waiting signal is detected and fires another On_Offering event.  We detect this second call and put it's information in the second call row.  If your device supports it, you will see the CallerID name and number and the status of the call.  When you click "answer" on this call, use the lineSwapHold function to place the first call on hold and answer the second call.  .  Each individual call generates it's own unique callhandle and TeleTools uses the etLine.CallHandle property to keep track of the calls.

The buttons and text boxes are updated again and "swap hold" appears on the first call button.  You can press this button and put the second call on hold and place the first one back in the "connected" state.  You can swap back and forth to your hearts content.



ComboDevice Selects and activates your TAPI telephony device


Displays the number of active calls

etLine1 The TeleTools etLine component


Buttons that control each of the two possible calls

TextCallerIDName(2) Displays the callerID name for call 1 and 2


Displays the callerID number for call 1 and 2

TextState(2) Displays the call state for each call


Event Handler Routine


ComboDevice_Click Calls the device checking routine to see if the device is a type of modem, updates the display and then activates the selected device
CommandCall_Click Checks to see if a button was clicked, and if so which button and which callhandle is assigned to that button.  This routine allows you to answer a call, hangup a call and swap the held call with the connected call
etLine1_OnCallBegin detects and reports that the call has started
etLine1_OnCallerID detects and displays the callerID name and number if supported by the device


Reports that a call is answered and in the connected state


Reports that a call has been hung up by the remote party

etLine1_OnHold Reports that the call was placed on hold
etLine1_OnHoldPendingConference On some PBX's this event will fire to let you know the call is on hold
etLine1_OnHoldPendingTransfer On some PBX's this event will fire to let you know the call is on hold
etLine1_OnIdle The call is in the idle state.  Usually, you are ready for another call


Event fires to let you know an incoming call has been detected


Activates the etLine component and gets your list of TAPI devices


Closes the form and releases the etLine component




IsDataModem Function returns true if tests indicate the device is a datamodem
IsVoiceModem Function returns true if tests indicate the device is a datamodem
Hangup Hangs up an active call or a call that has been disconnected
GetCallIndex Get the callhandle of the call and assign an index number for each of the calls to use in referencing buttons and text boxes that display call information


Updates the buttons and status textboxes with call information


Release Notes

May 8, 2003