fix: Fix warm transfer not working#762
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe change adds Plivo-specific handling to the warm transfer handler. After a successful conference transfer is created, the code now checks if the call provider is Plivo and attempts to suppress the serializer's automatic hang-up logic by setting an internal flag, with graceful error handling. ChangesPlivo Serializer Hang-up Prevention
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes warm transfer functionality for Plivo-based calls. Previously, when transferring to a live agent, the Pipecat EndFrame would cause the Plivo serializer to invoke _hang_up_call() and drop the caller from the conference. The fix preemptively sets _hangup_attempted=True on the Plivo serializer so it skips its automatic hang-up API call, allowing the customer leg to stay connected in the conference.
Changes:
- Before ending the AI conversation on a successful transfer, set the Plivo serializer's
_hangup_attemptedflag to suppress its auto hang-up. - Wrapped in try/except with warning-level logging so any failure to access the serializer is non-fatal.
- Only applied when
context.provider == CallProvider.PLIVO.
Summary by CodeRabbit