diff --git a/CHANGELOG.md b/CHANGELOG.md index 67597ec7..ac1b9742 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Change Log + +## [4.48.1](https://github.com/plivo/plivo-python/tree/v4.48.1) (2024-02-26) +**Added new param 'waitTime' for MPC XML + ## [4.48.0](https://github.com/plivo/plivo-python/tree/v4.48.0) (2024-02-12) **Custom Verify OTP - Added new optional param 'otp' for Create Session and made 'otp' param optional for Validate Session** diff --git a/plivo/version.py b/plivo/version.py index 91f3e08e..9f436c9b 100644 --- a/plivo/version.py +++ b/plivo/version.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = '4.48.0' +__version__ = '4.48.1' diff --git a/plivo/xml/MultiPartyCallElement.py b/plivo/xml/MultiPartyCallElement.py index 6104ba0c..d2cd27d1 100644 --- a/plivo/xml/MultiPartyCallElement.py +++ b/plivo/xml/MultiPartyCallElement.py @@ -92,6 +92,26 @@ def set_wait_music_method(self, wait_music_method): self.wait_music_method = wait_music_method return self + @property + def wait_time(self): + return self.__wait_time + + @wait_time.setter + @validate_args( + wait_time=[ + optional( + of_type_exact(int), + check(lambda wait_time: 0 <= wait_time <= 1800, '0 <= wait_time <= 1800') + ) + ], + ) + def wait_time(self, wait_time): + self.__wait_time = wait_time + + def set_wait_time(self, wait_time): + self.wait_time = wait_time + return self + @property def agent_hold_music_url(self): return self.__agent_hold_music_url @@ -543,6 +563,7 @@ def __init__( record_min_member_count=1, wait_music_url=None, wait_music_method='GET', + wait_time=None, agent_hold_music_url=None, agent_hold_music_method='GET', customer_hold_music_url=None, @@ -585,6 +606,7 @@ def __init__( self.record_min_member_count = record_min_member_count self.wait_music_url = wait_music_url self.wait_music_method = wait_music_method + self.wait_time = wait_time self.agent_hold_music_url = agent_hold_music_url self.agent_hold_music_method = agent_hold_music_method self.customer_hold_music_url = customer_hold_music_url @@ -619,6 +641,7 @@ def to_dict(self): 'recordMinMemberCount': self.record_min_member_count, 'waitMusicUrl': self.wait_music_url, 'waitMusicMethod': self.wait_music_method, + 'waitTime': self.wait_time, 'agentHoldMusicUrl': self.agent_hold_music_url, 'agentHoldMusicMethod': self.agent_hold_music_method, 'customerHoldMusicUrl': self.customer_hold_music_url, diff --git a/plivo/xml/ResponseElement.py b/plivo/xml/ResponseElement.py index 3fc27396..a6679219 100644 --- a/plivo/xml/ResponseElement.py +++ b/plivo/xml/ResponseElement.py @@ -333,6 +333,7 @@ def add_multi_party_call(self, max_participants=10, wait_music_url=None, wait_music_method="GET", + wait_time=None, agent_hold_music_url=None, agent_hold_music_method='GET', customer_hold_music_url=None, @@ -371,6 +372,7 @@ def add_multi_party_call(self, max_participants=max_participants, wait_music_url=wait_music_url, wait_music_method=wait_music_method, + wait_time=wait_time, agent_hold_music_url=agent_hold_music_url, agent_hold_music_method=agent_hold_music_method, customer_hold_music_url=customer_hold_music_url, diff --git a/setup.py b/setup.py index e24bac1b..9840d8c0 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name='plivo', - version='4.48.0', + version='4.48.1', 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', diff --git a/tests/xml/test_MultiPartyCallElement.py b/tests/xml/test_MultiPartyCallElement.py index e6084ca6..5563ddec 100644 --- a/tests/xml/test_MultiPartyCallElement.py +++ b/tests/xml/test_MultiPartyCallElement.py @@ -78,12 +78,14 @@ def test_builder_setting(self): 'statusCallbackEvents="mpc-state-changes,participant-state-changes" ' \ 'statusCallbackMethod="POST" stayAlone="false" stopRecordingAudio="http://plivo.com/api.mp3" ' \ 'stopRecordingAudioMethod="GET" ' \ + 'waitTime="5" ' \ 'waitMusicMethod="GET" recordMinMemberCount="1">Helsinki ' element = plivoxml.MultiPartyCallElement(content='Helsinki', role='customer'). \ set_max_duration(4500).set_max_participants(9).set_end_mpc_on_exit(True). \ set_customer_hold_music_url('http://plivo.com/voice.mp3').set_coach_mode(False). \ set_on_exit_action_url('http://plivo.com/api.mp3').set_on_exit_action_method('GET'). \ set_stop_recording_audio("http://plivo.com/api.mp3"). \ - set_start_recording_audio("http://plivo.com/api.mp3") + set_start_recording_audio("http://plivo.com/api.mp3"). \ + set_wait_time(5) self.assertXmlEqual(expected_xml, element.to_string(False)) diff --git a/tests/xml/test_responseElement.py b/tests/xml/test_responseElement.py index 496d77e7..e7efb230 100644 --- a/tests/xml/test_responseElement.py +++ b/tests/xml/test_responseElement.py @@ -120,13 +120,14 @@ def test_add_mpc(self): 'stopRecordingAudio="https://plivo.com/plivoTone.mp3" ' \ 'stopRecordingAudioMethod="GET" ' \ 'waitMusicMethod="POST" ' \ + 'waitTime="5" ' \ 'waitMusicUrl="https://plivo.com/plivoTone.mp3">multi party conference' \ '' elem = plivoxml.ResponseElement().add_multi_party_call(content='multi party conference', role='customer', max_duration=20000, max_participants=7, wait_music_url='https://plivo.com/plivoTone.mp3', - wait_music_method='POST', start_mpc_on_enter=True, + wait_music_method='POST', wait_time=5, start_mpc_on_enter=True, record=True, record_file_format='wav', mute=True, enter_sound='beep:2', exit_sound='beep:1', hold=True, on_exit_action_url='https://plivo.com/exitAction',