代码之家  ›  专栏  ›  技术社区  ›  Marcus

Twilio中的活动呼叫列表

  •  1
  • Marcus  · 技术社区  · 7 年前

    有没有办法在Twilio中获取帐户的所有正在进行的呼叫列表?

    /2010-04-01/Accounts/{AccountSid}/Calls/List-In-Progress
    

    非常感谢您的帮助!

    1 回复  |  直到 7 年前
        1
  •  3
  •   philnash    7 年前

    Twilio开发者布道者。

    当然有!当你 list calls from the API filter by the Status . 可用状态包括:排队、振铃、进行中、取消、完成、失败、忙或无应答。

    要在Node中实现这一点(我不确定您使用的是什么语言,但我们之前已经在这里讨论过Node!),你会做:

    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);
    );