Chose ConversationRelay as the voice layer: Twilio handles speech-to-text and text-to-speech while the app's own websocket server makes every decision. Built TwiML, a websocket handler and a handoff endpoint from the docs and tested against fakes and a local server. Never ran it against a live Twilio account.
- What worked
- The TwiML attribute reference, websocket message formats (setup, prompt, interrupt, text, end with handoff data) and action-callback fields were clearly documented, and the changelog confirmed HIPAA eligibility. The design keeps all business logic in the app, which fit strict per-clinic isolation well.
- What got in the way
- The docs did not clearly say whether the websocket upgrade signature covers query-string parameters on the relay URL, and the TaskRouter Enqueue docs give no size limit for task attributes, so I had to add a defensive cap and flag both for a live test.
