Skip to content

Commit

Permalink
Merge pull request #211 from plivo/VT-4178
Browse files Browse the repository at this point in the history
Vt 4178
  • Loading branch information
manjunath-plivo authored May 5, 2022
2 parents e764c9f + bd80506 commit 8734b2a
Show file tree
Hide file tree
Showing 13 changed files with 143 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [5.11.0](https://github.com/plivo/plivo-java/tree/v5.11.0) (2022-05-05)
**Feature - List all recordings**
- `fromNumber` and `toNumber` added to filtering param [List all recordings](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)
- `recordMinMemberCount` param added in [Add a participant to a multiparty call using API](https://www.plivo.com/docs/voice/api/multiparty-call/participants#add-a-participant)

## [5.10.0](https://github.com/plivo/plivo-java/tree/v5.10.0) (2022-03-25)
**Feature - DialElement**
- `confirmTimeout` parameter added to [The Dial element](https://www.plivo.com/docs/voice/xml/dial/)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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.10.0</version>
<version>5.11.0</version>
</dependency>
```

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.10.0
version=5.11.0
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.10.0</version>
<version>5.11.0</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
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class MultiPartyCallParticipantAdd extends VoiceUpdater<MultiPartyCallPar
private Integer maxDuration = 14400;
@InRange(message = "must be in range [2-10]", min = 2, max = 10)
private Integer maxParticipants = 10;
@InRange(message = "must be in range [1-2]", min = 1, max = 2)
private Integer recordMinMemberCount = 1;
@UrlValues
private String waitMusicUrl;
@OneOf(message = "should be one of [GET, POST]", options = {"GET", "POST"})
Expand Down Expand Up @@ -189,6 +191,10 @@ public Integer maxParticipants() {
return maxParticipants;
}

public Integer recordMinMemberCount() {
return recordMinMemberCount;
}

public String waitMusicUrl() {
return waitMusicUrl;
}
Expand Down Expand Up @@ -372,6 +378,11 @@ public MultiPartyCallParticipantAdd maxParticipants(Integer maxParticipants) {
return this;
}

public MultiPartyCallParticipantAdd recordMinMemberCount(Integer recordMinMemberCount) {
this.recordMinMemberCount = recordMinMemberCount;
return this;
}

public MultiPartyCallParticipantAdd waitMusicUrl(String waitMusicUrl) {
this.waitMusicUrl = waitMusicUrl;
return this;
Expand Down
18 changes: 18 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 @@ -15,6 +15,24 @@ public class Recording extends BaseResource {
private String recordingUrl;
private String resourceUri;
private String recordingId;
private String fromNumber;
private String toNumber;

public String getFromNumber() {
return fromNumber;
}

public void setFromNumber(String fromNumber) {
this.fromNumber = fromNumber;
}

public String getToNumber() {
return toNumber;
}

public void setToNumber(String toNumber) {
this.toNumber = toNumber;
}

public static RecordingGetter getter(String id) {
return new RecordingGetter(id);
Expand Down
78 changes: 78 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 @@ -10,6 +10,12 @@ public class RecordingLister extends VoiceLister<Recording> {

private String subaccount;
private String callUuid;
private String fromNumber;
private String toNumber;
private String conferenceName;
private String mpcName;
private String conferenceUuid;
private String mpcUuid;
private PropertyFilter<Date> addTime;

public String subaccount() {
Expand All @@ -20,6 +26,30 @@ public String callUuid() {
return this.callUuid;
}

public String fromNumber() {
return this.fromNumber;
}

public String toNumber() {
return this.toNumber;
}

public String conferenceName() {
return this.conferenceName;
}

public String mpcName() {
return this.mpcName;
}

public String conferenceUuid() {
return this.conferenceUuid;
}

public String mpcUuid() {
return this.mpcUuid;
}

public PropertyFilter<Date> addTime() {
return this.addTime;
}
Expand All @@ -33,6 +63,54 @@ public RecordingLister subaccount(final String subaccount) {
return this;
}

/**
* @param fromNumber Used to filter recordings for a specific fromNumber.
*/
public RecordingLister fromNumber(final String fromNumber) {
this.fromNumber = fromNumber;
return this;
}

/**
* @param toNumber Used to filter recordings for a specific toNumber.
*/
public RecordingLister toNumber(final String toNumber) {
this.toNumber = toNumber;
return this;
}

/**
* @param conferenceName Used to filter recordings for a specific conferenceName.
*/
public RecordingLister conferenceName(final String conferenceName) {
this.conferenceName = conferenceName;
return this;
}

/**
* @param mpcName Used to filter recordings for a specific mpcName.
*/
public RecordingLister mpcName(final String mpcName) {
this.mpcName = mpcName;
return this;
}

/**
* @param conferenceUuid Used to filter recordings for a specific conferenceUuid.
*/
public RecordingLister conferenceUuid(final String conferenceUuid) {
this.conferenceUuid = conferenceUuid;
return this;
}

/**
* @param mpcUuid Used to filter recordings for a specific mpcUuid.
*/
public RecordingLister mpcUuid(final String mpcUuid) {
this.mpcUuid = mpcUuid;
return this;
}

/**
* @param callUuid Used to filter recordings for a specific call.
*/
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/plivo/api/xml/MultiPartyCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public class MultiPartyCall extends PlivoXml implements ResponseNestable {
@InRange(message = "must be in range [2-10]", min = 2, max = 10)
private Integer maxParticipants = 10;

@XmlAttribute
@InRange(message = "must be in range [1-2]", min = 1, max = 2)
private Integer recordMinMemberCount = 1;

@XmlAttribute
@UrlValues
private String waitMusicUrl;
Expand Down Expand Up @@ -173,6 +177,10 @@ public Integer maxParticipants() {
return maxParticipants;
}

public Integer recordMinMemberCount() {
return recordMinMemberCount;
}

public String waitMusicUrl() {
return waitMusicUrl;
}
Expand Down Expand Up @@ -312,6 +320,11 @@ public MultiPartyCall maxParticipants(Integer maxParticipants) {
return this;
}

public MultiPartyCall recordMinMemberCount(Integer recordMinMemberCount) {
this.recordMinMemberCount = recordMinMemberCount;
return this;
}

public MultiPartyCall waitMusicUrl(String waitMusicUrl) {
this.waitMusicUrl = waitMusicUrl;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private static void startNewMPCWithCustomer(String fromNumber, String toNumber)

MultiPartyCallParticipantAddResponse resp = MultiPartyCall.addParticipant(MultiPartyCallUtils.friendlyName("myMPC"),
MultiPartyCallUtils.customer, fromNumber, Collections.singletonList(toNumber)).
startMpcOnEnter(false).endMpcOnExit(true).maxDuration(1500).maxParticipants(7).record(true).update();
startMpcOnEnter(false).endMpcOnExit(true).maxDuration(1500).maxParticipants(7).record(true).recordMinMemberCount(1).update();

System.out.println(resp.getMessage());
System.out.printf("from number matches: %s", resp.getCalls().get(0).getFrom().equals(fromNumber));
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.10.0
5.11.0
1 change: 1 addition & 0 deletions src/test/java/com/plivo/api/MPCTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public void addParticipant() throws Exception {
put("delay_dial", 0);
put("max_duration", 20000);
put("max_participants", 10);
put("record_min_member_count", 1);
put("wait_music_method", "GET");
put("agent_hold_music_method", "GET");
put("customer_hold_music_method", "GET");
Expand Down
4 changes: 3 additions & 1 deletion src/test/resources/com/plivo/api/recordingGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
"recording_start_ms": "1407235163907.00000",
"recording_type": "conference",
"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/"
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/",
"from_number": "+919999323467",
"to_number": "+919891865130"
}
12 changes: 9 additions & 3 deletions src/test/resources/com/plivo/api/recordingListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"recording_start_ms": "1407235163907.00000",
"recording_type": "conference",
"recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-1124-a664-0026b945b522.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/"
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/",
"from_number": "+919999323467",
"to_number": "+919891865130"
},
{
"add_time": "2014-08-05 16:05:21.993853+05:30",
Expand All @@ -32,7 +34,9 @@
"recording_start_ms": "1407234829553.00000",
"recording_type": "conference",
"recording_url": "http://s3.amazonaws.com/recordings_2013/fc2716b0-1c8b-11e4-bwad-842b2b17453e.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/"
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/",
"from_number": "+919999323467",
"to_number": "+919891865130"
},
{
"add_time": "2014-08-05 15:51:56.582492+05:30",
Expand All @@ -45,7 +49,9 @@
"recording_start_ms": "1407234081443.00000",
"recording_type": "conference",
"recording_url": "http://s3.amazonaws.com/recordings_2013/3e701c9e-1c8a-11e4-bwad-842b2b17453e.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/3e701c9e-1c8a-11e4-bwad-842b2b17453e/"
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/3e701c9e-1c8a-11e4-bwad-842b2b17453e/",
"from_number": "+919999323467",
"to_number": "+919891865130"
}
]
}

0 comments on commit 8734b2a

Please sign in to comment.