adiStopDTMFDetector

Stops DTMF detection.

Supported board types

Prototype

DWORD adiStopDTMFDetector ( CTAHD ctahd)

Argument

Description

ctahd

Context handle returned by ctaCreateContext or ctaAttachContext.

Return values

Return value

Description

SUCCESS

 

CTAERR_FUNCTION_NOT_ACTIVE

Attempt made to stop a function that was not running.

CTAERR_INVALID_CTAHD

Context handle is invalid.

CTAERR_INVALID_SEQUENCE

Attempt made to stop a function that is already being stopped.

CTAERR_INVALID_STATE

Function not available in the current port state.

CTAERR_SVR_COMM

Server communication error.

Events

Event

Description

ADIEVN_DTMF_DETECT_DONE

After the detector stops, the ADI service generates a DONE event with the value field set to CTA_REASON_STOPPED.

Details

Use adiStopDTMFDetector to disable detection of DTMFs. Detection is automatically enabled by the call control protocols upon transition to the ADI_CC_STATE_CONNECTED state. After this function is called, DTMF events are not reported. After the DONE event is received, restart the detector with adiStartDTMFDetector.

adiCollectDigits does not work if you disable DTMF detection. No digits are collected and no events are generated.

Example

int myStopDTMFDetector( CTAHD ctahd )
{
 CTA_EVENT event;

 if( adiStopDTMFDetector( ctahd ) != SUCCESS )
     return MYFAILURE;

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

     switch( event.id )
     {
         case ADIEVN_DTMF_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. */
     }
 }
}