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.

On an emergency call (911, or the 933 test number) this is the caller's identity: the platform looks up the emergency address registered on this number and hands it to the emergency service as the callback number. Use a number on your account in +E.164 form with emergency services enabled. A Caller ID Override on the connection can replace this value: an override that applies to emergency calls (always, emergency) always does, and a normal override is used as the fallback when this value is not a valid number — leave the override off on connections that place emergency calls.

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.

Header names must start with X-; other names are not forwarded. For emergency calls the caller's coordinates can be sent as X-Latitude / X-Longitude (WGS 84, 6 to 8 decimals), for example from navigator.geolocation. This built-in geolocation is available for U.S. emergency calls and must be enabled by Telnyx support (PIDF-LO) on the number used as callerNumber; without that, the headers are forwarded but not used to locate the caller. Identity headers (From, P-Asserted-Identity) cannot be set here — the caller is identified by callerNumber. See TelnyxRTC.newCall for an emergency-call example.

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

Deprecated

Use only IClientOptions.keepConnectionAliveOnSocketClose By passing keepConnectionAliveOnSocketClose as true, the SDK will attempt to keep Peer connection alive when the WebSocket connection is closed unexpectedly (e.g. network interruption, device sleep, etc).

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?: IPreferredCodec[]

Preferred codecs for the call, as entries from RTCRtpReceiver.getCapabilities('audio').codecs.

prefetchIceCandidates?: boolean

Enable or disable prefetching ICE candidates. Defaults to false.

Sets iceCandidatePoolSize to 1 when on and 0 when off. A deeper pool gains nothing — BUNDLE negotiates the call down to a single transport, so only one pre-gathered set is ever adopted — while costing one gathering pass per local network interface per ICE server for each unit.

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