Skip to content

VAPI-3161: Add <Refer> BXML verb support - #295

Open
mramasubramanian-bw wants to merge 6 commits into
mainfrom
VAPI-3161-add-refer-verb
Open

VAPI-3161: Add <Refer> BXML verb support#295
mramasubramanian-bw wants to merge 6 commits into
mainfrom
VAPI-3161-add-refer-verb

Conversation

@mramasubramanian-bw

@mramasubramanian-bw mramasubramanian-bw commented May 9, 2026

Copy link
Copy Markdown

Adds the <Refer> BXML verb.

  • bandwidth/models/bxml/verbs/refer.py: new Refer verb (referCompleteUrl, referCompleteMethod, tag attributes, one required SipUri child).
  • Reuses the existing SipUri type (bandwidth/models/bxml/verbs/sip_uri.py) for the child element instead of a separate ReferSipUri - no cross-field validation restricting which SipUri attributes are legal per verb (matches csharp-sdk#201, which dropped this as over-engineering).
  • ReferCompleteCallback model is out of scope here - lands separately once VAPI-3440 merges.
  • Tests in test/unit/models/bxml/test_refer.py.

Tests: pytest test/unit/models/ - 276/276 pass.

VAPI-3435

Adds support for the SIP REFER BXML verb to the python-sdk, mirroring
the <Transfer> pattern but with the SIP-protocol-mandated success
semantics: a successful REFER terminates the call on Bandwidth's side.

Scope: BXML verb + unit tests only. The referCompleteCallback model
will be regenerated from the OpenAPI spec once api-specs#2142 merges.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bwappsec

bwappsec commented May 9, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Unblocked by api-specs#2142 merging. Hand-written to match the
OpenAPI generator output pattern (mirrors TransferCompleteCallback).

Fields: standard call fields + referCallStatus, referSipResponseCode,
notifySipResponseCode. Excludes cause/errorMessage/errorId (not in spec)
and enqueuedTime (inbound SIP URI calls only).

Adds scenario tests for all four referComplete outcomes:
- Success (202 REFER, 200 NOTIFY)
- Failure: REFER rejected (e.g. 405, no NOTIFY)
- Failure: destination unreachable (202 REFER, 4xx NOTIFY)
- Failure: NOTIFY timeout (202 REFER, no NOTIFY)

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@stampercasey
stampercasey marked this pull request as ready for review June 18, 2026 19:58
@stampercasey
stampercasey requested review from a team as code owners June 18, 2026 19:58
stampercasey and others added 2 commits June 18, 2026 16:04
The Transfer SipUri carries ~12 Transfer-specific params (transfer_answer_url,
uui, auth, fallback URLs) that are invalid in a REFER context. A user passing
any of those would silently produce malformed BXML.

ReferSipUri accepts only uri — matching the spec and the C# SDK's nested
Refer.SipUri class design.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@stampercasey
stampercasey enabled auto-merge June 18, 2026 20:26
stampercasey
stampercasey previously approved these changes Jun 19, 2026
Remove ReferCompleteCallback (will land later via a separate api-specs-driven
PR once VAPI-3440 merges) and delete the distinct ReferSipUri type. Refer now
takes the existing Transfer-flavored SipUri directly, matching the plain,
validation-free style of the other BXML verb models in this SDK.
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.

3 participants