integrate IPs with SessionS

This commit is contained in:
ionutboangiu
2025-12-08 12:36:32 +02:00
committed by Dan Christian Bogos
parent 17f11d060b
commit 897d6f0da1
15 changed files with 413 additions and 160 deletions

View File

@@ -183,6 +183,16 @@ func (ip *AllocatedIP) AsNavigableMap() map[string]*utils.DataNode {
}
}
// Digest returns a string representation of the allocated IP for digest replies.
func (ip *AllocatedIP) Digest() string {
return utils.ConcatenatedKey(
ip.ProfileID,
ip.PoolID,
ip.Message,
ip.Address.String(),
)
}
// IPAllocations represents IP allocations with usage tracking and TTL management.
type IPAllocations struct {
Tenant string

View File

@@ -2212,6 +2212,7 @@ type mongoStoredSession struct {
NodeID string
CGRID string
Tenant string
IPAllocID string
ResourceID string
ClientConnID string
EventStart MapEvent
@@ -2238,6 +2239,7 @@ func (ms *MongoStorage) SetBackupSessionsDrv(nodeID, tnt string, storedSessions
NodeID: nodeID,
CGRID: sess.CGRID,
Tenant: sess.Tenant,
IPAllocID: sess.IPAllocID,
ResourceID: sess.ResourceID,
ClientConnID: sess.ClientConnID,
EventStart: sess.EventStart,
@@ -2286,6 +2288,7 @@ func (ms *MongoStorage) GetSessionsBackupDrv(nodeID, tnt string) ([]*StoredSessi
oneStSession := &StoredSession{
CGRID: result.CGRID,
Tenant: result.Tenant,
IPAllocID: result.IPAllocID,
ResourceID: result.ResourceID,
ClientConnID: result.ClientConnID,
EventStart: result.EventStart,

View File

@@ -38,6 +38,7 @@ type StoredSRun struct {
type StoredSession struct {
CGRID string
Tenant string
IPAllocID string
ResourceID string
ClientConnID string // connection ID towards the client so we can recover from passive
EventStart MapEvent // Event which started the session