etAnswerPlayDigitsHeadset Sample Program

TeleTools

This program demonstrates how to answer a call, play a wave file, control the attached headset and monitor for digits while the call is connected and 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 parties.

etAnswerPlayDigitsHeadset was written with the Way2Call Hi-Phone desktop specifically for use with the Headset.  If you do not have a headset connected, please use etAnswerPlayDigits.

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 Professional or Enterprise Edition if you wish to compile it yourself

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

Using This Sample Program

  1. When the program is loaded the etLine TeleScope, etPhone TeleScope and etPlay TeleScope are displayed.
    Use the etLine TeleScope to select and active a TAPI line device.
    Use the etPhone TeleScope to select and active a TAPI phone 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. Click the Headset checkbox to take the headset off hook.

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

  6. 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.

  7. 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.

  2. Click the Headset checkbox to put the headset on hook.

Note: The Headset check box may be checked at any time before or during the call.

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, etPhone 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 disabled, the etPlay1.Source.FileName property is set then et 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.

When the Headset check box is checked the property etPhone1.Headset.MicrophoneAndSpeaker is set to True.
This cause the properties etPhone1.Headset.OnHook, etPhone1.Headset.MicrophoneOnly and etPhone1.Headset.SpeakerOnly to be set to False.

When the Headset check box is unchecked the property etPhone1.Headset.OnHook is set to True.
This cause the properties etPhone1.Headset.MicrophoneAndSpeaker, etPhone1.Headset.MicrophoneOnly and etPhone1.Headset.SpeakerOnly to be set to False.

Control

Description

Headset checkbox Checkbox used to set the state of the headset

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

CheckHeadset_Click

Sets the properties etPhone1.Headset.MicrophoneAndSpeaker and etPhone1.Headset.OnHook

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 8, 2003

Published