From 521f4c06da807521abc84e9ea91f6731d1e646a3 Mon Sep 17 00:00:00 2001 From: Abinaya-plivo Date: Tue, 16 Nov 2021 18:07:53 +0530 Subject: [PATCH] Removed start recording and stop recording announcements on MPC and added SDk Versioning --- CHANGELOG.md | 4 ++++ .../MultiPartyCallInterface.php | 18 ---------------- src/Plivo/Version.php | 2 +- src/Plivo/XML/MultiPartyCall.php | 21 +------------------ tests/Resources/MultiPartyCallTest.php | 4 +--- 5 files changed, 7 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03dfed60..3706445e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [v4.25.0](https://github.com/plivo/plivo-php/releases/tag/v4.25.0) - 2021-11-16 +**Features - Voice: Multiparty calls** +- Removed start recording and stop recording announcements on MPC. + ## [v4.24.0](https://github.com/plivo/plivo-php/releases/tag/v4.24.0) - 2021-11-11 **Features - Messaging** - New 10DLC API: diff --git a/src/Plivo/Resources/MultiPartyCall/MultiPartyCallInterface.php b/src/Plivo/Resources/MultiPartyCall/MultiPartyCallInterface.php index 396ce4e7..b548f442 100644 --- a/src/Plivo/Resources/MultiPartyCall/MultiPartyCallInterface.php +++ b/src/Plivo/Resources/MultiPartyCall/MultiPartyCallInterface.php @@ -353,24 +353,6 @@ public function addParticipant($role, array $optionalArgs = []){ else{ $optionalArgs['exit_sound_method'] = 'GET'; } - if(isset($optionalArgs['start_recording_audio'])){ - MPCUtils::validUrl('startRecordingAudio', $optionalArgs['start_recording_audio'], false); - } - if(isset($optionalArgs['start_recording_audio_method'])){ - MPCUtils::validParam('startRecordingAudioMethod', strtoupper($optionalArgs['start_recording_audio_method']), ['string'], false, ['GET', 'POST']); - } - else{ - $optionalArgs['start_recording_audio_method'] = 'GET'; - } - if(isset($optionalArgs['stop_recording_audio'])){ - MPCUtils::validUrl('stopRecordingAudio', $optionalArgs['stop_recording_audio'], false); - } - if(isset($optionalArgs['stop_recording_audio_method'])){ - MPCUtils::validParam('stopRecordingAudioMethod', strtoupper($optionalArgs['stop_recording_audio_method']), ['string'], false, ['GET', 'POST']); - } - else{ - $optionalArgs['stop_recording_audio_method'] = 'GET'; - } $mandatoryArgs = ['role' => $role]; $optionalArgs['isVoiceRequest'] = true; $response = $this->client->update( diff --git a/src/Plivo/Version.php b/src/Plivo/Version.php index 6af75fcc..500b19a6 100644 --- a/src/Plivo/Version.php +++ b/src/Plivo/Version.php @@ -20,7 +20,7 @@ class Version /** * @const int PHP helper library minor version number */ - const MINOR = 24; + const MINOR = 25; /** * @const int PHP helper library patch number diff --git a/src/Plivo/XML/MultiPartyCall.php b/src/Plivo/XML/MultiPartyCall.php index 2432b89c..fe11d89f 100644 --- a/src/Plivo/XML/MultiPartyCall.php +++ b/src/Plivo/XML/MultiPartyCall.php @@ -20,8 +20,7 @@ class MultiPartyCall extends Element { 'statusCallbackEvents', 'statusCallbackUrl', 'statusCallbackMethod', 'stayAlone', 'coachMode', 'mute', 'hold', 'startMpcOnEnter', 'endMpcOnExit', 'enterSound', 'enterSoundMethod', 'exitSound', 'exitSoundMethod', - 'onExitActionUrl', 'onExitActionMethod', 'relayDTMFInputs', - 'startRecordingAudio', 'startRecordingAudioMethod', 'stopRecordingAudio', 'stopRecordingAudioMethod' + 'onExitActionUrl', 'onExitActionMethod', 'relayDTMFInputs' ]; /** @@ -194,23 +193,5 @@ function __construct($body, $attributes = []) { if(isset($attributes['onExitActionUrl']) and !MPCUtils::validUrl('onExitActionUrl', $attributes['onExitActionUrl'], false)){ throw new PlivoXMLException('Invalid attribute value ' . $attributes['onExitActionUrl']. ' for onExitActionUrl'); } - if(isset($attributes['startRecordingAudio']) and !MPCUtils::validUrl('startRecordingAudio', $attributes['startRecordingAudio'], false)){ - throw new PlivoXMLException('Invalid attribute value ' . $attributes['startRecordingAudio']. ' for startRecordingAudio'); - } - if(isset($attributes['stopRecordingAudio']) and !MPCUtils::validUrl('stopRecordingAudio', $attributes['stopRecordingAudio'], false)){ - throw new PlivoXMLException('Invalid attribute value ' . $attributes['stopRecordingAudio']. ' for stopRecordingAudio'); - } - if(isset($attributes['startRecordingAudioMethod']) and !in_array(strtoupper($attributes['startRecordingAudioMethod']), $VALID_METHOD_VALUES, true)){ - throw new PlivoXMLException('Invalid attribute value ' . $attributes['startRecordingAudioMethod']. ' for startRecordingAudioMethod'); - } - elseif (!isset($attributes['startRecordingAudioMethod'])){ - $attributes['startRecordingAudioMethod'] = 'GET'; - } - if(isset($attributes['stopRecordingAudioMethod']) and !in_array(strtoupper($attributes['stopRecordingAudioMethod']), $VALID_METHOD_VALUES, true)){ - throw new PlivoXMLException('Invalid attribute value ' . $attributes['stopRecordingAudioMethod']. ' for stopRecordingAudioMethod'); - } - elseif (!isset($attributes['stopRecordingAudioMethod'])){ - $attributes['stopRecordingAudioMethod'] = 'GET'; - } } } \ No newline at end of file diff --git a/tests/Resources/MultiPartyCallTest.php b/tests/Resources/MultiPartyCallTest.php index 79ff46c0..c0135bd4 100644 --- a/tests/Resources/MultiPartyCallTest.php +++ b/tests/Resources/MultiPartyCallTest.php @@ -71,9 +71,7 @@ function testMPCAddParticipant(){ 'enter_sound'=> 'beep:1', 'enter_sound_method'=> 'GET', 'exit_sound'=> 'beep:2', - 'exit_sound_method'=> 'GET', - 'start_recording_audio_method'=> 'GET', - 'stop_recording_audio_method'=> 'GET' + 'exit_sound_method'=> 'GET' ]); $body = file_get_contents(__DIR__ . '/../Mocks/multiPartyCallsAddParticipantResponse.json');