Skip to content

Commit 5d50582

Browse files
Add AnswerCall Attribute To Ring BXML Verb
Added the answerCall attribute to the Ring class and updated the test to expect it in serialization output.
1 parent 91026c8 commit 5d50582

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/main/java/com/bandwidth/voice/bxml/verbs/Ring.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ public class Ring implements Verb {
1919
*/
2020
@XmlAttribute
2121
private Double duration;
22+
23+
/**
24+
* (optional) A boolean indicating whether or not to answer the call when Ring is executed on an unanswered
25+
* incoming call. Default value is 'true'.
26+
*/
27+
@XmlAttribute
28+
private boolean answerCall;
2229
}

src/test/java/com/bandwidth/BxmlTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,14 +429,15 @@ public void testStopRecording() {
429429
@Test
430430
public void testRing() {
431431
Ring ring = Ring.builder()
432-
.duration(3.0)
433-
.build();
432+
.duration(3.0)
433+
.answerCall(false)
434+
.build();
434435

435436
String response = new Response()
436437
.add(ring)
437438
.toBXML();
438439

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

441442
assertEquals("BXML strings not equal", expected, response);
442443
}

0 commit comments

Comments
 (0)