mirror of
https://github.com/donl/plivo-node.git
synced 2026-06-30 06:12:08 -06:00
removed code changes of start recording and stop recording announcement on MPC
This commit is contained in:
parent
d0f168bbe7
commit
b57d0da9cc
4 changed files with 2 additions and 52 deletions
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
## [v4.24.0](https://github.com/plivo/plivo-node/tree/v4.24.0) (2021-11-12)
|
||||
**Features - Voice: Multiparty calls**
|
||||
- The [Add Multiparty Call API](https://www.plivo.com/docs/voice/api/multiparty-call/participants#add-a-participant) allows for greater functionality by accepting options like `start recording audio`, `stop recording audio`, and their HTTP methods.
|
||||
- [Multiparty Calls](https://www.plivo.com/docs/voice/api/multiparty-call/) now has new APIs to `stop` and `play` audio.
|
||||
|
||||
## [v4.23.1](https://github.com/plivo/plivo-node/tree/v4.23.1) (2021-10-13)
|
||||
|
|
|
|||
|
|
@ -308,28 +308,6 @@ export class MultiPartyCall extends PlivoResource{
|
|||
params.exitSoundMethod = 'GET'
|
||||
}
|
||||
|
||||
if(params.startRecordingAudio){
|
||||
validUrl('startRecordingAudio', params.startRecordingAudio, false)
|
||||
}
|
||||
|
||||
if(params.startRecordingAudioMethod){
|
||||
validParam('startRecordingAudioMethod', params.startRecordingAudioMethod.toUpperCase(), [String], false, ['GET', 'POST'])
|
||||
}
|
||||
else {
|
||||
params.startRecordingAudioMethod = 'GET'
|
||||
}
|
||||
|
||||
if(params.stopRecordingAudio){
|
||||
validUrl('stopRecordingAudio', params.stopRecordingAudio, false)
|
||||
}
|
||||
|
||||
if(params.stopRecordingAudioMethod){
|
||||
validParam('stopRecordingAudioMethod', params.stopRecordingAudioMethod.toUpperCase(), [String], false, ['GET', 'POST'])
|
||||
}
|
||||
else {
|
||||
params.stopRecordingAudioMethod = 'GET'
|
||||
}
|
||||
|
||||
if(params.to && (String(params.ringTimeout).split('<').length > params.to.split('<').length)){
|
||||
throw new MPCError("RingTimeout:number of ring_timeout(s) should be same as number of destination(s)")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -473,10 +473,6 @@ Response.prototype = {
|
|||
* @param {string} [attributes.recordingCallbackUrl]
|
||||
* @param {string} [attributes.statusCallbackUrl]
|
||||
* @param {string} [attributes.customerHoldMusicUrl]
|
||||
* @param {string} [attributes.startRecordingAudio]
|
||||
* @param {string} [attributes.stopRecordingAudio]
|
||||
* @param {string} [attributes.startRecordingAudioMethod]
|
||||
* @param {string} [attributes.stopRecordingAudioMethod]
|
||||
*/
|
||||
addMultiPartyCall: function (body, attributes){
|
||||
const VALID_ROLE_VALUES = ['agent', 'supervisor', 'customer']
|
||||
|
|
@ -668,28 +664,6 @@ Response.prototype = {
|
|||
if(attributes.customerHoldMusicUrl && !plivoUtils.validUrl('customerHoldMusicUrl', attributes.customerHoldMusicUrl, false)){
|
||||
throw new PlivoXMLError('Invalid attribute value ' + attributes.customerHoldMusicUrl + ' for customerHoldMusicUrl')
|
||||
}
|
||||
|
||||
if(attributes.startRecordingAudio && !plivoUtils.validUrl('startRecordingAudio', attributes.startRecordingAudio, false)){
|
||||
throw new PlivoXMLError('Invalid attribute value ' + attributes.startRecordingAudio + ' for startRecordingAudio')
|
||||
}
|
||||
|
||||
if(attributes.stopRecordingAudio && !plivoUtils.validUrl('stopRecordingAudio', attributes.stopRecordingAudio, false)){
|
||||
throw new PlivoXMLError('Invalid attribute value ' + attributes.stopRecordingAudio + ' for stopRecordingAudio')
|
||||
}
|
||||
|
||||
if(attributes.startRecordingAudioMethod && VALID_METHOD_VALUES.indexOf(attributes.startRecordingAudioMethod.toUpperCase())===-1){
|
||||
throw new PlivoXMLError('Invalid attribute value ' + attributes.startRecordingAudioMethod + ' for startRecordingAudioMethod')
|
||||
}
|
||||
else if (!attributes.startRecordingAudioMethod){
|
||||
attributes.startRecordingAudioMethod = 'GET'
|
||||
}
|
||||
|
||||
if(attributes.stopRecordingAudioMethod && VALID_METHOD_VALUES.indexOf(attributes.stopRecordingAudioMethod.toUpperCase())===-1){
|
||||
throw new PlivoXMLError('Invalid attribute value ' + attributes.stopRecordingAudioMethod + ' for stopRecordingAudioMethod')
|
||||
}
|
||||
else if (!attributes.stopRecordingAudioMethod){
|
||||
attributes.stopRecordingAudioMethod = 'GET'
|
||||
}
|
||||
return this.add(new MultiPartyCall(Response), body, attributes);
|
||||
},
|
||||
|
||||
|
|
@ -1010,7 +984,6 @@ function MultiPartyCall(Response){
|
|||
'statusCallbackEvents', 'statusCallbackUrl', 'statusCallbackMethod',
|
||||
'stayAlone', 'coachMode', 'mute', 'hold', 'startMpcOnEnter', 'endMpcOnExit',
|
||||
'enterSound', 'enterSoundMethod', 'exitSound', 'exitSoundMethod',
|
||||
'onExitActionUrl', 'onExitActionMethod', 'relayDTMFInputs',
|
||||
'startRecordingAudio', 'startRecordingAudioMethod', 'stopRecordingAudio', 'stopRecordingAudioMethod'];
|
||||
'onExitActionUrl', 'onExitActionMethod', 'relayDTMFInputs'];
|
||||
}
|
||||
util.inherits(MultiPartyCall, Response);
|
||||
|
|
|
|||
|
|
@ -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" 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">Nairobi</MultiPartyCall></Response>',mpcResponse.toXML());
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue