Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 181
create a new tone definition for a specific call progress tone — dx_createtone( )
!
!!
! 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_SYSTEM
error from operating system
EDX_TNPARM
invalid tone template parameter
EDX_TNQUERYDELETE
tone not queried or deleted prior to create
!
!!
! Example
#include "srllib.h"
#include "dxxxlib.h"
main()
{
int brdhdl; /* board handle */
.
.
.
/* Open board */
if ((brdhdl = dx_open("brdB1",0)) == -1) {
printf("Cannot open board\n");
/* Perform system error processing */
exit(1);
}
/* Get the Tone Information for the TID_BUSY1 tone*/
int result;
TONE_DATA tonedata;
if ((result = dx_querytone(brdhdl, TID_BUSY1, &tonedata, EV_ASYNC)) == -1) {
printf("Cannot obtain tone information for TID_BUSY1 \n");
/* Perform system error processing */
exit(1);
}
/* Delete the current TID_BUSY1 call progress tone before creating a new definition*/
if ((result = dx_deletetone(brdhdl, TID_BUSY1, EV_ASYNC)) == -1) {
printf("Cannot delete the TID_BUSY1 tone\n");
/* Perform system error processing */
exit(1);
}
/* Change call progress default Busy tone */
tonedata.numofseg = 1; /* Single segment tone */
toneinfo.toneseg[0].tn1_min = 0; /* Min. Frequency for Tone 1 (in Hz) */
toneinfo.toneseg[0].tn1_max = 450; /* Max. Frequency for Tone 1 (in Hz) */
toneinfo.toneseg[0].tn2_min = 0; /* Min. Frequency for Tone 2 (in Hz) */
toneinfo.toneseg[0].tn2_max = 150; /* Max. Frequency for Tone 2 (in Hz) */
toneinfo.toneseg[0].tnon_min = 400; /* Debounce Min. ON Time */
toneinfo.toneseg[0].tnon_max = 550; /* Debounce Max. ON Time */