(Page 61 of 80 in this chapter)
typedef struct
{
DWORD size ; /* size of this structure */
DWORD freq1; /* first frequency (Hz) */
INT32 ampl1; /* level of first tone (dBm) */
DWORD freq2; /* second frequency (Hz) */
INT32 ampl2; /* level of second tone (dBm) */
DWORD ontime; /* on duration of DTMF tone (ms) */
DWORD offtime; /* off duration of DTMF tone (ms) */
INT32 iterations; /* times to repeat above; -1 = forever */
/* last offtime is trimmed if repeat>1 */
} ADI_TONE_PARMS;
/* generates an Intralata Reorder SIT per BellCore */
int myPlaySITReorder( CTAHD ctahd )
{
ADI_TONE_PARMS p[3] = {0};
ADI_EVENT event;
int tonecnt = 3;
p[0].freq1 = 914; p[0].ampl1 = -24; p[0].ontime = 275; p[0].iterations = 1;
p[1].freq1 = 1429; p[1].ampl1 = -24; p[1].ontime = 380; p[1].iterations = 1;
p[2].freq1 = 1777; p[2].ampl1 = -24; p[2].ontime = 380; p[2].iterations = 1;
if( adiStartTones( ctahd, tonecnt, p ) != SUCCESS )
return MYFAILURE;
while( 1 )
{
myGetEvent( &event ); /* see adiFetchAndProcess example */
switch( event.id )
{
case ADIEVN_TONES_DONE:
if( event.value == CTA_REASON_RELEASED )
return MYDISCONNECT; /* call has been terminated */
else if( IS_ADI_ERROR( event.value ) )
return MYFAILURE; /* API error */
else
return SUCCESS; /* stopped normally */
break;
}
}
}
(Page 61 of 80 in this chapter)