
Description | Cautions | Example | Errors
Name: |
int fx_initstat(dev,state) | |
Inputs: |
int dev |
fax channel device handle |
|
int state |
initial fax state |
Returns: |
0 if success | |
|
-1 if failure | |
Includes: |
srllib.h | |
|
dxxxlib.h | |
|
faxlib.h | |
Category: |
set initial fax state | |
Mode: |
synchronous | |
|
||
The fx_initstat( ) function sets the initial fax state. You must issue this function in your application to establish the initial fax state of the specified fax channel.
Following T.30 protocol, you must always initially set a caller party to be the transmitter of a fax and a called party to be the receiver of a fax.
Only use the fx_initstat( ) function prior to issuing the first send or receive function of a fax session. Once you issue the fx_initstat( ) function for a fax session, the correct fax state of the application is maintained automatically by the fax library throughout the fax session, even if turnaround polling is specified.
|
||
Parameter |
Description | |
dev |
Specifies the channel device handle for the fax channel obtained when the channel was opened. | |
state |
Specifies the initial fax state. Valid values: | |
|
DF_RX |
called application (receive state) 0 |
|
DF_TX |
caller application (transmit state) 1 |
You must issue the fx_initstat( ) function before issuing the first send or receive function for a fax call to select the appropriate protocol for the fax session.
#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
int voxdev; /* Voice channel device handle. */
int dev; /* Fax channel device handle. */
/*
* Open the channel using dx_open( ) and obtain the Dialogic
* VOICE channel device handle in voxdev. Use voxdev for all
* Voice API calls.
*/
.
.
/*
* Open the channel using fx_open( ) and obtain the Dialogic
* FAX channel device handle in dev. Use dev for all
* Fax API calls.
*/
.
.
/*
* Set channel on-hook using dx_sethook( ) in synchronous
* mode.
*/
.
.
/*
* Wait for 1 ring and go off-hook. */
.
.
/*
* Set the initial FAX state to be RECEIVER. */
if (fx_initstat(dev,DF_RX) == -1) {
printf("Error - %s (error code %d)\n", ATDV_ERRMSGP(dev),
ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
}
/* Issue a fx_rcvfax( ). */
.
.
See Appendix D for a list of error codes that may be returned for this function.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation