mirror of
https://github.com/donl/plivo-node.git
synced 2026-06-05 06:12:31 -06:00
Reverted back to original
This commit is contained in:
parent
b59e57cf9a
commit
f2f3ec5ba0
2 changed files with 5 additions and 26 deletions
|
|
@ -34,7 +34,7 @@ var client = new plivo.Client('MAMDJMMTEZOWY0ZMQWM2', 'OTljNmVmOGVkNGZhNjJlOWIyM
|
|||
// console.error(err);
|
||||
// });
|
||||
|
||||
client.multiPartyCalls.addParticipant({'friendlyName' : 'TestMPC', 'from' : '+919090909090', 'to': 'sip:koushikqa119062465586783372208@phone-qa.voice.plivodev.com'}).then(function (response) {
|
||||
client.multiPartyCalls.addParticipant('agent', {"friendlyName" : "TestMPC", 'from' : '+919090909090', 'to': 'sip:koushikqa119062465586783372208@phone-qa.voice.plivodev.com'}).then(function (response) {
|
||||
console.log(response);
|
||||
}, function (err) {
|
||||
console.error(err);
|
||||
|
|
|
|||
|
|
@ -45,9 +45,7 @@ export class MultiPartyCall extends PlivoResource{
|
|||
throw new MPCError('specify (from, to) when not adding an existing callUuid to multi party participant')
|
||||
}
|
||||
|
||||
if(params.role){
|
||||
validParam('role', params.role.toLowerCase(), [String], true, ['agent', 'supervisor', 'customer'])
|
||||
}
|
||||
validParam('role', params.role.toLowerCase(), [String], true, ['agent', 'supervisor', 'customer'])
|
||||
|
||||
if(params.from){
|
||||
validParam('from', params.from, [String], false)
|
||||
|
|
@ -295,7 +293,7 @@ export class MultiPartyCall extends PlivoResource{
|
|||
return super.delete()
|
||||
}
|
||||
|
||||
startRecording(params){
|
||||
startRecording(params){
|
||||
if(params.fileFormat){
|
||||
validParam('fileFormat', params.fileFormat, [String], false, ['mp3', 'wav'])
|
||||
}
|
||||
|
|
@ -405,25 +403,6 @@ export class MultiPartyCallInterface extends PlivoResourceInterface{
|
|||
return identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* List MultiPartyCalls
|
||||
* @method
|
||||
* @param {object} params
|
||||
* @param {string} [params.subAccount]
|
||||
* @param {string} [params.friendlyName]
|
||||
* @param {string} [params.status]
|
||||
* @param {number} [params.terminationCauseCode]
|
||||
* @param {Date} [params.end_time__gt]
|
||||
* @param {Date} [params.end_time__gte]
|
||||
* @param {Date} [params.end_time__lt]
|
||||
* @param {Date} [params.end_time__lte]
|
||||
* @param {Date} [params.creation_time__gt]
|
||||
* @param {Date} [params.creation_time__gte]
|
||||
* @param {Date} [params.creation_time__lt]
|
||||
* @param {Date} [params.creation_time__lte]
|
||||
* @param {number} [params.limit]
|
||||
* @param {number} [params.offset]
|
||||
*/
|
||||
list(params={}) {
|
||||
if(params.subAccount){
|
||||
validSubAccount(params.subAccount);
|
||||
|
|
@ -482,7 +461,7 @@ export class MultiPartyCallInterface extends PlivoResourceInterface{
|
|||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).get();
|
||||
}
|
||||
|
||||
addParticipant(role, params = {}){
|
||||
addParticipant( role = 'agent', params = {}){
|
||||
let errors = validate([
|
||||
{field: 'friendly_name', value: params.friendlyName, validators: ['isString']}
|
||||
]);
|
||||
|
|
@ -495,10 +474,10 @@ export class MultiPartyCallInterface extends PlivoResourceInterface{
|
|||
if(params.friendlyName){
|
||||
validParam('friendlyName', params.friendlyName, [String], false)
|
||||
}
|
||||
console.log(params.friendlyName);
|
||||
let mpcId = this.makeMpcId(params.uuid, params.friendlyName)
|
||||
delete params.uuid
|
||||
delete params.friendlyName
|
||||
params.role = role
|
||||
return new MultiPartyCall(this[clientKey], {id: mpcId[0] + mpcId[1]}).addParticipant(params)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue