Voice Relay connects a live phone call to a WebSocket server that you host. Sinch handles speech-to-text and text-to-speech, so your server only exchanges plain text with your LLM. To connect it, host a wss:// WebSocket server that forwards each transcribed turn to your LLM and returns the reply as text. Then add a VOICE_RELAY destination to the dial command in your Voice service's SVAML, with your endpoint, a text-to-speech voice and a speech-to-text language. The tutorial includes a working example for OpenAI, Anthropic Claude or Google Gemini, and a Sinch Functions template you can deploy instead of hosting the server yourself.
For more information, see:
- Call chatbots with Voice Relay (tutorial): step-by-step setup, example code and the Functions template
- Voice Relay reference: the WebSocket interface and AsyncAPI specification
- Voice Relay connection flow: how a call connects to your server
- Text-to-speech voices: choose the ttsVoice value.
Comments
0 comments
Please sign in to leave a comment.