Documentation Index
Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
Use this file to discover all available pages before exploring further.
Call Class
TheCall 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
| Property | Type | Description |
|---|---|---|
id | string | Unique call identifier |
state | CallState | Current call state (see Call States) |
direction | 'inbound' | 'outbound' | Call direction |
remotePartyNumber | string | Remote party’s phone number |
remotePartyName | string | Remote party’s display name (if available) |
localPartyNumber | string | Local party’s phone number |
active | boolean | Whether the call is currently active |
recoveredCallId | string | Previous call ID if this call was recovered after reconnection |
peerConnection | RTCPeerConnection | Underlying WebRTC PeerConnection (for advanced use) |
Call States
| State | Description |
|---|---|
new | Call object created, not yet dialed |
requesting | Outbound INVITE sent to server |
ringing | Inbound: INVITE received. Outbound: remote ringing |
answering | Inbound call being answered (media negotiation) |
active | Call connected — media flowing |
held | Call on hold |
hangup | Call ended (local or remote hangup) |
destroy | Call object cleaned up |
recovering | Call being recovered after reconnection |
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.
muteAudio() / unmuteAudio()
Toggle the microphone.
hold() / unhold()
Put the call on hold or resume it.
dtmf(digit)
Send a DTMF tone (0-9, *, #).
sendDigits(digits)
Send a sequence of DTMF digits.
Events
Register event listeners usingcall.on(eventName, handler):
Call State Events
| Event | Payload | Description |
|---|---|---|
telnyx.notification | INotification | Call state updates, media 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
- ICallOptions — Call configuration options
- INotification — Notification types and payloads
- TelnyxRTC Class — Client methods and events
- SDK Commonalities — Call states across all SDK platforms
- Best Practices — Production call management guide