Package-level declarations

Manages outgoing Verto protocol messages and requests.

The root package provides the main client interface and call management functionality.

Features

The SDK provides the following key features:

  • Audio calls with support for different audio devices (speaker, earpiece, bluetooth)

  • Call management (make, answer, reject, end calls)

  • Push notification support for incoming calls

  • Network resilience with automatic reconnection

  • Custom SIP headers support

  • Configurable logging levels

Quick Start

Here's a basic example of using the SDK:

// Initialize client
val client = TelnyxClient(context)

// Make a call
val call = client.newInvite(
callerName = "John Doe",
callerNumber = "+1234567890",
destinationNumber = "+1987654321",
clientState = "my-state"
)

// Answer an incoming call
client.acceptCall(
callId = uuid,
destinationNumber = "destination"
)

// End a call
client.endCall(callId)

Architecture

The SDK is organized into several key packages:

  • model - Data models and enums for call states, audio devices, etc.

  • peer - WebRTC peer connection management

  • socket - WebSocket communication with Telnyx servers

  • utilities - Helper functions and network monitoring

  • verto - Implementation of the Verto protocol for signaling

Types

Link copied to clipboard
data class AttachCallParams(val userVariables: AttachUserVariables) : ParamRequest
Link copied to clipboard
data class AttachUserVariables(val pushNotificationEnvironment: String = if (BuildConfig.DEBUG) "development" else "production", val pushNotificationProvider: String = "android")
Link copied to clipboard
data class ByeDialogParams(val callId: UUID) : DialogParams
Link copied to clipboard
data class ByeParams(val sessid: String, val causeCode: Int, val cause: String, val dialogParams: ByeDialogParams) : ParamRequest
Link copied to clipboard
data class CallDialogParams(val useStereo: Boolean = false, val attach: Boolean = false, val video: Boolean = false, val screenShare: Boolean = false, val audio: Boolean = true, val userVariables: ArrayList<Any> = arrayListOf(), val clientState: String = "", val callId: UUID, val remoteCallerIdName: String = "", val callerIdNumber: String = "", val callerIdName: String = "", val destinationNumber: String = "", val customHeaders: ArrayList<CustomHeaders> = arrayListOf())
Link copied to clipboard
data class CallParams(val sessid: String, val sdp: String, val userAgent: String = "Android-" + BuildConfig.SDK_VERSION.toString(), val dialogParams: CallDialogParams) : ParamRequest
Link copied to clipboard
sealed class DialogParams
Link copied to clipboard
data class DisablePushParams(val user: String, val userVariables: UserVariables) : ParamRequest
Link copied to clipboard
data class InfoParams(val sessid: String, val dtmf: String, val dialogParams: CallDialogParams) : ParamRequest
Link copied to clipboard
data class InitiateOrStopStatPrams(val type: String = "debug_report_stop", val debugReportId: String = UUID.randomUUID().toString(), val debugReportVersion: Int = 1, val id: String = UUID.randomUUID().toString(), val jsonrpc: String = "2.0") : ParamRequest
Link copied to clipboard
data class LoginParam(val loginToken: String?, val login: String?, val passwd: String?, val userVariables: JsonObject, val loginParams: Map<Any, Any>?, val sessid: String, val userAgent: String = "Android-" + BuildConfig.SDK_VERSION.toString()) : ParamRequest
Link copied to clipboard
data class ModifyParams(val sessid: String, val action: String, val dialogParams: CallDialogParams) : ParamRequest
Link copied to clipboard
sealed class ParamRequest
Link copied to clipboard
class SendingMessageBody(val id: String, val method: String, val params: ParamRequest, val jsonrpc: String = "2.0")

A data class the represents the structure of every message received via the socket connection

Link copied to clipboard
data class StateParams(val state: String?) : ParamRequest
Link copied to clipboard
data class StatPrams(val type: String = "debug_report_data", val debugReportId: String = UUID.randomUUID().toString(), val reportData: JsonObject, val debugReportVersion: Int = 1, val id: String = UUID.randomUUID().toString(), val jsonrpc: String = "2.0") : ParamRequest
Link copied to clipboard
data class TokenDisablePushParams(val loginToken: String, val userVariables: UserVariables) : ParamRequest
Link copied to clipboard
data class UserVariables(val pushDeviceToken: String, val pushNotificationProvider: String = "android")