whatsapp integration
This commit is contained in:
parent
d077292bbc
commit
141ca9fda3
15 changed files with 578 additions and 1 deletions
|
|
@ -30,6 +30,15 @@ class Settings(BaseSettings):
|
|||
bonvoice_api_url: str = "https://backend.pbx.bonvoice.com/autoDialManagement/autoCallBridging/"
|
||||
bonvoice_media_allowlist: str = "103.131.25.5"
|
||||
voice_session_ttl_seconds: int = 600
|
||||
whatsapp_api_version: str = "v21.0"
|
||||
whatsapp_verify_token: str = ""
|
||||
whatsapp_app_secret: str = ""
|
||||
whatsapp_access_token: str = ""
|
||||
whatsapp_phone_number_id: str = ""
|
||||
whatsapp_business_account_id: str = ""
|
||||
meta_app_id: str = ""
|
||||
# Public HTTPS base for webhook callback (no trailing slash), e.g. https://api.urmiai.com
|
||||
public_api_base_url: str = ""
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=(".env", "../.env"),
|
||||
|
|
@ -46,4 +55,13 @@ class Settings(BaseSettings):
|
|||
return [self.frontend_origin]
|
||||
|
||||
|
||||
@computed_field # type: ignore[prop-decorator]
|
||||
@property
|
||||
def whatsapp_webhook_url(self) -> str:
|
||||
base = self.public_api_base_url.rstrip("/") if self.public_api_base_url else ""
|
||||
if base:
|
||||
return f"{base}/api/v1/whatsapp/webhook"
|
||||
return "/api/v1/whatsapp/webhook"
|
||||
|
||||
|
||||
settings = Settings()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue