Skip to main content

ICallOptions ICallOptions

Table of contents

Properties

Properties

audio

Optional audio: boolean | MediaTrackConstraints

Overrides client's default audio constraints. Defaults to true


callerName

Optional callerName: string

Name to use as the caller ID name when dialing out to a destination.


callerNumber

Optional callerNumber: string

Number to use as the caller ID when dialing out to a destination. A valid phone number is required for dials out to PSTN numbers.


camId

Optional camId: string

deviceId to use as webcam. Overrides the client's default one.


clientState

Optional clientState: string

Telnyx's Call Control client_state. Can be used with Connections with Advanced -> Events enabled. clientState string should be base64 encoded.


customHeaders

Optional customHeaders: { name: string ; value: string }[]

Add custom headers to the INVITE and ANSWER request.


debug

Optional debug: boolean

Enable debug mode for this call.


debugOutput

Optional debugOutput: "file" | "socket"

Output debug logs to a file.


destinationNumber

Optional destinationNumber: string

Phone number or SIP URI to dial.


forceRelayCandidate

Optional forceRelayCandidate: boolean

Force the use of a relay ICE candidate.


iceServers

Optional iceServers: RTCIceServer[]

Overrides client's default iceServers to use for certain call.


id

Optional id: string

Custom ID to identify the call. This will be used as the callID in place of the UUID generated by the client.


keepConnectionAliveOnSocketClose

Optional keepConnectionAliveOnSocketClose: boolean

Optimistic flag to attempt keeping the call alive when the WebSocket connection closes.

When enabled, the SDK will attempt to preserve the active call during brief network interruptions by re-attaching to the existing peer connection instead of hanging up when an attach message is received.

Important: This is an optimistic setting, not a deterministic guarantee. Recovery fails if the peer connection's signalingState transitions to closed (e.g., after device sleep), or if ICE restart was attempted due to connection failure. Check call.signalingStateClosed to determine if a call is recoverable.

See

IClientOptions.keepConnectionAliveOnSocketClose for detailed behavior documentation


localElement

Optional localElement: string | HTMLMediaElement

Overrides client's default localElement.


localStream

Optional localStream: MediaStream

If set, the call will use this stream instead of retrieving a new one.


mediaSettings

Optional mediaSettings: Object

Configures media (audio/video) in a call.

Type declaration

NameType
sdpASBandwidthKbps?number
useSdpASBandwidthKbps?boolean

micId

Optional micId: string

deviceId to use as microphone. Overrides the client's default one.


onNotification

Optional onNotification: Function

Overrides client's default telnyx.notification handler for this call.


preferred_codecs

Optional preferred_codecs: RTCRtpCodecCapability[]

Preferred codecs for the call.


prefetchIceCandidates

Optional prefetchIceCandidates: boolean

Enable or disable ICE Candidate Prefetching.


remoteElement

Optional remoteElement: string | HTMLMediaElement

Overrides client's default remoteElement.


remoteStream

Optional remoteStream: MediaStream

If set, the call will use this stream instead of retrieving a new one.


speakerId

Optional speakerId: string

deviceId to use as speaker. Overrides the client's default one.


telnyxCallControlId

Optional telnyxCallControlId: string

Telnyx Call Control ID, if using Call Control services.


telnyxLegId

Optional telnyxLegId: string

Telnyx call leg ID, if using Call Control services.


telnyxSessionId

Optional telnyxSessionId: string

Telnyx call session ID, if using Call Control services.


trickleIce

Optional trickleIce: boolean

Enable or disable Trickle ICE.


useStereo

Optional useStereo: boolean

Uses stereo audio instead of mono.


video

Optional video: boolean

Overrides client's default video constraints. Defaults to false