etAnswerPlayDigits Sample Program

TeleTools

This program demonstrates how to answer a call, play a wave file and monitor for digits while the call is connected then hang-up.

The operations demonstrated in the program are commonly used in call center applications that need to play wave files or gather DTMF information during a call between two humans.

It was written with the Way2Call Hi-Phone desktop which allows it to work very nicely with the connected handset.

Click here for more information about the Way2Call Hi-Phone.

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

Click here to see more product and technical information about the Way2Call Hi-Phone.

Development Environment Technical Information
Telephony Hardware Technical Information

Requirements

  • 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 play digits using any of the following Editions of TeleTools v3.7

    • TeleTools Standard

    • TeleTools Professional

    • TeleTools Enterprise

Using This Sample Program

  1. When the program is loaded the etLine TeleScope and etPlay TeleScope are displayed.
    Use the etLine TeleScope to select and active a TAPI line device.
    Use the etPlay TeleScope to select the wave play audio device associated with the line device.

  2. Using another telephone line (remote phone) make a call to the telephony device.

  3. Answer the call.
    If you have a handset attached to the telephony device then you may answer by picking up the handset (if your device supports this feature).  Otherwise you may click the Answer button.

  4. To play the wave file over the selected Windows wave play audio device click the Play button

  5. To monitor digits check the MonitorDigits checkbox then press the digits on the remote parties telephone.
    The digits will be displayed in the editbox below the MonitorDigits checkbox.

  6. To stop monitoring for digits do any one of the following:

  • Press the "#" key on the remote phone

  • Hang up the remote phone

  • Click the hung up button

  • Uncheck the MonitorDigits checkbox

  • Hang up the attached phone (if your device supports this feature)

  1. Hang up the call.
    If you have a handset attached to the telephony device then you may hang up by hanging up the handset (if your device supports this feature).  Otherwise you may click the Hangup button.

Download this Sample Program

For use with TeleTools v3.7

File

Purpose

Visual Basic 5,6 - (90kb)

Source code and wave files

Tell us what you need?

Click here and tell us what you need!

 

How this Sample Program Works

When the program is loaded the etLine and etPlay controls are enabled and their TeleScopes are displayed.  The remaining controls are disabled.  

When an inbound call is detected by etLine the etLine1.OnOffering event handler routine is executed which enables the Answer button.

When a call is answered the etLine1.OnConnected event handler routine to be executed.  This routine disables the Answer button and enabled the Play button, MonitorDigits checkbox and hangup button.

When the Play button is clicked it will be disabled, the etPlay1.Source.FileName property is set and then the  etPlay1.Device.Active property is set to true to begin playing the wave file.   Notice that etPlay1.Source.FileName is set to a list of files.  etPlay combines these files and plays them as one.  

When a wave file is done playing the etPlay1_OnDone event handler routine is executed.  This routine enables the Play button so the wave file may be played again.

When the MonitorDigits checkbox is checked the etLine control will detect DTMF tones and display them in the Digits editbox.  The etLine1_OnDigitReceived event handler routine is executed each time a DTMF tone is detected. If a "#" is detected then Monitoring digits will be deactivated.

When the Hang up button is clicked etPlay will stop playing wave files and the call will be hung up.

When the remote party hangs up the phone the etLine1_OnDisconnected will execute.  This routine calls the Hang up buttons click event handler routine; CommandHangup_Click

When a call not longer exists the etLine1_OnIdle event handler routine is executed.  This routine disables all of the buttons in preparation for the next inbound call.

Control

Description

Answer button

Button used to answer calls

Play button

Button used to play the wave file

MonitorDigits checkbox

Checkbox used to activate/deactivate the monitoring for DTMF tones

Digits editbox

Edit box used to display digits received by the etLine control

Hang up button

Button used to hang up calls

etLine

TeleTools etLine control used to access the TAPI line device.

etPlay

TeleTools etPlay control used to access the Windows wave play audio device.

 

Event Handler Routine

Description

CheckMonitorDigits_Click

Activate/deactivate monitoring digits

CommandAnswer_Click

Answer calls

CommandHangup_Click

Hangup calls

CommandPlay_Click

Play a wave file

etLine1_OnConnected

Enable/disable buttons when a call is connected

etLine1_OnDigitReceived

Respond to digits when received

etLine1_OnDisconnected

Hang up calls when the remote party hangs up

etLine1_OnIdle

Enable/disable buttons when a call no longer exists

etLine1_OnOffering

Enabled the Answer button when an inbound call is detected

etPlay1_OnDone

Enabled the Play button when playing of a wave file is complete

Form_Load

Enabled TeleTools controls, display TeleScopes and disable buttons

Form_Unload

Clean up

Release Notes

April 3, 2003

Published