diff --git a/CHANGELOG.md b/CHANGELOG.md index 12ee3554..a43e8570 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## [v4.32.0](https://github.com/plivo/plivo-node/tree/v4.32.0) (2022-05-05) +**Features - List all recordings** +- `fromNumber` and `toNumber` added in filtering params [List all recordings](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) +- `record_min_member_count` param added to [Add a participant to a multiparty call using API](https://www.plivo.com/docs/voice/api/multiparty-call/participants#add-a-participant) + ## [v4.31.0](https://github.com/plivo/plivo-node/tree/v4.31.0) (2022-04-27) **Feature - 10DLC API callback** - Added callback support for campaign, brand, link number request. diff --git a/lib/resources/multiPartyCall.js b/lib/resources/multiPartyCall.js index 56f65322..1e892452 100644 --- a/lib/resources/multiPartyCall.js +++ b/lib/resources/multiPartyCall.js @@ -144,6 +144,13 @@ export class MultiPartyCall extends PlivoResource{ params.maxParticipants = 10 } + if(params.recordMinMemberCount || params.recordMinMemberCount === 0){ + validRange('recordMinMemberCount', params.recordMinMemberCount, false, 1, 2) + } + else { + params.recordMinMemberCount = 1 + } + if(params.waitMusicUrl){ validUrl('waitMusicUrl', params.waitMusicUrl, false) } diff --git a/lib/resources/recordings.js b/lib/resources/recordings.js index f9294fe4..91bf16c7 100644 --- a/lib/resources/recordings.js +++ b/lib/resources/recordings.js @@ -27,6 +27,8 @@ export class RetrieveRecordingResponse { this.recordingType = params.recordingType; this.recordingUrl = params.recordingUrl; this.resourceUri = params.resourceUri; + this.fromNumber = params.fromNumber; + this.toNumber = params.toNumber; } } @@ -45,6 +47,11 @@ export class ListRecordingResponse { this.recordingType = params.recordingType; this.recordingUrl = params.recordingUrl; this.resourceUri = params.resourceUri; + this.fromNumber = params.fromNumber; + this.toNumber = params.toNumber; + this.mpcName = params.mpcName; + this.conferenceUuid = params.conferenceUuid; + this.mpcUuid = params.mpcUuid; } } diff --git a/lib/rest/request-test.js b/lib/rest/request-test.js index 2e2fe1d0..b014c96b 100644 --- a/lib/rest/request-test.js +++ b/lib/rest/request-test.js @@ -2005,7 +2005,9 @@ export function Request(config) { recording_start_ms: '1407235163907.00000', recording_type: 'conference', recording_url: 'http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-11e4-a664-0026b945b52x.mp3', - resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/' + resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/', + from_number: '+919999323467', + to_number: '+919891865130', } }); } @@ -2034,7 +2036,9 @@ export function Request(config) { recording_start_ms: '1407235163907.00000', recording_type: 'conference', recording_url: 'http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-1124-a664-0026b945b522.mp3', - resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/' + resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/', + from_number: '+919999323467', + to_number: '+919891865130', }, { add_time: '2014-08-05 16:05:21.993853+05:30', @@ -2047,7 +2051,9 @@ export function Request(config) { recording_start_ms: '1407234829553.00000', recording_type: 'conference', recording_url: 'http://s3.amazonaws.com/recordings_2013/fc2716b0-1c8b-11e4-bwad-842b2b17453e.mp3', - resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/' + resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/', + from_number: '+919999323467', + to_number: '+919891865130', } ] } diff --git a/lib/utils/plivoxml.js b/lib/utils/plivoxml.js index fd5a8874..a31a7572 100644 --- a/lib/utils/plivoxml.js +++ b/lib/utils/plivoxml.js @@ -448,6 +448,7 @@ Response.prototype = { * @param {string} [attributes.role] * @param {number} [attributes.maxDuration] * @param {number} [attributes.maxParticipants] + * @param {number} [attributes.recordMinMemberCount] * @param {string} [attributes.waitMusicMethod] * @param {string} [attributes.agentHoldMusicMethod] * @param {string} [attributes.customerHoldMusicMethod] @@ -506,6 +507,13 @@ Response.prototype = { attributes.maxParticipants = 10 } + if(attributes.recordMinMemberCount && (attributes.recordMinMemberCount<1 || attributes.recordMinMemberCount>2)){ + throw new PlivoXMLError('Invalid attribute value ' + attributes.recordMinMemberCount + ' for recordMinMemberCount') + } + else if(!attributes.recordMinMemberCount){ + attributes.recordMinMemberCount = 1 + } + if(attributes.waitMusicMethod && VALID_METHOD_VALUES.indexOf(attributes.waitMusicMethod.toUpperCase())===-1){ throw new PlivoXMLError('Invalid attribute value ' + attributes.waitMusicMethod + ' for waitMusicMethod') } @@ -1004,7 +1012,7 @@ util.inherits(DTMF, Response); function MultiPartyCall(Response){ this.element = 'MultiPartyCall'; this.nestables = []; - this.valid_attributes = ['role', 'maxDuration', 'maxParticipants', 'waitMusicUrl', + this.valid_attributes = ['role', 'maxDuration', 'maxParticipants', 'recordMinMemberCount', 'waitMusicUrl', 'waitMusicMethod', 'agentHoldMusicUrl', 'agentHoldMusicMethod', 'customerHoldMusicUrl', 'customerHoldMusicMethod', 'record', 'recordFileFormat', 'recordingCallbackUrl', 'recordingCallbackMethod', diff --git a/package.json b/package.json index b407d4e7..cc1c4276 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.31.0", + "version": "4.32.0", "description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML", "homepage": "https://github.com/plivo/plivo-node", "files": [ diff --git a/test/xml.js b/test/xml.js index cfc587ed..7a630474 100644 --- a/test/xml.js +++ b/test/xml.js @@ -35,7 +35,7 @@ describe('PlivoXML', function () { maxDuration: 1000, statusCallbackEvents: 'participant-speak-events, participant-digit-input-events, add-participant-api-events, participant-state-changes, mpc-state-changes' }); - assert.equal('Nairobi',mpcResponse.toXML()); + assert.equal('Nairobi',mpcResponse.toXML()); done(); }); }); diff --git a/types/resources/recordings.d.ts b/types/resources/recordings.d.ts index 2cc6f4bd..9e291dc0 100644 --- a/types/resources/recordings.d.ts +++ b/types/resources/recordings.d.ts @@ -12,6 +12,8 @@ export class RetrieveRecordingResponse { recordingType: string; recordingUrl: string; resourceUri: string; + fromNumber: string; + toNumber: string; } export class ListRecordingResponse { constructor(params: object); @@ -27,6 +29,11 @@ export class ListRecordingResponse { recordingType: string; recordingUrl: string; resourceUri: string; + fromNumber: string; + toNumber: string; + conferenceUuid: string; + mpcName: string; + mpcUuid: string; } /** * Represents a Recording