Stop Stream
The StopStream verb is used to stop a stream that was started with a previous <StartStream> verb.
If there is no stream with the given name on the call, this verb has no effect.
Text Content
There is no text content available to be set for the <StopStream> verb.
Attributes
| Attribute | Description |
|---|---|
| name | (required) The name of the stream to stop. This is either the user selected name when sending the <StartStream> verb, or the system generated name returned in the Media Stream Started webhook if <StartStream> was sent with no name attribute. |
| wait | (optional) If set to true, BXML execution will pause at this verb until the WebSocket connection established by <StartStream> is closed. This is essential for bidirectional streams where your service needs to send audio back over the WebSocket — without wait="true", the call would continue executing subsequent verbs (or end if there are none), closing the WebSocket before your service can respond. When the WebSocket connection closes (either by your server or by a timeout), BXML execution resumes with the next verb. Default is false. |
Webhooks Received
| Webhooks | Can reply with more BXML |
|---|---|
| Media Stream Stopped | No |
Examples
Stopping a media stream
- XML
- Java
- C#
- Ruby
- NodeJS
- Python
- PHP
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<StopStream name="live_audience"/>
</Response>
StopStream stopStream = new StopStream().builder()
.name("live_audience")
.build();
Response response = new Response()
.with(stopStream);
System.out.println(response.toBXML());
StopStream stopStream = new StopStream
{
Name = "live_audience",
};
Response response = new Response();
response.Add(stopStream);
Console.WriteLine(response.ToBXML());
stop_stream = Bandwidth::Bxml::StopStream.new({ name: 'live_audience' })
response = Bandwidth::Bxml::Response.new([stop_stream])
p response.to_bxml
const stopStream = new Bxml.StopStream({
name: 'live_audience'
});
const response = new Bxml.Response(stopStream);
console.log(response.toBxml());
stop_stream = StopStream(
name="live_audience",
)
response = Response()
response.add_verb(stop_stream)
print(response.to_bxml())
$stopStream = new BandwidthLib\Voice\Bxml\StopStream("live_audience");
$response = new BandwidthLib\Voice\Bxml\Response();
$response->addVerb($stopStream);
echo $response->toBxml();