diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e96ba4c..4ed44cb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Change Log +## [5.45.0](https://github.com/plivo/plivo-java/tree/v5.45.0) (2024-09-30) +**Feature - Adding new param support for Number Masking session with single party ** +- Added `create_session_with_single_party`, `virtual_number_cooloff_period` and `force_pin_authentication` attributes in Masking Session + ## [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 320034b7..ce0a93da 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ 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.44.3/plivo-java-5.44.3.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.45.0/plivo-java-5.45.0.jar). If you are using Maven, use the following XML to include the Plivo SDK as a dependency. @@ -19,13 +19,13 @@ 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.45.0 ``` If you are using Gradle, use the following line in your dependencies. ``` -compile 'com.plivo:plivo-java:5.44.3' +compile 'com.plivo:plivo-java:5.45.0' ``` ### To Install Beta release diff --git a/pom.properties b/pom.properties index 2045d653..b67e3858 100644 --- a/pom.properties +++ b/pom.properties @@ -1,6 +1,6 @@ # Written manually. -version=5.44.3 +version=5.45.0 groupId=com.plivo artifactId=plivo-java diff --git a/pom.xml b/pom.xml index e13c3945..4f7bc323 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.plivo plivo-java - 5.43.3 + 5.45.0 plivo-java A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML @@ -76,7 +76,6 @@ 2.7.5 test - diff --git a/src/main/java/com/plivo/api/models/maskingsession/MaskingSessionCreator.java b/src/main/java/com/plivo/api/models/maskingsession/MaskingSessionCreator.java index e646c889..8c6e2ecd 100644 --- a/src/main/java/com/plivo/api/models/maskingsession/MaskingSessionCreator.java +++ b/src/main/java/com/plivo/api/models/maskingsession/MaskingSessionCreator.java @@ -24,11 +24,14 @@ public class MaskingSessionCreator extends VoiceCreator { - + private String firstParty; + private String secondParty; private int sessionExpiry; private int callTimeLimit; private int ringTimeout; @@ -19,7 +20,7 @@ public class MaskingSessionUpdater extends VoiceUpdater obtainFallback2Call() throws PlivoV return client().getVoiceFallback2Service().maskingSessionUpdate(client().getAuthId(), id, this); } + public String firstParty() { + return this.firstParty; + } + public MaskingSessionUpdater firstParty(final String firstParty){ + this.firstParty = firstParty; + return this; + } + public String secondParty() { + return this.secondParty; + } + public MaskingSessionUpdater secondParty(final String secondParty){ + this.secondParty = secondParty; + return this; + } public int callTimeLimit() { return this.callTimeLimit; } @@ -127,5 +142,12 @@ public MaskingSessionUpdater sessionExpiry(final int sessionExpiry) { this.sessionExpiry = sessionExpiry; return this; } + public boolean createSessionWithSingleParty() { + return this.createSessionWithSingleParty; + } + public MaskingSessionUpdater createSessionWithSingleParty(final boolean record){ + this.createSessionWithSingleParty = createSessionWithSingleParty; + return this; + } } diff --git a/src/main/resources/com/plivo/api/version.txt b/src/main/resources/com/plivo/api/version.txt index c5b3b8d6..5a053acd 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.45.0 diff --git a/src/test/java/com/plivo/api/MaskingSessionTest.java b/src/test/java/com/plivo/api/MaskingSessionTest.java index 4c1692cd..47bdc2ff 100644 --- a/src/test/java/com/plivo/api/MaskingSessionTest.java +++ b/src/test/java/com/plivo/api/MaskingSessionTest.java @@ -24,6 +24,33 @@ public void maskingSessionCreate() throws Exception { assertRequest("POST", "Masking/Session/"); } + @Test + public void maskingSessionCreate_createSessionWithSingleParty() throws Exception { + expectResponse("maskingSessionCreateResponse.json", 201); + + MaskingSession.creator("916303955746","").createSessionWithSingleParty(true).create(); + + assertRequest("POST", "Masking/Session/"); + } + + @Test + public void maskingSessionCreate_forcePinAuthentication() throws Exception { + expectResponse("maskingSessionCreateResponse.json", 201); + + MaskingSession.creator("916303955746", "916303955747").isPinAuthenticationRequired(true).generatePin(true).generatePinLength(4).firstPartyPin("1234").secondPartyPin("2345").pinRetry(2).pinRetryWait(6).pinPromptPlay("https://plivobin-prod-usw.plivops.com/api/v1/speak.mp3").unknownCallerPlay("https://plivobin-prod-usw.plivops.com/api/v1/speak.mp3").incorrectPinPlay("https://plivobin-prod-usw.plivops.com/api/v1/speak.mp3").forcePinAuthentication(true).create(); + + assertRequest("POST", "Masking/Session/"); + } + + @Test + public void maskingSessionCreate_virtualNumberCooloffPeriod() throws Exception { + expectResponse("maskingSessionCreateResponse.json", 201); + + MaskingSession.creator("916303955746", "916303955747").virtualNumberCooloffPeriod(2500).create(); + + assertRequest("POST", "Masking/Session/"); + } + @Test public void maskingSessionCreateWithClient() throws Exception { expectResponse("maskingSessionCreateResponse.json", 201); diff --git a/src/test/resources/com/plivo/api/maskingSessionCreateResponse.json b/src/test/resources/com/plivo/api/maskingSessionCreateResponse.json index 315fe345..e7b1b372 100644 --- a/src/test/resources/com/plivo/api/maskingSessionCreateResponse.json +++ b/src/test/resources/com/plivo/api/maskingSessionCreateResponse.json @@ -1,45 +1,48 @@ { - "api_id": "f2a246e0-d585-4d55-bff5-4a6688b8a34a", - "session_uuid": "2d265b0a-32a1-4450-a36c-f5e09144598e", - "virtual_number": "+919790969500", + "api_id": "e0218e45-53f5-435b-83d2-936010e40acc", + "session_uuid": "1091db69-2290-4633-9222-c9473c4815b6", + "virtual_number": "+919988776676", "message": "Session created", "session": { - "first_party": "917708772011", - "second_party": "918220568648", - "virtual_number": "919790969500", + "first_party": "916303955747", + "second_party": "916384780853", + "virtual_number": "919988776676", "status": "active", - "initiate_call_to_first_party": true, - "session_uuid": "2d265b0a-32a1-4450-a36c-f5e09144598e", - "callback_url": "http://plivobin.non-prod.plivops.com/1jvpmrs1", - "callback_method": "GET", - "created_time": "2024-05-29 04:47:18 +0000 UTC", - "modified_time": "2024-05-29 04:47:18 +0000 UTC", - "expiry_time": "2024-05-29 06:27:18 +0000 UTC", - "duration": 6000, + "initiate_call_to_first_party": false, + "session_uuid": "1091db69-2290-4633-9222-c9473c4815b6", + "callback_url": "", + "callback_method": "POST", + "created_time": "2024-09-05 06:43:26 +0000 UTC", + "modified_time": "2024-09-05 06:43:26 +0000 UTC", + "expiry_time": "2024-09-05 06:46:46 +0000 UTC", + "duration": 200, "amount": 0, "call_time_limit": 14400, - "ring_timeout": 120, - "first_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml", - "second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml", + "ring_timeout": 45, + "first_party_play_url": "", + "second_party_play_url": "", "record": false, "record_file_format": "mp3", - "recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml", - "recording_callback_method": "GET", + "recording_callback_url": "", + "recording_callback_method": "POST", "interaction": null, "total_call_amount": 0, "total_call_count": 0, "total_call_billed_duration": 0, "total_session_amount": 0, "last_interaction_time": "", - "unknown_caller_play": "https://vinodhan-test.s3.amazonaws.com/Number+masking+audio/2024-02-13-201825_178983233.mp3", - "is_pin_authentication_required": false, - "generate_pin": null, - "generate_pin_length": null, - "first_party_pin": null, - "second_party_pin": null, - "pin_prompt_play": null, - "pin_retry": null, - "pin_retry_wait": null, - "incorrect_pin_play": null + "unknown_caller_play": "https://file-examples.com/storage/fefda3519566d3360a0efb3/2017/11/file_example_MP3_700KB.mp3", + "is_pin_authentication_required": true, + "generate_pin": false, + "generate_pin_length": 4, + "first_party_pin": "1234", + "second_party_pin": "4321", + "pin_prompt_play": "https://file-examples.com/storage/fefda3519566d3360a0efb3/2017/11/file_example_MP3_700KB.mp3", + "pin_retry": 2, + "pin_retry_wait": 7, + "incorrect_pin_play": "https://file-examples.com/storage/fefda3519566d3360a0efb3/2017/11/file_example_MP3_700KB.mp3", + "create_session_with_single_party": null, + "virtual_number_cooloff_period": 3500, + "force_pin_authentication": true } } \ No newline at end of file