From ac7eb6fbaf55f62abc4194d178a5c4b8387ff135 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Sun, 20 Sep 2015 10:09:55 +0300 Subject: [PATCH] trim spaces for balance dest ids --- build.sh | 2 +- engine/account.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 8e6f3a0b6..b71a8ba77 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #! /usr/bin/env sh -echo "Installing CGRateS..." +echo "Building CGRateS..." go install github.com/cgrates/cgrates/cmd/cgr-engine cr=$? diff --git a/engine/account.go b/engine/account.go index b086b539f..f9d354d27 100644 --- a/engine/account.go +++ b/engine/account.go @@ -188,13 +188,13 @@ func (ub *Account) getBalancesForPrefix(prefix, category string, balances Balanc } b.account = ub if b.DestinationIds != "" && b.DestinationIds != utils.ANY { + balDestIds := strings.Split(b.DestinationIds, utils.INFIELD_SEP) for _, p := range utils.SplitPrefix(prefix, MIN_PREFIX_MATCH) { if x, err := cache2go.Get(utils.DESTINATION_PREFIX + p); err == nil { destIds := x.(map[interface{}]struct{}) for dId, _ := range destIds { - balDestIds := strings.Split(b.DestinationIds, utils.INFIELD_SEP) for _, balDestID := range balDestIds { - if dId == balDestID { + if dId == strings.TrimSpace(balDestID) { b.precision = len(p) usefulBalances = append(usefulBalances, b) break