get cost call duration fix

This commit is contained in:
Radu Ioan Fericean
2013-10-07 22:28:04 +03:00
parent 88f789cea9
commit c59dc78f01
2 changed files with 6 additions and 2 deletions

View File

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

View File

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