TxConfig
public struct TxConfig
This structure is intended to used for Telnyx SDK configurations.
-
Undocumented
Declaration
Swift
public internal(set) var sipUser: String? { get }
-
Undocumented
Declaration
Swift
public internal(set) var password: String? { get }
-
Undocumented
Declaration
Swift
public internal(set) var token: String? { get }
-
Undocumented
Declaration
Swift
public internal(set) var pushNotificationConfig: TxPushConfig? { get }
-
Undocumented
Declaration
Swift
public internal(set) var ringBackTone: String? { get }
-
Undocumented
Declaration
Swift
public internal(set) var ringtone: String? { get }
-
Undocumented
Declaration
Swift
public internal(set) var reconnectClient: Bool { get }
-
Undocumented
Declaration
Swift
public internal(set) var pushEnvironment: PushEnvironment? { get }
-
Enables WebRTC communication statistics reporting to Telnyx servers.
Note
This flag is different fromlogLevel
:debug
: When enabled, sends WebRTC communication statistics to Telnyx servers for monitoring and debugging purposes. SeeWebRTCStatsReporter
class for details on the statistics collected.logLevel
: Controls console log output in Xcode when running the app in debug mode.
Important
Thedebug
flag is disabled by default to minimize data usage.Declaration
Swift
public internal(set) var debug: Bool { get }
-
Controls whether the SDK should force TURN relay for peer connections. When enabled, the SDK will only use TURN relay candidates for ICE gathering, which prevents the “local network access” permission popup from appearing.
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.Declaration
Swift
public internal(set) var forceRelayCandidate: Bool { get }
-
init(sipUser:
password: pushDeviceToken: ringtone: ringBackTone: pushEnvironment: logLevel: reconnectClient: debug: forceRelayCandidate: ) Constructor for the Telnyx SDK configuration using SIP credentials.
Declaration
Swift
public init(sipUser: String, password: String, pushDeviceToken: String? = nil, ringtone: String? = nil, ringBackTone: String? = nil, pushEnvironment: PushEnvironment? = nil, logLevel: LogLevel = .none, reconnectClient: Bool = true, debug: Bool = false, forceRelayCandidate: Bool = false )
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”)
logLevel
(Optional) The verbosity level for SDK logs (defaults to
.none
) -
init(token:
pushDeviceToken: ringtone: ringBackTone: pushEnvironment: logLevel: debug: forceRelayCandidate: ) Constructor for the Telnyx SDK configuration using JWT token authentication.
Declaration
Swift
public init(token: String, pushDeviceToken: String? = nil, ringtone: String? = nil, ringBackTone: String? = nil, pushEnvironment: PushEnvironment? = nil, logLevel: LogLevel = .none, debug: Bool = false, forceRelayCandidate: Bool = false)
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”)
logLevel
(Optional) The verbosity level for SDK logs (defaults to
.none
)serverConfiguration
(Optional) Custom configuration for signaling server and TURN/STUN servers (defaults to Telnyx Production servers)
-
Validate if TxConfig parameters are valid
Throws
Throws TxConfig parameters errorsDeclaration
Swift
public func validateParams() throws