mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
integrate IPs with SessionS
This commit is contained in:
committed by
Dan Christian Bogos
parent
17f11d060b
commit
897d6f0da1
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user