fix: fix inbound for Cloudonix with softphone

This commit is contained in:
Abhishek Kumar 2026-05-28 19:49:41 +05:30
parent c4da6d6537
commit e695436fb3

View file

@ -699,12 +699,16 @@ class CloudonixProvider(TelephonyProvider):
if "Twilio-AccountSid" in trunk_headers:
underlying_provider = "twilio"
direction = webhook_data.get("Direction", "inbound").lower()
if direction in {"inbound", "subscriber"}:
direction = "inbound"
return NormalizedInboundData(
provider=CloudonixProvider.PROVIDER_NAME,
call_id=call_id,
from_number=webhook_data.get("From", ""),
to_number=webhook_data.get("To", ""),
direction=webhook_data.get("Direction", "inbound").lower(),
direction=direction,
call_status=webhook_data.get("CallStatus", "in-progress"),
account_id=account_id,
from_country=webhook_data.get("FromCountry"),