Skip to content

Commit

Permalink
Merge pull request #52 from Bandwidth/DX-2282-Add-Attribute-To-Ring-BXML
Browse files Browse the repository at this point in the history
Add AnswerCall Attribute To Ring BXML Verb
  • Loading branch information
abaldwin-Bandwidth authored Oct 28, 2021
2 parents 91026c8 + 5d50582 commit 5bcb72f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/main/java/com/bandwidth/voice/bxml/verbs/Ring.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ public class Ring implements Verb {
*/
@XmlAttribute
private Double duration;

/**
* (optional) A boolean indicating whether or not to answer the call when Ring is executed on an unanswered
* incoming call. Default value is 'true'.
*/
@XmlAttribute
private boolean answerCall;
}
7 changes: 4 additions & 3 deletions src/test/java/com/bandwidth/BxmlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,15 @@ public void testStopRecording() {
@Test
public void testRing() {
Ring ring = Ring.builder()
.duration(3.0)
.build();
.duration(3.0)
.answerCall(false)
.build();

String response = new Response()
.add(ring)
.toBXML();

String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Ring duration=\"3.0\"/></Response>";
String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Ring duration=\"3.0\" answerCall=\"false\"/></Response>";

assertEquals("BXML strings not equal", expected, response);
}
Expand Down

0 comments on commit 5bcb72f

Please sign in to comment.