fix: platform register failed

This commit is contained in:
pggiroro
2025-08-22 15:16:52 +08:00
parent 1a8e2bc816
commit b6ee2843b0
2 changed files with 2 additions and 5 deletions

View File

@@ -435,13 +435,10 @@ func (gb *GB28181Plugin) checkPlatform() {
gb.Error("查询平台失败", "error", err.Error())
return
}
gb.Info("找到启用状态的平台", "count", len(platformModels))
if gb.Platforms != nil && len(gb.Platforms) > 0 {
platformModels = append(platformModels, gb.Platforms...)
}
gb.Info("找到启用状态的平台", "count", len(platformModels))
// 遍历所有平台进行初始化和注册
for _, platformModel := range platformModels {
if platformModel.Enable {

View File

@@ -97,7 +97,7 @@ func NewPlatform(pm *gb28181.PlatformModel, plugin *GB28181Plugin, unRegister bo
p.DialogClient = sipgo.NewDialogClientCache(p.Client, *p.ContactHDR)
p.MaxForwardsHDR = sip.MaxForwardsHeader(70)
p.plugin.platforms.Set(p)
//p.plugin.platforms.Set(p)
p.OnDispose(func() {
if plugin.platforms.RemoveByKey(p.PlatformModel.ServerGBID) {
//for c := range d.channels.Range {