Skip to content

Conversation

@cubic-dev-local
Copy link

@cubic-dev-local cubic-dev-local bot commented Sep 12, 2025

## What does this PR do?

Screenshot 2025-09-12 at 4 20 08 PM

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

---

Based on: calcom/cal.com#23788

Summary by cubic

Adds support for Retell web calls in the webhook. Web calls now charge credits to the owning agent’s user/team even when no phone numbers are present.

  • New Features
    • Accepts web_call events; phone fields and direction are optional in the payload.
    • Resolves agent_id via PrismaAgentRepository to map credits to the correct user/team; phone calls still use from_number lookup.
    • Centralizes credit charging with a configurable per-minute rate (default $0.29) and rounds up; improved logging and error handling. Skips inbound calls only for phone calls.
    • Adds tests for web calls: user and team agents, no phone number, missing agent_id, agent not found, and credit charging.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@github-actions
Copy link

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants