Merge pull request #88 from kunal-plivo/filter-live-calls

live calls filtering by from, to numbers and call_direction
This commit is contained in:
Sachin Kulshrestha 2018-10-29 16:18:37 +05:30 committed by GitHub
commit d06f148b23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -510,8 +510,8 @@ export class CallInterface extends PlivoResourceInterface {
}).cancel();
}
listLiveCalls() {
return this[liveCallInterfaceKey].list();
listLiveCalls(params) {
return this[liveCallInterfaceKey].list(params);
}
getLiveCall(id) {
@ -585,11 +585,15 @@ class LiveCallInterface extends PlivoResourceInterface {
});
}
list() {
list(params) {
let client = this[clientKey];
if (params === undefined){
params = {}
}
params.status = 'live'
return new Promise((resolve, reject) => {
client('GET', action, {status: 'live'})
client('GET', action, params)
.then(response => {
let calls = [];
response.body.calls.forEach(callUuid => {