
Description | Cautions | Examples | Example 1: | Example 2: | Example 3: | Example 4: | Errors | See Also
Name: |
||
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 | |
|
||
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:
| ||
|
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 |
||
|
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. | |
|
|||
|
|
Value |
Description | |
DF_TXSUBADDR |
Enable subaddress transmission | ||
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.
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.
Example 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.
#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
#include <fcntl.h>
#include <sys\types.h>
#include <sys\stat.h>
#include <io.h>
#define NUMDOC 3
/* Need a DF_IOTT entry for each document to send. */
DF_IOTT iott[NUMDOC];
int rawfd,tifd1,tifd2;
int voxdev; /* Voice channel device handle. */
int dev; /* Fax channel device handle. */
unsigned short value;
.
.
/*
* Open the channel using dx_open( ) to obtain the Dialogic
* VOICE channel device handle in voxdev.
*/
if ((voxdev = dx_open("dxxxB1C1", NULL)) == -1) {
/* Error opening device. */
/* Perform system error processing */
exit(1);
}
/*
* Open the channel using fx_open( ) to obtain the FAX
* channel device handle in dev.
*/
if ((dev = fx_open("dxxxB1C1", NULL)) == -1) {
/* Error opening device. */
/* Perform system error processing */
exit(1);
}
.
.
/*
* Take channel offhook using dx_sethook( ) and perform
* outbound dial using dx_dial( ). Use voxdev as
* channel device handle for Voice API functions.
*/
.
.
/* Required -- Set initial state of FAX channel to TRANSMITTER. */
if (fx_initstat(dev,DF_TX) == -1) {
printf("Error - %s (error code %d)\n", ATDV_ERRMSGP(dev),
ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
}
.
.
/*
* Enable automatic Phase D messaging for TIFF/F file inter-page Phase D
* value. (NOTE: Specific Phase D messaging could have been used for each
* DF_IOTT structure if required for the application.
*/
value = DFC_AUTO;
if (fx_setparm(dev,FC_SENDCONT,(void *)&value) == -1) {
printf("Error - %s (error code %d)\n", ATDV_ERRMSGP(dev),
ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
}
/* Open raw and TIFF/F files to transmit. */
rawfd = dx_fileopen("coversht.raw",O_RDONLY|O_BINARY, NULL);
tifd1 = dx_fileopen("document1.tif",O_RDONLY|O_BINARY, NULL);
tifd2 = dx_fileopen("document2.tif",O_RDONLY|O_BINARY, NULL);
/*
* Set DF_IOTT structure (using fx_setiott( )).Send Phase D
* continuation value MPS after the raw format file
* coversheet.
*/
fx_setiott(&iott[0],rawfd,DF_RAW,DFC_MPS);
/*
* Set next DF_IOTT structure in the array. Send Phase D
* continuation value EOM after the first TIFF/F document:
* more pages to follow; renegotiate Phase B.
*/
fx_setiott(&iott[1],tifd1,DF_TIFF,DFC_EOM);
/*
* Set the next DF_IOTT structure in the array. Send Phase D
* continuation value EOP after the final TIFF/F document.
* Send 2 pages, start at document page 3 (Note: TIFF/F
* documents begin with document page zero).
*/
fx_setiott(&iott[2],tifd2,DF_TIFF,DFC_EOP);
iott[2].io_type |= IO_EOT;
iott[2].io_firstpg = 2L;
iott[2].io_pgcount = 2L;
/*
* Set the fax state of the channel to DF_TX using
* fx_initstat( ).
*/
/* Send all fax data now - synchronous mode. */
if (fx_sendfax(dev,iott,EV_SYNC) == -1) {
printf("Error code: %ld Error message: %s\n",
ATDV_LASTERR(dev), ATDV_ERRMSGP(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
printf("Phase E status: %ld\n", ATFX_ESTAT(dev));
/* Further error processing - application specific. */
.
}
Example 2: Send Fax of Raw Image Merged with ASCII Data
#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
#include <fcntl.h>
#include <sys\types.h>
#include <sys\stat.h>
#include <io.h>
#define NUMDOC 4
/* Need a DF_IOTT entry for each document to send. */
DF_IOTT iott[NUMDOC];
DF_ASCIIDATA asciidata[2];
int rawfd,tiffd,txtfd1,txtfd2;
unsigned long sndflag = EV_SYNC;
unsigned short value;
int voxdev; /* Voice channel device handle. */
int dev; /* Fax channel device handle. */
.
.
/*
* Open the channel using dx_open( ) to obtain the Dialogic
* VOICE channel device handle in voxdev.
*/
if ((voxdev = dx_open("dxxxB1C1", NULL)) == -1) {
/* Error opening device. */
/* Perform system error processing */
exit(1);
}
/*
* Open the channel using fx_open( ) to obtain the FAX
* channel device handle in dev.
*/
if ((dev = fx_open("dxxxB1C1", NULL)) == -1) {
/* Error opening device. */
/* Perform system error processing */
exit(1);
}
.
.
/*
* Take the channel offhook using dx_sethook( ) and
* perform outbound dial using dx_dial( ). Use voxdev
* as channel device handle for Voice API functions.
*/
.
.
/* Set initial state of FAX channel to TRANSMITTER. */
if (fx_initstat(dev,DF_TX) == -1) {
printf("Error - %s (error code %d)\n", ATDV_ERRMSGP(dev),
ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
}
.
.
/*
* If this is a channel for a VFX/40SC (return type DFS_FAX40)
* or VFX/40ESC (return type DFS_FAX40E),
* a resolution for sending the entire DF_IOTT can
* be specified in sndflag.
*/
if ((ATFX_CHTYPE(dev) == DFS_FAX40) ||
(ATFX_CHTYPE(dev) == DFS_FAX40E)) {
/* Set the transmit resolution to coarse (low). */
sndflag |= DF_TXRESLO;
}
/*
* Enable automatic Phase D messaging for TIFF/F file inter-page Phase D
* value. (NOTE: Specific Phase D messaging could have been used for each
* DF_IOTT structure if required for the application.
*/
value = DFC_AUTO;
if (fx_setparm(dev,FC_SENDCONT,(void *)&value) == -1) {
printf("Error - %s (error code %d)\n", ATDV_ERRMSGP(dev),
ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
}
/* Open raw and TIFF/F files to transmit. */
rawfd = dx_fileopen("logo.raw",O_RDONLY|O_BINARY, NULL);
tiffd = dx_fileopen("document.tif",O_RDONLY|O_BINARY, NULL);
txtfd1 = dx_fileopen("ascii1.txt",O_RDONLY|O_BINARY, NULL);
txtfd2 = dx_fileopen("ascii2.txt",O_RDONLY|O_BINARY, NULL);
/*
* Set DF_IOTT structure. The first fax page is to be created
* by merging a raw image file with 2 ASCII text files on to
* a single page. Set io_phdcont to DFC_MPG to cause the next
* DF_IOTT entry's image to be appended to the same page.
*/
fx_setiott(&iott[0],rawfd,DF_RAW,DFC_MPG);
/* The raw file is at low resolution */
iott[0].io_resln = DF_RESLO;
/*
* Set next DF_IOTT structure. Set io_phdcont to DFC_MPG to
* cause the next DF_IOTT entry's image to be appended to the
* same page. This is the first ASCII file to be appended to the
* raw image on a single page.
*
*/
fx_setiott(&iott[1],txtfd1,DF_ASCII,DFC_MPG);
/* Set the Margins and other ASCII graphical attributes
* in the DF_ASCIIDATA structure for the ASCII sub-page.
*/
asciidata[0].unit = DF_UNITS_IN10; /* 1/10th inch units */
asciidata[0].leftmargin = 10; /* 1" margins */
asciidata[0].rightmargin = 10;
asciidata[0].font = DF_FONT_0; /* use normal font */
asciidata[0].linespace = DF_SINGLESPACE;
asciidata[0].tabstops = 0;
/* These fields will apply to all subsequent ASCII sub-pages */
asciidata[0].topmargin = 10; /* 1" margins */
asciidata[0].botmargin = 10;
asciidata[0].pagelength = 110; /* length of page */
asciidata[0].pagepad = DF_PAD; /* pad to end of page */
/* Link the DF_ASCIIDATA to the DF_IOTT */
iott[1].io_datap = (void *)&asciidata[0];
/*
* Set next DF_IOTT structure. Send a Phase D continuation
* of MPS after this ASCII sub-page. This DF_IOTT entry completes
* the MPG chain with the last ASCII sub-page merged with the images
* defined by the previous DF_IOTT.
*/
fx_setiott(&iott[2],txtfd2,DF_ASCII,DFC_MPS);
/* Set the Margins and other ASCII graphical attributes
* in the DF_ASCIIDATA structure for the ASCII sub-page.
* Note that the Top/Bottom margins and Page Length/Page pad
* will take effect from the first ASCII sub-page.
*/
asciidata[1].unit = DF_UNITS_IN10; /* 1/10th inch units */
asciidata[1].leftmargin = 15; /* 1.5" margins */
asciidata[1].rightmargin = 15;
asciidata[1].font = DF_FONT_0; /* use normal font */
asciidata[1].linespace = DF_SINGLESPACE;
asciidata[1].tabstops = 0;
/* Link the DF_ASCIIDATA to the DF_IOTT */
iott[2].io_datap = (void *)&asciidata[1];
/*
* Set last DF_IOTT structure in the chain. Send Phase D
* continuation value EOP for the final document (TIFF/F
* format); send 2 pages, starting at document page 3 (Note:
* TIFF/F documents begin with document page zero).
*/
fx_setiott(&iott[3],tiffd,DF_TIFF,DFC_EOP);
iott[3].io_type |= IO_EOT;
iott[3].io_firstpg = 2L;
iott[3].io_pgcount = 2L;
/* Send all fax data now - synchronous mode. */
if (fx_sendfax(dev,&iott[0],sndflag) == -1) {
printf("Error code: %ld Error message: %s\n",
ATDV_LASTERR(dev), ATDV_ERRMSGP(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
/* Further error processing - application specific. */
.
.
}
Example 3: Send Fax - Asynchronous Programming Mode
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
#include <fcntl.h>
#include <sys\types.h>
#include <sys\stat.h>
#include <io.h>
#define MAXCHANS 12
/* Global variables. */
int catchall( );
int fax_send( );
/* Error routine - print error information. */
void print_err(dev)
int dev;
{
printf("Error - %s (error code %d)\n",
ATDV_ERRMSGP(dev),ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev)==EDX_SYSTEM) {
/* Perform system error processing */
}
return;
}
/*
* main( ): Opens all channels and enables handler for
* asynchronous operation. Channels go off-hook, dial the
* appropriate number and send the fax document.
*/
main( )
{
int chan;
char * chnamep;
int mode = SR_STASYNC;
int voxdev; /* Voice channel device handle. */
int faxdev; /* Fax channel device handle. */
/* Set SRL to turn off creation of internal thread */
if( sr_setparm( SRL_DEVICE, SR_MODELTYPE, &mode ) == -1 ){
printf( "Error: cannot set srl mode\n" );
exit( 1 );
}
for (chan=0; chan < MAXCHANS; chan++) {
/*
* Set chnamep to the channel device name, e.g.,
* dxxxB1C1, dxxxB1C2, etc.
* Open the channel using dx_open( ) such that voxdev
* has the VOICE channel device handle.
* Open the channel using fx_open( ) such that faxdev
* has the FAX channel device handle.
*/
if(( voxdev = dx_open( chnamep, NULL )) == -1 ){
printf( "Error: cannot open vox device\n" );
exit( 1 );
}
if(( faxdev = fx_open( chnamep, NULL )) == -1 ){
printf( "Error: cannot open fax device\n" );
exit( 1 );
}
.
.
.
/* enable a handler for all events on any devices */
if( sr_enbhdlr( EV_ANYDEV, EV_ANYEVT, dx_handler ) == -1 ){
printf( "Error: could not enable handler\n" );
exit( 1 );
}
.
.
.
/*
* Place channel on-hook by calling dx_sethook( ) with
* its mode field set to EV_ASYNC (asynchronous).
*/
if( dx_sethook( voxdev, DX_ONHOOK, EV_ASYNC ) == -1 ){
printf( "dx_sethook failed: error = %s\n", ATDV_ERRMSGP( voxdev ));
exit( 1 );
}
.
.
/*
* Enable automatic Phase D messaging for TIFF/F file inter-page
* Phase D value by setting FC_SENDCONT to DFC_AUTO.
*/
.
.
}
/*
* All channels have been opened and a sethook function
* issued to place the channels on-hook. Use sr_waitevt( )
* to wait for completion events. On receiving any
* completion event, control is transferred to the
* catchall( ) handler function.
*/
while(sr_waitevt(-1))
.
.
/* Event handler. */
/*
* This routine gets called when sr_waitevt( ) receives any event.
* Maintain a state machine for every channel and issue the
* appropriate function depending on the next action to be
* performed on the channel, e.g., the application may wish
* to perform an outbound dial after receiving an offhook
* completion event.
*/
int catchall( )
{
int dev;
char * fnamep;
long phdcmd, phdrpy;
dev = sr_getevtdev( );
/* Determine the event. */
switch(sr_getevttype( )) {
case TDX_SETHOOK:
.
.
break;
case TDX_DIAL:
/* Dial complete. */
.
.
/*
* Connection has been established with remote
* receiver. Prepare to send fax. Call fax_send( ) -
* fnamep is the name of the file (TIFF/F) containing
* the document to be sent.
*/
if (fax_send(dev, fnamep,DF_TIFF) == -1) {
/*
* Application specific error handling here;
* fax_send( ) prints out error information.
*/
.
.
}
break;
case TFX_FAXSEND:
/* The document has been successfully sent. */
printf("Sent %ld pages at speed %ld, resln %ld,
width %ld\n", ATFX_PGXFER(dev), ATFX_SPEED(dev),
ATFX_RESLN(dev), ATFX_WIDTH(dev));
/* Set channel on-hook; fax session completed. */
.
.
break;
case TFX_FAXERROR:
/* Error during the fax session. */
print_err(dev);
printf("Phase E status %ld\n", ATFX_ESTAT(dev));
/* Application specific error handling. */
.
.
break;
default:
.
.
break;
} /* End of switch. */
return(0);
}
/*
* This routine is called from the catchall( ) event handler
* after an outbound dial has successfully completed and a
* fax document has to be sent. The fax_send( ) routine will
* perform the necessary initialization of the DF_IOTT
* structure and call fx_sendfax( ) to send the document.
*/
int fax_send(dev, filenamep, datatype)
int dev;
char * filenamep;
int datatype;
{
int fhandle;
/*
* Set the Local ID using fx_setparm( ) and set the
* initial state of the channel to be a transmitter
* (DF_TX) using fx_initstat( ).
*/
.
/*
* Set up the DF_IOTT structure to send the required
* document.
*/
if((fhandle = dx_fileopen(filenamep, O_RDONLY|O_BINARY, NULL))==-1) {
printf("Unable to open send file %s\n",filenamep);
return(-1);
}
fx_setiott(&iott, fhandle, datatype, DFC_EOP);
iott.io_type |= IO_EOT;
/*
* Set the fax state of the channel to DF_TX using
* fx_initstat( ).
*/
.
if (fx_sendfax(dev, &iott, EV_ASYNC) == -1) {
printf("Error issuing sendfax\n");
print_err(dev);
.
.
return(-1);
}
return(0);
}
Example 4: Send Fax with two TIFF/F files, Each File to a Different Subaddress
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
#define NUMDOC 2
/* Need a DF_IOTT entry for each document to send. */
DF_IOTT iott[NUMDOC];
int tifd1,tifd2;
int dev; /* Fax channel device handle */
int voxdev; /* Voice channel device handle */
unsigned short phdcmd;
char *subaddr1 "3865";
char *subaddr2 "3923";
.
.
/*
* Open the channel using dx_open( ) to obtain the Dialogic
* voice channel device handle in voxdev.
*/
if ((voxdev = dx_open("dxxxB1C1", NULL)) == -1) {
/* Error opening device */
/* Perform system error processing */
exit(1);
}
/*
* Open the channel using fx_open( ) to obtain the fax
* channel device handle in dev.
*/
if ((dev = fx_open("dxxxB1C1", NULL)) == -1) {
/* Error opening device */
/* Perform system error processing */
exit(1);
}
.
.
/*
* Take channel offhook using dx_sethook( ) and perform
* outbound dial using dx_dial( ). Use voxdev as
* channel device handle for Voice API functions.
*/
.
.
/* Required -- set initial state of channel to Transmitter */
if (fx_initstat(dev,DF_TX) == -1) {
printf("Error - %s (error code %d)\n", ATDV_ERRMSGP(dev),
ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
}
/*
* Change the default FC_SENDCONT parameter value (DFC_EOM) to DFC_AUTO.
* Note: The FC_SENDCONT parameter controls the Phase D command sent between
* pages of a multi-page TIFF/F file. When subaddress fax routing is specified in
* fx_sendfax( ), DFC_AUTO sets the FC_SENDCONT parameter value to DFC_MPS for the
* fax transmission. If the FC_SENDCONT value is left at the default (DFC_EOM) when
* subaddress fax routing is specified, the DFC_EOM value would indicate that each
* page of the multi-page TIFF/F file should be sent to a different subaddress.
* With DFC_EOM, renegotiation of Phase B would take place after each TIFF/F page.
*/
phdcmd = DFC_AUTO;
if (fx_setparm(dev,FC_SENDCONT,(void *)&phdcmd) == -1) {
printf("Error - %s (error code %d)\n", ATDV_ERRMSGP(dev),
ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
}
/* Open TIFF/F files to transmit. */
tifd1 = dx_fileopen("file3865.tif",O_RDONLY | O_BINARY);
tifd2 = dx_fileopen("file3923.tif",O_RDONLY | O_BINARY);
/*
* To allow the application to route the second TIFF/F file to a different
* subaddress, set the first TIFF/F file's DF_IOTT data structure's io_phdcont
* field value to DFC_EOM. DFC_EOM will force a Phase B negotiation after all
* specified pages of the first TIFF/F file are sent (the io_type field value
* should be set to IO_EOT). The second subaddress is sent to the receiver
* during the second Phase B negotiation. Note: This only needs to be done when
* sending fax data to more than one subaddress. If all fax data is to be sent to
* one subaddress, set the parameter once and send the entire fax.
*/
fx_setiott(&iott[0],tifd1,DF_TIFF,DFC_EOM);
iott[0].io_type |= IO_EOT;
/*
* Set the next DF_IOTT structure in the array. Send Phase D
* continuation value DFC_EOP after the final TIFF/F document.
*/
fx_setiott(&iott[1],tifd2,DF_TIFF,DFC_EOP);
iott[1].io_type |= IO_EOT;
/* Set the subaddress parameter for the first TIFF/F file. */
if ((rc = fx_setparm(dev, FC_TXSUBADDR, subaddr1)) == -1) {
printf("\nTXSUBADDR setparm Error : %s", ATDV_ERRMSGP(dev)
.
.
}
/* Send the first file. */
if (fx_sendfax(dev, &iott[0] , DF_TXSUBADDR|EV_SYNC) == -1) {
printf("Error code: %ld Error message: %s\n",
ATDV_LASTERR(dev), ATDV_ERRMSGP(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
printf("Phase E status: %ld\n", ATFX_ESTAT(dev));
/* Further error processing - application specific. */
.
.
}
/* Update the subaddress parameter for the second TIFF/F file. */
if ((rc = fx_setparm(dev, FC_TXSUBADDR, subaddr2)) == -1) {
printf("\nTXSUBADDR setparm Error : %s", ATDV_ERRMSGP(dev)));
.
}
.
.
/* Send the second file. */
if (fx_sendfax(dev, &iott[1] , DF_TXSUBADDR|EV_SYNC) == -1) {
printf("Error code: %ld Error message: %s\n",
ATDV_LASTERR(dev), ATDV_ERRMSGP(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
printf("Phase E status: %ld\n", ATFX_ESTAT(dev));
/* Further error processing - application specific. */
.
.
}
.
.
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( ).
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation