mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Use UTC everywhere we build cgrid out of setuptime
This commit is contained in:
@@ -309,7 +309,7 @@ func (self *CsvRecordsProcessor) recordToStoredCdr(record []string, cfgIdx int)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
storedCdr.CgrId = utils.Sha1(storedCdr.AccId, storedCdr.SetupTime.String())
|
||||
storedCdr.CgrId = utils.Sha1(storedCdr.AccId, storedCdr.SetupTime.UTC().String())
|
||||
if storedCdr.TOR == utils.DATA && self.duMultiplyFactors[cfgIdx] != 0 {
|
||||
storedCdr.Usage = time.Duration(float64(storedCdr.Usage.Nanoseconds()) * self.duMultiplyFactors[cfgIdx])
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ func (self *FwvRecordsProcessor) recordToStoredCdr(record string, cfgKey string)
|
||||
}
|
||||
}
|
||||
if storedCdr.CgrId == "" && storedCdr.AccId != "" && cfgKey != "*header" {
|
||||
storedCdr.CgrId = utils.Sha1(storedCdr.AccId, storedCdr.SetupTime.String())
|
||||
storedCdr.CgrId = utils.Sha1(storedCdr.AccId, storedCdr.SetupTime.UTC().String())
|
||||
}
|
||||
if storedCdr.TOR == utils.DATA && duMultiplyFactor != 0 {
|
||||
storedCdr.Usage = time.Duration(float64(storedCdr.Usage.Nanoseconds()) * duMultiplyFactor)
|
||||
|
||||
@@ -39,7 +39,7 @@ func NewStoredCdrFromExternalCdr(extCdr *ExternalCdr, timezone string) (*StoredC
|
||||
return nil, err
|
||||
}
|
||||
if len(storedCdr.CgrId) == 0 { // Populate CgrId if not present
|
||||
storedCdr.CgrId = utils.Sha1(storedCdr.AccId, storedCdr.SetupTime.String())
|
||||
storedCdr.CgrId = utils.Sha1(storedCdr.AccId, storedCdr.SetupTime.UTC().String())
|
||||
}
|
||||
if storedCdr.AnswerTime, err = utils.ParseTimeDetectLayout(extCdr.AnswerTime, timezone); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user