Table of contents
Properties
- anonymous_login
- callReportFlushInterval
- callReportInterval
- debug
- debugOutput
- enableCallReports
- env
- forceRelayCandidate
- hangupOnBeforeUnload
- iceServers
- keepConnectionAliveOnSocketClose
- login
- login_token
- maxReconnectAttempts
- mediaPermissionsRecovery
- mutedMicOnStart
- password
- prefetchIceCandidates
- region
- ringbackFile
- ringtoneFile
- rtcIp
- rtcPort
- skipLastVoiceSdkId
- skipTrailing
- trickleIce
- useCanaryRtcServer
Properties
anonymous_login
•Optional anonymous_login: Object
anonymous_login login options
Type declaration
callReportFlushInterval
•Optional callReportFlushInterval: number
Interval in milliseconds for submitting intermediate call reports while a call is active.
Set to 0 to disable time-based intermediate reports.
Default
callReportInterval
•Optional callReportInterval: number
Interval in milliseconds for collecting call statistics after the initial
high-resolution startup window. Stats are aggregated over each interval
and submitted as intermediate reports while the call is active.
Default
debug
•Optional debug: boolean
Enable debug mode for this client.
This will gather WebRTC debugging information.
debugOutput
•Optional debugOutput: "file" | "socket"
Debug output option
enableCallReports
•Optional enableCallReports: boolean
Enable automatic call quality reporting to voice-sdk-proxy.
When enabled, WebRTC stats are collected periodically during calls
and posted to the voice-sdk-proxy /call_report endpoint when the call ends.
Default
env
•Optional env: Environment
Environment to use for the connection.
So far this property is only for internal purposes.
forceRelayCandidate
•Optional forceRelayCandidate: boolean
Force the use of a relay ICE candidate.
hangupOnBeforeUnload
•Optional hangupOnBeforeUnload: boolean
Controls whether the SDK attempts to send BYE for active calls during
browser page unload. Enabled by default to preserve graceful call cleanup,
but applications that handle page lifecycle themselves can disable it to
avoid best-effort unload BYE races.
Default
iceServers
•Optional iceServers: RTCIceServer[]
ICE Servers to use for all calls within the client connection. Overrides the default ones.
keepConnectionAliveOnSocketClose
•Optional keepConnectionAliveOnSocketClose: boolean
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).
login
•Optional login: string
The username to authenticate with your SIP Connection.
login and password will take precedence over
login_token for authentication.
login_token
•Optional login_token: string
The JSON Web Token (JWT) to authenticate with your SIP Connection.
This is the recommended authentication strategy. See how to create one.
maxReconnectAttempts
•Optional maxReconnectAttempts: number
Maximum number of automatic socket reconnection attempts after an unexpected
disconnect. When the limit is reached, no further automatic reconnects are
scheduled and a telnyx.error event with code RECONNECTION_EXHAUSTED (45003)
is emitted. A manual connect() call resets the counter and starts a fresh
retry sequence.
Set to 0 to allow unlimited automatic reconnect attempts.
When omitted, defaults to 10.
Default
mediaPermissionsRecovery
•Optional mediaPermissionsRecovery: Object
Configuration for media permissions recovery on inbound calls.
When enabled and the initial getUserMedia call fails while answering,
the SDK emits a recoverable telnyx.error event with resume() and
reject() callbacks so the app can prompt the user to fix permissions
before the call fails.
Recovery is attempted only for inbound calls. If the app calls
resume(), the SDK retries getUserMedia. If the app calls reject()
or does not respond before timeout, recovery fails and the call is
terminated with the usual media error flow.
In the recovery flow the emitted error carries event.recoverable === true
(top-level) plus the resume/reject/retryDeadline helpers, and
event.error.fatal === false (the SDK is actively handling recovery via
the app’s cooperation). Outside the recovery flow, media failures are
terminal (event.error.fatal === true, no top-level recoverable).
Example
Type declaration
mutedMicOnStart
•Optional mutedMicOnStart: boolean
Disabled microphone by default when the call starts or adding a new audio source.
password
•Optional password: string
The password to authenticate with your SIP Connection.
prefetchIceCandidates
•Optional prefetchIceCandidates: boolean
Enable or disable prefetching ICE candidates. Defaults to true.
region
•Optional region: string
Region to use for the connection.
ringbackFile
•Optional ringbackFile: string
A URL to a wav/mp3 ringback file that will be used when you disable
“Generate Ringback Tone” in your SIP Connection.
ringtoneFile
•Optional ringtoneFile: string
A URL to a wav/mp3 ringtone file.
rtcIp
•Optional rtcIp: string
RTC connection IP address to use instead of the default one.
Useful when using a custom signaling server.
rtcPort
•Optional rtcPort: number
RTC connection port to use instead of the default one.
Useful when using a custom signaling server.
skipLastVoiceSdkId
•Optional skipLastVoiceSdkId: boolean
When reconnecting with a stored voice_sdk_id, append
?skip_last_voice_sdk_id=true to the WebSocket URL so VSP routes
the connection to a different b2bua-rtc instance instead of sticky-
reconnecting to the same one. Useful when retrying after errors
caused by stale state on a specific b2bua-rtc node.
Default
skipTrailing
•Optional skipTrailing: boolean
When set to true, appends skip_trailing=true to the VSP WebSocket
URL so VSP skips pre-routing identity resolution (telephony-tokens
validation and UsersClass trailing checks) for this connection.
This is intended for internal/test-infra usage (e.g. BBT-generated
credentials) where the connection should not participate in trailing
release routing. The actual login still goes to the upstream RTC
service for normal authentication — this only skips VSP’s pre-routing
lookup used for trailing target selection.
Default
trickleIce
•Optional trickleIce: boolean
Enable or disable Trickle ICE.
useCanaryRtcServer
•Optional useCanaryRtcServer: boolean
Use Telnyx’s Canary RTC server