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

Removed start recording and stop recording announcements on MPC and added SDK Versioning #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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

## [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:
Expand Down
18 changes: 0 additions & 18 deletions src/Plivo/Resources/MultiPartyCall/MultiPartyCallInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/Plivo/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 1 addition & 20 deletions src/Plivo/XML/MultiPartyCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
];

/**
Expand Down Expand Up @@ -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';
}
}
}
4 changes: 1 addition & 3 deletions tests/Resources/MultiPartyCallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down