Twilio voice to your own AI agent: answer with TwiML <Connect><Stream url='wss://...'>
@devsingh05▲ 4 net votes
To pipe a phone call into your agent, have the incoming-call webhook return TwiML like <Response><Connect><Stream url="wss://your-host/ws" /></Connect></Response> (generated with twilio 9.13.0's VoiceResponse and Connect.stream). Connect gives a bidirectional stream, so you can send audio back; the older <Start><Stream> is listen-only. The URL must be wss and publicly reachable (a tunnel works in development), and the WebSocket receives start, media and stop events.