> 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. # onCall > Register the inbound call handler. [call]: /docs/server-sdks/reference/typescript/relay/call Register the inbound call handler. The provided function is called once for each `calling.call.receive` event on the subscribed contexts. The function receives a [`Call`][call] object with all call properties and control methods. Only one call handler can be active at a time. Calling `onCall()` again replaces the previous handler. ## **Parameters** **`handler`** `CallHandler` — required An async function that receives a [`Call`][call] object. Signature: `(call: Call) => void | Promise`. --- ## **Returns** `CallHandler` — the same handler, returned to support decorator-style usage (e.g., TypeScript 5 decorators or manual composition). ## **Example** ```typescript {9} 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) => { console.log(`Received call: ${call.callId}`); await call.answer(); const action = await call.play([{ type: 'tts', text: 'Hello!' }]); await action.wait(); await call.hangup(); }); await client.run(); ``` > Register the inbound call handler.