etFaxManJrReceive Sample Program

TeleTools

This sample applications demonstrates the ability to receive faxes using both ExceleTel TeleTools and FaxMan Jr ActiveX controls from Data Techniques Inc. TeleTools takes care of TAPI while FaxMan Jr handles the actual Fax transmission.

ExceleTel teamed up with Data Techniques to provide the best TAPI telephony fax solution with the benefit of already running samples that you can cut and paste into your application.

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

Development Environment Technical Information
Telephony Hardware Technical Information

 

Requirements

  • ExceleTel 3.7.2 or later

  • FaxManJr from Data Techniques

  • Fax capable voicemodem or other TAPI fax device

Using This Sample Program

First a little information about TAPI and Fax. TAPI has two purposes, first is to supply a common Application Programming Interface (API) for virtually all telephony hardware used with the Windows operating systems. Hence the name Telephony Application Programming Interface (TAPI). Second, TAPI acts as a traffic cop allowing multiple applications to utilize the same telephony device simultaneously. In other words you do not have to shut down your fax application to dial-in to get your email, for example.

At the current time Microsoft does not have an API for sending and receiving faxes through TAPI. However they do provide a Passthrough method of accessing modems’ AT command set directly and therefore access to the modems’ Fax features.

The etFaxManJrReceive sample application demonstrates the ability to receive an incoming fax, using both ExceleTel TeleTools and Data Techniques FaxMan Jr ActiveX controls. TeleTools takes care of TAPI while FaxMan Jr handles the actual Fax transmission. This sample program is intended to illustrate how ExceleTel TeleTools and Data Techniques FaxMan Jr work together. For more information on either product see their respective sample applications and help files.

This application searches for, and provides the user with a list of all Group 3 fax devices. The user selects and activates the appropriate fax device, specifies a location for the storage of the incoming fax, and can enter an initialization string to be sent to the modem.

Status messages generated by the application, ExceleTel TeleTools and FaxMan Jr are displayed in the three separate status boxes. Further information can be viewed and modified by activating ExceleTel Telescope by double clicking on the "etLine" phone icon.

Download this Sample Program

For Use TeleTools v3.7

File

Purpose

EXE Ready to run!
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

The information in the event boxes below give more technical detail, but the code used is as easy as this:

FaxmanJr1.Class = FAX_1        'set things up
etLine1.CallMonitorMediaModesMediaModes = LINEMEDIAMODE_G3FAX
etLine1.CallMonitorMediaModesActive = True

and in the etLine_OnMediaModesChange event handler which detects we sense a fax, not a voice call...

etLine1.CommEnabled = True             'enable comm port communication
etLine1.CallBearerMode = LINEBEARERMODE_PASSTHROUGH 'set the right mode
FaxmanJr1.ReceiveDir = TextFaxRecDir.Text
FaxmanJr1.CommHandle = etLine1.CommHandle    'pass the comm handle
FaxmanJr1.Receive (0)                        'start receiving the fax!

In addition, you have all of the TeleTools and FaxManJr events, methods and properties still available to allow you complete control over fax and voice calls.

Control

Description

CheckActive User clicks this check box to activate or deactivate telephony line device
ComboDevice Combo Box is populated with all G3 fax devices. User selects the device to activate for listening and receiving the fax.
etLine1 Use for collecting information about the TAPI Line devices. Click to activate
TextFaxRecDir Specifies the directory path where the fax is to be stored. Note: This sample program does not validate the path name, therefore if an invalid path is specified, no messages are displayed, and no fax file will be written to the system.
FaxManJr1 Contains properties and events that facilitate the sending and receiving of faxes.
TextModemInitString Used to be sent
TextFormMsgs
TextETMsgs
TextFaxMsgs
Text boxes that display messages that originate from 3 sources: 1) Form – the sample application, 2) ET – from etLine1 TeleTools component, 3) Fax – from FaxManJr component

 

Event Handler Routine

Description

Form_Load

Event Handler Routine for: Form OnLoad event. This event fires when the form is created. Populates the ComboDevice combo box with all G3 fax devices. Sets the etLine1.DeviceName property to the first device found. Sets 2 required FaxManJr properties: 1) Class, to Class 1, due to the increased control it provides. 2) Fax receive directory to the application path.

CheckActive_Click Event Handler Routine for: CheckActive OnClick event. This event fires when the CheckActive check box is clicked. Sets the etLine1.DeviceActive property to activate or deactivate the TAPI line device
ComboDevice_Click Event Handler Routine for: ComboDevice OnClick event. This event fires when the ComboDevice combo box is clicked. Sets the etLine1.DeviceName property to the selected device. Sets the etLine1.CallMonitorMediaModesMediaModes property to type G3 fax. This indicates to etLine1 that it will be monitoring for G3 fax tones. See the etLine1_OnConnected event handler.

FaxmanJr1_Message

Event Handler Routine for: FaxmanJr1 OnMessage event. Fires when messages are received from the fax modem. Update TextFaxMsgs.

FaxmanJr1_Status

Event Handler Routine for: FaxmanJr1 OnMessage event. Fires when status of the fax transmission changes. Update TextFaxMsgs.

FaxmanJr1_CompletionStatus

Event Handler Routine for: FaxmanJr1 OnCompletionStatus event. Fires when FaxmanJr1 indicates that the fax transmission is complete. The etLine1.CallHangup method is called to tell TAPI that the call has been hung-up.

etLine1_OnCallMediaModeChange

Event Handler Routine for: etLine1 OnCallMediaModeChange event. This event fires when etLine1 detects a G3 fax tone. Top monitoring for media mode changes by setting etLine1.CallMonitorMediaModesActive property to false. Set the property etLine1.CommEnabled to true. If the call is properly connected, then etLine1.CommAvailable has a value of True indicating that the etLine1.CommHandle property value is valid. Set etLine1.CallBearerMode to Passthrough mode. (Per Microsoft: When a call is active in LINEBEARERMODE_PASSTHROUGH, the service provider gives direct access to the attached hardware for control by the application. This mode is used primarily by applications desiring temporary direct control over asynchronous modems, accessed through the Win32 comm functions, for the purpose of configuring or using special features not otherwise supported by the service provider.) Set FaxManJr1.ReceiveDir property to the directory specified to store the received fax. Set FaxManJr1.CommHandle property to the comm handle supplied by etLine1 (etLine1.CommHandle). Forces FaxMan Jr. to use an already-opened comm port handle instead of opening a comm port handle of its own. Set FaxManJr1.DeviceInit property to the string used to initialize the fax modem. Set FaxManJr1.DeviceReset property to reset the fax modem Call the FaxManJr1.Receive Method specifying the argument of 0. This causes FaxMan Jr to attempt to answer the line without bothering to detect a ring.

etLine1_OnConnected

Event Handler Routine for: etLine1 OnConnected event. Fires when the call is connected. Set etLine1.CallMonitorMediaMode to True. This will cause TAPI to begin monitoring for the G3 fax tone. See etLine1.CallMonitorMediaModesMediaModes in the routine ComboDevice_Click.

etLine1_OnDisconnected

Event Handler Routine for: etLine1 OnDisconnected event. Fires when the remote party disconnects the call. Call etLine1.CallHangup to hang-up the call.

etLine1_OnRing

Event Handler Routine for: etLine1 OnRing event. Fires when a ring for an inbound call is detected. Call etLine1.CallAnswer to answer the call.
Form_Resize Event Handler Routine for: Form OnResize event. Fires when the user changes the size of the form. The controls on the form are resized according to the change.

Form_Unload

Event Handler Routine for: Form OnUnload event. Fires when the form is closed. If FaxMan Jr is processing an incoming fax then cancel it. Close all open files. If a call exists then hang-up. If the TAPI line device is active then deactivate it.
btnInfo_Click Display TeleTools contact information and copyright

 

Subroutine

Description

None

 

 

Release Notes

October1, 2003

Update for the current version of TeleTools and FaxManJr.  Special thanks to Rush Austin at Data Techniques for his help.

Jan 15, 1999

first release