Add call.ring() to the Relay Call API - #93
Open
jakubkarolczyk wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
call.ring()to the RelayCallAPI — send 180 Ringing on an inbound call without answering it. Signalling only: no media, no answer, no billing.Why
Related to signalwire/cloud-product#20389. When a Relay app deliberately does not
answer()an inbound call (e.g. it runs authorization checks and only answers once a destination picks up), SignalWire sends the upstream carrier no provisional response; the carrier hits its post-dial-delay limit, cancels, and re-attempts.ring()lets the app send a 180 to satisfy the carrier's PDD timer without committing to an answer.Server method: signalwire/mod_infrastructure#1846.
Behavior worth knowing
answer()— it is no longer offered to other consumers and can no longer be handed off withpass.480(default 180s).ringis a no-op that returns success without sending a provisional.Changes
relay/call.py—ring(**kwargs), mirroringanswer(dispatchescalling.ring).tests/unit/relay/test_call.py—test_ring(asserts thecalling.ringwire call).relay/docs/call-methods.md—ringunder Lifecycle.CHANGELOG.md—[Unreleased]entry.Note on the earlier revision
This PR originally added
accept(early_media=False), sending either 180 or 183. The server-side method was subsequently cut down to a single, media-freeringthat sends 180 only — the 183/early-media path is deferred to a separatepreanswermethod. This PR has been updated to match: the method isring, andearly_mediais gone. The server's request validator is a strict allowlist, so the previous form would have been rejected with a 400.