Reputation: 855
Is there a way to get a list of all In-Progress calls for an account in Twilio?
Something like:
/2010-04-01/Accounts/{AccountSid}/Calls/List-In-Progress
Any help greatly appreciated!
Upvotes: 1
Views: 155
Reputation: 73027
Twilio developer evangelist here.
There sure is! When you list calls from the API you can filter by the Status
. Available statuses are: queued, ringing, in-progress, canceled, completed, failed, busy, or no-answer.
To do this in Node (I'm not sure what language you're using, but we have discussed Node on here before!), you would do:
const accountSid = 'your_account_sid';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);
client.calls.each({ status: 'in-progress' }, call =>
// do something with the call
console.log(call.sid);
);
Let me know if this helps at all.
Upvotes: 3