SessionS MinCallDuration implementation, fixes #1016

This commit is contained in:
DanB
2018-03-28 11:24:59 +02:00
parent 72b01dcfc1
commit 33f371b2ff

View File

@@ -706,6 +706,10 @@ func (smg *SMGeneric) GetMaxUsage(gev SMGenericEvent) (maxUsage time.Duration, e
return
}
maxUsage = time.Duration(maxDur)
if maxUsage != time.Duration(-1*time.Second) &&
maxUsage < smg.cgrCfg.SessionSCfg().MinCallDuration {
return 0, errors.New("UNAUTHORIZED_MIN_DURATION")
}
return
}