mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
* feat: inbound telephony (twilio & vobiz) * chore: add ruff and lint formatting * fix: add missing cloudonix interface compliance implementation
78 lines
2.7 KiB
Python
78 lines
2.7 KiB
Python
import os
|
|
from pathlib import Path
|
|
|
|
from api.enums import Environment
|
|
|
|
ENVIRONMENT = os.getenv("ENVIRONMENT", Environment.LOCAL.value)
|
|
# Absolute path to the project root directory (i.e. the directory containing
|
|
# the top-level api/ package). Having a single canonical location helps
|
|
# when constructing file-system paths elsewhere in the codebase.
|
|
APP_ROOT_DIR: Path = Path(__file__).resolve().parent
|
|
|
|
FILLER_SOUND_PROBABILITY = 0.0
|
|
|
|
VOICEMAIL_RECORDING_DURATION = 5.0
|
|
|
|
# Configuration constants
|
|
ENABLE_SMART_TURN = os.getenv("ENABLE_SMART_TURN", "false").lower() == "true"
|
|
ENABLE_TRACING = os.getenv("ENABLE_TRACING", "false").lower() == "true"
|
|
ENABLE_RNNOISE = os.getenv("ENABLE_RNNOISE", "false").lower() == "true"
|
|
|
|
# URLs for deployment
|
|
BACKEND_API_ENDPOINT = os.getenv("BACKEND_API_ENDPOINT", "http://localhost:8000")
|
|
UI_APP_URL = os.getenv("UI_APP_URL", "http://localhost:3010")
|
|
|
|
DATABASE_URL = os.environ["DATABASE_URL"]
|
|
REDIS_URL = os.environ["REDIS_URL"]
|
|
|
|
DEPLOYMENT_MODE = os.getenv("DEPLOYMENT_MODE", "oss")
|
|
DOGRAH_MPS_SECRET_KEY = os.getenv("DOGRAH_MPS_SECRET_KEY", None)
|
|
MPS_API_URL = os.getenv("MPS_API_URL", "https://services.dograh.com")
|
|
|
|
# Storage Configuration
|
|
ENABLE_AWS_S3 = os.getenv("ENABLE_AWS_S3", "false").lower() == "true"
|
|
|
|
# MinIO Configuration
|
|
MINIO_ENDPOINT = os.getenv("MINIO_ENDPOINT", "localhost:9000")
|
|
MINIO_PUBLIC_ENDPOINT = os.getenv("MINIO_PUBLIC_ENDPOINT")
|
|
MINIO_ACCESS_KEY = os.getenv("MINIO_ACCESS_KEY", "minioadmin")
|
|
MINIO_SECRET_KEY = os.getenv("MINIO_SECRET_KEY", "minioadmin")
|
|
MINIO_BUCKET = os.getenv("MINIO_BUCKET", "voice-audio")
|
|
MINIO_SECURE = os.getenv("MINIO_SECURE", "false").lower() == "true"
|
|
|
|
# AWS S3 Configuration
|
|
S3_BUCKET = os.environ.get("S3_BUCKET")
|
|
S3_REGION = os.environ.get("S3_REGION", "us-east-1")
|
|
|
|
# Sentry configuration
|
|
SENTRY_DSN = os.getenv("SENTRY_DSN")
|
|
|
|
|
|
ENABLE_ARI_STASIS = os.getenv("ENABLE_ARI_STASIS", "false").lower() == "true"
|
|
SERIALIZE_LOG_OUTPUT = os.getenv("SERIALIZE_LOG_OUTPUT", "false").lower() == "true"
|
|
ENABLE_TELEMETRY = os.getenv("ENABLE_TELEMETRY", "false").lower() == "true"
|
|
|
|
# Country code mapping: ISO country code -> international dialing prefix
|
|
COUNTRY_CODES = {
|
|
"US": "1", # United States
|
|
"CA": "1", # Canada
|
|
"GB": "44", # United Kingdom
|
|
"IN": "91", # India
|
|
"AU": "61", # Australia
|
|
"DE": "49", # Germany
|
|
"FR": "33", # France
|
|
"BR": "55", # Brazil
|
|
"MX": "52", # Mexico
|
|
"IT": "39", # Italy
|
|
"ES": "34", # Spain
|
|
"NL": "31", # Netherlands
|
|
"SE": "46", # Sweden
|
|
"NO": "47", # Norway
|
|
"DK": "45", # Denmark
|
|
"FI": "358", # Finland
|
|
"CH": "41", # Switzerland
|
|
"AT": "43", # Austria
|
|
"BE": "32", # Belgium
|
|
"LU": "352", # Luxembourg
|
|
"IE": "353", # Ireland
|
|
}
|