Twilio 客户端电话会议参会人数 Android

Number of Participants in Twilio Client Conference Call Android

我正在使用Twilio Client for Android,我想显示当前连接到电话会议的参与者人数。
我已经尝试了将近 2 天,但无法得出结果。
请帮忙

这里是 Twilio 开发人员布道者。

为此,您需要使用 REST API。您应该已经在使用基于服务器的应用程序 generate tokens for your Twilio Client application, so in there you'll want another endpoint that can take the Conference SID and look up the participants using the REST API。完成后,您需要从 Android 应用程序调用您的服务器以获取当前的参与者数量。

使用 Python(因为这是示例 Twilio 客户端服务器的实现方式),它可能看起来有点像这样:

from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "your_account_sid"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of participant objects with the properties described above
participants = client.participants('CFbbe4632a3c49700934481addd5ce1659').list()
len(participants)

您还可以使用 websocket 连接或类似方式连接到您的网络服务器应用程序,并在收到 conference event.

时查找并广播参与者

如果有帮助请告诉我。