TxConfig
Properties
DEFAULT_TIMEOUT
sipUser
password
token
pushNotificationConfig
ringBackTone
ringtone
reconnectClient
pushEnvironment
debug
- Note: This flag is different from
logLevel:debug: When enabled, sends WebRTC communication statistics to Telnyx servers for monitoring and debugging purposes. SeeWebRTCStatsReporterclass for details on the statistics collected.logLevel: Controls console log output in Xcode when running the app in debug mode.
- Important: The
debugflag is disabled by default to minimize data usage.
forceRelayCandidate
- Note: Enabling this may affect the quality of calls when devices are on the same local network, as all media will be relayed through TURN servers.
- Important: This setting is disabled by default to maintain optimal call quality.
enableQualityMetrics
sendWebRTCStatsViaSocket
- Note: This flag is independent of
debugandenableQualityMetrics:debug: Enables WebRTC stats collection and real-time metricsenableQualityMetrics: Enables call quality metrics calculationsendWebRTCStatsViaSocket: Enables sending collected stats via socket to Telnyx servers
- Important: This flag is disabled by default to minimize network traffic
reconnectTimeout
- If a call is successfully reconnected within this time, the call continues normally.
- If reconnection fails after this timeout period, the call will be terminated and a
reconnectFailederror will be triggered. - Default value is 60 seconds (defined by
DEFAULT_TIMEOUT). - This timeout helps prevent calls from being stuck in a “reconnecting” state indefinitely.
customLogger
Methods
init(sipUser:password:pushDeviceToken:ringtone:ringBackTone:pushEnvironment:logLevel:customLogger:reconnectClient:debug:forceRelayCandidate:enableQualityMetrics:sendWebRTCStatsViaSocket:reconnectTimeOut:)
- Parameters:
- sipUser: The SIP username for authentication
- password: The password associated with the SIP user
- pushDeviceToken: (Optional) The device’s push notification token, required for receiving inbound call notifications
- ringtone: (Optional) The audio file name to play for incoming calls (e.g., “my-ringtone.mp3”)
- ringBackTone: (Optional) The audio file name to play while making outbound calls (e.g., “my-ringbacktone.mp3”)
- pushEnvironment: (Optional) The push notification environment (production or debug)
- logLevel: (Optional) The verbosity level for SDK logs (defaults to
.none) - customLogger: (Optional) Custom logger implementation for handling SDK logs. If not provided, the default logger will be used
- reconnectClient: (Optional) Whether the client should attempt to reconnect automatically. Default is true.
- debug: (Optional) Enables WebRTC communication statistics reporting to Telnyx servers. Default is false.
- forceRelayCandidate: (Optional) Controls whether the SDK should force TURN relay for peer connections. Default is false.
- enableQualityMetrics: (Optional) Controls whether the SDK should deliver call quality metrics. Default is false.
- sendWebRTCStatsViaSocket: (Optional) Whether to send WebRTC statistics via socket to Telnyx servers. Default is false.
- reconnectTimeOut: (Optional) Maximum time in seconds the SDK will attempt to reconnect a call after network disruption. Default is 60 seconds.
Parameters
| Name | Description |
|---|---|
| sipUser | The SIP username for authentication |
| password | The password associated with the SIP user |
| pushDeviceToken | (Optional) The device’s push notification token, required for receiving inbound call notifications |
| ringtone | (Optional) The audio file name to play for incoming calls (e.g., “my-ringtone.mp3”) |
| ringBackTone | (Optional) The audio file name to play while making outbound calls (e.g., “my-ringbacktone.mp3”) |
| pushEnvironment | (Optional) The push notification environment (production or debug) |
| logLevel | (Optional) The verbosity level for SDK logs (defaults to .none) |
| customLogger | (Optional) Custom logger implementation for handling SDK logs. If not provided, the default logger will be used |
| reconnectClient | (Optional) Whether the client should attempt to reconnect automatically. Default is true. |
| debug | (Optional) Enables WebRTC communication statistics reporting to Telnyx servers. Default is false. |
| forceRelayCandidate | (Optional) Controls whether the SDK should force TURN relay for peer connections. Default is false. |
| enableQualityMetrics | (Optional) Controls whether the SDK should deliver call quality metrics. Default is false. |
| sendWebRTCStatsViaSocket | (Optional) Whether to send WebRTC statistics via socket to Telnyx servers. Default is false. |
| reconnectTimeOut | (Optional) Maximum time in seconds the SDK will attempt to reconnect a call after network disruption. Default is 60 seconds. |
init(token:pushDeviceToken:ringtone:ringBackTone:pushEnvironment:logLevel:customLogger:reconnectClient:debug:forceRelayCandidate:enableQualityMetrics:sendWebRTCStatsViaSocket:reconnectTimeOut:)
- Parameters:
- token: JWT token generated from https://developers.telnyx.com/docs/v2/webrtc/quickstart
- pushDeviceToken: (Optional) The device’s push notification token, required for receiving inbound call notifications
- ringtone: (Optional) The audio file name to play for incoming calls (e.g., “my-ringtone.mp3”)
- ringBackTone: (Optional) The audio file name to play while making outbound calls (e.g., “my-ringbacktone.mp3”)
- pushEnvironment: (Optional) The push notification environment (production or debug)
- logLevel: (Optional) The verbosity level for SDK logs (defaults to
.none) - customLogger: (Optional) Custom logger implementation for handling SDK logs. If not provided, the default logger will be used
- reconnectClient: (Optional) Whether the client should attempt to reconnect automatically. Default is true.
- debug: (Optional) Enables WebRTC communication statistics reporting to Telnyx servers. Default is false.
- forceRelayCandidate: (Optional) Controls whether the SDK should force TURN relay for peer connections. Default is false.
- enableQualityMetrics: (Optional) Controls whether the SDK should deliver call quality metrics. Default is false.
- sendWebRTCStatsViaSocket: (Optional) Whether to send WebRTC statistics via socket to Telnyx servers. Default is false.
- reconnectTimeOut: (Optional) Maximum time in seconds the SDK will attempt to reconnect a call after network disruption. Default is 60 seconds.
Parameters
| Name | Description |
|---|---|
| token | JWT token generated from https://developers.telnyx.com/docs/v2/webrtc/quickstart |
| pushDeviceToken | (Optional) The device’s push notification token, required for receiving inbound call notifications |
| ringtone | (Optional) The audio file name to play for incoming calls (e.g., “my-ringtone.mp3”) |
| ringBackTone | (Optional) The audio file name to play while making outbound calls (e.g., “my-ringbacktone.mp3”) |
| pushEnvironment | (Optional) The push notification environment (production or debug) |
| logLevel | (Optional) The verbosity level for SDK logs (defaults to .none) |
| customLogger | (Optional) Custom logger implementation for handling SDK logs. If not provided, the default logger will be used |
| reconnectClient | (Optional) Whether the client should attempt to reconnect automatically. Default is true. |
| debug | (Optional) Enables WebRTC communication statistics reporting to Telnyx servers. Default is false. |
| forceRelayCandidate | (Optional) Controls whether the SDK should force TURN relay for peer connections. Default is false. |
| enableQualityMetrics | (Optional) Controls whether the SDK should deliver call quality metrics. Default is false. |
| sendWebRTCStatsViaSocket | (Optional) Whether to send WebRTC statistics via socket to Telnyx servers. Default is false. |
| reconnectTimeOut | (Optional) Maximum time in seconds the SDK will attempt to reconnect a call after network disruption. Default is 60 seconds. |
validateParams()
- Throws: Throws TxConfig parameters errors