Intel 05-1832-002 IP Phone User Manual


 
342 Voice API for Windows Operating Systems Library Reference — November 2003
dx_rec( ) — record voice data from a single channel
/* Start asynchronous dx_rec() on the channel */
if (
dx_rec(chdev[i],&iott[i],&tpt,RM_TONE|EV_ASYNC)
== -1) {
/* process error */
}
}
/* Use sr_waitevt to wait for the completion of dx_rec().
* On receiving the completion event, TDX_RECORD, control is transferred
* to a handler function previously established using sr_enbhdlr().
*/
.
.
}
int record_handler()
{
long term;
/* Use ATDX_TERMMSK() to get the reason for termination. */
term = ATDX_TERMMSK(sr_getevtdev());
if (term & TM_MAXDTMF) {
printf("record terminated on receiving DTMF digit(s)\n");
} else if (term & TM_NORMTERM) {
printf("normal termination of dx_rec()\n");
} else {
printf("Unknown termination reason: %x\n", term);
}
/* Kick off next function in the state machine model. */
.
.
return 0;
}
!
!!
! See Also
dx_recf( )
dx_reciottdata( )
dx_recm( )
dx_recmf( )
dx_recvox( )
dx_setparm( )
dx_getparm( )
DX_IOTT data structure (to identify source or destination of the voice data)
event management functions in Standard Runtime Library API Library Reference
ATDX_TERMMSK( )
DV_TPT data structure (to specify a termination condition)
dx_setuio( )