Optional anonymous_anonymous_login login options
The target ID to use for the anonymous login. this is typically the ID of the AI assistant you want to connect to.
A string indicating the target type, for now only ai_assistant is supported.
Optional target_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.
Optional debugEnable debug mode for this client. This will gather WebRTC debugging information.
Optional debugDebug output option
Optional envEnvironment to use for the connection. So far this property is only for internal purposes.
Optional forceForce the use of a relay ICE candidate.
Optional iceICE Servers to use for all calls within the client connection. Overrides the default ones.
Optional keepOptimistic 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:
signalingState is NOT closedRecovery fails (call will be hung up and recreated) when:
connectionState transitions to failedsignalingState transitions to closed (e.g., after device sleep)Fallback Behavior: When recovery is not possible, the SDK automatically falls back to recreating the call. The fallback process depends on the failure scenario:
If ICE restart was attempted (connectionState went to failed):
For all other unrecoverable states (signalingState closed, peer destroyed):
Monitoring Connection Health: Subscribe to these events to detect connection issues:
telnyx.rtc.peerConnectionFailureError - Primary event. Fires when connectionState goes to failed.
This indicates the ICE/DTLS transport failed and recovery will be attempted via ICE restart.
telnyx.rtc.peerConnectionSignalingStateClosed - Fires when signalingState transitions to closed.
Check call.signalingStateClosed to verify recoverability.
In both cases, if 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.
Optional loginThe username to authenticate with your SIP Connection.
login and password will take precedence over
login_token for authentication.
Optional login_The JSON Web Token (JWT) to authenticate with your SIP Connection. This is the recommended authentication strategy. See how to create one.
Optional mutedDisabled microphone by default when the call starts or adding a new audio source.
Optional passwordThe password to authenticate with your SIP Connection.
Optional prefetchEnable or disable prefetching ICE candidates.
Optional regionRegion to use for the connection.
Optional ringbackA URL to a wav/mp3 ringback file that will be used when you disable "Generate Ringback Tone" in your SIP Connection.
Optional ringtoneA URL to a wav/mp3 ringtone file.
Optional rtcRTC connection IP address to use instead of the default one. Useful when using a custom signaling server.
Optional rtcRTC connection port to use instead of the default one. Useful when using a custom signaling server.
Optional trickleEnable or disable Trickle ICE.
Optional useUse Telnyx's Canary RTC server
IClientOptions IClientOptions