
Description | Example | Errors | See Also
Name: |
int ATFX_ECM (dev) | |
Inputs: |
int dev |
fax channel device handle |
Returns: |
whether fax data was transferred using ECM if successful | |
|
-1 if function called before completion of Phase B | |
Includes: |
srllib.h | |
|
dxxxlib.h | |
|
faxlib.h | |
Category: |
extended attribute | |
Mode: |
synchronous | |
|
||
The ATFX_ECM( ) function returns information on use of ECM for fax data transfer. Valid values are:
DFS_NOECM |
Error Correction Mode (ECM) not used to transfer fax data |
DFS_ECM |
Error Correction Mode (ECM) used to transfer fax data |
This function has the following parameter:
|
|
Parameter |
Description |
dev |
Specifies the channel device handle for the fax channel obtained when the channel was opened. |
After completion of Phase B negotiation, you can call ATFX_ECM( ) to determine whether ECM was used in the fax data transfer. The value in ATFX_ECM( ) remains valid until a new fax session is initiated.
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
DF_IOTT iott[10];
int dev;
/* Handler for Phase B events. */
int phb_hdlr( );
main( )
{
/*
* Open the channel and obtain the Dialogic device handle
* in dev.
*/
.
.
/*
* Install handler using sr_enbhdlr( ) to service
* TFX_PHASEB events.
*/
if (sr_enbhdlr(dev, TFX_PHASEB, phb_hdlr) == -1) {
printf("Failed to install Phase B handler \n");
return;
}
/*
* Call fx_sendfax( ) in asynchronous mode after setting
* up the DF_IOTT array. Set DF_PHASEB bit in mode field
* to enable generation of Phase B events.
*/
if (fx_sendfax(dev, iott, EV_ASYNC|DF_PHASEB) == -1) {
printf("Error - %s (error code %d)\n",
ATDV_ERRMSGP(dev),ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev)==EDX_SYSTEM) {
/* Perform system error processing */
}
}
.
.
}
/*
* Handler registered with SRL to handle TFX_PHASEB events.
*/
int phb_hdlr( )
{
int dev = sr_getevtdev( );
if (ATFX_ECM(dev) == DFS_ECM) {
printf("ECM was used during transfer\n");
.
.
}
return(0);
}
If an invalid fax channel device handle is specified in dev, this function fails and returns AT_FAILURE.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation