tests passing on get max session time

This commit is contained in:
Radu Ioan Fericean
2013-10-04 16:18:28 +03:00
parent c889eafb20
commit 7632a8f14e
11 changed files with 72 additions and 64 deletions

View File

@@ -307,7 +307,7 @@ func (sm *FSSessionManager) LoopAction(s *Session, cd *engine.CallDescriptor, in
s.sessionManager.DisconnectSession(s, SYSTEM_ERROR)
}
engine.Logger.Debug(fmt.Sprintf("Result of MaxDebit call: %v", cc))
if cc.GetTotalDuration() == 0 || err != nil {
if cc.GetDuration() == 0 || err != nil {
engine.Logger.Info(fmt.Sprintf("No credit left: Disconnect %v", s))
sm.DisconnectSession(s, INSUFFICIENT_FUNDS)
return

View File

@@ -87,7 +87,7 @@ func (s *Session) startDebitLoop() {
}
nextCd.TimeEnd = nextCd.TimeStart.Add(s.sessionManager.GetDebitPeriod())
cc := s.sessionManager.LoopAction(s, &nextCd, index)
time.Sleep(cc.GetTotalDuration())
time.Sleep(cc.GetDuration())
index++
}
}