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


adiStopToneDetector

Description

Stops a precise tone detector.

Prototype

DWORD adiStopToneDetector ( CTAHD ctahd,
unsigned toneid )

ctahd CTA context handle returned by ctaCreateContext.

toneid A specified instance of the detector to stop (current range is 1-3, and corresponds to the toneid passed to adiStartToneDetector).

Return Values

Events

ADIEVN_TONE_1_DETECT_DONE

ADIEVN_TONE_2_DETECT_DONE

ADIEVN_TONE_3_DETECT_DONE

Details

This function deactivates a precise tone detector. When the detector is stopped, the ADI service generates a DONE event with the value field set to CTA_REASON_STOPPED. A specific DONE event is defined for each of three (3) precise tone detectors.

The tone detector specified by the toneid cannot be restarted until the DONE event is received.

See Also

adiStartToneDetector

Example


int myStopToneDetector( CTAHD ctahd )    /* stop detector #2 */
{
 CTA_EVENT event;

    if( adiStopToneDetector( ctahd, 2 ) != SUCCESS )
        return MYFAILURE;

    while( 1 )
    {
        myGetEvent( &event );           /* see ctaWaitEvent example */

        switch( event.id )
        {
            case ADIEVN_TONE_2_DETECT_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;

            /* might include cases to handle disconnect, DTMFs, etc. */
        }
    }
}



Table of Contents Index NMS Glossary Previous Page Next Page (Page 64 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.