Skip to content

Commit

Permalink
Merge pull request #260 from plivo/VT-7300
Browse files Browse the repository at this point in the history
added wait time param in MPC XML flow
  • Loading branch information
Abinaya-Shunmugavel authored Feb 26, 2024
2 parents 564a5f1 + 6339128 commit 935e482
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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**

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.48.0'
__version__ = '4.48.1'
23 changes: 23 additions & 0 deletions plivo/xml/MultiPartyCallElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions plivo/xml/ResponseElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
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.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',
Expand Down
4 changes: 3 additions & 1 deletion tests/xml/test_MultiPartyCallElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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</MultiPartyCall> '
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))
3 changes: 2 additions & 1 deletion tests/xml/test_responseElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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</MultiPartyCall>' \
'</Response>'

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',
Expand Down

0 comments on commit 935e482

Please sign in to comment.