# adiStopCollection

Stops the asynchronous digit collection operation.

#### Supported board types

- AG

- CG

#### Prototype

DWORD adiStopCollection ( CTAHD ctahd)

Argument | Description
ctahd | Context handle returned by ctaCreateContext or ctaAttachContext.

#### Return values

Return value | Description
SUCCESS |
ADIERR_INVALID_CALL_STATE | Function not available in the current call state.
CTAERR_FUNCTION_NOT_ACTIVE | Attempt made to stop a function that was not running.
CTAERR_INVALID_CTAHD | Context handle is invalid.
CTAERR_INVALID_STATE | Function not available in the current port state.
CTAERR_SVR_COMM | Server communication error.

#### Events

Event | Description
ADIEVN_COLLECTION_DONE | After digit collection terminates, the ADI service generates a DONE event with the value field set to CTA_REASON_STOPPED.

#### Details

Use adiStopCollection to stop digit collection started with adiCollectDigits. When digit collection stops, ADIEVN_COLLECTION_DONE is generated. Any digits already collected are included in the event's buffer.

#### See also

adiFlushDigitQueue, adiGetDigit