mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
fix: add missing call_id in gathered_context for telnyx
This commit is contained in:
parent
025bc14392
commit
31e2c135b0
2 changed files with 14 additions and 1 deletions
|
|
@ -22,6 +22,8 @@ from api.services.telephony.base import (
|
|||
from api.utils.common import get_backend_endpoints
|
||||
from api.utils.telephony_address import normalize_telephony_address
|
||||
|
||||
from fastapi import WebSocketDisconnect
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from fastapi import WebSocket
|
||||
|
||||
|
|
@ -139,6 +141,7 @@ class TelnyxProvider(TelephonyProvider):
|
|||
status="initiated",
|
||||
caller_number=from_number,
|
||||
provider_metadata={
|
||||
"call_id": call_control_id,
|
||||
"call_control_id": call_control_id,
|
||||
"call_leg_id": call_leg_id,
|
||||
"call_session_id": call_session_id,
|
||||
|
|
@ -321,6 +324,15 @@ class TelnyxProvider(TelephonyProvider):
|
|||
},
|
||||
)
|
||||
|
||||
except WebSocketDisconnect as e:
|
||||
# Telnyx opens the WebSocket during `bridging` (pre-answer) but only
|
||||
# sends the `start` event on `call.answered`. If the call ends before
|
||||
# answer (no-answer timeout, busy, declined), Telnyx closes the
|
||||
# socket abruptly — surface this as an expected end-of-call.
|
||||
logger.info(
|
||||
f"[run {workflow_run_id}] Telnyx WebSocket closed before stream start "
|
||||
f"(call ended pre-answer): code={e.code}, reason={e.reason!r}"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Error in Telnyx WebSocket handler: {e}")
|
||||
raise
|
||||
|
|
|
|||
|
|
@ -140,7 +140,8 @@ class VonageProvider(TelephonyProvider):
|
|||
status=response_data.get("status", "started"),
|
||||
caller_number=from_number,
|
||||
provider_metadata={
|
||||
"call_uuid": response_data["uuid"]
|
||||
"call_id": response_data["uuid"],
|
||||
"call_uuid": response_data["uuid"],
|
||||
}, # Vonage needs UUID persisted for WebSocket
|
||||
raw_response=response_data,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue