> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # DetectAction > Action handle for an active detection operation. [call-detect]: /docs/server-sdks/reference/typescript/relay/call/detect [base-action-interface]: /docs/server-sdks/reference/typescript/relay/actions [stop]: /docs/server-sdks/reference/typescript/relay/actions/detect-action/stop Returned from [`call.detect()`][call-detect]. Tracks an active detection operation (answering machine, fax tone, or digit detection). Terminal states: `finished`, `error`. > **Note** > > Unlike other actions, `DetectAction` also resolves on the first detection result, > not just on terminal state events. This means `await action.wait()` returns as > soon as a detection is made. Inherits all properties and methods from the [base Action interface][base-action-interface] (`controlId`, `isDone`, `completed`, `result`, `wait()`). ## **Properties** No additional properties beyond the [base Action interface][base-action-interface]. ## **Methods** #### [stop](/docs/server-sdks/reference/typescript/relay/actions/detect-action/stop) Stop detection immediately. ## **Example** ```typescript {11} import { RelayClient } from '@signalwire/sdk'; const client = new RelayClient({ project: process.env.SIGNALWIRE_PROJECT_ID!, token: process.env.SIGNALWIRE_API_TOKEN!, contexts: ['default'] }); client.onCall(async (call) => { await call.answer(); const action = await call.detect({ type: 'machine', params: { initialTimeout: 5.0 }, }); const event = await action.wait(10); const detectResult = event.params.detect ?? {}; console.log(`Detected: ${JSON.stringify(detectResult)}`); }); await client.run(); ``` > Action handle for an active detection operation. ## Docs - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/detect-action/stop.md): Stop detection immediately.