Intel 05-1832-002 IP Phone User Manual


 
228 Voice API for Windows Operating Systems Library Reference — November 2003
dx_getdig( ) — collect digits from a channel digit buffer
corresponding voice channels are listening. This occurs because the network functionality of
the voice board cannot be separated from the voice functionality in an analog connection
between two callers. In this situation, you are not able to determine which caller sent the
DTMF digit.
!
!!
! Errors
If the function returns -1, use the Standard Runtime Library (SRL) Standard Attribute function
ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive
error message. One of the following error codes may be returned:
EDX_BADPARM
Invalid parameter
EDX_BADTPT
Invalid DV_TPT entry
EDX_BUSY
Channel busy
EDX_SYSTEM
Error from operating system; use dx_fileerrno( ) to obtain error value
!
!!
! Example 1
This example illustrates how to use dx_getdig( ) in synchronous mode.
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
DV_TPT tpt[3];
DV_DIGIT digp;
int chdev, numdigs, cnt;
/* open the channel with dx_open( ). Obtain channel device descriptor
* in chdev
*/
if ((chdev = dx_open("dxxxB1C1",NULL)) == -1) {
/* process error */
}
/* initiate the call */
.
.
/* Set up the DV_TPT and get the digits */
dx_clrtpt(tpt,3);
tpt[0].tp_type = IO_CONT;
tpt[0].tp_termno = DX_MAXDTMF; /* Maximum number of digits */
tpt[0].tp_length = 4; /* terminate on 4 digits */
tpt[0].tp_flags = TF_MAXDTMF; /* terminate if already in buf. */
tpt[1].tp_type = IO_CONT;
tpt[1].tp_termno = DX_LCOFF; /* LC off termination */
tpt[1].tp_length = 3; /* Use 30 msec (10 msec resolution timer) */
tpt[1].tp_flags = TF_LCOFF|TF_10MS; /* level triggered, clear history,