Incoming Call Policy: a caller hanging up during the hunt is logged as "no answer", leaving the call stuck at Escalated
Summary
If the caller hangs up while an engineer's phone is ringing, OneUptime treats it as "the engineer didn't answer". It marks that attempt NoAnswer, logs a new attempt as Ringing, sets the call log to Escalated, and sends Twilio new dial instructions. Twilio ignores them because the call has already ended. The call log stays at Escalated for good, with no endedAt and a final attempt stuck at Ringing.
IncomingCallStatus.CallerHungUp exists but is never set.
Environment
- Self-hosted, server 14.0.1, Twilio as call provider. The same code is on current
master. - Incoming Call Policy with one escalation rule (one user, about 30 s ring timeout) and "repeat if no one answers" enabled.
Steps to reproduce
- Call the policy's number.
- Let the engineer's phone ring and hang up before the ring timeout.
- Look at the call log and its items, in the dashboard or through
/incoming-call-logand/incoming-call-log-item.
Expected
- The call log is
CallerHungUp, withendedAtset. - The last attempt is closed.
- No further dial is attempted.
Actual
What the call log and its items show, with times relative to the start of the call:
| Attempt | Start | End | Status |
|---|---|---|---|
| 1 | 0 s | 11 s (caller hung up) | NoAnswer |
| 2 | 11 s | never | Ringing |
The call log stays Escalated, repeatCount 1, with no endedAt. We reproduced this three times with the same result. For comparison:
- Nobody answers at all: every attempt ends at the full ring timeout and the call log ends
NoAnswerwithendedAtset (correct). - Engineer answers: the call log ends
Completed(correct).
Root cause
TwilioCallProvider.parseDialStatusWebhookonly readsDialCallStatusandDialCallDuration.- When the caller hangs up during a
<Dial>, Twilio still requests theactionURL. TheDialCallStatusit sends looks just like an unanswered ring, but the request also carries the inbound call'sCallStatus, which is no longerin-progress. That field is ignored. - So the dial-status handler in
App/FeatureSet/Notification/API/IncomingCall.tsfollows the "not answered" path:- marks the attempt
NoAnswer - resolves the next rule, or repeats the policy
- creates a
Ringingitem - sets the log to
Escalated - returns dial TwiML, which Twilio discards because the call has ended
- marks the attempt
- No later webhook ever closes the log.
Suggested fix
- Add the inbound call's
CallStatustoDialStatusData. For example:
callerStillConnected: body.CallStatus === "in-progress"- At the top of the dial-status handler, before any escalation or repeat logic, when
callerStillConnectedis false:- mark the current item with its real dial result
- set the call log to
CallerHungUpwithendedAt - return an empty response
- Optionally, also set a status callback on the inbound call, so a hang-up during the greeting or between attempts closes the log too.
Impact
- Missed calls where the caller gave up can't be told apart from calls still in progress, so reporting on and alerting about missed calls is unreliable.
- Call logs accumulate that are never closed, each ending in an attempt stuck at
Ringing.
Related: #4159 (notify policy owners on unanswered calls)
Source: OneUptime/oneuptime