我正在构建一个Android应用程序,我使用LinPhone Lib进行音频/视频并使用VoIP发送消息。
我读了很多博客,最后,我得到了一个使用LinPhone Lib进行音频/视频通话的EasyLinphone GitHub代码。我读了这段代码,因为我还在做RND LinPhone SDK如何工作。
我完美地完成了音频和视频通话功能。现在我陷入困境如何在聊天室发送消息。
下面的代码根据我的RND应该工作,但我正在逐步解决一个小问题。如果有人有任何想法,请帮助我。
public LinphoneChatRoom startSingleMessageTo(PhoneBean bean, String messageString, boolean isVideoCall) {
LinphoneChatRoom chat_room = mLinphoneCore.getChatRoom(bean.getUserName() + "@" + bean.getHost()); //lc is object of LinphoneCore
chat_room.sendMessage(messageString);
return chat_room;
}
下面我需要有关linPhone lib的帮助。
如何开始聊天室?
如何在该chatRoom中发送消息?
LinphoneChatRoom chatRoom = null;
try {
chatRoom = sLinphoneUtils.getLc().getOrCreateChatRoom("sip:"+bean.getUserName()+"@sip.linphone.org");
LinphoneChatMessage msg = chatRoom.createLinphoneChatMessage(messageString);
chatRoom.sendChatMessage(msg);
}
catch (Exception e)
{
e.getMessage();
}