Connect
Definition
The Connect
verb is used to start a bidirectional media Stream. A bidirectional stream sends inbound call audio to an application via a WebSocket and receives audio from that WebSocket, playing it into the outbound track of the call. This allows you to create a two-way audio connection between the caller and the application.
See Stream for full details on streaming call audio via WebSockets.
You can stop the bidirectional stream by either closing the WebSocket or ending the call.
Connect
has no attributes.
Nesting Rules
- You can nest Stream within the
Connect
verb. - You cannot nest the
Connect
verb within other FlexML verbs.
Example
In this example, the Connect
verb will start a bidirectional stream to the WebSocket at wss://example.com
with the name myStream
. The Stream
noun will be used to specify the WebSocket URL and the name of the stream. The Stream
noun is required within the Connect
verb.
<Response>
<Connect>
<Stream name="myStream" url="wss://example.com"/>
</Connect>
</Response>