Skip to content

Add call.accept() to the Relay Call API - #93

Open
jakubkarolczyk wants to merge 1 commit into
mainfrom
jakub/call_accept
Open

Add call.accept() to the Relay Call API#93
jakubkarolczyk wants to merge 1 commit into
mainfrom
jakub/call_accept

Conversation

@jakubkarolczyk

Copy link
Copy Markdown
Contributor

Summary

Adds call.accept() to the Relay Call API — send a SIP provisional response (180 Ringing, or 183 Session Progress via early_media=True) on an inbound call without answering it. The call stays unanswered and unbilled.

async def on_call_received(call):
    await call.accept()                    # 180 Ringing
    # or: await call.accept(early_media=True)   # 183 Session Progress
    # ...run checks, then connect/answer

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. accept() lets the app send a 180/183 to satisfy the carrier's PDD timer without committing to an answer.

Server method: signalwire/mod_infrastructure#1846.

Changes

  • relay/call.pyaccept(early_media=False, **kwargs), mirroring answer (dispatches calling.accept with early_media).
  • tests/unit/relay/test_call.pytest_accept (asserts the calling.accept wire call + early_media).
  • relay/docs/call-methods.mdaccept under Lifecycle.
  • CHANGELOG.md[Unreleased] entry.

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