Twilio:我在被拒绝的电话中收到 "Participant is unavailable at the moment"

Twilio: I get "Participant is unavailable at the moment" in rejected call

我目前正在我的 Android 应用程序中实现 Twilio Video,其中正常行为(也是我需要的行为)应该是: 如果客户端 A 调用客户端 B,而客户端 B 拒绝调用,则客户端 A 收到 (onConversation) 包含 code:107, message:Participant rejects the call. 的错误(对象 TwilioConversationsException)。 或者,如果客户端 A 调用客户端 B,而客户端 B 未连接到 Twilio,则客户端 A 会立即收到错误 code:106, message:Participant is unavailable at the moment.。此时我会重试几次,直到用户连接并响应(接受或拒绝),或者呼叫发起后 30 秒过去。

我正在基于此工作,但在客户端 B 失去互联网连接或应用程序意外关闭后我遇到了问题。重新连接到 Twilio 后,当客户端 B 拒绝呼叫时,客户端 A 收到错误 code:106, message:Participant is unavailable at the moment. 而不是 code:107, message:Participant rejects the call.,欺骗客户端 A 认为客户端 B 与 Twilio 断开连接(当他实际连接时),这会触发新的呼叫尝试。对于我一直在观察的情况,此问题与客户端 B 身份相关联,它以某种方式仍然注册为 unavailable 并且无法正常工作。如果我更改客户端 B 的身份,行为会恢复正常,但这不是我的想法。我的意图是让身份成为我的用户 ID:唯一且固定。 在 iOS 中发生了同样的事情,根据这个线程:

Twilio iOS Video Call: Getting "User is unavailable" error message when user rejects the call

我希望得到一些帮助!此致!

一位同事寻求 Twilio 支持,并被告知:

Hey Deneb,

These workflows have some challenges with the current Conversations API in Programmable Video, and we're working on solving them in an upcoming addition to the product: A new Rooms API. Rooms will allow your users to connect to named Room (a multi-party conference call) by a name that you define, or by its unique ID (RoomSid). Using this API, you won't have to worry about if/when your endpoints are online--you can just have your users connect to the proper Room and they'll be able to share voice and video with one another.

The Rooms API will be rolling out in just a few weeks, and I think it'll be a much better fit for your use case. If you're in need of a solution more urgently, I'd recommend using a third-party notifications product, like Firebase or PubNub, to make sure that both participants are "awake" and connected, then initiating the invite flow.

Let me know if you have any questions on this. Thanks for trying Programmable Video,

Regards, Rob Brazier