feat: add amd callback

This commit is contained in:
Sabiha Khan 2026-03-03 20:12:04 +05:30
parent aed5a782fb
commit fb08f56524
11 changed files with 308 additions and 137 deletions

View file

@ -231,3 +231,30 @@ def get_countries_for_code(dialing_code: str) -> list[str]:
return []
return [country for country, code in COUNTRY_CODES.items() if code == dialing_code]
def parse_cloudonix_amd_callback(data: dict) -> dict:
"""
Parse Cloudonix AMD callback data into generic format.
Note: This is Cloudonix-specific and not part of the generic provider interface
as AMD callbacks are currently only supported by Cloudonix.
Args:
data: Raw AMD callback data from Cloudonix
Returns:
Dict with parsed AMD information
"""
return {
"call_id": data.get("CallSid", ""),
"session": data.get("Session", ""),
"answered_by": data.get("AnsweredBy", ""),
"from_number": data.get("From", ""),
"to_number": data.get("To", ""),
"call_status": data.get("CallStatus", ""),
"domain": data.get("Domain", ""),
"direction": data.get("Direction", ""),
"account_sid": data.get("AccountSid", ""),
"api_version": data.get("ApiVersion", "")
}