Previous Page Table Of Contents../index.html IndexNext Page

fx_rcvfax( )

Description | Examples | Errors | See Also

Name:

int fx_rcvfax(dev, faxname, rcvflag)

Inputs:

int dev

fax channel device handle (to receive fax data)

char * faxname

name to assign received document

unsigned long rcvflag

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:

receive fax

Mode:

synchronous/asynchronous

 

Top Of PageDescription

The fx_rcvfax( ) function receives fax data from an open channel device and stores it as a TIFF/F file or a raw file.

NOTE:
A raw file stores fax data as a single page of unstructured, unformatted data.

The fx_rcvfax( ) function can be issued by the fax receiver or the fax transmitter. To stop a fax reception in progress, use fx_stopch( ).

The encoding scheme in which the incoming fax data may be stored (MH or MMR) is based on the capability of the Dialogic fax product. For product capabilities, see Section 2.4. Key Product Features on page 8.

For more information on setting up the channel device to receive fax data, see Chapter 5. Implementing Fax Capability -- Receive Fax.

 

Parameter

Description

dev

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

faxname

Specifies the file name to assign to the incoming fax data.

 

The TIFF/F or raw file, named in faxname, is created or overwritten as needed. When storing multi-page fax data in raw files, you must specify a different file for each incoming fax page.

rcvflag

A logical OR bit mask that indicates the following:

  The file format in which to save the incoming fax data

  Polling request from the transmitter is valid or not

  The mode of operation, 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

  Set maximum receive width

  Set preferred receive length

  Store all incoming fax data at low (coarse) or high (fine) vertical resolution

  Enable user-defined I/O functions (fx_rcvfax2( ) only)

 

The rcvflag bit mask can have the following values:

File format bit:

Value

Description

DF_TIFF

TIFF/F structured formatted fax data

DF_RAW

Raw, unformatted fax data

 

Poll bit:

 
 

Value

Description

rcvflag

DF_NOPOLL

Polling invalid (default)

(cont.)

DF_POLL

Polling valid

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

 

Value

Description

EV_SYNC

Synchronous mode operation.

EV_ASYNC

Asynchronous mode operation.

 

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

Value

Description

DF_PHASEB

Enable Phase B event generation. When this bit is set, a TFX_PHASEB event is returned each time Phase B is completed during the receive fax operation. For more information, see Section 5.3.3. Enable Phase B Event Generation on page 82.

DF_PHASED

Enable Phase D event generation. When this bit is set, a TFX_PHASED event is returned each time Phase D is completed during the receive fax operation, except for the last page. After the last page, fx_rcvfax( ) completes (synchronous mode) or a TFX_FAXRECV event occurs (asynchronous mode). For more information, see Section 5.3.4. Enable Phase D Event Generation on page 83.

 

DF_ACCEPT_VRQ

Enable accepting operator intervention (voice request) from remote station

DF_ISSUE_VRQ

Enable issuing operator intervention (voice request) to remote station

 

Maximum receive width bits:

Value

Description

rcvflag
(cont.)

DF_1728MAX

Maximum receive width: 1728 pixels

DF_2048MAX

Maximum receive width: 2048 pixels

DF_2432MAX

Maximum receive width: 2432 pixels (default)

 

Preferred receive length bits:

 

Value

Description

DF_A4MAXLEN

Maximum receive length: A4 size (approximately 11 inches)

DF_B4MAXLEN

Maximum receive length: B4 size (approximately 14 inches)

DF_NOMAXLEN

Maximum receive length: unlimited (default)

Vertical resolution of fax data storage. The default is the incoming fax data's specified resolution.

Value

Description

DF_RXRESLO

Store all incoming fax data at low vertical resolution.

DF_RXRESHI

Store all incoming fax data at high vertical resolution.

 

Enable user-defined I/O bit, available for fx_rcvfax2( ) only:

Value

Description

IO_UIO

User-defined I/O functions for fx_rcvfax2( )

Top Of PageExamples

Examples 1 and 2 use fx_rcvfax( ) for receiving fax data into TIFF/F and raw format files in synchronous mode. 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 would control a single channel using a synchronous mode of operation.

Example 3 uses fx_rcvfax( ) 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 could control a single channel or multiple channels using an asynchronous mode of operation. See the Voice Software Reference - Standard Runtime Library for information on programming modes and the Standard Runtime Library (SRL) functions.

Top Of PageErrors

In synchronous mode, this function returns a zero to indicate successful completion or a -1 to indicate an error.

In asynchronous mode, this function returns a zero to indicate successful invocation or a -1 to indicate an invocation error.

Errors that occur during reception generate a Standard Runtime Library event (TFX_FAXERROR). To access the Dialogic defined error code, call the Dialogic standard attribute functions ATDV_LASTERR( ) and ATDV_ERRMSGP( ). The latter returns a string describing the error (see the Voice Software Reference-Programmer's Guide). See Appendix D for a list of Dialogic defined fax error codes.

If the fx_rcvfax( ) function successfully completes, a TFX_FAXRECV Dialogic Standard Runtime Library event is generated.

The fax extended attribute ATFX_ESTAT( )) provides additional error information for T.30 Phase E fax protocol.

System errors return an EDX_SYSTEM error; use dx_fileerrno( ) to obtain error value. Refer to the dx_fileerrno( ) function in the Voice Software Reference - Programmer's Guide for a list of the possible system error values.

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