fix: gb28181 update source ip,port when recover device

This commit is contained in:
pg
2025-03-27 18:15:21 +08:00
committed by pggiroro
parent 01d41a3426
commit 470cab36da
+4 -1
View File
@@ -44,7 +44,7 @@ type GB28181Plugin struct {
m7s.Plugin
AutoInvite bool `default:"true" desc:"自动邀请"`
Serial string `default:"34020000002000000001" desc:"sip 服务 id"` //sip 服务器 id, 默认 34020000002000000001
Realm string `default:"3402000000" desc:"sip 服务域"` //sip 服务器域,默认 3402000000
Realm string `default:"3402000000" desc:"sip 服务域"` //sip 服务器域,默认 3402000000
Username string
Password string
Sip SipConfig
@@ -657,6 +657,9 @@ func (gb *GB28181Plugin) RecoverDevice(d *Device, req *sip.Request) {
d.UpdateTime = time.Now()
d.RegisterTime = time.Now()
d.Online = true
d.IP = hostname
d.Port = port
d.HostAddress = hostname + ":" + portStr
if gb.DB != nil {
var existing Device