Skip to content

[codex] Fix inbound call log ingestion#12

Merged
DebdipWritesCode merged 1 commit into
mainfrom
codex/fix-inbound-call-log-ingest
Jun 12, 2026
Merged

[codex] Fix inbound call log ingestion#12
DebdipWritesCode merged 1 commit into
mainfrom
codex/fix-inbound-call-log-ingest

Conversation

@rahuliitk

Copy link
Copy Markdown
Contributor

Summary

  • Return organizationId, userId, agentNumber, and provider from the internal phone-number runtime config endpoint.
  • Normalize call-log ingestion URLs so SERVER_API_URL=https://api.quickvoice.co posts to /api/v1/calls.
  • Add a regression test for production-style call-log URL construction.

Root cause

Inbound calls were connecting, but completed call logs were not being saved. Production AI logs showed:

[CALL_LOG] Failed to post completed call: organization_id is required

The worker fetched config by phone number and received the agent configuration, but the server response did not include tenant metadata from the linked phone/agent. Without organizationId and userId, the AI worker could not build a valid call-log payload for the internal /calls ingest route.

There was also a second issue on the same path: post_call_log() posted directly to ${SERVER_API_URL}/calls. In production SERVER_API_URL is the origin (https://api.quickvoice.co), so the ingest URL needs /api/v1/calls.

Validation

  • python3 apps/ai/tests/test_calllog_handler.py
  • pnpm --filter server check-types
  • pnpm --filter server build

Full AI unittest discovery is still blocked locally by missing optional runtime deps (loguru, livekit), unrelated to this focused call-log handler test.

@DebdipWritesCode DebdipWritesCode marked this pull request as ready for review June 12, 2026 05:53
@DebdipWritesCode DebdipWritesCode merged commit adb6b27 into main Jun 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants