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

added the new params in add participant api #271

Merged
merged 4 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [4.55.1](https://github.com/plivo/plivo-python/tree/v4.55.1) (2024-07-04)
**Feature - Adding new param support for Add Participant API**
- Added `Send_digits` and `send_on_preanswer` attribute in add participant

## [4.55.0](https://github.com/plivo/plivo-python/tree/v4.55.0) (2024-06-05)
**Feature - Adding locale support for Create Session API**
- Added new param `locale` for create session API
Expand Down
34 changes: 22 additions & 12 deletions plivo/resources/multipartycall.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def add_participant(self,
start_recording_audio_method='GET',
stop_recording_audio=None,
stop_recording_audio_method='GET',
create_mpc_with_single_participant=True
create_mpc_with_single_participant=True,
send_digits=None,
send_on_preanswer=False
):
return self.client.multi_party_calls.add_participant(role, uuid=self.id,
**to_param_dict(self.add_participant, locals()))
Expand All @@ -88,8 +90,9 @@ def resume_recording(self):
def start_participant_recording(self, participant_id, file_format=None, recording_callback_url=None,
recording_callback_method=None, record_track_type='all'):
return self.client.multi_party_calls.start_participant_recording(participant_id=participant_id, uuid=self.id,
**to_param_dict(self.start_participant_recording,
locals()))
**to_param_dict(
self.start_participant_recording,
locals()))

def stop_participant_recording(self, participant_id, record_track_type='all'):
return self.client.multi_party_calls.stop_participant_recording(participant_id=participant_id, uuid=self.id,
Expand Down Expand Up @@ -142,8 +145,9 @@ class MultiPartyCallParticipant(SecondaryPlivoResource):
def start_participant_recording(self, file_format=None, recording_callback_url=None,
recording_callback_method=None, record_track_type='all'):
return self.client.multi_party_calls.start_participant_recording(participant_id=self.secondary_id, uuid=self.id,
**to_param_dict(self.start_participant_recording,
locals()))
**to_param_dict(
self.start_participant_recording,
locals()))

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

def pause_participant_recording(self, record_track_type='all'):
return self.client.multi_party_calls.pause_participant_recording(participant_id=self.secondary_id, uuid=self.id,
**to_param_dict(self.pause_participant_recording,
locals()))
**to_param_dict(
self.pause_participant_recording,
locals()))

def resume_participant_recording(self, record_track_type='all'):
return self.client.multi_party_calls.resume_participant_recording(participant_id=self.secondary_id, uuid=self.id,
**to_param_dict(self.resume_participant_recording,
locals()))
return self.client.multi_party_calls.resume_participant_recording(participant_id=self.secondary_id,
uuid=self.id,
**to_param_dict(
self.resume_participant_recording,
locals()))

def update(self, coach_mode=None, hold=None, mute=None):
return self.client.multi_party_calls.update_participant(participant_id=self.secondary_id,
Expand Down Expand Up @@ -336,6 +343,7 @@ def get(self, uuid=None, friendly_name=None, callback_url=None, callback_method=
callback_url=[optional(is_url())],
callback_method=[optional(of_type(six.text_type))],
create_mpc_with_single_participant=[optional(of_type_exact(bool))],
send_on_preanswer=[optional(of_type_exact(bool))],
)
def add_participant(self,
role,
Expand Down Expand Up @@ -390,7 +398,9 @@ def add_participant(self,
stop_recording_audio_method='GET',
callback_url=None,
callback_method=None,
create_mpc_with_single_participant=True
create_mpc_with_single_participant=True,
send_digits=None,
send_on_preanswer=False
):
mpc_id = self.__make_mpc_id(friendly_name, uuid)
caller_name = caller_name or from_
Expand Down Expand Up @@ -420,7 +430,7 @@ def add_participant(self,
)
def start(self, uuid=None, friendly_name=None, callback_url=None, callback_method=None):
mpc_id = self.__make_mpc_id(friendly_name, uuid)
localObject={}
localObject = {}
localObject['status'] = 'active',
if callback_url:
localObject['callback_url'] = callback_url,
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.0'
__version__ = '4.55.1'
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.0',
version='4.55.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
5 changes: 3 additions & 2 deletions tests/resources/test_multipartycalls.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ def test_add_participant(self):
'role': 'agent',
'start_recording_audio_method': 'GET',
'stop_recording_audio_method': 'GET',
'create_mpc_with_single_participant': True
'create_mpc_with_single_participant': True,
'send_on_preanswer': False
}

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

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