mirror of
https://github.com/Monibuca/plugin-gb28181.git
synced 2025-12-24 13:27:57 +08:00
更新通道逻辑优化
This commit is contained in:
@@ -59,6 +59,7 @@ func (d *Device) addChannel(channel *Channel) {
|
||||
func (d *Device) UpdateChannels(list []*Channel) {
|
||||
d.channelMutex.Lock()
|
||||
defer d.channelMutex.Unlock()
|
||||
d.Channels = nil
|
||||
for _, c := range list {
|
||||
c.device = d
|
||||
if c.ParentID != "" {
|
||||
@@ -123,7 +124,6 @@ func (d *Device) CreateMessage(Method sip.Method) (requestMsg *sip.Message) {
|
||||
return
|
||||
}
|
||||
func (d *Device) Query() int {
|
||||
d.Channels = nil
|
||||
requestMsg := d.CreateMessage(sip.MESSAGE)
|
||||
requestMsg.ContentType = "Application/MANSCDP+xml"
|
||||
requestMsg.Body = fmt.Sprintf(`<?xml version="1.0"?>
|
||||
|
||||
Reference in New Issue
Block a user