
Description | Example | Errors | See Also
Name: |
long ATFX_BSTAT(dev) | |
Inputs: |
int dev |
fax channel device handle |
Returns: |
Phase B status bitmap after TFX_PHASEB event if successful | |
|
AT_FAILURE if error | |
Includes: |
srllib.h | |
|
dxxxlib.h | |
|
faxlib.h | |
Category: |
extended attribute | |
Mode: |
synchronous | |
|
||
The ATFX_BSTAT( ) function returns a bitmap to indicate Phase B status. Valid values are:
Phase B Status |
Description |
Remote station ID available | |
Remote station Non-Standard Facilities (NSF) message available | |
Digital Information Signal (DIS) message available, sent from receiver to transmitter | |
Digital Command Signal (DCS) message available, sent from transmitter to receiver | |
Subaddress routing message available, sent from transmitter to receiver |
To obtain the remote station ID, use the FC_REMOTEID parameter value in the fx_getparm( ) function.
For details on receiving the DCS, DIS and NSF messages, see the fx_getDCS( ), fx_getDIS( ) and fx_getNSF( ) function references.
|
|
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 information is available, you must enable Phase B events (DF_PHASEB in the fx_rcvfax( ), fx_rcvfax2( ) or fx_sendfax( ) function) and issue ATFX_BSTAT( ) when the Phase B event (TFX_PHASEB) occurs.
Between multiple Phase B negotiations during the same fax session, ATFX_BSTAT( ) returns the Phase B availability information from the previously completed Phase B negotiation.
If fx_sendfax( ), fx_rcvfax( ) and fx_rcvfax2( ) are issued in synchronous mode (EV_SYNC), you must install an event handler to handle Phase B events by using the sr_enbhdlr( ) function of the Standard Runtime Library. See the Voice Software Reference - Standard Runtime Library for event handler details.
#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( );
if (ATFX_BSTAT(dev) & DFS_REMOTEID) {
/*
* Remote ID available - get remote id using
* fx_getparm( ).
*/
.
.
}
/* Remote data rate capability. */
printf("Data rate for fax transmission: %ld\n",
ATFX_SPEED(dev));
.
.
return(0);
}
If one of the following conditions is present, this function fails and returns AT_FAILURE:
An invalid fax channel device handle is specified in dev.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation