# adiStopTones

Stops generating tones.

#### Supported board types

- AG

- CG

#### Prototype

DWORD adiStopTones ( 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_TONES_DONE | When the tone generation function is stopped, the ADI service generates a DONE event with the value (reason) CTA_REASON_STOPPED.

#### Details

Use adiStopTones to terminate tone generation started by either adiStartTones or adiStartDTMF. You can restart tone generation, and any other functions requiring voice output, when you receive the DONE event.

For more information, refer to Generating tones.

#### Example

int myStopTones( CTAHD ctahd )
{
CTA_EVENT event;
if( adiStopTones( ctahd ) != 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;
/* might include cases to handle disconnect, DTMFs, etc. */
}
}
}