mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Adding usage conversion back in auth.go
This commit is contained in:
@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package v1
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
@@ -53,6 +54,9 @@ func (self *ApierV1) GetMaxUsage(usageRecord engine.UsageRecord, maxUsage *float
|
||||
if usageRecord.SetupTime == "" {
|
||||
usageRecord.SetupTime = utils.META_NOW
|
||||
}
|
||||
if usageRecord.Usage == "" {
|
||||
usageRecord.Usage = strconv.FormatFloat(self.Config.MaxCallDuration.Seconds(), 'f', -1, 64)
|
||||
}
|
||||
storedCdr, err := usageRecord.AsStoredCdr()
|
||||
if err != nil {
|
||||
return utils.NewErrServerError(err)
|
||||
|
||||
Reference in New Issue
Block a user