mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-05-18 20:08:19 +00:00
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Root cause: CDR webhook fires 5s after dispose, stores monitorUCID. Frontend has agent-side UCID from SIP. They never matched → disposition not persisted, agent call history empty. Fix: - Dispose endpoint now creates Call records for ALL answered calls (inbound + outbound), not just outbound. Record gets agent-side UCID + correct disposition immediately. - Webhook checks if Call record already exists (by agent UCID via monitorUCID→agentUCID mapping). If found, enriches with recording URL, agent chain name, CDR timing. If not found, creates as fallback. - SupervisorService stores UCID mapping from real-time events (which carry both UCIDs). Auto-expires after 10 minutes. Verified: UCID-MAP logged, dispose creates record, webhook enriches without duplicating. DB shows correct agent UCID + disposition + recording. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>