From 23057ac34b60d0199a5726873387589c54f7d698 Mon Sep 17 00:00:00 2001 From: abinaya-plivo Date: Wed, 11 Sep 2024 12:50:15 +0530 Subject: [PATCH] java SDK changes to add new machine detection optional parameters --- CHANGELOG.md | 4 +++ README.md | 6 ++-- pom.properties | 2 +- pom.xml | 2 +- .../plivo/api/models/call/CallCreator.java | 34 +++++++++++++++++-- src/main/resources/com/plivo/api/version.txt | 2 +- 6 files changed, 42 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e96ba4ce..326185552 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Change Log +## [5.44.4](https://github.com/plivo/plivo-java/tree/v5.44.4) (2024-09-10) +**Feature - Adding few optional parameters to the existing machine detection params** +- Added six new optional machine detection params `machine_detection_maximum_speech_length`,`machine_detection_initial_silence`,`machine_detection_maximum_words`,`machine_detection_initial_greeting`,`machine_detection_silence`,`machine_detection_answer_time` + ## [5.44.3](https://github.com/plivo/plivo-java/tree/v5.44.3) (2024-09-06) **Feature - Adding more attribute on mdr object** - Added `message_sent_time`, `message_updated_time` and `error-message` on get and list Message API diff --git a/README.md b/README.md index 320034b7d..fcff9d863 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe com.plivo plivo-java - 5.44.3 + 5.44.4 ``` @@ -308,7 +308,7 @@ class Test bodyComponent.setParameters(bodyParameters); components.add(bodyComponent); - template.setComponents(components) + template.setComponents(components); MessageCreateResponse response = Message.creator("+14156667778","+14156667777").type(MessageType.WHATSAPP).template(template).create(); ObjectMapper ow = new ObjectMapper(); String json_output = ow.writeValueAsString(response); @@ -375,7 +375,7 @@ class Test Plivo.init("", ""); String[] media = {"https://sample-videos.com/img/Sample-png-image-1mb.png"}; try { - MessageCreateResponse response = Message.creator("+14156667778","+14156667777","WA -text").log(false).type(MessageType.WHATSAPP).media_urls(media).create() + MessageCreateResponse response = Message.creator("+14156667778","+14156667777","WA -text").log(false).type(MessageType.WHATSAPP).media_urls(media).create(); System.out.println(response); } catch (PlivoRestException | IOException e) { diff --git a/pom.properties b/pom.properties index 2045d6534..26293e958 100644 --- a/pom.properties +++ b/pom.properties @@ -1,6 +1,6 @@ # Written manually. -version=5.44.3 +version=5.44.4 groupId=com.plivo artifactId=plivo-java diff --git a/pom.xml b/pom.xml index e13c3945d..c118f84e5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.plivo plivo-java - 5.43.3 + 5.43.4 plivo-java A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML diff --git a/src/main/java/com/plivo/api/models/call/CallCreator.java b/src/main/java/com/plivo/api/models/call/CallCreator.java index 9fdd3ea96..25884ebf6 100644 --- a/src/main/java/com/plivo/api/models/call/CallCreator.java +++ b/src/main/java/com/plivo/api/models/call/CallCreator.java @@ -30,6 +30,12 @@ public class CallCreator extends VoiceCreator { private Long machineDetectionTime; private String machineDetectionUrl; private String machineDetectionMethod; + private Long machineDetectionMaximumSpeechLength; + private Long machineDetectionInitialSilence; + private Long machineDetectionMaximumWords; + private Long machineDetectionInitialGreeting; + private Long machineDetectionSilence; + private Long machineDetectionAnswerTime; @JsonSerialize(using = MapToCommaListSerializer.class) private Map sipHeaders; private Long ringTimeout; @@ -332,8 +338,32 @@ public CallCreator machineDetectionUrl(final String machineDetectionUrl) { return this; } - public CallCreator machineDetectionMethod(final String machineDetectionMethod) { - this.machineDetectionMethod = machineDetectionMethod; + public CallCreator machineDetectionMaximumWords(final Long machineDetectionMaximumWords) { + this.machineDetectionMaximumWords = machineDetectionMaximumWords; + return this; + } + + public CallCreator machineDetectionMaximumSpeechLength(final Long machineDetectionMaximumSpeechLength) { + this.machineDetectionMaximumSpeechLength = machineDetectionMaximumSpeechLength; + return this; + } + + public CallCreator machineDetectionInitialSilence(final Long machineDetectionInitialSilence) { + this.machineDetectionInitialSilence = machineDetectionInitialSilence; + return this; + } + public CallCreator machineDetectionSilence(final Long machineDetectionSilence) { + this.machineDetectionSilence = machineDetectionSilence; + return this; + } + + public CallCreator machineDetectionInitialGreeting(final Long machineDetectionInitialGreeting) { + this.machineDetectionInitialGreeting = machineDetectionInitialGreeting; + return this; + } + + public CallCreator machineDetectionAnswerTime(final Long machineDetectionAnswerTime) { + this.machineDetectionAnswerTime = machineDetectionAnswerTime; return this; } diff --git a/src/main/resources/com/plivo/api/version.txt b/src/main/resources/com/plivo/api/version.txt index c5b3b8d6c..10b7d2be2 100644 --- a/src/main/resources/com/plivo/api/version.txt +++ b/src/main/resources/com/plivo/api/version.txt @@ -1 +1 @@ -5.44.3 +5.44.4