
Description | Example | Errors | See Also
Name: |
long ATFX_CODING(dev) | |
Inputs: |
int dev |
fax channel device handle |
Returns: |
negotiated line encoding scheme if successful | |
|
AT_FAILURE if error (or if initial Phase B not completed) | |
Includes: |
srllib.h | |
|
dxxxlib.h | |
|
faxlib.h | |
Category: |
extended attribute | |
Mode: |
Synchronous | |
|
||
The ATFX_CODING( ) function returns most recently negotiated fax encoding scheme between the transmitter and receiver for the specified fax channel.
Valid values are:
Modified Huffman line encoding scheme | |
DFS_MR |
Modified Read line encoding scheme |
DFS_MMR |
Modified Modified Read line encoding scheme |
Parameter |
Description |
|
dev |
Specifies the channel device handle for the fax channel obtained when the channel was opened. |
The data provided by this function is updated each time the fax transfer completes Phase B of the T.30 protocol. After a fax session terminates, the value from the last fax transfer is available until the start of a new fax session.
To be notified when Phase B has completed, you must enable Phase B events (DF_PHASEB in the fx_rcvfax( ), fx_rcvfax2( ) or fx_sendfax( ) function) and issue ATFX_CODING( ) when the Phase B event (TFX_PHASEB) occurs.
Between multiple Phase B completions during the same fax session, ATFX_CODING( ) returns the Phase B encoding information from the previously completed Phase B negotiation.
For a receiver application, the line encoding scheme negotiated between the transmitter and receiver for the fax transfer may be different than the encoding scheme of the stored fax data.
For a transmitter application, the line encoding scheme negotiated between the transmitter and receiver for the fax transfer may be different than the encoding scheme of the stored fax data or the encoding scheme specified in the FC_TXCODING parameter. The final negotiated data transmission line encoding scheme is based on the receiver's capabilities.
#include <stdio.h>
#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 using fx_open( ) and obtain the Dialogic
* FAX device handle in dev.
*/
.
.
/*
* Install handler 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( );
/* Negotiated line encoding scheme. */
printf("Negotiated data encoding scheme: %ld\n",
ATFX_CODING(dev));
.
.
return(0);
}
If one of the following conditions is present, this function fails and returns AT_FAILURE:
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation