mirror of
https://github.com/donl/plivo-node.git
synced 2026-05-31 22:07:36 -06:00
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:
commit
d06f148b23
1 changed files with 8 additions and 4 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue