# Stopping

Call vceStop to stop play or record. Stopping play or record results in a DONE event. The value field of the DONE event contains CTA_REASON_STOPPED.

Note: CTA_REASON_STOPPED is also returned if play or record is stopped when the voice object being played or recorded is closed with vceClose. If you are playing a list, play is stopped if an object containing any message in the list is closed.

## Using DTMF to terminate play or record

By default, play or record terminates when any DTMF digit is detected. The play parameter structure and the record parameter structure provide a selective DTMF abort mask specifying which DTMF digits terminate the function.

The DTMF abort mask is a 16-bit entity where each bit corresponds to a specific key on the telephone keypad. Setting a bit in the mask causes the voice function to terminate if that particular key is entered. The DTMF abort mask corresponds to the DTMF telephone keys as shown:

| Most significant bit | Least significant bit
--- | --- | ---
Bit position | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
DTMF key | D | C | B | A | # | * | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0

For example, if the abort mask is set to 0x03FF, the playing and recording functions terminate if the remote party enters any digit from 0 through 9. The vcedef.h include file contains #defines (VCE_DTMF_xxx) for each digit and for certain digit groups.