mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-19 22:28:45 +05:00
New GetCdrID method
This commit is contained in:
committed by
Dan Christian Bogos
parent
ee727e26fb
commit
0235c90f2d
@@ -110,6 +110,15 @@ func (cgrEv *CGREvent) AsDataProvider() (ev MapStorage) {
|
||||
}
|
||||
}
|
||||
|
||||
func (cgrEv *CGREvent) GetCDRUniqueID() string {
|
||||
if chargeId, ok := cgrEv.APIOpts[MetaChargeID]; ok {
|
||||
return IfaceAsString(chargeId)
|
||||
} else if cgrId, ok := cgrEv.Event[CGRID]; ok {
|
||||
return IfaceAsString(cgrId)
|
||||
}
|
||||
return UUIDSha1Prefix()
|
||||
}
|
||||
|
||||
// EventWithFlags is used where flags are needed to mark processing
|
||||
type EventWithFlags struct {
|
||||
Flags []string
|
||||
|
||||
@@ -791,6 +791,7 @@ const (
|
||||
MetaCDR = "*cdr"
|
||||
MetaExporterIDs = "*exporterIDs"
|
||||
MetaExporterID = "*exporterID"
|
||||
MetaChargeID = "*chargeID"
|
||||
MetaAsync = "*async"
|
||||
MetaUsage = "*usage"
|
||||
MetaStartTime = "*startTime"
|
||||
|
||||
Reference in New Issue
Block a user