mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 07:08:45 +05:00
Update MaxUsage with value from config in case Usage isn't presented in event
This commit is contained in:
committed by
Dan Christian Bogos
parent
1645275098
commit
c93282a165
@@ -1315,12 +1315,13 @@ func (sS *SessionS) initSessionDebitLoops(s *Session) {
|
||||
func (sS *SessionS) authSession(tnt string, evStart *engine.SafEvent) (maxUsage time.Duration, err error) {
|
||||
cgrID := GetSetCGRID(evStart)
|
||||
var eventUsage time.Duration
|
||||
eventUsage, err = evStart.GetDuration(utils.Usage)
|
||||
if err != nil {
|
||||
|
||||
if eventUsage, err = evStart.GetDuration(utils.Usage); err != nil {
|
||||
if err != utils.ErrNotFound {
|
||||
return
|
||||
}
|
||||
evStart.Set(utils.Usage, sS.cgrCfg.SessionSCfg().MaxCallDuration) // will be used in CD
|
||||
eventUsage = sS.cgrCfg.SessionSCfg().MaxCallDuration
|
||||
err = nil
|
||||
}
|
||||
s := &Session{
|
||||
|
||||
Reference in New Issue
Block a user