diff --git a/engine/calldesc.go b/engine/calldesc.go index 5580c0687..f4fb5fb30 100644 --- a/engine/calldesc.go +++ b/engine/calldesc.go @@ -168,6 +168,10 @@ func (cd *CallDescriptor) getAccount() (ub *Account, err error) { return cd.account, err } +func (cd *CallDescriptor) ResetAccount() { + cd.account = nil +} + /* Restores the activation periods for the specified prefix from storage. */ diff --git a/sessionmanager/session.go b/sessionmanager/session.go index 09f539db7..8a48b1ad4 100644 --- a/sessionmanager/session.go +++ b/sessionmanager/session.go @@ -86,7 +86,7 @@ func (s *Session) debitLoop(runIdx int) { //engine.Logger.Debug(fmt.Sprintf("NEXTCD: %s", utils.ToJSON(nextCd))) nextCd.DurationIndex += debitPeriod // first presumed duration cc := new(engine.CallCost) - nextCd.account = nil // make sure it is not cached + nextCd.ResetAccount() // make sure it is not cached if err := s.sessionManager.Rater().MaxDebit(nextCd, cc); err != nil { engine.Logger.Err(fmt.Sprintf("Could not complete debit opperation: %v", err)) s.sessionManager.DisconnectSession(s.eventStart, s.connId, SYSTEM_ERROR)