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

added new recording params #236

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Change Log
## [5.20.1](https://github.com/plivo/plivo-java/tree/v5.20.1) (2023-03-08)
- Added `cost`, `rounded_duration`, and `days_of_storage` parameters to the response for [get single recording API](https://www.plivo.com/docs/voice/api/recording#retrieve-a-recording) and [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)
- Added `rounded_duration` parameter as a filter option for [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)

## [5.20.0](https://github.com/plivo/plivo-java/tree/v5.20.0) (2023-02-23)
- Add `isDomestic` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message)

## [5.19.2](https://github.com/plivo/plivo-java/tree/v5.19.2) (2023-02-23)
**Feature - Enhance MDR filtering capabilities **
- Added new fields on MDR object response
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ The Plivo Java SDK makes it simpler to integrate communications into your Java a

### To Install Stable release

You can use this SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the [JAR file](https://search.maven.org/remotecontent?filepath=com/plivo/plivo-java/5.19.1/plivo-java-5.19.1.jar).
You can use this SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the [JAR file](https://search.maven.org/remotecontent?filepath=com/plivo/plivo-java/5.20.1/plivo-java-5.20.1.jar).

If you are using Maven, use the following XML to include the Plivo SDK as a dependency.

```xml
<dependency>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.19.2</version>
<version>5.20.1</version>
</dependency>
```

If you are using Gradle, use the following line in your dependencies.
```
compile 'com.plivo:plivo-java:5.19.2'
compile 'com.plivo:plivo-java:5.20.0'
```

### To Install Beta release
Expand Down
2 changes: 1 addition & 1 deletion pom.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Written manually.

version=5.19.2
version=5.20.1
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.19.2</version>
<version>5.20.1</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
5 changes: 5 additions & 0 deletions src/main/java/com/plivo/api/models/message/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class Message extends BaseResource {
private String tendlcRegistrationStatus;
private String destinationCountryIso2;
private String requesterIP;
private Boolean isDomestic;

public static MessageCreator creator(String source, List<String> destination, String text) {
return new MessageCreator(source, destination, text);
Expand Down Expand Up @@ -116,6 +117,10 @@ public Long getUnits() {
return units;
}

public Boolean getIsDomestic() {
return isDomestic;
}

@Override
public String getId() {
return getMessageUuid();
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/plivo/api/models/recording/Recording.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public class Recording extends BaseResource {
private String addTime;
private String callUuid;
private String conferenceName;
private String cost;
private String daysOfStorage;
private String recordingDurationMs;
private String recordingEndMs;
private String recordingFormat;
Expand All @@ -15,6 +17,7 @@ public class Recording extends BaseResource {
private String recordingUrl;
private String resourceUri;
private String recordingId;
private String roundedDuration;
private String fromNumber;
private String toNumber;

Expand Down Expand Up @@ -112,6 +115,18 @@ public String getRecordingUrl() {
return recordingUrl;
}

public String getCost() {
return cost;
}

public String getDaysOfStorage() {
return daysOfStorage;
}

public String getRoundedDuration() {
return roundedDuration;
}

public String getResourceUri() {
return resourceUri;
}
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/plivo/api/models/recording/RecordingLister.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class RecordingLister extends VoiceLister<Recording> {
private String mpcName;
private String conferenceUuid;
private String mpcUuid;
private String roundedDuration;
private PropertyFilter<Date> addTime;

public String subaccount() {
Expand Down Expand Up @@ -54,6 +55,10 @@ public PropertyFilter<Date> addTime() {
return this.addTime;
}

public String roundedDuration() {
return roundedDuration;
}

/**
* @param subaccount auth_id of the subaccount. Lists only those recordings of the main accounts
* which are tied to the specified subaccount.
Expand Down Expand Up @@ -127,6 +132,14 @@ public RecordingLister addTime(final PropertyFilter<Date> addTime) {
return this;
}

/**
* @param roundedDuration Used to filter out recordings according to their rounded duration as multiples of 60 seconds.
*/
public RecordingLister roundedDuration(final String roundedDuration) {
this.roundedDuration = roundedDuration;
return this;
}

@Override
protected Call<ListResponse<Recording>> obtainCall() {
return client().getVoiceApiService().recordingList(client().getAuthId(), toMap());
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.19.2
5.20.1
3 changes: 2 additions & 1 deletion src/test/resources/com/plivo/api/messageGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.1"
"requester_ip": "192.168.1.1",
"is_domestic": false
}
60 changes: 40 additions & 20 deletions src/test/resources/com/plivo/api/messageListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.1"
"requester_ip": "192.168.1.1",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -35,7 +36,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.2"
"requester_ip": "192.168.1.2",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -50,7 +52,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.3"
"requester_ip": "192.168.1.3",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -65,7 +68,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.4"
"requester_ip": "192.168.1.4",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -80,7 +84,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.5"
"requester_ip": "192.168.1.5",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -95,7 +100,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.6"
"requester_ip": "192.168.1.6",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -110,7 +116,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.7"
"requester_ip": "192.168.1.7",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -125,7 +132,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.8"
"requester_ip": "192.168.1.8",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -140,7 +148,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.9"
"requester_ip": "192.168.1.9",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -155,7 +164,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.10"
"requester_ip": "192.168.1.10",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -170,7 +180,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.11"
"requester_ip": "192.168.1.11",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -185,7 +196,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.12"
"requester_ip": "192.168.1.12",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -200,7 +212,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.13"
"requester_ip": "192.168.1.13",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -215,7 +228,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.14"
"requester_ip": "192.168.1.14",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -230,7 +244,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.15"
"requester_ip": "192.168.1.15",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -245,7 +260,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.16"
"requester_ip": "192.168.1.16",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -260,7 +276,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.17"
"requester_ip": "192.168.1.17",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -275,7 +292,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.18"
"requester_ip": "192.168.1.18",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -290,7 +308,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.19"
"requester_ip": "192.168.1.19",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -305,7 +324,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.20"
"requester_ip": "192.168.1.20",
"is_domestic": false
}
]
}
5 changes: 4 additions & 1 deletion src/test/resources/com/plivo/api/recordingGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
"recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-11e4-a664-0026b945b52x.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/",
"from_number": "+919999323467",
"to_number": "+919891865130"
"to_number": "+919891865130",
"cost": "0.0004",
"rounded_duration": "120",
"days_of_storage": "209"
}
Loading