Previous PageTable Of Contents../index.htmlIndexNext Page

fx_sendfax( )

Description | Cautions | Examples | Example 1: | Example 2: | Example 3: | Example 4: | Errors | See Also

Name:

int fx_sendfax(dev, iotp, sndflag)

Inputs:

int dev

fax channel device channel

DF_IOTT *iotp

pointer to fax transfer table

unsigned long sndflag

mode flag

Returns:

0 if success (on invocation in asynchronous mode)

-1 if failure (on invocation in asynchronous mode)

Includes:

srllib.h

dxxxlib.h

faxlib.h

Category:

send fax

Mode:

synchronous/asynchronous

 

Top Of PageDescription

The fx_sendfax( ) function transmits fax data as specified by a table of DF_IOTT data structures.

The fx_sendfax( ) function can be issued by the fax transmitter or the fax receiver. You can stop a fax transfer in progress at any time by issuing fx_stopch( ).

You can also send faxes using fax convenience functions. See fx_sendascii( ), fx_sendraw( ) and fx_sendtiff( ).

For more information on setting up the channel device to send fax data, see Chapter 4. Implementing Fax Capability -- Send Fax.

Parameter

Description

dev

Specifies the channel device handle for the fax channel obtained when the channel was opened.

iotp

A pointer to the DF_IOTT table entries that describe the fax data.

sndflag

The sndflag field is a logical OR bit mask that indicates one or more conditions:

  mode of operation for the function, synchronous or asynchronous

  enable generation of Phase B events (T.30 pre-message procedure)

  enable generation of Phase D events (T.30 post-message procedure)

  enable accepting and issuing operator intervention (voice request) from remote station

  enable transmitting all DF_IOTT entries at low or high resolution

  enable transmitting of subaddress values

 

The sndflag bit mask can have the following values:

Mode bit (for more information, see Section 4.7.1. Mode of Operation on page 63):

 

Value

Description

DF_ENABLE_RTV

Enable remote terminal verification (RTV). You must set both DF_PHASEB and DF_ENABLE_RTV bits to enable RTV.

If both bits are set, the Phase B event is sent to the application upon receipt of the DIS (digital identification signal) and the remote station ID. This allows the application to verify the recipient's identity and abort transmission if necessary before the firmware responds with a DCS message (digital command signal).

The application must then call fx_rtvContinue( ) to indicate continuation or cancellation of the fax transfer.

If both bits are not set, the Phase B event is received by the application after the firmware has already sent the DCS message to the recipient.

EV_SYNC

Synchronous mode operation

EV_ASYNC

Asynchronous mode operation

Phase B, Phase D and Operator Intervention (Voice Request) enable bits. Set one or more of the following, where the default is disabled:

Value

Description

DF_PHASEB

Enable Phase B event generation. When this bit is set, a TFX_PHASEB event is generated each time Phase B of the T.30 protocol is completed while fx_sendfax( ) is transmitting fax data. For more information, see Section 4.7.2. Enable Phase B Event Generation on page 64.

DF_PHASED

Enable Phase D event generation. When this bit is set, a TFX_PHASED event is generated each time Phase D of the T.30 protocol is completed during the send fax operation. A Phase D event is generated for every page except for the last page. After the last page, if your application is running in synchronous mode fx_sendfax( ) completes or in asynchronous mode a TFX_FAXSEND event occurs. For more information, see Section 4.7.3. Enable Phase D Event Generation on page 65.

DF_ACCEPT_VRQ

Enable accepting voice request from remote station

DF_ISSUE_VRQ

Enable issuing voice request to remote station

Vertical resolution of the fax transmission. The default is to transmit at the resolution specified in the file (TIFF/F) or DF_IOTT (raw and ASCII):

Value

Description

DF_TXRESLO

Transmit all DF_IOTT entries at low (coarse) vertical resolution.

DF_TXRESHI

Transmit all DF_IOTT entries at high (fine) vertical resolution.

Transmit subaddress enable bit:

Value

Description

 

DF_TXSUBADDR

Enable subaddress transmission

Top Of PageCautions

In asynchronous mode, the fax library needs to repeatedly access the DF_IOTT structure entries during the fax transmission, even though fx_sendfax( ) has returned control to the application. Each channel controlled by the single process must have its own separate DF_IOTT structures.

The io_type field of the last DF_IOTT structure entry must contain an IO_EOT to identify it as the last structure entry.

Top Of PageExamples

Example 1 illustrates the use of fx_sendfax( ) in synchronous mode with DF_IOTT structures as an array.

Example 2 shows fx_sendfax( ) with DF_IOTT structures set for raw image merged with ASCII data followed by a multi-page TIFF/F file. The synchronous programming code fragments shown can be used in a multi-threaded application where the program creates a separate thread for every channel. Each thread can control a single channel using a synchronous mode of operation.

Example 3 illustrates the use of fx_sendfax( ) in asynchronous mode. The asynchronous programming code fragments shown can be used in a multi-threaded application where the program creates multiple threads. Each thread can control a single channel or multiple channels using an asynchronous mode of operation. See the Voice Software Reference - Standard Runtime for information on programming modes and the SRL functions.

Example 4 shows how to use fx_sendfax( ) to send two TIFF/F files with each file being routed to a different subaddress.

Top Of PageExample 1: Send Fax with Array-Based DF_IOTT - Synchronous

Notes for this example:

By not defining io_type in the first DF_IOTT entry, the next DF_IOTT entry is a DF_IOTT array entry by default. Array entries must be contiguous (0, 1, 2, etc.). To explicitly state that the next DF_IOTT is contiguous, specify the IO_CONT value in the io_type field.

To indicate that data is stored on a disk device, IO_DEV is specified in the io_type field of the fx_setiott( ) function (see the fx_setiott( ) function reference source code).

In the last DF_IOTT entry of Example 1, the IO_EOT value in the io_type field indicates the last DF_IOTT entry in the table.

The fx_setiott( ) calls could specify DFC_AUTO for automatic Phase D continuation determination.

Top Of PageExample 2: Send Fax of Raw Image Merged with ASCII Data

Top Of PageExample 3: Send Fax - Asynchronous Programming Mode

Top Of PageExample 4: Send Fax with two TIFF/F files, Each File to a Different Subaddress

Top Of PageErrors

See Appendix D for a list of error codes that may be returned for this function. See Section 8.3. Error Handling on page 128 for more information on Dialogic Standard Runtime Library events generated.

If fx_sendfax( ) returns an error, you can locate the DF_IOTT structure processed when the error occurred by using the fax extended attribute ATFX_LASTIOTT( ).

Top Of PageSee Also


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2002, Intel Corporation
All rights reserved
This page generated February, 2002