问题描述
我们正在使用 Agora SDK 在 Android 中构建调用应用程序。我们检查了这个样本:
https://github.com/AgoraIO/Basic-Video-Call
在我们的应用中,2 个用户可以进行视频通话。我们正在使用此示例:https://github.com/AgoraIO/Basic-Video-Call/tree/master/One-to-One-Video/Agora-Android-Tutorial-Kotlin-1to1
对于群组通话,我们遵循以下示例:https://github.com/AgoraIO/Basic-Video-Call/tree/master/Group-Video/OpenVideoCall-Android
我们正在尝试以这种方式实现群呼:
-
两者都建立连接(使用 https://github.com/AgoraIO/Basic-Video-Call/tree/master/One-to-One-Video/Agora-Android-Tutorial-Kotlin-1to1)
解决方法
对于呼叫邀请方案,您需要利用某种信令解决方案。 Agora.io 提供了 RTM SDK,您可以与 Agora RTC SDK 一起使用。你可以参考 Agora 的指南来了解它的实现方式:https://docs.agora.io/en/Real-time-Messaging/rtm_invite_android?platform=Android
这是您实际创建邀请的方式
void inviteCall(final String peerUid,final String channel) {
// Creates LocalInvitation
LocalInvitation invitation = RtmCallManager.createLocalInvitation(peerUid);
invitation.setContent(channel);
// Sends call invitation
RtmCallManager.sendLocalInvitation(invitation);
}
您还需要使用类似 Android 的 ConnectionService 来实现呼叫通知。以下是来电通知指南:https://docs.agora.io/en/Real-time-Messaging/faq/call_invite_notification