Skip to main content

Call Class

The Call object represents a voice call. It’s created by client.newCall() (outbound) or received via telnyx.notification (inbound).

Getting a Call Object

Outbound call

Inbound call


Properties


Call States


Methods

answer()

Answer an incoming call.
Only call answer() when the call state is ringing. Calling answer() on an already-active call creates a duplicate PeerConnection, which causes one-way audio issues.

hangup()

End the call.
See Migration Guide for upgrading from 2.25.x.

muteAudio() / unmuteAudio()

Toggle the microphone.

hold() / unhold()

Put the call on hold or resume it.

dtmf(digit)

Send a DTMF tone (0-9, *, #).

sendAIConversationMessage(item)

Send an outbound AI conversation item over the active VSP WebSocket session. Use this to return the result of a client-side tool execution back to the AI backend after receiving a function_call via the telnyx.ai.conversation event, or to subscribe to ACA pre-playout assistant audio. For client-side tool results:
For ACA pre-playout audio subscription:
The call_id must match the one from the inbound function_call. This is a fire-and-forget notification — the SDK does not wait for a response. Requires an active WebSocket connection (throws if disconnected).

sendDigits(digits)

Send a sequence of DTMF digits.

Events

Register event listeners using call.on(eventName, handler):

Call State Events


Advanced

Access the PeerConnection

For custom WebRTC monitoring or manipulation:
Direct PeerConnection access is for advanced use cases only. The SDK manages the PeerConnection lifecycle — calling methods like close() or setRemoteDescription() directly may break the call.

Custom headers

Add SIP headers to the INVITE for server-side correlation:

Common Patterns

Simple outbound call with state handling

Inbound call with accept/reject UI

Hold and resume


See Also