etFaxHandoff Sample Program

TeleTools

The FaxHandoff sample program demonstrates how to use the call handoff and media mode monitoring features of TeleTools and TAPI to hand control of a fax call to another TAPI application. When using this sample program Microsoft Fax must be running but must not answer the call. FaxHandoff will be used to answer the call. If a fax tone is detected then the etLine.OnMediaModeChange event will fire and the etLine.CallHandoff method is used to hand ownership of the call to the application "awfxex32.exe" which is Microsoft fax.  You may need to change this to "faxqueue.exe" depending on your version of Windows

Requirements
Using This Sample Program
Download this Sample Program 
How this Sample Program Works

Release Notes

Requirements

  • TeleTools 3.7 or above

  • Microsoft Fax (included with windows)

  • a fax capable device tied to MSFax in your machine

  • a fax machine to test with

Using This Sample Program

Make sure you have a faxmodem or other fax device installed in your machine and that you have configured windows fax to use this device.  Make sure the exe file for your fax software is placed in the "application" box and that your fax software is not set to answer the call automatically.  Help for windows faxing is in your accessories start menu item.

Select your telephony device in the dropdown combobox and check the active checkbox.  Place an incoming fax call and when you see the ring event fire, press the answer button.  Your call will be handed off to your other software and that software should take over and answer the fax.

Download this Sample Program

For Use TeleTools v3.7

File

Purpose

EXE Ready to run!
Borland C++ 4,5,6 Source code and wave files
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
Visual C++ 6 Source code and wave files
Visual C++ .NET Source code and wave files
Visual Fox Pro 6 Source code and wave files
Visual Fox Pro .NET Not available
Tell us what you need? Click here and tell us what you need!

 

How this Sample Program Works

 

 

Control

Description

CheckBoxActive Used to activate the TAPI Line device.
ComboBoxDevice Used to select the TAPI line device.
ButtonTeleScope When clicked the TeleScope.Visible property for the etLine control is toggled to True or False causing the TeleScope to be displayed or hidden.
LabelApplication Displays "Application"
EditApplication Holds the name of the TAPI fax application
ButtonAnswer For answering in bound calls.
ButtonHangup For hanging up all calls.
ButtonClear Clears the information in the Memo1 control
Memo1 Displays the log information.
etLine1 The etLine control

 

Event Handler Routine

Description

FormCreate

Event Handler Routine for: creation of the form. It fills the combo box with available TAPI line devices and initialize the line device and the combo box to the first device available.

ButtonAnswerClick Event Handler Routine for: the ButtonAnswer.OnClick event of the ButtonAnswer control. The etLine1.Call.Answer method is called. If it returns False then the etLine1.Error.Text property is appended to the log edit box.
ComboBoxDeviceChange Event Handler Routine for: the ComboBoxDevice.OnChange event of the ComboBoxDevice control The etLine1.Device.Active property is checked to see if the current device is active, if so then CheckBoxActive is set to false causing the device to be deactivated. The etLine1.Device.ID is set to the index value of the device chosen in the combo box. If no errors occurred, then the properties etLine1.Privilege.Monitor and etLine1.Privilege.Owner are set to true.
ButtonHangupClick Event Handler Routine for: the OnClick event of the ButtonHangup control. The etLine1.Call.Hangup method is called. If it returns False, the etLine1.Error.Text property is appended to the log edit box.
ButtonTeleScopeClick Event Handler Routine for: the OnClick event of the ButtonTeleScope control. This button causes the etLine1.TeleScope.Visibile property to be toggled. This causes the TeleScope to be displayed or hidden.
CheckBoxActiveClick

Event Handler Routine for: the CheckBoxActive.OnClick event for the CheckBox control. If the control is checked, then the line device is activated by setting the property etLine1.Device.Active = TRUE; if not checked, then the line device is deactivated by setting the property etLine1.Device.Active = FALSE.

If there error LINEERR_INVALIDMEDIAMODE is returned when activating the line device, the device is probably not 100% TAPI compliant. The etLine1.Device.MediaModesActive is set to LINEMEDIAMODE_DATAMODEM and etLine1.Device.Active is once again set to TRUE. We are assuming that the device is a modem that does not support the voice features so we attempt to activate the modem in data mode.

etLine1CallMediaModeChange Event Handler Routine for: etLine.OnCallMediaModeChange event. The etLine1.Call.MediaMode is checked to see if the call is actually an inbound fax. If it is a fax then the call is handed off to the fax application defined in the EditApplication control, the method etLine1.Call.HandOff is used to perform the hand off.
etLine1Connected Event Handler Routine for: etLine.OnConnected event. The etLine1.Call.MonitorMediaModes.MediaModes property is set to LINEMEDIAMODE_G3FAX. This indicates that the Monitor Media Modes feature causes the etLine1.OnCallMediaMode event to fire when a fax tone is detected. If an error occurs setting this property then a message will be appended to the log otherwise etLine1.Call.MonitorMediaModes.Active is set to True which starts the monitoring.
etLine1Disconnected Event Handler Routine for: etLine.OnDisconnected event. The etLine1.OnDisconnected event fires when a call is disconnected. If the property etLine1.Call.Owner is True then the etLine1.Call.Hangup method is called.
etLine1Idle Event Handler Routine for: etLine.OnIdle event. The log edit box is updated with a message.
etLine1Ring Event Handler Routine for: etLine.OnRing event. The log edit box is updated with a message.
FormClose Event Handler Routine for: closing of the form. The etLine1.Call.Active property is set to False, which causes the etLine1.Call.Hangup method to be called. The etLine1.Device.Active property is set to False. Any errors are displayed in the log.
FormResize * Event Handler Routine for: resizing of the form. The log box is re-sized to fit the proportions of the form.*

* VB version only

Subroutine

Description

 

 

 

Release Notes

June 16, 2002

first release