Skip to content

feat: rate-limit Plivo audio send to ~1.2x real-time#621

Draft
san0808 wants to merge 1 commit intomasterfrom
feat/plivo-rate-limit
Draft

feat: rate-limit Plivo audio send to ~1.2x real-time#621
san0808 wants to merge 1 commit intomasterfrom
feat/plivo-rate-limit

Conversation

@san0808
Copy link
Copy Markdown
Contributor

@san0808 san0808 commented Apr 6, 2026

Summary

  • TTS generates audio much faster than real-time, causing 60s+ buffer buildup in Plivo. Mark ACKs get delayed, hangup timeout expires, thus calls cut off mid-sentence.
  • Adds rate-limiting to TelephonyOutputHandler base class (same algorithm as SIP-Trunk handler), gated on io_provider == 'plivo'
  • Caps send rate at 1.2x real-time (configurable via TELEPHONY_MAX_SEND_RATE_FACTOR env var, 0 to disable)
  • Resets rate-limit counters on sequence change and interruption
  • 60s response now builds max ~12s buffer (well within Plivo's 40s limit)

@san0808 san0808 marked this pull request as draft April 6, 2026 18:15
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