A carrier hangup the carrier refuses is not retried: the call stays connected while its record says it ended
Before you file
- [x] I searched the existing issues and found none for this bug.
What happened
CallManager ends a call before it asks the carrier to hang up, and a carrier request that fails is only written to the console (requestCarrierHangup). For a call held in a store, hangupDurable commits hangup-bot first (L649-L667). When the carrier then refuses the hangup or the request fails, hangupCall resolves, processWebhookDurable acknowledges the webhook that triggered a notify call's hangup, and the record reads hangup-bot in the manager and in the store while the call is still connected at the carrier. Nothing asks again: a redelivered call.speak.ended finds the call ended.
Twilio's hangupCall does not read the HTTP status (twilio.ts L425), so a refused Twilio hangup is not even written to the console. A carrier-profile Plivo provider throws on a status outside 2xx, and a carrier-profile Telnyx provider does too from #792.
Expected: a hangup the carrier did not accept stays retryable. The end commits with a pending carrier hangup on the record, cleared once the carrier accepts the command; a redelivered webhook for the call, or a call the host makes on a timer, sends the pending hangup again; and hangupCall tells its caller when the carrier refused.
Steps to reproduce
- A carrier-profile
TelnyxVoiceProviderand aCallManagerwithInMemoryTelephonyCallStore;initiateCall({ mode: 'notify', message }),persistCall, then the signedcall.answeredthroughprocessWebhookDurable. - Answer
POST /v2/calls/{id}/actions/hangupwith 422 (or reject the fetch). - Send the signed
call.speak.endedwith the speak'sclient_stateandstatus: completed.
processWebhookDurable resolves { accepted: true, applied: 1 }, the call reads hangup-bot in the manager and the store, and the carrier call is never hung up. A redelivery of the webhook sends nothing.
Package and version
@framers/agentos master fb6fcdf78fc909e3ae1ba71285df1285860dc135
Environment
n/a
Logs
[CallManager] Hangup failed: Error: Telnyx hangup failed: 422
23 Nov 2026 UTC. The refusal case needs durable pending-hangup state, a retry route that can see an ended call, and consistent error handling from the carrier providers. Making the carrier error visible alone would still leave the persisted call unable to retry.