diff --git a/client.go b/client.go index 9583638c..84ca17e5 100644 --- a/client.go +++ b/client.go @@ -1382,7 +1382,7 @@ func (c *Client) doSetup( func (c *Client) isChannelPairInUse(channel int) bool { for _, cm := range c.medias { - if cm.tcpChannel == channel || cm.tcpChannel == (channel+1) { + if (cm.tcpChannel+1) == channel || cm.tcpChannel == channel || cm.tcpChannel == (channel+1) { return true } } diff --git a/server_session.go b/server_session.go index 03192f60..07901846 100644 --- a/server_session.go +++ b/server_session.go @@ -1115,7 +1115,7 @@ func (ss *ServerSession) handleRequestInner(sc *ServerConn, req *base.Request) ( func (ss *ServerSession) isChannelPairInUse(channel int) bool { for _, sm := range ss.setuppedMedias { - if sm.tcpChannel == channel || sm.tcpChannel == (channel+1) { + if (sm.tcpChannel+1) == channel || sm.tcpChannel == channel || sm.tcpChannel == (channel+1) { return true } }