# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .media_codec import MediaCodec
from .sip_media_encryption_enum import SipMediaEncryptionEnum
from .sip_trunk_transport_enum import SipTrunkTransportEnum


class GetPhoneNumberOutboundSipTrunkConfigResponseModel(UncheckedBaseModel):
    """
    SIP Trunk configuration details for a phone number
    """

    address: str = pydantic.Field()
    """
    Hostname or IP the SIP INVITE is sent to
    """

    transport: SipTrunkTransportEnum = pydantic.Field()
    """
    Protocol to use for SIP transport
    """

    media_encryption: SipMediaEncryptionEnum = pydantic.Field()
    """
    Whether or not to encrypt media (data layer).
    """

    headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
    """
    SIP headers for INVITE request
    """

    attributes_to_headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
    """
    Map of dynamic variable name to header name for attributes_to_headers
    """

    has_auth_credentials: bool = pydantic.Field()
    """
    Whether authentication credentials are configured
    """

    username: typing.Optional[str] = pydantic.Field(default=None)
    """
    SIP trunk username (if available)
    """

    has_outbound_trunk: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether a LiveKit SIP outbound trunk is configured
    """

    enabled_codecs: typing.Optional[typing.List[MediaCodec]] = pydantic.Field(default=None)
    """
    Media codecs that are offered in the SDP for outbound calls. If empty, all supported codecs are offered.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
