From 3c4f1609ae532c4546510c73571fab343c409efd Mon Sep 17 00:00:00 2001 From: Kunal Sanghvi Date: Wed, 17 Oct 2018 08:17:28 +0530 Subject: [PATCH] liva calls filtering by from, to numbers and call_direction --- lib/resources/call.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/resources/call.js b/lib/resources/call.js index edb99a0..8ea073d 100644 --- a/lib/resources/call.js +++ b/lib/resources/call.js @@ -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 => {