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

Changes for single party session #276

Merged
merged 8 commits into from
Sep 30, 2024
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Change Log
## [4.56.0](https://github.com/plivo/plivo-python/tree/v4.56.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

## [4.55.5](https://github.com/plivo/plivo-python/tree/v4.55.5) (2024-09-10)
**Feature - Adding validations for AudioStream XML creation**
- Added Validations for AudioStream XML creation
Expand All @@ -7,7 +11,6 @@
**Feature - Adding more attribute on mdr object**
- Added `message_sent_time`, `message_updated_time` and `error-message` on get and list Message API


## [4.55.3](https://github.com/plivo/plivo-python/tree/v4.55.3) (2024-09-06)
**Feature - Adding support for brand_name, code_length and app_hash in Create,Get and List Session**
- Added new request param `brand_name` , `app_hash` and `code_length` in create Session API
Expand Down
10 changes: 8 additions & 2 deletions plivo/resources/maskingsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def create_masking_session(self,
incorrect_pin_play=None,
unknown_caller_play=None,
subaccount=None,
geomatch=None
geomatch=None,
create_session_with_single_party=None,
virtual_number_cooloff_period=None,
force_pin_authentication=None
):
return self.client.request('POST', ('Masking', 'Session',),
to_param_dict(self.create_masking_session, locals()), is_voice_request=True)
Expand All @@ -85,6 +88,8 @@ def get_masking_session(self,

def update_masking_session(self,
session_uuid,
first_party=None,
second_party=None,
session_expiry=None,
call_time_limit=None,
record=None,
Expand All @@ -97,7 +102,8 @@ def update_masking_session(self,
second_party_play_url=None,
recording_callback_method=None,
subaccount=None,
geomatch=None
geomatch=None,
create_session_with_single_party=None
):
return self.client.request('POST', ('Masking', 'Session', session_uuid),
to_param_dict(self.update_masking_session, locals()), is_voice_request=True)
Expand Down
2 changes: 1 addition & 1 deletion plivo/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = '4.55.5'
__version__ = '4.56.0'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='plivo',
version='4.55.5',
version='4.56.0',
description='A Python SDK to make voice calls & send SMS using Plivo and to generate Plivo XML',
long_description=long_description,
url='https://github.com/plivo/plivo-python',
Expand Down
42 changes: 42 additions & 0 deletions tests/resources/test_maskingsessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,48 @@ def test_create(self):
self.assertUrlEqual(
self.get_voice_url('Masking', 'Session'), self.client.current_request.url)

@with_response(201)
# create_session_with_single_party is passed
def test_create(self):
self.client.masking_sessions.create_masking_session(
first_party='917708772011',
create_session_with_single_party=True)
self.assertEqual(self.client.current_request.method, 'POST')
self.assertUrlEqual(
self.get_voice_url('Masking', 'Session'), self.client.current_request.url)

@with_response(201)
# force_pin_authentication is passed
def test_create(self):
self.client.masking_sessions.create_masking_session(
first_party='917708772011',
second_party='916303955746',
is_pin_authentication_required=True,
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",
unknown_caller_play="https://file-examples.com/storage/fefda3519566d3360a0efb3/2017/11/file_example_MP3_700KB.mp3",
force_pin_authentication=True,
session_expiry=0)
self.assertEqual(self.client.current_request.method, 'POST')
self.assertUrlEqual(
self.get_voice_url('Masking', 'Session'), self.client.current_request.url)

@with_response(201)
# virtual_number_cooloff_period is passed
def test_create(self):
self.client.masking_sessions.create_masking_session(
first_party='917708772011',
second_party='916303955746',
virtual_number_cooloff_period=3500,
)
self.assertEqual(self.client.current_request.method, 'POST')
self.assertUrlEqual(
self.get_voice_url('Masking', 'Session'), self.client.current_request.url)

@with_response(200)
def test_delete(self):
session_uuid = "9fe6cba9-62b2-4de0-98a4-6b878fb906de"
Expand Down
Loading