Skip to main content

Config

Config is used to log in and connect to the Telnyx WebRTC client. It contains the necessary fields to log in with either a token or credentials. The base Config class is represented like so:

Config Parameters

  • sipCallerIDName (String, required): Name associated with the SIP account
  • sipCallerIDNumber (String, required): Number associated with the SIP account
  • notificationToken (String?, optional): Token used to register the device for notifications if required (FCM or APNS)
  • autoReconnect (bool?, optional): Flag to decide whether or not to attempt a reconnect (3 attempts) in the case of a login failure with legitimate credentials
  • logLevel (LogLevel, optional): Log level to set for SDK Logging (defaults to LogLevel.all)
  • debug (bool, required): Flag to enable debug logs
  • customLogger (CustomLogger?, optional): Custom logger to use for logging - if left null the default logger will be used which uses the Logger package
  • ringTonePath (String?, optional): Path to the ringtone file (audio to play when receiving a call)
  • ringbackPath (String?, optional): Path to the ringback file (audio to play when calling)
  • reconnectionTimeout (int?, optional): Reconnection timeout in milliseconds (Default 60 seconds). This is the maximum time allowed for a call to be in the RECONNECTING or DROPPED state
  • region (Region, optional): The region to use for the connection (defaults to Region.auto)
  • fallbackOnRegionFailure (bool, optional): Whether the SDK should default to AUTO after attempting and failing to connect to a specified region (defaults to true)

Available Regions

The Region enum provides the following options:
  • Region.auto: Automatically select the best region (default)
  • Region.eu: European region
  • Region.usCentral: US Central region
  • Region.usEast: US East region
  • Region.usWest: US West region
  • Region.caCentral: Canada Central region
  • Region.apac: Asia Pacific region
The base Config class contains shared fields that are used by both the TokenConfig and CredentialConfig classes. These are the actual classes that you will use to log into the client.

TokenConfig

TokenConfig is used to log in with a token. It extends the base Config class and looks like this:

CredentialConfig

CredentialConfig is used to log in with credentials. It extends the base Config class and looks like this: