Developing a Fax Application

for (;;)

{

BT_ZERO(args_fax); args_fax.s_tp = tp; args_fax.combine = 0;

if (BfvFaxNextPageTiff(lp,&args_fax) <= 0) break;

BT_ZERO(args_fax); args_fax.s_tp = tp;

if (BfvFaxSendPageTiff(lp,&args_fax) < 0) break;

}

Loops through the TIFF-F file, getting the next page and sending it to the driver.

BfvFaxEndOfDocument(lp, &args_fax);

Finishes up when the TIFF data is exhausted.

BT_ZERO(args_tiff); args_tiff.tp = tp; BfvTiffClose(&args_tiff);

Closes the TIFF-F file after the file is transmitted.

BT_ZERO(args_admin);

BfvLineDetach (lp, &args_admin);

Frees all the memory for the attached line and closes the device.

Receiving a Fax Using Calls for TIFF-F Files

One way to receive a fax using function calls for TIFF-F files is demonstrated below. Each function is presented in sequential order, and the action it performs is described beneath it.

BT_ZERO(args_admin); args_admin.unit = unit;

lp = BfvLineAttach(&args_admin);

Attaches to a free channel and gets a BTLINE pointer.

args_admin.config_file_name = "usrcnfig.cfg"; BfvLineReset(lp,&args_admin);

Resets the channel and sets the user-configured options in the user-defined configuration file named usrcnfig.cfg.

BT_ZERO(args_tiff); args_tiff.fname = name; args_tiff.fmode = "w";

tp = BfvTiffOpen(&args_tiff);

Opens the TIFF-F file name to store the received fax.

November 2009

76

Page 76
Image 76
Dialogic 6.2 manual Receiving a Fax Using Calls for TIFF-F Files, Opens the TIFF-F file name to store the received fax