Skip to content

Commit efcaa58

Browse files
Merge pull request #271 from plivo/VT-7874
added the new params in add participant api
2 parents f846a26 + f4b8791 commit efcaa58

File tree

5 files changed

+31
-16
lines changed

5 files changed

+31
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## [4.55.1](https://github.com/plivo/plivo-python/tree/v4.55.1) (2024-07-04)
4+
**Feature - Adding new param support for Add Participant API**
5+
- Added `Send_digits` and `send_on_preanswer` attribute in add participant
6+
37
## [4.55.0](https://github.com/plivo/plivo-python/tree/v4.55.0) (2024-06-05)
48
**Feature - Adding locale support for Create Session API**
59
- Added new param `locale` for create session API

plivo/resources/multipartycall.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ def add_participant(self,
6161
start_recording_audio_method='GET',
6262
stop_recording_audio=None,
6363
stop_recording_audio_method='GET',
64-
create_mpc_with_single_participant=True
64+
create_mpc_with_single_participant=True,
65+
send_digits=None,
66+
send_on_preanswer=False
6567
):
6668
return self.client.multi_party_calls.add_participant(role, uuid=self.id,
6769
**to_param_dict(self.add_participant, locals()))
@@ -88,8 +90,9 @@ def resume_recording(self):
8890
def start_participant_recording(self, participant_id, file_format=None, recording_callback_url=None,
8991
recording_callback_method=None, record_track_type='all'):
9092
return self.client.multi_party_calls.start_participant_recording(participant_id=participant_id, uuid=self.id,
91-
**to_param_dict(self.start_participant_recording,
92-
locals()))
93+
**to_param_dict(
94+
self.start_participant_recording,
95+
locals()))
9396

9497
def stop_participant_recording(self, participant_id, record_track_type='all'):
9598
return self.client.multi_party_calls.stop_participant_recording(participant_id=participant_id, uuid=self.id,
@@ -142,8 +145,9 @@ class MultiPartyCallParticipant(SecondaryPlivoResource):
142145
def start_participant_recording(self, file_format=None, recording_callback_url=None,
143146
recording_callback_method=None, record_track_type='all'):
144147
return self.client.multi_party_calls.start_participant_recording(participant_id=self.secondary_id, uuid=self.id,
145-
**to_param_dict(self.start_participant_recording,
146-
locals()))
148+
**to_param_dict(
149+
self.start_participant_recording,
150+
locals()))
147151

148152
def stop_participant_recording(self, record_track_type='all'):
149153
return self.client.multi_party_calls.stop_participant_recording(participant_id=self.secondary_id, uuid=self.id,
@@ -152,13 +156,16 @@ def stop_participant_recording(self, record_track_type='all'):
152156

153157
def pause_participant_recording(self, record_track_type='all'):
154158
return self.client.multi_party_calls.pause_participant_recording(participant_id=self.secondary_id, uuid=self.id,
155-
**to_param_dict(self.pause_participant_recording,
156-
locals()))
159+
**to_param_dict(
160+
self.pause_participant_recording,
161+
locals()))
157162

158163
def resume_participant_recording(self, record_track_type='all'):
159-
return self.client.multi_party_calls.resume_participant_recording(participant_id=self.secondary_id, uuid=self.id,
160-
**to_param_dict(self.resume_participant_recording,
161-
locals()))
164+
return self.client.multi_party_calls.resume_participant_recording(participant_id=self.secondary_id,
165+
uuid=self.id,
166+
**to_param_dict(
167+
self.resume_participant_recording,
168+
locals()))
162169

163170
def update(self, coach_mode=None, hold=None, mute=None):
164171
return self.client.multi_party_calls.update_participant(participant_id=self.secondary_id,
@@ -336,6 +343,7 @@ def get(self, uuid=None, friendly_name=None, callback_url=None, callback_method=
336343
callback_url=[optional(is_url())],
337344
callback_method=[optional(of_type(six.text_type))],
338345
create_mpc_with_single_participant=[optional(of_type_exact(bool))],
346+
send_on_preanswer=[optional(of_type_exact(bool))],
339347
)
340348
def add_participant(self,
341349
role,
@@ -390,7 +398,9 @@ def add_participant(self,
390398
stop_recording_audio_method='GET',
391399
callback_url=None,
392400
callback_method=None,
393-
create_mpc_with_single_participant=True
401+
create_mpc_with_single_participant=True,
402+
send_digits=None,
403+
send_on_preanswer=False
394404
):
395405
mpc_id = self.__make_mpc_id(friendly_name, uuid)
396406
caller_name = caller_name or from_
@@ -420,7 +430,7 @@ def add_participant(self,
420430
)
421431
def start(self, uuid=None, friendly_name=None, callback_url=None, callback_method=None):
422432
mpc_id = self.__make_mpc_id(friendly_name, uuid)
423-
localObject={}
433+
localObject = {}
424434
localObject['status'] = 'active',
425435
if callback_url:
426436
localObject['callback_url'] = callback_url,

plivo/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# -*- coding: utf-8 -*-
2-
__version__ = '4.55.0'
2+
__version__ = '4.55.1'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='plivo',
13-
version='4.55.0',
13+
version='4.55.1',
1414
description='A Python SDK to make voice calls & send SMS using Plivo and to generate Plivo XML',
1515
long_description=long_description,
1616
url='https://github.com/plivo/plivo-python',

tests/resources/test_multipartycalls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ def test_add_participant(self):
189189
'role': 'agent',
190190
'start_recording_audio_method': 'GET',
191191
'stop_recording_audio_method': 'GET',
192-
'create_mpc_with_single_participant': True
192+
'create_mpc_with_single_participant': True,
193+
'send_on_preanswer': False
193194
}
194195

195196
add_participant_response = self.client.multi_party_calls.add_participant(friendly_name='Voice', role='agent',
@@ -222,7 +223,7 @@ def test_add_participant(self):
222223
coach_mode=False, dial_music='http://music.plivo.com/bella-ciao.wav', ring_timeout=100,
223224
status_callback_events='participant-speak-events', max_duration=25000, max_participants=5,
224225
relay_dtmf_inputs=True, customer_hold_music_url='http://music.plivo.com/bella-ciao.wav',
225-
customer_hold_music_method='post', exit_sound_method='Post', record_file_format='wav')
226+
customer_hold_music_method='post', exit_sound_method='Post', record_file_format='wav', send_on_preanswer=False)
226227

227228
self.__assert_requests(actual_response=add_participant_response, expected_method='POST',
228229
expected_url='https://api.plivo.com/v1/Account/MAXXXXXXXXXXXXXXXXXX/'

0 commit comments

Comments
 (0)