我正在构建一个Android应用程序,其中我使用LinPhone Lib进行音频/视频并使用VoIP发送消息。
我读了很多博客,最后,我得到了一个EasyLinphone GitHub代码,该代码使用LinPhone Lib进行音频/视频通话。我正在读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();
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句