diff --git a/config/config.go b/config/config.go index f341547ad..5513c68c6 100644 --- a/config/config.go +++ b/config/config.go @@ -516,7 +516,7 @@ func loadConfig(c *conf.ConfigFile) (*CGRConfig, error) { } } if hasOpt = c.HasOption("session_manager", "max_call_duration"); hasOpt { - maxCallDurStr, _ := c.GetString("session_manager", "min_call_duration") + maxCallDurStr, _ := c.GetString("session_manager", "max_call_duration") if cfg.SMMaxCallDuration, err = utils.ParseDurationWithSecs(maxCallDurStr); err != nil { return nil, err } diff --git a/config/config_test.go b/config/config_test.go index 698fdf922..fa37603af 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -248,7 +248,7 @@ func TestConfigFromFile(t *testing.T) { eCfg.SMRater = "test" eCfg.SMRaterReconnects = 99 eCfg.SMDebitInterval = 99 - eCfg.SMMinCallDuration = time.Duration(99) * time.Second + eCfg.SMMinCallDuration = time.Duration(98) * time.Second eCfg.SMMaxCallDuration = time.Duration(99) * time.Second eCfg.FreeswitchServer = "test" eCfg.FreeswitchPass = "test" diff --git a/config/test_data.txt b/config/test_data.txt index 9cd147771..48662cf0d 100644 --- a/config/test_data.txt +++ b/config/test_data.txt @@ -92,7 +92,7 @@ rater = test # Address where to reach the Rater. rater_reconnects = 99 # Number of reconnects to rater before giving up. debit_interval = 99 # Interval to perform debits on. max_call_duration = 99 # Maximum call duration a prepaid call can last -min_call_duration = 99 # Only authorize calls with allowed duration bigger than this +min_call_duration = 98 # Only authorize calls with allowed duration bigger than this [freeswitch] server = test # Adress where to connect to FreeSWITCH socket.