Skip to content

Commit

Permalink
java SDK changes to add new machine detection optional parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Abinaya-Shunmugavel committed Sep 11, 2024
1 parent 429dea1 commit 23057ac
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe
<dependency>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.44.3</version>
<version>5.44.4</version>
</dependency>
```

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -375,7 +375,7 @@ class Test
Plivo.init("<auth_id>", "<auth_token>");
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) {
Expand Down
2 changes: 1 addition & 1 deletion pom.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Written manually.

version=5.44.3
version=5.44.4
groupId=com.plivo
artifactId=plivo-java

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.43.3</version>
<version>5.43.4</version>
<name>plivo-java</name>
<description>A Java SDK to make voice calls &amp; send SMS using Plivo and to generate Plivo XML</description>
<licenses>
Expand Down
34 changes: 32 additions & 2 deletions src/main/java/com/plivo/api/models/call/CallCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ public class CallCreator extends VoiceCreator<CallCreateResponse> {
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<String, String> sipHeaders;
private Long ringTimeout;
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/com/plivo/api/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.44.3
5.44.4

0 comments on commit 23057ac

Please sign in to comment.