Renamed Contex column for Dispatchers.csv to Subsystems

This commit is contained in:
Trial97
2019-02-19 12:31:48 +02:00
committed by Dan Christian Bogos
parent 738b3a8ed3
commit c65fc66407
7 changed files with 28 additions and 22 deletions

View File

@@ -2406,11 +2406,11 @@ func (tps TPDispatchers) AsTPDispatchers() (result []*utils.TPDispatcherProfile)
ID: tp.ID,
}
}
if tp.Contexts != "" {
if tp.Subsystems != "" {
if _, has := contextMap[tenantID]; !has {
contextMap[tenantID] = make(utils.StringMap)
}
contextSplit := strings.Split(tp.Contexts, utils.INFIELD_SEP)
contextSplit := strings.Split(tp.Subsystems, utils.INFIELD_SEP)
for _, context := range contextSplit {
contextMap[tenantID][context] = true
}
@@ -2525,7 +2525,7 @@ func APItoModelTPDispatcher(tpDPP *utils.TPDispatcherProfile) (mdls TPDispatcher
}
filters := strings.Join(tpDPP.FilterIDs, utils.INFIELD_SEP)
context := strings.Join(tpDPP.Subsystems, utils.INFIELD_SEP)
subsystems := strings.Join(tpDPP.Subsystems, utils.INFIELD_SEP)
interval := ""
if tpDPP.ActivationInterval != nil {
@@ -2544,7 +2544,7 @@ func APItoModelTPDispatcher(tpDPP *utils.TPDispatcherProfile) (mdls TPDispatcher
Tpid: tpDPP.TPid,
Tenant: tpDPP.Tenant,
ID: tpDPP.ID,
Contexts: context,
Subsystems: subsystems,
FilterIDs: filters,
ActivationInterval: interval,
Strategy: tpDPP.Strategy,
@@ -2560,7 +2560,7 @@ func APItoModelTPDispatcher(tpDPP *utils.TPDispatcherProfile) (mdls TPDispatcher
Tpid: tpDPP.TPid,
Tenant: tpDPP.Tenant,
ID: tpDPP.ID,
Contexts: context,
Subsystems: subsystems,
FilterIDs: filters,
ActivationInterval: interval,
Strategy: tpDPP.Strategy,

View File

@@ -1807,7 +1807,7 @@ func TestAPItoModelTPDispatcher(t *testing.T) {
Tpid: "TP1",
Tenant: "cgrates.org",
ID: "Dsp",
Contexts: "*any",
Subsystems: "*any",
FilterIDs: "FLTR_ACNT_dan;FLTR_DST_DE",
Strategy: utils.MetaFirst,
ActivationInterval: "2014-07-14T14:35:00Z",

View File

@@ -392,7 +392,7 @@ type TPDispatcher struct {
Tpid string //
Tenant string `index:"0" re:""`
ID string `index:"1" re:""`
Contexts string `index:"2" re:""`
Subsystems string `index:"2" re:""`
FilterIDs string `index:"3" re:""`
ActivationInterval string `index:"4" re:""`
Strategy string `index:"5" re:""`