> 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/python/relay/call/detect [base-action-interface]: /docs/server-sdks/reference/python/relay/actions [stop]: /docs/server-sdks/reference/python/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] (`control_id`, `is_done`, `completed`, `result`, `wait()`). ## **Properties** No additional properties beyond the [base Action interface][base-action-interface]. ## **Methods** #### [stop](/docs/server-sdks/reference/python/relay/actions/detect-action/stop) Stop detection immediately. ## **Example** ```python from signalwire.relay import RelayClient client = RelayClient( project="your-project-id", token="your-api-token", contexts=["default"], ) @client.on_call async def handle_call(call): await call.answer() action = await call.detect( {"type": "machine", "params": {"initial_timeout": 5.0}} ) event = await action.wait(timeout=10) detect_result = event.params.get("detect", {}) print(f"Detected: {detect_result}") client.run() ``` > Action handle for an active detection operation. ## Docs - [stop](https://signalwire.com/docs/server-sdks/reference/python/relay/actions/detect-action/stop.md): Stop detection immediately.