
Description | Cautions | Example | Errors | See Also
Name: |
int fx_stopch(dev, mode) | |
Inputs: |
int dev |
valid Dialogic fax channel device handle |
|
unsigned short mode |
synchronous/asynchronous mode bitmap |
Returns: |
0 if success | |
|
-1 if failure | |
Includes: |
srllib.h | |
|
dxxxlib.h | |
|
faxlib.h | |
Category: |
resource management | |
Mode: |
synchronous/asynchronous | |
|
||
The fx_stopch( ) function forces termination of a fax send or receive on a fax channel device. It forces a fax channel in the busy state to become idle.
If the fax channel specified in dev is already idle, fx_stopch( ) has no effect and returns a success.
A fx_stopch( ) function issued on a channel executing the T.30 fax protocol for either send or receive will disconnect the fax transfer and enter Phase E of the T.30 fax protocol to terminate the fax transfer. The active send or receive function returns a -1. ATDV_LASTERR( ) returns EFX_DISCONNECT and ATFX_ESTAT( ) returns EFX_ABORTCMD.
Dialogic recommends that you use fx_stopch( ) to stop fax I/O only after a fax send or receive function has been issued.
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
main( )
{
int dev; /* Fax channel device handle.*/
/* Open the FAX channel device. */
if ((dev = fx_open("dxxxB1C1", NULL)) == -1) {
/* Error opening device. */
/* Perform system error processing */
exit(1);
}
/* Use the FAX channel device to send or receive faxes. */
.
.
/*
* Issue a stop to force the termination of the fax session
* if necessary.
*/
if (fx_stopch(dev, EV_ASYNC) == -1) {
/* Error stopping device. */
printf("Error stopping channel\n");
printf("Error - %s (error code %d)\n",
ATDV_ERRMSGP(dev), ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
exit(1);
}
.
.
}
If this function returns -1 to indicate failure, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following error reasons:
|
|
EDX_BADPARM |
Invalid fax parameter |
EDX_SYSTEM |
Operating system error; use dx_fileerrno( ) to obtain error value. |
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation