mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
get cost call duration fix
This commit is contained in:
@@ -303,11 +303,12 @@ func (cd *CallDescriptor) GetCost() (*CallCost, error) {
|
||||
}
|
||||
// global rounding
|
||||
cost = utils.Round(cost, roundingDecimals, roundingMethod)
|
||||
subject := strings.Split(matchedSubject, ":")
|
||||
cc := &CallCost{
|
||||
Direction: cd.Direction,
|
||||
TOR: cd.TOR,
|
||||
Tenant: cd.Tenant,
|
||||
Subject: matchedSubject,
|
||||
Subject: subject[len(subject)-1],
|
||||
Account: cd.Account,
|
||||
Destination: destPrefix,
|
||||
Cost: cost,
|
||||
|
||||
@@ -199,7 +199,10 @@ func (self *Mediator) getCostsFromRater(cdr utils.CDR) (*engine.CallCost, error)
|
||||
Account: cdr.GetAccount(),
|
||||
Destination: cdr.GetDestination(),
|
||||
TimeStart: t1,
|
||||
TimeEnd: t1.Add(d)}
|
||||
TimeEnd: t1.Add(d),
|
||||
LoopIndex: 0,
|
||||
}
|
||||
cd.CallDuration = cd.TimeEnd.Sub(cd.TimeStart)
|
||||
if cdr.GetReqType() == utils.PSEUDOPREPAID {
|
||||
err = self.connector.Debit(cd, cc)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user