Intel 05-1832-002 IP Phone User Manual


 
410 Voice API for Windows Operating Systems Library Reference — November 2003
dx_settonelen( ) — change the duration of the built-in beep tone
!
!!
! Example
#include "srllib.h"
#include "dxxxlib.h"
int chdev; /* channel descriptor */
DV_TPT tpt; /* termination parameter table */
DX_XPB xpb; /* I/O transfer parameter block */
.
.
.
/* Increase beep tone len to 800ms */
dx_settonelen (4);
/* Open channel */
if ((chdev = dx_open("dxxxB1C1",0)) == -1) {
printf("Cannot open channel\n");
/* Perform system error processing */
exit(1);
}
/* Set to terminate play on 1 digit */
tpt.tp_type = IO_EOT;
tpt.tp_termno = DX_MAXDTMF;
tpt.tp_length = 1;
tpt.tp_flags = TF_MAXDTMF;
/* Wait forever for phone to ring and go offhook */
if (dx_wtring(chdev,1,DX_OFFHOOK,-1) == -1) {
printf("Error waiting for ring - %s\n", ATDV_LASTERR(chdev));
exit(2);
}
/* Start playback */
if (dx_playwav(chdev,"HELLO.WAV",&tpt,PM_TONE|EV_SYNC) == -1) {
printf("Error playing file - %s\n", ATDV_ERRMSGP(chdev));
exit(3);
}
/* clear digit buffer */
dx_clrdigbuf(chdev);
/* Start 6KHz ADPCM recording */
if
(dx_recvox(chdev,"MESSAGE.VOX", &tpt, NULL,RM_TONE|EV_SYNC) == -1)
{
printf("Error recording file - %s\n", ATDV_ERRMSGP(chdev));
exit(4);
}
/* hang up the phone*/
if (dx_sethook (chdev,DX_ONHOOK,EV_SYNC)) {
printf("Error putting phone on hook - %s\n", ATDV_ERRMSGP(chdev));
exit(5);
}
/* close the channel */
if (dx_close (chdev,DX_ONHOOK,EV_SYNC)) {
printf("Error closing channel - %s\n", ATDV_ERRMSGP(chdev));
exit(6);
}
!
!!
! See Also
dx_play( )
dx_playiottdata( )