Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/main/java/com/bandwidth/sdk/model/bxml/StopStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*
* @param name (str, optional): 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.
* @param wait (bool, optional): If true, the BXML interpreter will wait for the stream to stop before processing the next verb.
*/
public class StopStream implements Verb {

Expand All @@ -33,6 +34,14 @@ public class StopStream implements Verb {
@XmlAttribute
protected String name;

@XmlAttribute
protected Boolean wait;

// Original constructor for backwards compatibility
public StopStream(String name) {
this.name = name;
}

@Override
public String getVerbName() {
return TYPE_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@ public void stopStreamVerbWorks() throws JAXBException {

assertThat(new Bxml().with(new StopStream("name")).toBxml(jaxbContext), is(expectedBxml));
};

@Test
public void stopStreamVerbWithWaitWorks() throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(Bxml.class);
String expectedBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><StopStream name=\"name\" wait=\"true\"/></Bxml>";

assertThat(new Bxml().with(new StopStream("name", true)).toBxml(jaxbContext), is(expectedBxml));
};
};