VAPI-4041: send Twilio's action params from /bw/continue - #31
Open
mramasubramanian-bw wants to merge 2 commits into
Open
mramasubramanian-bw wants to merge 2 commits into
mramasubramanian-bw wants to merge 2 commits into
Conversation
- Dial: map transferComplete to DialCallStatus/DialBridged, and join the dialed leg's transferDisconnect (new /bw/transfer-leg) for DialCallSid and DialCallDuration, waiting up to transferLegWaitMs (default 400 ms). - Record: send RecordingUrl, RecordingSid, RecordingDuration from recordComplete and register the recording with the Recordings facade. - Gather: on no digits or speech, resume the document after that Gather instead of requesting the action, unless actionOnEmptyResult="true".
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Review fixes for the Dial action join: - A multi-number Dial reported whichever leg disconnected first, usually a cancelled loser. Now all of the Dial's legs are considered and the one that answered wins; if the parent bridged but the winner has not reported, no leg is reported rather than a loser. - Leftover or late leg events were applied to the next Dial on the call. Each Dial now gets a key (<doc nonce>.<index>) on both its transferCompleteUrl and its legs' transferDisconnectUrl, so legs only join their own Dial. The wait ends early once every expected leg has reported, and a call's unread legs are dropped on disconnect.
This branch has not been deployed
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
/bw/continuenow answers each verb'sactionwith the params Twilio would send, so customer handlers branch the same way they did on Twilio.transferCompletemaps toDialCallStatusandDialBridged.DialCallSidandDialCallDurationcome from the dialed leg'stransferDisconnect. That event arrives at a new/bw/transfer-legendpoint and is joined to the parent'stransferComplete, waiting up totransferLegWaitMs(default 400 ms) because Bandwidth documents no ordering between the two. If the leg event never shows up, those two fields are left out rather than made up. Translated Dial targets now carrytransferDisconnectUrl, with the callback creds, whenever the Dial has an action.recordCompletesendsRecordingUrl,RecordingSidandRecordingDuration, and the recording can now be fetched through the Recordings facade. Bandwidth has no equivalent of Twilio'sDigits, so it is left out.gatherUrl(&gather=N).actionOnEmptyResult="true"(&onEmpty=1) requests the action withDigits=""instead. Bandwidth's speech-timeout text counts as no input. A translator instance that hasn't seen the document (after a restart, or on another replica) falls back to requesting the action.AGENTS.md and the verb matrix notes are updated to describe the new behavior.
Testing
test/server-continue.test.ts,test/translate-continue.test.tstest/server-inbound.test.ts(gatherUrl now includes&gather=1)npm run typecheckis clean;npm testgives 389 passed, 6 skipped