
Description | Example | Errors
Name: |
long ATFX_TERMMSK(dev) | |
Inputs: |
int dev |
fax channel device handle |
Returns: |
bitmap of termination reasons if successful | |
|
AT_FAILURE if error | |
Includes: |
srllib.h | |
|
dxxxlib.h | |
|
faxlib.h | |
Category: |
extended attribute | |
Mode: |
Synchronous | |
|
||
The ATFX_TERMMSK( ) function returns a bitmap of termination reasons.
Call this function after the successful completion of fx_rcvfax( ), fx_rcvfax2( ), or fx_sendfax( ) to determine the termination reason. Valid values are:
|
TM_FXTERM |
Normal completion of fax send/receive |
TM_POLLED |
Poll request received from transmitter |
TM_VOICEREQ |
Voice request (operator intervention) issued/received |
The termination reason is available until the next send or receive is issued on the channel.
|
|
Parameter |
Description |
|
dev |
Specifies the channel device handle for the fax channel obtained when the channel was opened. |
#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
int dev;
long lTermMask;
/*
* Open the channel using fx_open( ) and obtain the Dialogic
* FAX device handle in dev.
*/
.
.
/*
* Call fx_rcvfax( ) to receive a fax into the file
* "myfax.tif".
*/
if (fx_rcvfax(dev, "myfax.tif", DF_TIFF|EV_SYNC) == -1) {
printf("Error - %s (error code %ld)\n",
ATDV_ERRMSGP(dev),ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev)==EDX_SYSTEM) {
/* Perform system error processing */
}
/*
* Additional error processing - check Phase E status to
* determine cause of error during fax protocol.
*/
printf("Phase E status: %ld\n", ATFX_ESTAT(dev));
.
.
}
/* Check termination reasons. */
lTermMask = ATFX_TERMMSK (dev);
/* Evaluate success/failure separately because all bits are turned on for -1 */
if (lTermMask == -1) {
printf("Failed to retrieve the termination mask!\n");
/* Process error */
}
if (lTermMask & TM_POLLED) {
printf("Poll received\n");
/* Respond to poll by issuing a fx_sendfax( ). */
.
.
}
if (lTermMask & TM_VOICEREQ) {
printf("Voice request received\n");
/* Respond to voice request (PRI_EOP). */
.
.
}
This function fails and returns AT_FAILURE if an invalid fax channel device handle is specified in dev.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation