Skip to content

Commit 36cdca0

Browse files
authored
VAPI-2496 add wait attribute to StopStream (#206)
* VAPI-2496 add `wait` attribute to `StopStream` * forgot quotes
1 parent 8249004 commit 36cdca0

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/main/java/com/bandwidth/sdk/model/bxml/StopStream.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*
2626
* @param name (str, optional): The name of the stream to stop.
2727
* 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.
28+
* @param wait (bool, optional): If true, the BXML interpreter will wait for the stream to stop before processing the next verb.
2829
*/
2930
public class StopStream implements Verb {
3031

@@ -33,6 +34,14 @@ public class StopStream implements Verb {
3334
@XmlAttribute
3435
protected String name;
3536

37+
@XmlAttribute
38+
protected Boolean wait;
39+
40+
// Original constructor for backwards compatibility
41+
public StopStream(String name) {
42+
this.name = name;
43+
}
44+
3645
@Override
3746
public String getVerbName() {
3847
return TYPE_NAME;

src/test/java/com/bandwidth/sdk/unit/models/bxml/StopStreamVerbTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,12 @@ public void stopStreamVerbWorks() throws JAXBException {
2727

2828
assertThat(new Bxml().with(new StopStream("name")).toBxml(jaxbContext), is(expectedBxml));
2929
};
30+
31+
@Test
32+
public void stopStreamVerbWithWaitWorks() throws JAXBException {
33+
JAXBContext jaxbContext = JAXBContext.newInstance(Bxml.class);
34+
String expectedBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><StopStream name=\"name\" wait=\"true\"/></Bxml>";
35+
36+
assertThat(new Bxml().with(new StopStream("name", true)).toBxml(jaxbContext), is(expectedBxml));
37+
};
3038
};

0 commit comments

Comments
 (0)