Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 167
close a channel or board device handle — dx_close( )
!
!!
! Errors
If this function returns -1 to indicate failure, a system error has occurred; use dx_fileerrno( ) to
obtain the system error value. Refer to the dx_fileerrno( ) function for a list of the possible system
error values.
!
!!
! Example 1
This example illustrates how to close a channel device handle.
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
int chdev; /* channel descriptor */
.
.
.
/* Open Channel */
if ((chdev = dx_open("dxxxB1C1",NULL)) == -1) {
/* process error */
}
.
.
.
/* Close channel */
if (
dx_close(chdev)
== -1) {
/* process error */
}
}
!
!!
! Example 2
This example illustrates how to close a physical board device handle when using cached prompts.
#include "srllib.h"
#include "dxxxlib.h"
main()
{
int brdhdl; /* board handle */
.
.
.
/* Open board */
if (
(brdhdl = dx_open("brdB1",0)
) == -1) {
printf("Cannot open board\n");
/* Perform system error processing */
exit(1);
}
.
.
.
dx_close(brdhdl);
}