*** id: d1578ee9-90b3-468e-a9aa-2fe587315475 title: detectFax slug: /node/reference/voice/call/detect-fax description: detectFax method for the Call class. max-toc-depth: 3 ---------------- [calldetect-events]: /docs/server-sdk/v4/node/reference/voice/call-detect#events [calldetect-onstarted]: /docs/server-sdk/v4/node/reference/voice/call-detect#onstarted [calldetect]: /docs/server-sdk/v4/node/reference/voice/call-detect ### detectFax \[#voice\_call\_detect\_fax] * **detectFax**(`params?`): `Promise`\<[`CallDetect`][calldetect]> Detects the presence of a fax machine. #### Parameters Object containing the parameters for fax detection. Number of seconds to run the detector for. The fax tone to detect: `CED` or `CNG`. Whether to wait until the device is ready for voicemail delivery. Callback to listen for events. List of detect events can be found [here][calldetect-events]. Example event: [`onStarted`][calldetect-onstarted]. #### Returns `Promise`\<[`CallDetect`][calldetect]> A promise that resolves to a [`CallDetect`][calldetect] object that you can use to view the current state and results of the `detect` session. #### Example ```js import { SignalWire } from "@signalwire/realtime-api"; const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" }) const voiceClient = client.voice; // Setup a voice client tolisten for incoming calls await voiceClient.listen({ topics: ['office'], onCallReceived: async (call) => { // Answer the call console.log("Call received"); call.answer(); // Fax detection await call.detectFax({ tone: 'CNG', listen: { onStarted: () => { console.log("Fax detection started"); }, onUpdated: (event) => { console.log("Fax detection updated:", event.result); }, onEnded: (event) => { console.log("Fax detection finished:", event.result); call.hangup(); } } }).onStarted() } }) ```