From ea0f6745d0cac3f26f37875b4a504ce7f4213891 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Tue, 12 Apr 2016 19:36:40 +0300 Subject: [PATCH] derived charging exclude destination feature --- engine/handler_derivedcharging.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/engine/handler_derivedcharging.go b/engine/handler_derivedcharging.go index 52f48eb03..e845ac1dd 100644 --- a/engine/handler_derivedcharging.go +++ b/engine/handler_derivedcharging.go @@ -50,12 +50,10 @@ func DerivedChargersMatchesDest(dcs *utils.DerivedChargers, dest string) bool { for _, p := range utils.SplitPrefix(dest, MIN_PREFIX_MATCH) { if x, err := cache2go.Get(utils.DESTINATION_PREFIX + p); err == nil { destIds := x.(map[interface{}]struct{}) - for value := range dcs.DestinationIDs { - for idId := range destIds { - dId := idId.(string) - if value == dId { - return true - } + for dId := range destIds { + includeDest, found := dcs.DestinationIDs[dId.(string)] + if found { + return includeDest } } }