#4219·oneuptime

Incoming Call Policy: a caller hanging up during the hunt is logged as "no answer", leaving the call stuck at Escalated

Author: alexandre-gianniCreated Oct 1, 2026Updated Oct 1, 2026
Labelsbug

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

  1. Call the policy's number.
  2. Let the engineer's phone ring and hang up before the ring timeout.
  3. Look at the call log and its items, in the dashboard or through /incoming-call-log and /incoming-call-log-item.

Expected

  • The call log is CallerHungUp, with endedAt set.
  • 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 NoAnswer with endedAt set (correct).
  • Engineer answers: the call log ends Completed (correct).

Root cause

  1. TwilioCallProvider.parseDialStatusWebhook only reads DialCallStatus and DialCallDuration.
  2. When the caller hangs up during a <Dial>, Twilio still requests the action URL. The DialCallStatus it sends looks just like an unanswered ring, but the request also carries the inbound call's CallStatus, which is no longer in-progress. That field is ignored.
  3. So the dial-status handler in App/FeatureSet/Notification/API/IncomingCall.ts follows the "not answered" path:
    • marks the attempt NoAnswer
    • resolves the next rule, or repeats the policy
    • creates a Ringing item
    • sets the log to Escalated
    • returns dial TwiML, which Twilio discards because the call has ended
  4. No later webhook ever closes the log.

Suggested fix

  • Add the inbound call's CallStatus to DialStatusData. For example:
typescript
  callerStillConnected: body.CallStatus === "in-progress"
  • At the top of the dial-status handler, before any escalation or repeat logic, when callerStillConnected is false:
    • mark the current item with its real dial result
    • set the call log to CallerHungUp with endedAt
    • 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)