GithubHelp home page GithubHelp logo

shoyu666 / open-im-server-call Goto Github PK

View Code? Open in Web Editor NEW
87.0 2.0 43.0 13.46 MB

Open-IM-Server 音视频通话

License: Apache License 2.0

Makefile 0.94% Go 79.37% Dockerfile 2.58% Shell 6.76% Batchfile 10.35%
video-call open-im-server im openim video real-time realtime webrtc

open-im-server-call's Introduction

Open-IM-Server Call

说明:

由于OpenIMSDK 的视频通话功能是闭源的,阻挡了想了解视频通话功能的伙伴。
通过分析OpenIMSDK后,给出视频通话功能的原理和服务器代码。
客户端的实现,参考livekit。
本功能只用于学习交流。 

官方 Open-IM-SDK-Core (客户端sdk的核心部分) 已经包含了音视频通信部分,
但客户端demo是闭源的,所以客户端可以基于livekit-sdk自行实现视音频部分(参考livekit,livekit都是开源的)
### 功能:
实现 [OpenIMSDK](https://github.com/OpenIMSDK/Open-IM-Server) 的视频通话功能。

### 特点:
跟OpenIMSDK 官方一样基于 开源的视频服务[livekit](https://livekit.io/) 实现。
兼容 OpenIMSDK 官方的demo。


### 原理:
IM只做用户信息,好友管理,消息的透传等。视频通话是通过livekit实现(webrtc)。

步骤
1. A发起视频:A发送SignalReq_Invite 信令(包含房间号,被邀请人)
2. 服务器接受信令,创建livekit的token,将token返回给发起方,同时透传发起方的消息给接受方。
3. 接收方收到OnReceiveNewInvitation回调
4. 接收方接受视频,向服务器发送SignalReq_Accept 信令。
5. 服务器接受信令,创建livekit的token,将token返回给接收方,同时透传接收方的消息给接发送方。
6. 发起方收到OnInviteeAccepted回调。
7. 接收方和发起方通过各自的token进入视频聊天房间(此过程是见livekit/webrtc)


### 使用说明
[直接使用Open-IM-Server + Call 整合好的分支](https://github.com/shoyu666/Open-IM-Server)

##### [安装livekit](https://docs.livekit.io/guides/getting-started/)

linux curl -sSL https://get.livekit.io | bash livekit-server --dev

注意:必须要有https域名和证书



##### 修改配置

rtc: signalTimeout: 35 #livekit的服务地址 liveURL: wss://www.xxxx.xx:7890 #livekit的key(部署livekit时自定义) key: xxx #livekit的secret(部署livekit时自定义) secret: xxx

##### 代码目录
和openim service目录一致
如:cmd\rpc\open_im_real_time_comm

##### 运行
运行 cmd/rpc/open_im_real_time_comm/main.go
运行后会注册服务名为:RealTimeComm 的rpc服务。
修改 OpenIM demo的服务器地址,发起视频通话。


#### 问题记录
##### 问题:missing SignalGetRooms method https://github.com/shoyu666/Open-IM-Server-Call/issues/2#issue-1399210934

解决方案:您可以使用 Open_IM-Server 老的版本

原因:Open_IM-Server 源分支在 9月28号提交的代码,增加了 SignalGetRooms方法 提交记录

目前Open_IM-Server版本 SignalGetRooms 方法实际没有用到,可能后续版本这个方法会被用到。

也可以使用 Open-IM-Server + Call 整合好的分支 https://github.com/shoyu666/Open-IM-Server


![image](https://github.com/shoyu666/Open-IM-Server-Call/blob/7787f14fd1e1c91b488b5e3a83e058a86dd7e4bb/preview.gif)

open-im-server-call's People

Contributors

shoyu666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

open-im-server-call's Issues

# Open_IM/internal/rpc/rtc ../../../internal/rpc/rtc/rtcLiveKit.go:66:36: cannot use rpc (variable of type *rtcLiveKit) as type "Open_IM/pkg/proto/rtc".RtcServiceServer in argument to rtc.RegisterRtcServiceServer: *rtcLiveKit does not implement "Open_IM/pkg/proto/rtc".RtcServiceServer (missing SignalGetRooms method)

Open_IM/internal/rpc/rtc

../../../internal/rpc/rtc/rtcLiveKit.go:66:36: cannot use rpc (variable of type *rtcLiveKit) as type "Open_IM/pkg/proto/rtc".RtcServiceServer in argument to rtc.RegisterRtcServiceServer:
*rtcLiveKit does not implement "Open_IM/pkg/proto/rtc".RtcServiceServer (missing SignalGetRooms method)

忙线处理有思路吗?

我在客户端实现忙线处理,但是由于网络原因发现存在很大问题, 看来只能在服务器端实现通话中缓存,是在livekit 缓存好还是在openim 端

你好,我这边配置出现无法链接的情况,麻烦帮我看看可以么

1.可以收到 邀请的signaling,但是接收方拒绝或者同意的signaling都收不到。

var res = await OpenIM.iMManager.signalingManager.signalingReject(
info: SignalingInfo(
opUserID: OpenIM.iMManager.uid,
invitation: InvitationInfo(
inviterUserID: userId.value, //rec
inviteeUserIDList: [OpenIM.iMManager.uid],
mediaType: '${mediaType.value}',
sessionType: 1)));
print("call res :${res}");

这个是拒绝的代码 userId.value是邀请者的id
[signaling response opUserID:"398168" invitation:<inviterUserID:"963992" inviteeUserIDList:"398168" roomID:"1669353008583241271" timeout:3600 mediaType:"video" sessionType:1 initiateTime:1669353005 > participant:<groupInfo:<> groupMemberInfo:<> userInfo:<userID:"398168" nickname:"\346\226\260\346\211\213\345\256\2351" faceURL:"https://cos-13xD406-BB1C-4497-B9A0-4EEBC9B5E701-51222-0000051110DE3797.jpg" gender:2 > > opUserPlatformID:1 ]
这个是963992收到的信令的打印, 发起通话的是963992,拒绝通话的是398168。
// 邀请者收到:被邀请者拒绝音视频通话
onInviteeRejected: (info) {
print("onInviteeRejected-1t");
print("${info.toJson()}");
signalingInfoReject(info);
},
这里在963992的im_controller.dar中的回调没有调用,咋办呢,不通哦

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.