Interface ICallOptions

ICallOptions ICallOptions

Hierarchy

  • ICallOptions

Properties

audio?: boolean | MediaTrackConstraints

Overrides client's default audio constraints. Defaults to true

callerName?: string

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

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?: string

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

clientState?: string

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

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

Add custom headers to the INVITE and ANSWER request.

Type declaration

  • name: string
  • value: string
debug?: boolean

Enable debug mode for this call.

debugOutput?: "file" | "socket"

Output debug logs to a file.

destinationNumber?: string

Phone number or SIP URI to dial.

forceRelayCandidate?: boolean

Force the use of a relay ICE candidate.

iceServers?: RTCIceServer[]

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

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?: 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?: string | HTMLMediaElement

Overrides client's default localElement.

localStream?: MediaStream

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

mediaSettings?: {
    sdpASBandwidthKbps?: number;
    useSdpASBandwidthKbps?: boolean;
}

Configures media (audio/video) in a call.

Type declaration

  • Optional sdpASBandwidthKbps?: number
  • Optional useSdpASBandwidthKbps?: boolean
micId?: string

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

onNotification?: Function

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

preferred_codecs?: RTCRtpCodecCapability[]

Preferred codecs for the call.

prefetchIceCandidates?: boolean

Enable or disable ICE Candidate Prefetching.

remoteElement?: string | HTMLMediaElement

Overrides client's default remoteElement.

remoteStream?: MediaStream

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

speakerId?: string

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

telnyxCallControlId?: string

Telnyx Call Control ID, if using Call Control services.

telnyxLegId?: string

Telnyx call leg ID, if using Call Control services.

telnyxSessionId?: string

Telnyx call session ID, if using Call Control services.

trickleIce?: boolean

Enable or disable Trickle ICE.

useStereo?: boolean

Uses stereo audio instead of mono.

video?: boolean

Overrides client's default video constraints. Defaults to false