fix participant APIs when using LocalRouter (#67)

This commit is contained in:
David Zhao
2021-07-22 11:06:23 -07:00
committed by GitHub
parent d7be9096c6
commit 834dce543b
4 changed files with 34 additions and 52 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ func (r *LocalRouter) StartParticipantSignal(roomName string, pi ParticipantInit
}
// index channels by roomName | identity
key := participantKey(roomName, pi.Identity)
key := ParticipantKey(roomName, pi.Identity)
reqChan := r.getOrCreateMessageChannel(r.requestChannels, key)
resChan := r.getOrCreateMessageChannel(r.responseChannels, key)
+2 -2
View File
@@ -139,7 +139,7 @@ func (r *RedisRouter) StartParticipantSignal(roomName string, pi ParticipantInit
// create a new connection id
connectionId = utils.NewGuid("CO_")
pKey := participantKey(roomName, pi.Identity)
pKey := ParticipantKey(roomName, pi.Identity)
// map signal & rtc nodes
if err = r.setParticipantSignalNode(connectionId, r.currentNode.Id); err != nil {
@@ -172,7 +172,7 @@ func (r *RedisRouter) StartParticipantSignal(roomName string, pi ParticipantInit
}
func (r *RedisRouter) CreateRTCSink(roomName, identity string) (MessageSink, error) {
pkey := participantKey(roomName, identity)
pkey := ParticipantKey(roomName, identity)
rtcNode, err := r.getParticipantRTCNode(pkey)
if err != nil {
return nil, err
+1 -1
View File
@@ -22,7 +22,7 @@ func GetAvailableNodes(nodes []*livekit.Node) []*livekit.Node {
}).([]*livekit.Node)
}
func participantKey(roomName, identity string) string {
func ParticipantKey(roomName, identity string) string {
return roomName + "|" + identity
}