mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
Fix inbound call phone numbers not shown in usage logs (#241)
For outbound calls, the caller phone is stored as "phone_number" in initial_context. For inbound calls, it is stored as "caller_number". The usage log extraction only checked "phone_number", so inbound caller numbers were never surfaced. Add a fallback to also check "caller_number" when "phone_number" is absent. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
79bc91b1e0
commit
1d0a7cd2d8
1 changed files with 2 additions and 1 deletions
|
|
@ -316,9 +316,10 @@ class OrganizationUsageClient(BaseDBClient):
|
|||
total_duration_seconds += int(round(call_duration))
|
||||
|
||||
# Extract phone number from initial_context
|
||||
# Outbound calls store it as "phone_number"; inbound calls store it as "caller_number"
|
||||
phone_number = None
|
||||
if run.initial_context:
|
||||
phone_number = run.initial_context.get("phone_number")
|
||||
phone_number = run.initial_context.get("phone_number") or run.initial_context.get("caller_number")
|
||||
|
||||
# Extract disposition from gathered_context
|
||||
disposition = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue