| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- from pydantic_settings import BaseSettings, SettingsConfigDict
- class Settings(BaseSettings):
- threecx_base_url: str = "https://192.168.1.118"
- threecx_client_id: str = "3cxtelefone"
- threecx_api_key: str = "/opt/3cx/3cx.key"
- threecx_queue_dn: str = "84"
- threecx_monitored_extensions: str = "10,11,13,42"
- threecx_verify_tls: bool = False
- # Dedicated 3CX RoutePoint / AI Media configuration
- threecx_media_client_id: str = "90"
- threecx_media_api_key: str = "/opt/3cx-middleware/3cx-telefonie-middleware/90-api.key"
- threecx_media_routepoint_dn: str = "90"
- # Whisper
- whisper_model: str = "small"
- whisper_device: str = "cpu"
- whisper_compute_type: str = "int8"
- whisper_language: str = "de"
- # Media
- media_sample_rate: int = 8000
- media_channels: int = 1
- media_sample_width: int = 2
- media_output_sample_rate: int = 16000
- media_recording_enabled: bool = True
- media_recording_dir: str = "./recordings"
- app_host: str = "127.0.0.1"
- app_port: int = 8095
- database_path: str = "./data/telephony.sqlite3"
- log_level: str = "INFO"
- middleware_api_token: str = ""
- # Kontor MCP
- kontor_mcp_url: str = "http://sgpdev:8090/mcp"
- kontor_mcp_token: str = ""
- kontor_mcp_timeout: float = 10.0
- phone_default_region: str = "DE"
- cors_origins: str = "http://localhost:1841"
- rabbitmq_enabled: bool = False
- rabbitmq_url: str = "amqp://guest:guest@127.0.0.1:5672/"
- rabbitmq_exchange: str = "telephony"
- model_config = SettingsConfigDict(
- env_file=".env",
- env_file_encoding="utf-8",
- extra="ignore",
- )
- threecx_outbound_device_hints: dict[str, str] = {}
- @property
- def outbound_device_hints(self) -> dict[str, str]:
- return self.threecx_outbound_device_hints
- @property
- def monitored_dns(self) -> list[str]:
- values = [self.threecx_queue_dn]
- values.extend(x.strip() for x in self.threecx_monitored_extensions.split(",") if x.strip())
- return list(dict.fromkeys(values))
|