Intel 05-2342-002 Computer Accessories User Manual


 
34 Voice API for Linux Demo Guide — June 2005
Demo Details
The message system uses the DL_MSGS and DL_MSGTBL structures to store the information
needed for a DX_IOTT structure. The buildmsg( ), buildmsg_v( ), builddate( ), gt_iott( ),
gt_numiott( ), gt_groupiott( ), and gt_pairiott( ) functions use the message structures to build the
DX_IOTT structure. The playmsg( ) and plaympmsg( ) functions use the DX_IOTT structure to
play the message. The code for the playmsg( ) function is:
void playmsg(msgp)
char * msgp;
{
DX_IOTT iott[25];
DX_IOTT * iottp;
if (msgp[0] < ' '){ /* if it's an IOTT list */
iottp = (DX_IOTT *)msgp; /* just play it */
}else{ /* else */
buildmsg(iott,msgp,NULL); /* build IOTT list for */
iottp = iott; /* named prompt of nmbr */
}
if(dx_play(devhandle,(DX_IOTT *)iottp,(DV_TPT *)def_rp_tpt,NULL) == -1) {
disperr("Error playing message");
}
check_term(&csb); /* abort if hang-up condition */
}
The first if statement checks to see if the msgp parameter is either a DX_IOTT structure or an
ASCII name. If it is an ASCII name, a call to buildmsg( ) is used to create a DX_IOTT structure
from the DL_MSG structure named by msgp.
The dx_play( ) function plays the message using the DX_IOTT structure and the default record-
play DV_TPT structure located in def_rp_tcb.