etFaxmanJrSend Sample Program

TeleTools

This sample applications demonstrates the ability to send 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 etFaxManJrSend sample application demonstrates the ability to send a 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 of the outbound 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 event boxes below go into more technical detail about how this works, but sending a fax with TeleTools and FaxManJr is as easy as this:

FaxmanJr1.Class = FAX_1
etLine1.DeviceMediaModesActive = LINEMEDIAMODE_DATAMODEM
etLine1.CallParametersDefaults = False
etLine1.CallParametersBearerMode = LINEBEARERMODE_PASSTHROUGH
etLine1.CallPhoneNumber = ""
etLine1.CallDial                          'create a passthrough "call"
etLine1.CommEnabled = True
FaxmanJr1.CommHandle = etLine1.CommHandle 'set the calls handle
FaxmanJr1.FaxFiles = FaxFile.Text         'send 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.
ButtonSend Sets up and initiates the outbound call using the etLine1 component. This causes the etLine1.OnConnected event to fire where the FaxManJr1 component actually dials the number.
TextFaxSendFile Specifies the file to be sent. This file must be the in the FaxMan format (*.fmf).
TextPhone This is the phone number used by the FaxManJr1 component to complete the call.
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 properties: 1) FaxManJr Class, to Class 1, due to the increased control it provides. 2) Fax send 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.

ButtonSend_click

Event Handler Routine for: ButtonSend OnClick event. Fires when the ButtonSend button is clicked. The etLine1.CallMediaMode and etLine1.CallBearerMode properties are set before a call is made with the Call.Dial method. This is required to allow the FaxManJr1 component to communicate directly with the Fax modem. The etLine.OnConnected event will fire immediately after the etLine1.CallDial method is executed. The FaxManJr1 component will then complete dialing.

etLine1_OnConnected

Event Handler Routine for: etLine1 OnConnected event. Fires when the call is connected. Since a fax modem is being used this will occur immediately after the etLine.CallDial method is executed. The etLine1.CommEnabled property is set to true allowing access to the comm port opened by TAPI. The FaxManJr1.CommHandle property is set to the value of the open comm port found in the etLine.CommHandle property. The FaxManJr1 DeviceInit, DeviceReset, FaxFiles and FaxNumber property values are set. The FaxManJr.SendFax method is called causing the phone number to be dialed and the fax sent.

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.

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.

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 a fax then cancel it. Close all open files. If a call exists then etLine 1 will hang-up. If the TAPI line device is active then deactivate it.

 

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