Skip to content

Commit

Permalink
Merge pull request #190 from plivo/VT-3881
Browse files Browse the repository at this point in the history
initialCommit
  • Loading branch information
huzaif-plivo authored Feb 1, 2022
2 parents 81d1ec0 + 08d8211 commit efc0ddc
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 22 deletions.
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.22.0](https://github.com/plivo/plivo-python/tree/v4.22.0) (2022-01-27)
**Features - MPCStartCallRecording**
- parameter change from statusCallback to recordingCallback

## [4.21.0](https://github.com/plivo/plivo-python/tree/v4.21.0) (2021-12-14)
**Features - Voice**
- Routing SDK traffic through Akamai endpoints for all the [Voice APIs](https://www.plivo.com/docs/voice/api/overview/)
Expand Down
24 changes: 12 additions & 12 deletions plivo/resources/multipartycall.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def start(self):
def stop(self):
return self.client.multi_party_calls.stop(uuid=self.id)

def start_recording(self, file_format=None, status_callback_url=None, status_callback_method=None):
def start_recording(self, file_format=None, recording_callback_url=None, recording_callback_method=None):
return self.client.multi_party_calls.start_recording(uuid=self.id,
**to_param_dict(self.add_participant, locals()))

Expand All @@ -82,8 +82,8 @@ def pause_recording(self):
def resume_recording(self):
return self.client.multi_party_calls.resume_recording(uuid=self.id)

def start_participant_recording(self, participant_id, file_format=None, status_callback_url=None,
status_callback_method=None):
def start_participant_recording(self, participant_id, file_format=None, recording_callback_url=None,
recording_callback_method=None):
return self.client.multi_party_calls.start_participant_recording(participant_id=participant_id, uuid=self.id,
**to_param_dict(self.add_participant,
locals()))
Expand Down Expand Up @@ -127,8 +127,8 @@ class MultiPartyCallParticipant(SecondaryPlivoResource):
_identifier_string = 'mpc_uuid'
_secondary_identifier_string = 'member_id'

def start_participant_recording(self, file_format=None, status_callback_url=None,
status_callback_method=None):
def start_participant_recording(self, file_format=None, recording_callback_url=None,
recording_callback_method=None):
return self.client.multi_party_calls.start_participant_recording(participant_id=self.secondary_id, uuid=self.id,
**to_param_dict(self.add_participant,
locals()))
Expand Down Expand Up @@ -385,15 +385,15 @@ def stop(self, uuid=None, friendly_name=None):
uuid=[optional(of_type_exact(str))],
file_format=[optional(of_type_exact(str), is_in(('mp3', 'wav'), case_sensitive=False,
case_type='lower'))],
status_callback_url=[optional(of_type_exact(str), is_url())],
status_callback_method=[optional(of_type_exact(str), is_in(('GET', 'POST'), case_sensitive=False))],
recording_callback_url=[optional(of_type_exact(str), is_url())],
recording_callback_method=[optional(of_type_exact(str), is_in(('GET', 'POST'), case_sensitive=False))],
)
def start_recording(self,
uuid=None,
friendly_name=None,
file_format='mp3',
status_callback_url=None,
status_callback_method='POST'):
recording_callback_url=None,
recording_callback_method='POST'):
mpc_id = self.__make_mpc_id(friendly_name, uuid)
return self.client.request('POST', ('MultiPartyCall', mpc_id, 'Record'),
self.__clean_identifiers(to_param_dict(self.start_recording, locals())),
Expand Down Expand Up @@ -479,11 +479,11 @@ def get_participant(self, participant_id, uuid=None, friendly_name=None):
uuid=[optional(of_type_exact(str))],
file_format=[optional(of_type_exact(str), is_in(('mp3', 'wav'), case_sensitive=False,
case_type='lower'))],
status_callback_url=[optional(of_type_exact(str), is_url())],
status_callback_method=[optional(of_type_exact(str), is_in(('GET', 'POST'), case_sensitive=False))],
recording_callback_url=[optional(of_type_exact(str), is_url())],
recording_callback_method=[optional(of_type_exact(str), is_in(('GET', 'POST'), case_sensitive=False))],
)
def start_participant_recording(self, participant_id, uuid=None, friendly_name=None, file_format='mp3',
status_callback_url=None, status_callback_method='POST'):
recording_callback_url=None, recording_callback_method='POST'):
mpc_id = self.__make_mpc_id(friendly_name, uuid)
return self.client.request('POST', ('MultiPartyCall', mpc_id, 'Participant', participant_id, 'Record'),
self.__clean_identifiers(to_param_dict(self.start_recording, locals())),
Expand Down
2 changes: 1 addition & 1 deletion plivo/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
__version__ = '4.21.0'
__version__ = '4.22.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.21.0',
version='4.22.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
16 changes: 8 additions & 8 deletions tests/resources/test_multipartycalls.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,16 +418,16 @@ def test_kick_MPC_participant(self):
def test_start_recording(self):

file_format = 'wav'
status_callback_url = 'https://plivo.com/status'
recording_callback_url = 'https://plivo.com/status'
start_recording_response = self.client.multi_party_calls. \
start_recording(friendly_name='Voice', file_format=file_format, status_callback_url=status_callback_url)
start_recording(friendly_name='Voice', file_format=file_format, recording_callback_url=recording_callback_url)

self.__assert_requests(expected_url='https://api.plivo.com/v1/Account/MAXXXXXXXXXXXXXXXXXX/'
'MultiPartyCall/name_{}/Record/'.format('Voice'),
expected_method='POST',
expected_request_body={'file_format': 'wav',
'status_callback_url': status_callback_url,
'status_callback_method': 'POST'},
'recording_callback_url': recording_callback_url,
'recording_callback_method': 'POST'},
actual_response=start_recording_response)

def test_stop_recording(self):
Expand Down Expand Up @@ -474,17 +474,17 @@ def test_get_participant(self):
@with_response(200)
def test_start_participant_recording(self):
file_format = 'wav'
status_callback_url = "https://plivo.com/status"
recording_callback_url = "https://plivo.com/status"
participant_id = 10
start_participant_recording_response = self.client.multi_party_calls. \
start_participant_recording(participant_id=participant_id, friendly_name='Voice', file_format=file_format,
status_callback_url=status_callback_url)
recording_callback_url=recording_callback_url)
self.__assert_requests(expected_url='https://api.plivo.com/v1/Account/MAXXXXXXXXXXXXXXXXXX/MultiPartyCall'
'/name_{}/Participant/{}/Record/'.format('Voice', participant_id),
expected_method='POST',
expected_request_body={'file_format': 'wav',
'status_callback_url': status_callback_url,
'status_callback_method': 'POST'},
'recording_callback_url': recording_callback_url,
'recording_callback_method': 'POST'},
actual_response=start_participant_recording_response)

def test_stop_participant_recording(self):
Expand Down

0 comments on commit efc0ddc

Please sign in to comment.