> 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.

# detectFax

> Detect a fax tone on a call.

[detectaction]: /docs/server-sdks/reference/typescript/relay/actions

[detect]: /docs/server-sdks/reference/typescript/relay/call/detect

Detect a fax tone on the call. A typed convenience over [`detect()`][detect]
with the `fax` detector.

## **Parameters**

**`options`** `object`

Detector options.

---

**`options.tone`** `FaxTone`

`"CED"` (called station) or `"CNG"` (calling station).

---

**`options.timeout`** `number`

Maximum seconds to run the detector before stopping.

---

**`options.onCompleted`** `(event: RelayEvent) => void | Promise<void>`

Callback invoked when the operation reaches a terminal state.

---

## **Returns**

`Promise<`[`DetectAction`][detectaction]`>` -- An action handle with `stop()` and `wait()` methods. It resolves on the first detection result.

## **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.detectFax({ tone: 'CED', timeout: 20 });
  const event = await action.wait();
  console.log(event.params);
});

await client.run();
```