Use UTC everywhere we build cgrid out of setuptime

This commit is contained in:
DanB
2015-09-03 12:30:07 +02:00
parent a1b4c49ed6
commit 7f0925c4e0
3 changed files with 3 additions and 3 deletions

View File

@@ -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])
}

View File

@@ -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)

View File

@@ -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