openclaw - 💡(How to fix) Fix Realtime voice calls remain active after caller hangup [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#72998Fetched 2026-04-28 06:28:53
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
closed ×1

Error Message

Bundled realtime voice-call sessions can remain active after the caller hangs up. In the realtime handler, Twilio stop and WebSocket close currently close the realtime bridge, but the call is only finalized when the bridge closes with reason error. A normal hangup therefore does not emit call.ended and the call can remain in activeCalls until maxDurationSeconds fires.

  • onClose(reason): only emits terminal call event for reason === "error"

Fix Action

Fix / Workaround

Patch summary:

Code Example

docker run --rm -v /home/zss/openclaw:/src -w /src openclaw:local ./node_modules/.bin/vitest run extensions/voice-call/src/webhook/realtime-handler.test.ts
RAW_BUFFERClick to expand / collapse

Bug

Bundled realtime voice-call sessions can remain active after the caller hangs up. In the realtime handler, Twilio stop and WebSocket close currently close the realtime bridge, but the call is only finalized when the bridge closes with reason error. A normal hangup therefore does not emit call.ended and the call can remain in activeCalls until maxDurationSeconds fires.

This blocks outbound/new calls when maxConcurrentCalls is 1.

Relevant code

  • extensions/voice-call/src/webhook/realtime-handler.ts
  • Twilio stop: currently closes bridge only
  • WS close: currently closes bridge only
  • onClose(reason): only emits terminal call event for reason === "error"

Proposed fix branch

I pushed a branch with a regression test and fix here:

https://github.com/siegelz/bartholomew-src/tree/fix/realtime-voice-hangup-finalize

Patch summary:

  • Emit call.ended with reason completed when Twilio sends realtime stream stop
  • Also emit call.ended on normal realtime WebSocket close
  • Keep the existing once-only guard to avoid double finalization
  • Add a regression test for stream stop

I tried opening a PR from siegelz:fix/realtime-voice-hangup-finalize to openclaw:main, but the GitHub connector returned a 502 twice.

Test

docker run --rm -v /home/zss/openclaw:/src -w /src openclaw:local ./node_modules/.bin/vitest run extensions/voice-call/src/webhook/realtime-handler.test.ts

Result: 6 tests passed.

extent analysis

TL;DR

Emit call.ended with reason completed when Twilio sends realtime stream stop or on normal realtime WebSocket close to finalize the call.

Guidance

  • Review the proposed fix branch (fix/realtime-voice-hangup-finalize) and verify that it addresses the issue by checking the updated realtime-handler.ts file.
  • Test the fix using the provided command: docker run --rm -v /home/zss/openclaw:/src -w /src openclaw:local ./node_modules/.bin/vitest run extensions/voice-call/src/webhook/realtime-handler.test.ts.
  • Ensure the existing once-only guard is maintained to prevent double finalization.
  • Consider retrying the PR from siegelz:fix/realtime-voice-hangup-finalize to openclaw:main to integrate the fix.

Example

No code snippet is provided as the issue already includes a proposed fix branch with the necessary changes.

Notes

The fix relies on the realtime-handler.ts file and the Twilio stop and WebSocket close events. The provided test command can be used to verify the fix.

Recommendation

Apply the workaround by emitting call.ended with reason completed when Twilio sends realtime stream stop or on normal realtime WebSocket close, as proposed in the fix branch. This should resolve the issue of bundled realtime voice-call sessions remaining active after the caller hangs up.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Realtime voice calls remain active after caller hangup [1 participants]