添加28181 bye接口调用时将流关闭

This commit is contained in:
hongri8488
2022-10-25 13:51:31 +08:00
parent 34f5b7da79
commit 20c0ac52cb

View File

@@ -10,6 +10,7 @@ import (
"sync"
"time"
. "m7s.live/engine/v4"
"github.com/ghettovoice/gosip/sip"
"go.uber.org/zap"
"m7s.live/plugin/gb28181/v4/utils"
@@ -393,6 +394,11 @@ func (channel *Channel) Invite(opt InviteOptions) (code int, err error) {
}
func (channel *Channel) Bye(live bool) int {
d := channel.device
streamPath := fmt.Sprintf("%s/%s", d.ID, channel.DeviceID)
if s := Streams.Get(streamPath); s != nil {
s.Close()
}
if live && channel.LivePublisher != nil {
return channel.LivePublisher.Bye()
}