Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,26 @@ Translation is a fixed rulebook (`src/matrix/twilio-voice.json`), not a guess.
- `Reject` — maps to `Hangup`, but Bandwidth answers before hanging up, so the
caller may be billed for a short call.
- `Dial` — `Number`/`Sip` nouns map to `Transfer`, `Conference` noun maps to
`Conference`; the `Queue` and `Client` nouns are unsupported, and deep Dial
semantics (`answerOnBridge`, child-call status propagation) are not
replicated.
`Conference`; the `Queue` and `Client` nouns are unsupported, and
`answerOnBridge` is not replicated. The Dial `action` receives Twilio's
`DialCallStatus` and `DialBridged` mapped from Bandwidth's transfer result;
`DialCallSid` and `DialCallDuration` come from the dialed leg's
`transferDisconnect` event, which the translator receives at
`/bw/transfer-leg` and joins to the parent's `transferComplete` (waiting up
to `transferLegWaitMs`, default 400 ms, since Bandwidth documents no
ordering between the two). Each Dial's legs are keyed to that Dial, and for
a multi-number Dial the leg that answered is reported, not the cancelled
ones. As on Twilio, a caller hangup during the
transfer ends the session without requesting the action.
- `Gather` — a Gather that ends with no digits or speech does **not** request
the action (Twilio semantics): the translator remembers each call's last
TwiML document and re-translates the verbs after that Gather. Set
`actionOnEmptyResult="true"` to request the action with `Digits=""` instead.
On a translator instance that has not seen the document (restart, second
replica) the action is requested as a fallback.
- `Record` — the `action` receives `RecordingUrl`, `RecordingSid`, and
`RecordingDuration` from Bandwidth's `recordComplete`; Bandwidth's event has
no equivalent of Twilio's `Digits` (the key that stopped the recording).
- `Start` — the `Transcription` noun maps to `StartTranscription`; the
`Siprec` and `VirtualAgent` nouns are unsupported.
- `Refer` — Bandwidth only honors `Refer` on inbound SIP URI calls, so a PSTN
Expand Down
20 changes: 16 additions & 4 deletions src/matrix/twilio-voice.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
"notes": "DTMF and speech both supported. Per dev.bandwidth.com, BW Gather input accepts dtmf/speech/dtmf_speech.",
"docsUrl": "https://dev.bandwidth.com/docs/voice/programmable-voice/bxml/gather",
"attributes": {
"action": { "bxml": "gatherUrl", "status": "supported" },
"action": {
"bxml": "gatherUrl",
"status": "supported",
"notes": "No digits or speech does not request the action; the verbs after the Gather run instead (Twilio semantics). actionOnEmptyResult=\"true\" requests the action with Digits=\"\"."
},
"numDigits": { "bxml": "maxDigits", "status": "supported" },
"timeout": { "bxml": "firstDigitTimeout", "status": "supported" },
"finishOnKey": { "bxml": "terminatingDigits", "status": "supported" },
Expand Down Expand Up @@ -72,7 +76,11 @@
"notes": "Recording callback payloads differ; translator normalizes.",
"docsUrl": "https://dev.bandwidth.com/docs/voice/bxml/record",
"attributes": {
"action": { "bxml": "recordCompleteUrl", "status": "supported" },
"action": {
"bxml": "recordCompleteUrl",
"status": "supported",
"notes": "The callback carries RecordingUrl, RecordingSid, RecordingDuration. Bandwidth's event has no equivalent of Twilio's Digits."
},
"recordingStatusCallback": { "bxml": "recordingAvailableUrl", "status": "supported", "notes": "Async 'recording ready' webhook. Translator receives the BW recordingAvailableUrl event, reshapes it into Twilio recordingStatusCallback params, and forwards it; RecordingUrl points back at the translator's recording facade. recordingStatusCallbackMethod=GET is not honored (forwarded via POST)." },
"maxLength": { "bxml": "maxDuration", "status": "supported" },
"finishOnKey": { "bxml": "terminatingDigits", "status": "supported" },
Expand All @@ -83,12 +91,16 @@
"Dial": {
"bxml": "Transfer",
"status": "partial",
"notes": "Number/Sip nouns map to Transfer; Conference noun maps to Conference; Queue and Client nouns are unsupported. Deep Dial semantics (answerOnBridge, child-call status propagation) are not replicated in P0. When the record attribute is set to a recording-enabled value, a BW StartRecording verb is emitted immediately before the Transfer. Dual-channel variants (record-from-answer-dual, record-from-ringing-dual) emit StartRecording with multiChannel=true.",
"notes": "Number/Sip nouns map to Transfer; Conference noun maps to Conference; Queue and Client nouns are unsupported. answerOnBridge is not replicated. The Dial action receives DialCallStatus and DialBridged mapped from Bandwidth's transfer result, and DialCallSid/DialCallDuration from the dialed leg's transferDisconnect event when it has arrived. When the record attribute is set to a recording-enabled value, a BW StartRecording verb is emitted immediately before the Transfer. Dual-channel variants (record-from-answer-dual, record-from-ringing-dual) emit StartRecording with multiChannel=true.",
"docsUrl": "https://dev.bandwidth.com/docs/voice/bxml/transfer",
"attributes": {
"callerId": { "bxml": "transferCallerId", "status": "supported" },
"timeout": { "bxml": "callTimeout", "status": "supported" },
"action": { "bxml": "transferCompleteUrl", "status": "supported" },
"action": {
"bxml": "transferCompleteUrl",
"status": "supported",
"notes": "The callback carries DialCallStatus, DialBridged, and (from the dialed leg's transferDisconnect) DialCallSid and DialCallDuration. As on Twilio, a caller hangup during the transfer does not request the action."
},
"record": {
"bxml": "StartRecording",
"status": "partial",
Expand Down
Loading
Loading