WebSocket URL Twilio should connect to (e.g. wss://api.example.com/stream).
Optional token: stringOptional bearer token appended as a ?token= query parameter
for authenticating the WebSocket connection.
A complete TwiML XML document string.
// Without auth token:
twilioConversationTwiml('wss://api.example.com/call');
// => '<?xml version="1.0" encoding="UTF-8"?>\n<Response><Connect><Stream url="wss://api.example.com/call" /></Connect></Response>'
// With auth token:
twilioConversationTwiml('wss://api.example.com/call', 'jwt-token-here');
// => '<?xml version="1.0" ...><Response><Connect><Stream url="wss://api.example.com/call?token=jwt-token-here" /></Connect></Response>'
Generate TwiML for Twilio conversation mode using a bidirectional media stream.
The returned markup instructs Twilio to open a WebSocket to
streamUrland stream audio in both directions for the duration of the call. Twilio will send mu-law 8 kHz audio chunks as JSONmediaevents on the WebSocket.