Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

telnyx-webrtc-client-iostelnyx webrtc client iOS 命令行

Agent Skill

telnyx-webrtc-client-ios 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

186

周安装

8

GitHub Stars

167

下载量

65
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:telnyx-webrtc-client-ios(telnyx webrtc client iOS 命令行)
来源仓库:https://github.com/team-telnyx/telnyx-skills
仓库路径:skills/telnyx-webrtc-client-ios
安装命令:
npx skills add https://github.com/team-telnyx/telnyx-skills --skill telnyx-webrtc-client-ios
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/team-telnyx/telnyx-skills --skill telnyx-webrtc-client-ios

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在需要围绕仓库状态、代码变更或协作事项进行整理时使用。
  • 通过 GitHub 安装,支持 Codex、Claude、Cursor、Gemini CLI 等宿主环境。
  • 使用前应确认权限范围与维护状态,避免触发不必要的联网、命令执行或文件读写。
  • 建议结合原始 README 核验具体用法后再部署。

SKILL.md

Telnyx WebRTC - iOS SDK

Build real-time voice communication into iOS applications using Telnyx WebRTC.

Prerequisites: Create WebRTC credentials and generate a login token using the Telnyx server-side SDK. See the telnyx-webrtc-* skill in your server language plugin (e.g., telnyx-python, telnyx-javascript).

Installation

CocoaPods

pod 'TelnyxRTC', '~> 0.1.0'

Then run:

pod install --repo-update

Swift Package Manager

  1. In Xcode: File → Add Packages
  2. Enter: https://github.com/team-telnyx/telnyx-webrtc-ios.git
  3. Select the main branch

Project Configuration

  1. Disable Bitcode: Build Settings → "Bitcode" → Set to "NO"
  2. Enable Background Modes: Signing & Capabilities → +Capability → Background Modes:

- Voice over IP - Audio, AirPlay, and Picture in Picture

  1. Microphone Permission: Add to Info.plist: <key>NSMicrophoneUsageDescription</key> <string>Microphone access required for VoIP calls</string>

Authentication

Option 1: Credential-Based Login

import TelnyxRTC

let telnyxClient = TxClient()
telnyxClient.delegate = self

let txConfig = TxConfig(
    sipUser: "your_sip_username",
    password: "your_sip_password",
    pushDeviceToken: "DEVICE_APNS_TOKEN",
    ringtone: "incoming_call.mp3",
    ringBackTone: "ringback_tone.mp3",
    logLevel: .all
)

do {
    try telnyxClient.connect(txConfig: txConfig)
} catch {
    print("Connection error: \(error)")
}

Option 2: Token-Based Login (JWT)

let txConfig = TxConfig(
    token: "your_jwt_token",
    pushDeviceToken: "DEVICE_APNS_TOKEN",
    ringtone: "incoming_call.mp3",
    ringBackTone: "ringback_tone.mp3",
    logLevel: .all
)

try telnyxClient.connect(txConfig: txConfig)

Configuration Options

ParameterTypeDescription
sipUser / tokenStringCredentials from Telnyx Portal
passwordStringSIP password (credential auth)
pushDeviceTokenString?APNS VoIP push token
ringtoneString?Audio file for incoming calls
ringBackToneString?Audio file for ringback
logLevelLogLevel.none,.error,.warning,.debug,.info,.all
forceRelayCandidateBoolForce TURN relay (avoid local network)

Region Selection

let serverConfig = TxServerConfiguration(
    environment: .production,
    region: .usEast  // .auto, .usEast, .usCentral, .usWest, .caCentral, .eu, .apac
)

try telnyxClient.connect(txConfig: txConfig, serverConfiguration: serverConfig)

Client Delegate

Implement TxClientDelegate to receive events:

extension ViewController: TxClientDelegate {

    func onSocketConnected() {
        // Connected to Telnyx backend
    }

    func onSocketDisconnected() {
        // Disconnected from backend
    }

    func onClientReady() {
        // Ready to make/receive calls
    }

    func onClientError(error: Error) {
        // Handle error
    }

    func onIncomingCall(call: Call) {
        // Incoming call while app is in foreground
        self.currentCall = call
    }

    func onPushCall(call: Call) {
        // Incoming call from push notification
        self.currentCall = call
    }

    func onCallStateUpdated(callState: CallState, callId: UUID) {
        switch callState {
        case .CONNECTING:
            break
        case .RINGING:
            break
        case .ACTIVE:
            break
        case .HELD:
            break
        case .DONE(let reason):
            if let reason = reason {
                print("Call ended: \(reason.cause ?? "Unknown")")
                print("SIP: \(reason.sipCode ?? 0) \(reason.sipReason ?? "")")
            }
        case .RECONNECTING(let reason):
            print("Reconnecting: \(reason.rawValue)")
        case .DROPPED(let reason):
            print("Dropped: \(reason.rawValue)")
        }
    }
}

Making Outbound Calls

let call = try telnyxClient.newCall(
    callerName: "John Doe",
    callerNumber: "+15551234567",
    destinationNumber: "+18004377950",
    callId: UUID()
)

Receiving Inbound Calls

func onIncomingCall(call: Call) {
    // Store reference and show UI
    self.currentCall = call

    // Answer the call
    call.answer()
}

Call Controls

// End call
call.hangup()

// Mute/Unmute
call.muteAudio()
call.unmuteAudio()

// Hold/Unhold
call.hold()
call.unhold()

// Send DTMF
call.dtmf(digit: "1")

// Toggle speaker
// (Use AVAudioSession for speaker routing)

Push Notifications (PushKit + CallKit)

1. Configure PushKit

import PushKit

class AppDelegate: UIResponder, UIApplicationDelegate, PKPushRegistryDelegate {

    private var pushRegistry = PKPushRegistry(queue: .main)

    func initPushKit() {
        pushRegistry.delegate = self
        pushRegistry.desiredPushTypes = [.voIP]
    }

    func pushRegistry(_ registry: PKPushRegistry,
                      didUpdate credentials: PKPushCredentials,
                      for type: PKPushType) {
        if type == .voIP {
            let token = credentials.token.map { String(format: "%02X", $0) }.joined()
            // Save token for use in TxConfig
        }
    }

    func pushRegistry(_ registry: PKPushRegistry,
                      didReceiveIncomingPushWith payload: PKPushPayload,
                      for type: PKPushType,
                      completion: @escaping () -> Void) {
        if type == .voIP {
            handleVoIPPush(payload: payload)
        }
        completion()
    }
}

2. Handle VoIP Push

func handleVoIPPush(payload: PKPushPayload) {
    guard let metadata = payload.dictionaryPayload["metadata"] as? [String: Any] else { return }

    let callId = metadata["call_id"] as? String ?? UUID().uuidString
    let callerName = (metadata["caller_name"] as? String) ?? ""
    let callerNumber = (metadata["caller_number"] as? String) ?? ""

    // Reconnect client and process push
    let txConfig = TxConfig(sipUser: sipUser, password: password, pushDeviceToken: token)
    try? telnyxClient.processVoIPNotification(
        txConfig: txConfig,
        serverConfiguration: serverConfig,
        pushMetaData: metadata
    )

    // Report to CallKit (REQUIRED on iOS 13+)
    let callHandle = CXHandle(type: .generic, value: callerNumber)
    let callUpdate = CXCallUpdate()
    callUpdate.remoteHandle = callHandle

    provider.reportNewIncomingCall(with: UUID(uuidString: callId)!, update: callUpdate) { error in
        if let error = error {
            print("Failed to report call: \(error)")
        }
    }
}

3. CallKit Integration

import CallKit

class AppDelegate: CXProviderDelegate {

    var callKitProvider: CXProvider!

    func initCallKit() {
        let config = CXProviderConfiguration(localizedName: "TelnyxRTC")
        config.maximumCallGroups = 1
        config.maximumCallsPerCallGroup = 1
        callKitProvider = CXProvider(configuration: config)
        callKitProvider.setDelegate(self, queue: nil)
    }

    // CRITICAL: Audio session handling for WebRTC + CallKit
    func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) {
        telnyxClient.enableAudioSession(audioSession: audioSession)
    }

    func provider(_ provider: CXProvider, didDeactivate audioSession: AVAudioSession) {
        telnyxClient.disableAudioSession(audioSession: audioSession)
    }

    func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
        // Use SDK method to handle race conditions
        telnyxClient.answerFromCallkit(answerAction: action)
    }

    func provider(_ provider: CXProvider, perform action: CXEndCallAction) {
        telnyxClient.endCallFromCallkit(endAction: action)
    }
}

Call Quality Metrics

Enable with debug: true:

let call = try telnyxClient.newCall(
    callerName: "John",
    callerNumber: "+15551234567",
    destinationNumber: "+18004377950",
    callId: UUID(),
    debug: true
)

call.onCallQualityChange = { metrics in
    print("MOS: \(metrics.mos)")
    print("Jitter: \(metrics.jitter * 1000) ms")
    print("RTT: \(metrics.rtt * 1000) ms")
    print("Quality: \(metrics.quality.rawValue)")

    switch metrics.quality {
    case .excellent, .good:
        // Green indicator
    case .fair:
        // Yellow indicator
    case .poor, .bad:
        // Red indicator
    case .unknown:
        // Gray indicator
    }
}
Quality LevelMOS Range
.excellent> 4.2
.good4.1 - 4.2
.fair3.7 - 4.0
.poor3.1 - 3.6
.bad≤ 3.0

AI Agent Integration

1. Anonymous Login

client.anonymousLogin(
    targetId: "your-ai-assistant-id",
    targetType: "ai_assistant"
)

2. Start Conversation

// After anonymous login, destination is ignored
let call = client.newInvite(
    callerName: "User",
    callerNumber: "user",
    destinationNumber: "ai-assistant",  // Ignored
    callId: UUID()
)

3. Receive Transcripts

let cancellable = client.aiAssistantManager.subscribeToTranscriptUpdates { transcripts in
    for item in transcripts {
        print("\(item.role): \(item.content)")
        // role: "user" or "assistant"
    }
}

4. Send Text Message

let success = client.sendAIAssistantMessage("Hello, can you help me?")

Custom Logging

class MyLogger: TxLogger {
    func log(level: LogLevel, message: String) {
        // Send to your logging service
        MyAnalytics.log(level: level, message: message)
    }
}

let txConfig = TxConfig(
    sipUser: sipUser,
    password: password,
    logLevel: .all,
    customLogger: MyLogger()
)

Troubleshooting

IssueSolution
No audioEnsure microphone permission granted
Push not workingVerify APNS certificate in Telnyx Portal
CallKit crash on iOS 13+Must report incoming call to CallKit
Audio routing issuesUse enableAudioSession/disableAudioSession in CXProviderDelegate
Login failsVerify SIP credentials in Telnyx Portal

references/webrtc-server-api.md has the server-side WebRTC API — credential creation, token generation, and push notification setup. You MUST read it when setting up authentication or push notifications.

API Reference

TxClient

CLASS

TxClient

public class TxClient

The TelnyxRTC client connects your application to the Telnyx backend, enabling you to make outgoing calls and handle incoming calls.

Examples

Connect and login:

// Initialize the client

Listen TxClient delegate events.

extension ViewController: TxClientDelegate {

Methods

enableAudioSession(audioSession:)

public func enableAudioSession(audioSession: AVAudioSession)

Enables and configures the audio session for a call. This method sets up the appropriate audio configuration and activates the session.

  • Parameter audioSession: The AVAudioSession instance to configure
  • Important: This method MUST be called from the CXProviderDelegate's provider(_:didActivate:) callback to properly handle audio routing when using CallKit integration.

Example usage:

func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) {
    print("provider:didActivateAudioSession:")
    self.telnyxClient.enableAudioSession(audioSession: audioSession)
}

Parameters

NameDescription
audioSessionThe AVAudioSession instance to configure

disableAudioSession(audioSession:)

public func disableAudioSession(audioSession: AVAudioSession)

Disables and resets the audio session. This method cleans up the audio configuration and deactivates the session.

  • Parameter audioSession: The AVAudioSession instance to reset
  • Important: This method MUST be called from the CXProviderDelegate's provider(_:didDeactivate:) callback to properly clean up audio resources when using CallKit integration.

Example usage:

func provider(_ provider: CXProvider, didDeactivate audioSession: AVAudioSession) {
    print("provider:didDeactivateAudioSession:")
    self.telnyxClient.disableAudioSession(audioSession: audioSession)
}

Parameters

NameDescription
audioSessionThe AVAudioSession instance to reset

init()

public init()

TxClient has to be instantiated.

deinit

deinit

Deinitializer to ensure proper cleanup of resources

connect(txConfig:serverConfiguration:)

public func connect(txConfig: TxConfig,
                    serverConfiguration: TxServerConfiguration = TxServerConfiguration()) throws

Connects to the iOS cloglient to the Telnyx signaling server using the desired login credentials.

  • Parameters:

- txConfig: The desired login credentials. See TxConfig docummentation for more information. - serverConfiguration: (Optional) To define a custom signaling server and TURN/ STUN servers. As default we use the internal Telnyx Production servers.

  • Throws: TxConfig parameters errors

Parameters

NameDescription
txConfigThe desired login credentials. See TxConfig docummentation for more information.
serverConfiguration(Optional) To define a custom signaling server and TURN/ STUN servers. As default we use the internal Telnyx Production servers.

disconnect()

public func disconnect()

Disconnects the TxClient from the Telnyx signaling server.

isConnected()

public func isConnected() -> Bool

To check if TxClient is connected to Telnyx server.

  • Returns: true if TxClient socket is connected, false otherwise.

answerFromCallkit(answerAction:customHeaders:debug:)

public func answerFromCallkit(answerAction: CXAnswerCallAction,
                              customHeaders: [String:String] = [:],
                              debug: Bool = false)

Answers an incoming call from CallKit and manages the active call flow.

This method should be called from the CXProviderDelegate's provider(_:perform:) method when handling a CXAnswerCallAction. It properly integrates with CallKit to answer incoming calls.

Examples:

extension CallKitProvider: CXProviderDelegate {

endCallFromCallkit(endAction:callId:)

public func endCallFromCallkit(endAction: CXEndCallAction,
                               callId: UUID? = nil)

To end and control callKit active and conn

disablePushNotifications()

public func disablePushNotifications()

To disable push notifications for the current user

getSessionId()

public func getSessionId() -> String

Get the current session ID after logging into Telnyx Backend.

  • Returns: The current sessionId. If this value is empty, that means that the client is not connected to Telnyx server.

anonymousLogin(targetId:targetType:targetVersionId:userVariables:reconnection:serverConfiguration:)

public func anonymousLogin(
    targetId: String,
    targetType: String = "ai_assistant",
    targetVersionId: String? = nil,
    userVariables: [String: Any] = [:],
    reconnection: Bool = false,
    serverConfiguration: TxServerConfiguration = TxServerConfiguration()
)

Performs an anonymous login to the Telnyx backend for AI assistant connections. This method allows connecting to AI assistants without traditional authentication.

If the socket is already connected, the anonymous login message is sent immediately. If not connected, the socket connection process is started, and the anonymous login message is sent once the connection is established.

  • Parameters:

- targetId: The target ID for the AI assistant - targetType: The target type (defaults to "ai_assistant") - targetVersionId: Optional target version ID - userVariables: Optional user variables to include in the login - reconnection: Whether this is a reconnection attempt (defaults to false) - serverConfiguration: Server configuration to use for connection (defaults to TxServerConfiguration())

Parameters

NameDescription
targetIdThe target ID for the AI assistant
targetTypeThe target type (defaults to “ai_assistant”)
targetVersionIdOptional target version ID
userVariablesOptional user variables to include in the login
reconnectionWhether this is a reconnection attempt (defaults to false)
serverConfigurationServer configuration to use for connection (defaults to TxServerConfiguration())

sendRingingAck(callId:)

public func sendRingingAck(callId: String)

Send a ringing acknowledgment message for a specific call

  • Parameter callId: The call ID to acknowledge

Parameters

NameDescription
callIdThe call ID to acknowledge

sendAIAssistantMessage(_:)

public func sendAIAssistantMessage(_ message: String) -> Bool

Send a text message to AI Assistant during active call (mixed-mode communication)

  • Parameter message: The text message to send to AI assistant
  • Returns: True if message was sent successfully, false otherwise

Parameters

NameDescription
messageThe text message to send to AI assistant

sendAIAssistantMessage(_:base64Images:imageFormat:)

public func sendAIAssistantMessage(_ message: String, base64Images: [String]?, imageFormat: String = "jpeg") -> Bool

Send a text message with multiple Base64 encoded images to AI Assistant during active call

  • Parameters:

- message: The text message to send to AI assistant - base64Images: Optional array of Base64 encoded image data (without data URL prefix) - imageFormat: Image format (jpeg, png, etc.). Defaults to "jpeg"

  • Returns: True if message was sent successfully, false otherwise

Parameters

NameDescription
messageThe text message to send to AI assistant
base64ImagesOptional array of Base64 encoded image data (without data URL prefix)
imageFormatImage format (jpeg, png, etc.). Defaults to “jpeg”

Call

CLASS

Call

public class Call

A Call represents an audio or video communication session between two endpoints: WebRTC Clients, SIP clients, or phone numbers. The Call object manages the entire lifecycle of a call, from initiation to termination, handling both outbound and inbound calls.

A Call object is created in two scenarios:

  1. When you initiate a new outbound call using TxClient's newCall method
  2. When you receive an inbound call through the TxClientDelegate's onIncomingCall callback

Key Features

  • Audio and video call support
  • Call state management (NEW, CONNECTING, RINGING, ACTIVE, HELD, DONE)
  • Mute/unmute functionality
  • DTMF tone sending
  • Custom headers support for both INVITE and ANSWER messages
  • Call statistics reporting when debug mode is enabled

Examples

Creating an Outbound Call:

// Initialize the client

Handling an Incoming Call:

class CallHandler: TxClientDelegate {

Examples

// Access local audio tracks for visualization
if let localStream = call.localStream {
    let audioTracks = localStream.audioTracks
    // Use audio tracks for waveform visualization
}

remoteStream

public var remoteStream: RTCMediaStream?

The remote media stream containing audio and/or video tracks received from the remote party. This stream represents the media being received from the other participant in the call. Can be used for audio visualization, remote video display, or other media processing.

Examples

// Access remote audio tracks for visualization
if let remoteStream = call.remoteStream {
    let audioTracks = remoteStream.audioTracks
    // Use audio tracks for waveform visualization
}

TxConfig

STRUCT

TxConfig

public struct TxConfig

This structure is intended to used for Telnyx SDK configurations.

Methods

init(sipUser:password:pushDeviceToken:ringtone:ringBackTone:pushEnvironment:logLevel:customLogger:reconnectClient:debug:forceRelayCandidate:enableQualityMetrics:sendWebRTCStatsViaSocket:reconnectTimeOut:useTrickleIce:enableCallReports:callReportInterval:callReportLogLevel:callReportMaxLogEntries:)

public init(sipUser: String, password: String,
            pushDeviceToken: String? = nil,
            ringtone: String? = nil,
            ringBackTone: String? = nil,
            pushEnvironment: PushEnvironment? = nil,
            logLevel: LogLevel = .none,
            customLogger: TxLogger? = nil,
            reconnectClient: Bool = true,
            debug: Bool = false,
            forceRelayCandidate: Bool = false,
            enableQualityMetrics: Bool = false,
            sendWebRTCStatsViaSocket: Bool = false,
            reconnectTimeOut: Double = DEFAULT_TIMEOUT,
            useTrickleIce: Bool = false,
            enableCallReports: Bool = true,
            callReportInterval: TimeInterval = 5.0,
            callReportLogLevel: String = "debug",
            callReportMaxLogEntries: Int = 1000
)

Constructor for the Telnyx SDK configuration using SIP credentials.

  • 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. - useTrickleIce: (Optional) Controls whether the SDK should use trickle ICE for WebRTC signaling. Default is false. - enableCallReports: (Optional) Enable automatic call quality reporting to voice-sdk-proxy. Default is true. - callReportInterval: (Optional) Interval in seconds for collecting call statistics. Default is 5.0. - callReportLogLevel: (Optional) Minimum log level to capture for call reports. Default is "debug". - callReportMaxLogEntries: (Optional) Maximum number of log entries to buffer per call. Default is 1000.

Parameters

NameDescription
sipUserThe SIP username for authentication
passwordThe 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.
useTrickleIce(Optional) Controls whether the SDK should use trickle ICE for WebRTC signaling. Default is false.
enableCallReports(Optional) Enable automatic call quality reporting to voice-sdk-proxy. Default is true.
callReportInterval(Optional) Interval in seconds for collecting call statistics. Default is 5.0.
callReportLogLevel(Optional) Minimum log level to capture for call reports. Default is “debug”.
callReportMaxLogEntries(Optional) Maximum number of log entries to buffer per call. Default is 1000.

init(token:pushDeviceToken:ringtone:ringBackTone:pushEnvironment:logLevel:customLogger:reconnectClient:debug:forceRelayCandidate:enableQualityMetrics:sendWebRTCStatsViaSocket:reconnectTimeOut:useTrickleIce:enableCallReports:callReportInterval:callReportLogLevel:callReportMaxLogEntries:)

public init(token: String,
            pushDeviceToken: String? = nil,
            ringtone: String? = nil,
            ringBackTone: String? = nil,
            pushEnvironment: PushEnvironment? = nil,
            logLevel: LogLevel = .none,
            customLogger: TxLogger? = nil,
            reconnectClient: Bool = true,
            debug: Bool = false,
            forceRelayCandidate: Bool = false,
            enableQualityMetrics: Bool = false,
            sendWebRTCStatsViaSocket: Bool = false,
            reconnectTimeOut: Double = DEFAULT_TIMEOUT,
            useTrickleIce: Bool = false,
            enableCallReports: Bool = true,
            callReportInterval: TimeInterval = 5.0,
            callReportLogLevel: String = "debug",
            callReportMaxLogEntries: Int = 1000
)

Constructor for the Telnyx SDK configuration using JWT token authentication.

  • 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. - useTrickleIce: (Optional) Controls whether the SDK should use trickle ICE for WebRTC signaling. Default is false. - enableCallReports: (Optional) Enable automatic call quality reporting to voice-sdk-proxy. Default is true. - callReportInterval: (Optional) Interval in seconds for collecting call statistics. Default is 5.0. - callReportLogLevel: (Optional) Minimum log level to capture for call reports. Default is "debug". - callReportMaxLogEntries: (Optional) Maximum number of log entries to buffer per call. Default is 1000.

Parameters

NameDescription
tokenJWT 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.
useTrickleIce(Optional) Controls whether the SDK should use trickle ICE for WebRTC signaling. Default is false.
enableCallReports(Optional) Enable automatic call quality reporting to voice-sdk-proxy. Default is true.
callReportInterval(Optional) Interval in seconds for collecting call statistics. Default is 5.0.
callReportLogLevel(Optional) Minimum log level to capture for call reports. Default is “debug”.
callReportMaxLogEntries(Optional) Maximum number of log entries to buffer per call. Default is 1000.

validateParams()

public func validateParams() throws

Validate if TxConfig parameters are valid

  • Throws: Throws TxConfig parameters errors

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.02%
按下载量换算23

Claude

31.71%
按下载量换算21

Cursor

17.64%
按下载量换算11

Gemini CLI

9.79%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills