Table of Contents Index NMS Glossary Previous Page Next Page (Page 50 of 69 in this chapter) Version


adiStartTones

Description

Starts the generation of one or more tones.

Prototype

DWORD adiStartTones ( CTAHD ctahd,
unsigned count,
ADI_TONE_PARMS *parms )

ctahd CTA context handle returned by ctaCreateContext.

count The number of entries in the parms array.

parms Pointer to an array of tones, each defined by the following structure (NULL designates default values):

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;

Return Values

Events

DSP File

For most AG hardware, this function requires that tone.dsp has been loaded. On AG 2000 boards and AG 4000/C boards, tone.m54 must be loaded to the board before adiStartTones will work. On CG 6000C boards tone.f54 must be loaded to the board before adiStartTones will work. Refer to the board-specific installation and developer's manual for a table of MIPS usage for all functions.

For QX hardware, this function is supported in the standard DSP file. Refer to the QX Installation and Developer's Manual for a table of MIPS usage for all functions.

Details

Starts generation of a sequence of tones, each consisting of one or two frequencies and an iteration count. The DONE event is generated when the tone sequence has completed.

Each tone within the sequence comprises an ontime and an offtime, as well as an iterations count, all of which are contained in the ADI_TONE_PARMS structure. If the iterations count is one (1), the tone is not complete until the offtime has expired. If the iterations count is more than one, then the final offtime is omitted.

To generate a tone continuously (i.e. forever), set iterations to -1 and specify an offtime of 0 (zero).

Tone generation can be terminated prematurely using the adiStopTones command.

The ADI_TONE_PARMS structure contains the following fields:
Field

Description

freq1

The first of two frequencies or the only frequency of the tone to be generated (in Hz).

ampl1

The amplitude (in dBm) of the first frequency.

freq2

The second frequency (in Hz) if the tone to be generated contains two frequencies, or zero otherwise.

ampl2

The amplitude (in dBm) of the second frequency.

ontime

The duration (in ms) of the tone.

offtime

The duration (in ms) of silence to follow the tone; specify 0 for no offtime.

iterations

The number of times to repeat the tone (and silence period); specify -1 to repeat a cadence tone forever.

See Also

adiStopTones, adiStartDTMF

Example


/* generates an Intralata Reorder SIT per BellCore */
int myPlaySITReorder( CTAHD ctahd )
{
    ADI_TONE_PARMS p[3] = {0};
 CTA_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 ctaWaitEvent example */

        switch( event.id )
        {
            case ADIEVN_TONES_DONE:
                if( event.value == CTA_REASON_RELEASED )
                    return MYDISCONNECT;    /* call has been terminated */
                else if( CTA_IS_ERROR( event.value ) )
                    return MYFAILURE;       /* API error */
                else
                    return SUCCESS;         /* stopped normally */
                break;
        }
    }
}



Table of Contents Index NMS Glossary Previous Page Next Page (Page 50 of 69 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.