mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 08:08:45 +05:00
Merge branch 'master' of https://github.com/cgrates/cgrates
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -1066,7 +1067,14 @@ func (self *SQLStorage) GetTpRatingProfiles(tpid, tag string) (map[string]*Ratin
|
||||
rp.DestRatesTimingTag = destrates_timing_tag
|
||||
rp.ActivationTime = activation_time
|
||||
if fallback_subject != "" {
|
||||
rp.FallbackKey = fmt.Sprintf("%s:%s:%s:%s", direction, tenant, tor, fallback_subject)
|
||||
for _, fbs := range strings.Split(fallback_subject, ";") {
|
||||
newKey := fmt.Sprintf("%s:%s:%s:%s", direction, tenant, tor, fbs)
|
||||
var sslice utils.StringSlice = strings.Split(rp.FallbackKey, ";")
|
||||
if !sslice.Contains(newKey) {
|
||||
rp.FallbackKey += newKey + ";"
|
||||
}
|
||||
}
|
||||
rp.FallbackKey = strings.TrimRight(rp.FallbackKey, ";")
|
||||
}
|
||||
}
|
||||
return rpfs, nil
|
||||
|
||||
Reference in New Issue
Block a user