mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 15:48:44 +05:00
unig time.Duration in LcrSupplierCost
This commit is contained in:
@@ -717,7 +717,7 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) {
|
||||
lcrCost.SupplierCosts = append(lcrCost.SupplierCosts, &LCRSupplierCost{
|
||||
Supplier: supplier,
|
||||
Cost: cc.Cost,
|
||||
Duration: cc.GetDuration().String(),
|
||||
Duration: cc.GetDuration(),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -798,7 +798,7 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) {
|
||||
lcrCost.SupplierCosts = append(lcrCost.SupplierCosts, &LCRSupplierCost{
|
||||
Supplier: supplier,
|
||||
Cost: cc.Cost,
|
||||
Duration: cc.GetDuration().String(),
|
||||
Duration: cc.GetDuration(),
|
||||
QOS: map[string]float64{
|
||||
"ASR": asr,
|
||||
"ACD": acd,
|
||||
|
||||
@@ -58,14 +58,14 @@ type LCREntry struct {
|
||||
}
|
||||
|
||||
type LCRCost struct {
|
||||
SupplierCosts []*LCRSupplierCost
|
||||
Entry *LCREntry
|
||||
SupplierCosts []*LCRSupplierCost
|
||||
}
|
||||
|
||||
type LCRSupplierCost struct {
|
||||
Supplier string
|
||||
Cost float64
|
||||
Duration string
|
||||
Duration time.Duration
|
||||
Error error
|
||||
QOS map[string]float64
|
||||
qosSortParams []string
|
||||
|
||||
@@ -94,7 +94,7 @@ func TestLcrGetQosLimitsAll(t *testing.T) {
|
||||
}
|
||||
minAsr, maxAsr, minAcd, maxAcd := le.GetQOSLimits()
|
||||
if minAsr != 1.2 || maxAsr != 2.3 ||
|
||||
minAcd != time.Duration(45)*time.Second || maxAcd != time.Duration(67)*time.Minute {
|
||||
minAcd != 45*time.Second || maxAcd != 67*time.Minute {
|
||||
t.Error("Wrong qos limits parsed: ", minAsr, maxAsr, minAcd, maxAcd)
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ func TestLcrGetQosLimitsSome(t *testing.T) {
|
||||
}
|
||||
minAsr, maxAsr, minAcd, maxAcd := le.GetQOSLimits()
|
||||
if minAsr != 1.2 || maxAsr != -1 ||
|
||||
minAcd != -1 || maxAcd != time.Duration(67)*time.Minute {
|
||||
minAcd != -1 || maxAcd != 67*time.Minute {
|
||||
t.Error("Wrong qos limits parsed: ", minAsr, maxAsr, minAcd, maxAcd)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,8 +295,8 @@ func TestGetLCRStatic(t *testing.T) {
|
||||
eLcr := &LCRCost{
|
||||
Entry: &LCREntry{DestinationId: utils.ANY, RPCategory: "call", Strategy: LCR_STRATEGY_STATIC, StrategyParams: "dan;rif", Weight: 10.0},
|
||||
SupplierCosts: []*LCRSupplierCost{
|
||||
&LCRSupplierCost{Supplier: "*out:cgrates.org:call:dan", Cost: 0.6, Duration: "60s"},
|
||||
&LCRSupplierCost{Supplier: "*out:cgrates.org:call:rif", Cost: 1.2, Duration: "60s"},
|
||||
&LCRSupplierCost{Supplier: "*out:cgrates.org:call:dan", Cost: 0.6, Duration: 60 * time.Second},
|
||||
&LCRSupplierCost{Supplier: "*out:cgrates.org:call:rif", Cost: 1.2, Duration: 60 * time.Second},
|
||||
},
|
||||
}
|
||||
var lcr LCRCost
|
||||
|
||||
Reference in New Issue
Block a user