Intel 05-1832-002 IP Phone User Manual


 
230 Voice API for Windows Operating Systems Library Reference — November 2003
dx_getdig( ) — collect digits from a channel digit buffer
/* 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, 10 msec resolution */
tpt[2].tp_type = IO_EOT;
tpt[2].tp_termno = DX_MAXTIME; /* Function Time */
tpt[2].tp_length = 100; /* 10 seconds (100 msec resolution timer) */
tpt[2].tp_flags = TF_MAXTIME; /* Edge triggered */
/* clear previously entered digits */
if (dx_clrdigbuf(chdev[i]) == -1) {
/* process error */
}
if (
dx_getdig(chdev[i], tpt, &digp[chdev[i]], EV_ASYNC)
== -1) {
/* process error */
}
}
/* Use sr_waitevt() to wait for the completion of dx_getdig().
* On receiving the completion event, TDX_GETDIG, control is transferred
* to the handler function previously established using sr_enbhdlr().
*/
.
.
}
int digit_handler()
{
int chfd;
int cnt, numdigs;
chfd = sr_getevtdev();
numdigs = strlen(digp[chfd].dg_value);
for(cnt=0; cnt < numdigs; cnt++) {
printf("\nDigit received = %c, digit type = %d",
digp[chfd].dg_value[cnt], digp[chfd].dg_type[cnt]);
}
/* Kick off next function in the state machine model. */
.
.
return 0;
}
!
!!
! See Also
dx_addtone( )
dx_setdigtyp( )
DV_DIGIT data structure