feat: attended transfer via REFER + Replaces#47
Merged
Conversation
Add `Call::attended_transfer` — the same in-dialog REFER as blind transfer, but its Refer-To embeds a Replaces header (RFC 3891) naming a consultation dialog the transferor already built to the target, so the transferee takes over that leg instead of ringing the target afresh. - `refer::refer_to_with_replaces` builds the Refer-To with a percent-escaped Replaces, mapping the consult dialog's remote/local tags into the target's to-tag/from-tag frame. - `refer::DialogTriplet` + `Call::dialog_triplet` expose a call's dialog identity so the consult leg can be named. - Progress is reported identically to blind (sipfrag NOTIFY), so a consumer drives both the same way. Tests: header building + escaping (unit), and a UA-level REFER that asserts the escaped Replaces rides the wire. RFC-COVERAGE updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y59X1MtJu4rYWTDLGYB2KU
The attended transfer Refer-To should target the consultation peer's remote target (its Contact), per RFC 5589 §7 — paired with the dialog's Replaces. Cache it on the Call at establishment and expose a cheap accessor, so the consumer reads it without locking the dialog. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y59X1MtJu4rYWTDLGYB2KU
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.
What
Adds attended (consultative) transfer to the engine — the follow-up to blind transfer (#45). It's the same in-dialog
REFER, but theRefer-Toembeds aReplacesheader (RFC 3891) naming a consultation dialog the transferor already established to the target. The transferee'sINVITEthen replaces that leg rather than ringing the target afresh, so the held party and the consulted target are connected on the call the target already accepted.API added
Call::attended_transfer(target, &DialogTriplet)— mirrorsblind_transfer; outcome arrives identically overNOTIFY/sipfrag oninbound_requests, so a consumer drives blind and attended the same way.refer::refer_to_with_replaces(target, &DialogTriplet)— builds theRefer-Towith a percent-escapedReplaces, mapping the consult dialog'sremote_tag/local_taginto the target'sto-tag/from-tagframe (the RFC 3891 dialog-matching swap).refer::DialogTriplet+Call::dialog_triplet()— expose a call's dialog identity (Call-ID + tags) so the consultation leg can be named.Tests
refer_to_with_replaces_embeds_escaped_dialog+escape_leaves_unreserved_untouched— header construction and escaping.attended_refer_carries_replaces— UA-level: drives the REFER and asserts the escapedReplacesrides the wire.clippyclean,fmtclean.docs/RFC-COVERAGE.mdupdated — RFC 3891 moves from "Not implemented" to Implemented.Notes
Referred-By(RFC 3892) and no acting-on-inbound-REFER — unchanged from blind, left to the consumer.wavekat-voice's attended-transfer feature; that PR patches this branch locally and will pin the released version once this lands andrelease-plzpublishes.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y59X1MtJu4rYWTDLGYB2KU