Skip to content

Allow the SIP status for a call that rings out to be configured - #785

Open
bowdens wants to merge 2 commits into
livekit:mainfrom
bowdens:configurable-ringing-timeout-status
Open

Allow the SIP status for a call that rings out to be configured#785
bowdens wants to merge 2 commits into
livekit:mainfrom
bowdens:configurable-ringing-timeout-status

Conversation

@bowdens

@bowdens bowdens commented Aug 11, 2026

Copy link
Copy Markdown

Currently, when a call rings out after the ringing period the INVITE is rejected with a 486 Busy Here.

It would be convenient in our use case to allow a different code, such as a 503 Service Unavailable to be sent instead so that twilio fails over - it doesn't fail over on a 486.

This PR adds a ringing_timeout_status option which defaults to the current 486.

When an inbound call rings for the whole ringing timeout without anything in
the room subscribing to the caller's audio, the INVITE was rejected with a
hardcoded 486 Busy Here.

Carriers treat 486 as a definitive outcome and hand it straight back to the
caller, so there is no way to tell an upstream carrier that the call failed on
our side and another route should be tried. Which status is right depends on
the deployment, and it is not simply a matter of picking a better default:
codes that mean "retry me", 503 in particular, invite the carrier to re-send
the INVITE repeatedly, making the caller wait out the ringing timeout once per
attempt.

Add a ringing_timeout_status option to choose the status. It defaults to 486,
so behaviour is unchanged unless it is set.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bowdens
bowdens requested a review from a team as a code owner August 11, 2026 00:19
@bowdens bowdens changed the title Allow the SIp status for a call that rings out to be configured Allow the SIP status for a call that rings out to be configured Aug 11, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.33333% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.83%. Comparing base (0460b40) to head (6e13834).
⚠️ Report is 346 commits behind head on main.

Files with missing lines Patch % Lines
pkg/config/config.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #785      +/-   ##
==========================================
+ Coverage   65.25%   66.83%   +1.58%     
==========================================
  Files          51       41      -10     
  Lines        6588     8106    +1518     
==========================================
+ Hits         4299     5418    +1119     
- Misses       1915     2201     +286     
- Partials      374      487     +113     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Nothing covered the response to an inbound call that rings for the whole
ringing timeout without the room ever subscribing, in either the default or
the configured case.

Reuse the existing ringForever test room, which already skips the room's
subscribed signal, and let NewServiceTest take a handler so the dispatch can
return a short ringing timeout.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant