etDataModemDialTone Sample Program

TeleTools

This sample program shows how to detect a dial tone when using a data modem.

Click here for more information about <topic>.

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 can use this sample with any Edition of TeleTools v3.7

    • TeleTools Express

    • TeleTools Standard

    • TeleTools Professional

    • TeleTools Enterprise

  • A standard data modem with a handset connect.

Using This Sample Program

Data modems do a good job of detecting when a dial tone is NOT present. However they are not consistent at reporting when a dial tone IS detected.

When a Dial Tone is NOT Present

  1. Select a data modem

  2. Click the "Dial Tone?" button.


This dialog box belongs to the Microsoft Unimodem Telephony Service Provider (TSP).

This dialog box will close automatically, usually before the user has time to pick up the attached receiver and click either of the buttons.

  1. A dialog box will appear indicating a dial tone was not detected.

When a Dial Tone IS Present

  1. Select a data modem

  2. Click the "Dial Tone?" button.


This dialog box belongs to the Microsoft Unimodem Telephony Service Provider (TSP).

  1. Lift the handset that is attached to the modem.
    It is important that the user lift the handset otherwise you will have unpredictable results and may need to reboot.

  2. Click the Hangup button on the Call Status dialog box.

  3. A dialog box may or may not appear indicating if dial tone was detected.

  1. Click the sample programs Hangup button.

 

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

We use the etLine.DeviceList property to automatically populate the device combobox with the list of available TAPI devices on your machine.  In the ComboBoxDevice click event, the etLine.DeviceName property is set to your selected device to the name selected in the combobox. We then use the etLine.TAPITSP property to see the text of the name of the TSP associate with this device and look to see if it contains the word "modem".  If true, we then use the etLine.DeviceMediaModesAvailable property to check the flags set by the modem's INF file.  A datamodem will set the flags for LINEMEDIAMODE_INTERACTIVEVOICE and LINEMEDIAMODE_DATAMODEM, while a voicemodem will also set the flags for LINEMEDIAMODE_UNKNOWN  and LINEMEDIAMODE_AUTOMATEDVOICE.  We put the code for all of this into two simple functions, IsVoiceModem and IsOnlyDataModem.  If this is a datamodem, then we allow you to dial, if not, then we report that this device is either a voicemodem or something else.  If this is a voicemodem, we display a box asking you to download the etVoiceModemDialTone sample program instead.

If your device is a datamodem, we then set the etLine1.DeviceActive property to True and make sure the device activates without an error.  TeleTools then activates the "Dial Tone?" button so that you can press it to test for dialtone.  We set etLine1.CallPhoneNumber = "W" which tells the datamodem to wait for a dialtone and execute the etLine1.CallDial method to dial the phone.  Since datamodems fire the etLine_Onconnected event as soon as the dial string is sent, we place code in the etLine1_OnConnected event to notify the user that dialtone was detected and then call the etLine1.CallHangup method by accessing CommandHangup_Click.

In the On_Disconnected event we also check the etLine1.CallDisconnectMode property to see if it was "O" or LINEDISCONNECTMODE_NORMAL and if so display that dialtone was detected.  If the etLine1.CallDisconnectMode = LINEDISCONNECTMODE_NODIALTONE then we display that dialtone was NOT detected.  If these tests are inconclusive we report that your modem has not reported dialtone correctly and display what message is sent.

It is not safe to check for dial tone with every telephone call.  We suggest that you offer it as an option to your users as a diagnostic tool or perform a test when the program starts.

Control

Description

ComboDevice Lets the user select the Telephony device
CommandDialTone executes tests to see if a dialtone was detected

CommandHangup

Hangs up the call with the etLine1.CallHangup method

etLine The TeleTools etLine component

 

Event Handler Routine

Description

ComboDevice_Click

Sets the telephony device with the etLine.DeviceName property and checks to see if the device is a datamodem or a voicemodem

CommandDialTone_Click

Checks for dialtone by looking for a successful connect and the proper LINEDISCONNECTMODE

CommandHangup_Click

Hangs up the phone call with the etLine1.CallHangup method

etLine1_OnConnected

Fired when the phone number string is dialed and reports that dialtone was detected

etLine1_OnDisconnected

Fired when the remote party disconnects and checks the etLine1.CallDisconnectMode to see if it was LINEDISCONNECTMODE_NODIALTONE or LINEDISCONNECTMODE_NORMAL and reports if dialtone was detected
Form_Load Populates the device combobox with your TAPI devices using the etLine.DeviceList property

Form_Unload

Unloads the form and deactivates the etLine component

 

Subroutine

Description

IsDataModem

Function to check if selected device is a datamodem by using the etLine1.DeviceMediaModesAvailable property

IsVoiceModem

Function to check if the selected device is a voicemodem etLine1.DeviceMediaModesAvailable property

 

Release Notes

April 30, 2003

Published