Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 293
open a voice device and return a unique device handle — dx_open( )
!
!!
! Cautions
Do not use the Windows open( ) function to open a voice device. Unpredictable results will
occur.
In applications that spawn child processes from a parent process, the device handle is not
inheritable by the child process. Make sure devices are opened in the child process.
!
!!
! 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 open a channel device.
#include <windows.h>
#include "srllib.h>"
#include "dxxxlib.h>"
main()
{
int chdev; /* channel descriptor */
.
.
.
/* Open Channel */
if ((chdev =
dx_open("dxxxB1C1",0)
) == -1) {
/* process error */
}
.
.
}
!
!!
! Example 2
This example illustrates how to open a physical board device when using cached prompts.
#include <windows.h>
#include "srllib.h>"
#include "dxxxlib.h>"
main()
{
int brdhdl; /* board handle */
.
.
.
/* Open board */
if ((brdhdl =
dx_open("brdB1",0)
) == -1) {
/* process system error */
exit(1);
}
.
.
.
}