Merge pull request #245 from plivo/VT-4165

VT-4165:filtering added
This commit is contained in:
ajay-plivo 2022-05-05 19:30:28 +05:30 committed by GitHub
commit ea55779671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 46 additions and 6 deletions

View file

@ -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.

View file

@ -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)
}

View file

@ -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;
}
}

View file

@ -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',
}
]
}

View file

@ -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',

View file

@ -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": [

View file

@ -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('<Response><MultiPartyCall role="Agent" maxDuration="1000" statusCallbackEvents="participant-speak-events, participant-digit-input-events, add-participant-api-events, participant-state-changes, mpc-state-changes" maxParticipants="10" waitMusicMethod="GET" agentHoldMusicMethod="GET" customerHoldMusicMethod="GET" record="false" recordFileFormat="mp3" recordingCallbackMethod="GET" statusCallbackMethod="POST" stayAlone="false" coachMode="true" mute="false" hold="false" startMpcOnEnter="true" endMpcOnExit="false" enterSound="beep:1" enterSoundMethod="GET" exitSound="beep:2" exitSoundMethod="GET" onExitActionMethod="POST" relayDTMFInputs="false" startRecordingAudioMethod="GET" stopRecordingAudioMethod="GET">Nairobi</MultiPartyCall></Response>',mpcResponse.toXML());
assert.equal('<Response><MultiPartyCall role="Agent" maxDuration="1000" statusCallbackEvents="participant-speak-events, participant-digit-input-events, add-participant-api-events, participant-state-changes, mpc-state-changes" maxParticipants="10" recordMinMemberCount="1" waitMusicMethod="GET" agentHoldMusicMethod="GET" customerHoldMusicMethod="GET" record="false" recordFileFormat="mp3" recordingCallbackMethod="GET" statusCallbackMethod="POST" stayAlone="false" coachMode="true" mute="false" hold="false" startMpcOnEnter="true" endMpcOnExit="false" enterSound="beep:1" enterSoundMethod="GET" exitSound="beep:2" exitSoundMethod="GET" onExitActionMethod="POST" relayDTMFInputs="false" startRecordingAudioMethod="GET" stopRecordingAudioMethod="GET">Nairobi</MultiPartyCall></Response>',mpcResponse.toXML());
done();
});
});

View file

@ -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