Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java SDK changes to add new machine detection optional parameters #287

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
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.44.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
59 changes: 59 additions & 0 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 @@ -217,6 +223,30 @@ public String machineDetectionMethod() {
return this.machineDetectionMethod;
}

public Long machineDetectionSilence() {
return this.machineDetectionSilence;
}

public Long machineDetectionInitialSilence() {
return this.machineDetectionInitialSilence;
}

public Long machineDetectionInitialGreeting() {
return this.machineDetectionInitialGreeting;
}

public Long machineDetectionMaximumSpeechLength() {
return this.machineDetectionMaximumSpeechLength;
}

public Long machineDetectionMaximumWords() {
return this.machineDetectionMaximumWords;
}

public Long machineDetectionAnswerTime() {
return this.machineDetectionAnswerTime;
}

/**
* @return List of SIP headers in the form of 'key=value' pairs, separated by commas.
*/
Expand Down Expand Up @@ -337,6 +367,35 @@ public CallCreator machineDetectionMethod(final String machineDetectionMethod) {
return this;
}

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;
}

public CallCreator sipHeaders(final Map<String, String> sipHeaders) {
this.sipHeaders = sipHeaders;
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
Loading