Skip to content

Commit

Permalink
removed speak param from xml
Browse files Browse the repository at this point in the history
  • Loading branch information
PuneetAgrawal-plivo committed May 23, 2024
1 parent 3cc1229 commit b62c13e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions lib/utils/plivoxml.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ Response.prototype = {
* @param {string} [attributes.startRecordingAudioMethod]
* @param {string} [attributes.stopRecordingAudioMethod]
* @param {boolean} [attributes.recordParticipantTrack]
* @param {string} [attributes.recordTrackType]
*/
addMultiPartyCall: function (body, attributes){
const VALID_ROLE_VALUES = ['agent', 'supervisor', 'customer']
Expand Down Expand Up @@ -721,14 +720,6 @@ Response.prototype = {
else if (!attributes.recordParticipantTrack){
attributes.recordParticipantTrack = false
}

if(attributes.recordTrackType && !plivoUtils.isOneAmongStringUrl('recordTrackType', attributes.recordTrackType, false, ['all', 'both', 'participant'])){
throw new PlivoXMLError('Invalid attribute value ' + attributes.recordTrackType + ' for recordTrackType')
}
else if(!attributes.recordTrackType){
attributes.recordTrackType = 'all'
}

return this.add(new MultiPartyCall(Response), body, attributes);
},

Expand Down Expand Up @@ -1050,7 +1041,7 @@ function MultiPartyCall(Response){
'stayAlone', 'coachMode', 'mute', 'hold', 'startMpcOnEnter', 'endMpcOnExit',
'enterSound', 'enterSoundMethod', 'exitSound', 'exitSoundMethod',
'onExitActionUrl', 'onExitActionMethod', 'relayDTMFInputs',
'startRecordingAudio', 'startRecordingAudioMethod', 'stopRecordingAudio', 'stopRecordingAudioMethod', 'recordTrackType', 'recordParticipantTrack'];
'startRecordingAudio', 'startRecordingAudioMethod', 'stopRecordingAudio', 'stopRecordingAudioMethod', 'recordParticipantTrack'];
}
util.inherits(MultiPartyCall, Response);

Expand Down
2 changes: 1 addition & 1 deletion test/xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" 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" recordParticipantTrack="false" recordTrackType="all">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" recordParticipantTrack="false">Nairobi</MultiPartyCall></Response>',mpcResponse.toXML());
done();
});

Expand Down

0 comments on commit b62c13e

Please sign in to comment.