# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations from typing import List, Optional from typing_extensions import Literal from .fqdn import Fqdn from .._models import BaseModel from .dtmf_type import DtmfType from .uac_inbound import UacInbound from .uac_outbound import UacOutbound from .encrypted_media import EncryptedMedia from .anchorsite_override import AnchorsiteOverride from .uac_external_settings import UacExternalSettings from .uac_internal_settings import UacInternalSettings from .connection_rtcp_settings import ConnectionRtcpSettings from .connection_noise_suppression import ConnectionNoiseSuppression from .shared.connection_jitter_buffer import ConnectionJitterBuffer from .shared.connection_noise_suppression_details import ConnectionNoiseSuppressionDetails __all__ = ["UacConnection"] class UacConnection(BaseModel): """ A UAC (User Agent Client) Connection registers Telnyx to your PBX — the opposite of a standard SIP trunk, where the PBX registers to Telnyx. Use UAC when your PBX doesn’t support outbound SIP registration or you need Telnyx to maintain the registration. """ id: Optional[str] = None """Identifies the type of resource.""" active: Optional[bool] = None """Defaults to true""" anchorsite_override: Optional[AnchorsiteOverride] = None """ `Latency` directs Telnyx to route media through the site with the lowest round-trip time to the user's connection. Telnyx calculates this time using ICMP ping messages. This can be disabled by specifying a site to handle all media. """ android_push_credential_id: Optional[str] = None """The uuid of the push credential for Android""" authentication: Optional[Literal["uac-authentication"]] = None """The authentication strategy used by this connection.""" bridge_generate_comfort_noise_on_cn: Optional[bool] = None """ Stores the connection preference for generating silent RTP toward the opposite call leg when comfort-noise packets (CN, payload type 13) are received during hold. Defaults to false and returns the saved value. Only JSON true and false are accepted; null and non-boolean values are rejected. This preference is independent of default_on_hold_comfort_noise_enabled and does not modify that setting. This API provisions the preference; call-processing behavior is implemented separately. """ call_cost_in_webhooks: Optional[bool] = None """Specifies if call cost webhooks should be sent for this connection.""" connection_name: Optional[str] = None created_at: Optional[str] = None """ISO-8601 formatted date indicating when the resource was created.""" default_on_hold_comfort_noise_enabled: Optional[bool] = None """When enabled, Telnyx will generate comfort noise when you place the call on hold. If disabled, you will need to generate comfort noise or on hold music to avoid RTP timeout. """ dtmf_type: Optional[DtmfType] = None """Sets the type of DTMF digits sent from Telnyx to this Connection. Note that DTMF digits sent to Telnyx will be accepted in all formats. """ encode_contact_header_enabled: Optional[bool] = None """ Encode the SIP contact header sent by Telnyx to avoid issues for NAT or ALG scenarios. """ encrypted_media: Optional[EncryptedMedia] = None """Enable use of SRTP for encryption. Can only be set when the SIP signaling transport protocol is TLS. """ external_uac_settings: Optional[UacExternalSettings] = None """ External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. """ fqdn: Optional[str] = None """The Telnyx-managed FQDN generated for the UAC connection.""" fqdn_outbound_authentication: Optional[Literal["credential-authentication"]] = None """The fixed outbound authentication mode used by UAC FQDN records.""" fqdns: Optional[List[Fqdn]] = None """FQDN records managed automatically by the UAC connection lifecycle.""" inbound: Optional[UacInbound] = None internal_uac_settings: Optional[UacInternalSettings] = None """Internal Telnyx-side settings for a UAC connection.""" ios_push_credential_id: Optional[str] = None """The uuid of the push credential for Ios""" jitter_buffer: Optional[ConnectionJitterBuffer] = None """Configuration options for Jitter Buffer. Enables Jitter Buffer for RTP streams of SIP Trunking calls. The feature is off unless enabled. You may define min and max values in msec for customized buffering behaviors. Larger values add latency but tolerate more jitter, while smaller values reduce latency but are more sensitive to jitter and reordering. """ noise_suppression: Optional[ConnectionNoiseSuppression] = None """Controls when noise suppression is applied to calls. When set to 'inbound', noise suppression is applied to incoming audio. When set to 'outbound', it's applied to outgoing audio. When set to 'both', it's applied in both directions. When set to 'disabled', noise suppression is turned off. """ noise_suppression_details: Optional[ConnectionNoiseSuppressionDetails] = None """Configuration options for noise suppression. These settings are stored regardless of the noise_suppression value, but only take effect when noise_suppression is not 'disabled'. If you disable noise suppression and later re-enable it, the previously configured settings will be used. """ onnet_t38_passthrough_enabled: Optional[bool] = None """ Enable on-net T38 if you prefer the sender and receiver negotiating T38 directly if both are on the Telnyx network. If this is disabled, Telnyx will be able to use T38 on just one leg of the call depending on each leg's settings. """ outbound: Optional[UacOutbound] = None password: Optional[str] = None """The password to be used as part of the credentials. Must be 8 to 128 characters long. For primary accounts created on or after September 8, 2026, this password is returned as `********`. The password is returned in full on create, and on update only when that update changed the password. Accounts created before September 8, 2026 are unaffected. """ record_type: Optional[str] = None """Identifies the type of the resource.""" registration_status: Optional[str] = None """The most recently known SIP registration status for this UAC connection.""" registration_status_updated_at: Optional[str] = None """ ISO 8601 formatted date indicating when the registration status was last updated. """ rtcp_settings: Optional[ConnectionRtcpSettings] = None sip_uri_calling_preference: Optional[Literal["disabled", "unrestricted", "internal"]] = None """This feature enables inbound SIP URI calls to your Credential Auth Connection. If enabled for all (unrestricted) then anyone who calls the SIP URI @telnyx.com will be connected to your Connection. You can also choose to allow only calls that are originated on any Connections under your account (internal). """ tags: Optional[List[str]] = None """Tags associated with the connection.""" updated_at: Optional[str] = None """ISO-8601 formatted date indicating when the resource was updated.""" user_name: Optional[str] = None """The user name to be used as part of the credentials. Must be 4-32 characters long and alphanumeric values only (no spaces or special characters). At least one of the first 5 characters must be a letter. """ webhook_api_version: Optional[Literal["1", "2"]] = None """Determines which webhook format will be used, Telnyx API v1 or v2.""" webhook_event_failover_url: Optional[str] = None """ The failover URL where webhooks related to this connection will be sent if sending to the primary URL fails. Must include a scheme, such as 'https'. """ webhook_event_url: Optional[str] = None """The URL where webhooks related to this connection will be sent. Must include a scheme, such as 'https'. """ webhook_timeout_secs: Optional[int] = None """Specifies how many seconds to wait before timing out a webhook."""