Table of contents
Properties
- anonymous_login
- debug
- debugOutput
- env
- forceRelayCandidate
- iceServers
- keepConnectionAliveOnSocketClose
- login
- login_token
- mutedMicOnStart
- password
- prefetchIceCandidates
- region
- ringbackFile
- ringtoneFile
- rtcIp
- rtcPort
- trickleIce
- useCanaryRtcServer
Properties
anonymous_login
•Optional anonymous_login: Object
anonymous_login login options
Type declaration
| Name | Type | Description |
|---|---|---|
target_id | string | The target ID to use for the anonymous login. this is typically the ID of the AI assistant you want to connect to. |
target_type | string | A string indicating the target type, for now only ai_assistant is supported. |
target_version_id? | string | The target version ID to use for the anonymous login. This is optional and can be used to specify a particular version of the AI assistant. |
debug
•Optional debug: boolean
Enable debug mode for this client.
This will gather WebRTC debugging information.
debugOutput
•Optional debugOutput: "file" | "socket"
Debug output option
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.
iceServers
•Optional iceServers: RTCIceServer[]
ICE Servers to use for all calls within the client connection. Overrides the default ones.
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
(e.g., network offline, switching networks, device sleep/wake cycles) 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 depends on
the state of the underlying WebRTC peer connection:
-
Recovery succeeds when:
- The peer connection’s
signalingStateis NOTclosed - The peer connection instance still exists
- ICE restart was not triggered due to connection failure
- The peer connection’s
-
Recovery fails (call will be hung up and recreated) when:
- The peer connection’s
connectionStatetransitions tofailed - The peer connection’s
signalingStatetransitions toclosed(e.g., after device sleep) - The peer connection instance was destroyed
- The peer connection’s
-
If ICE restart was attempted (connectionState went to
failed):- The SDK hangs up the existing call and sends a BYE message
- A new call instance is created with a new call ID
- The SDK sends a new INVITE to re-establish the call as the active leg
-
For all other unrecoverable states (signalingState
closed, peer destroyed):- The SDK hangs up the existing call (no BYE sent since connection is dead)
- A new call instance is created with the same call ID
- The SDK answers the incoming ATTACH to re-establish the call
-
telnyx.rtc.peerConnectionFailureError- Primary event. Fires whenconnectionStategoes tofailed. This indicates the ICE/DTLS transport failed and recovery will be attempted via ICE restart. -
telnyx.rtc.peerConnectionSignalingStateClosed- Fires whensignalingStatetransitions toclosed. Checkcall.signalingStateClosedto verify recoverability.
autoRecoverCalls is enabled (default: true), the fallback is automatic
and seamless. The call’s state transitions through the normal flow and a callUpdate notification
is dispatched so your UI can update accordingly.
See
Error Handling Documentation
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.
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.
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.
trickleIce
•Optional trickleIce: boolean
Enable or disable Trickle ICE.
useCanaryRtcServer
•Optional useCanaryRtcServer: boolean
Use Telnyx’s Canary RTC server