diff --git a/.travis.yml b/.travis.yml index 7189bb09e..404a07a24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: go go: - - 1.4 - 1.5 script: $TRAVIS_BUILD_DIR/test.sh diff --git a/apier/v1/tpaliases.go b/apier/v1/tpaliases.go index d62f5cc42..cdb4b9296 100644 --- a/apier/v1/tpaliases.go +++ b/apier/v1/tpaliases.go @@ -72,7 +72,7 @@ func (self *ApierV1) GetTPAliasIds(attrs AttrGetTPAliasIds, reply *[]string) err if missing := utils.MissingStructFields(&attrs, []string{"TPid"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } - if ids, err := self.StorDb.GetTpTableIds(attrs.TPid, utils.TBL_TP_ALIASES, utils.TPDistinctIds{"`direction`", "`tenant`", "`category`", "`account`", "`subject`", "`group`"}, nil, &attrs.Paginator); err != nil { + if ids, err := self.StorDb.GetTpTableIds(attrs.TPid, utils.TBL_TP_ALIASES, utils.TPDistinctIds{"direction", "tenant", "category", "account", "subject", "context"}, nil, &attrs.Paginator); err != nil { return utils.NewErrServerError(err) } else if ids == nil { return utils.ErrNotFound diff --git a/apier/v1/tpusers.go b/apier/v1/tpusers.go index d150a04ea..79d9ea2d2 100644 --- a/apier/v1/tpusers.go +++ b/apier/v1/tpusers.go @@ -47,7 +47,8 @@ func (self *ApierV1) GetTPUser(attr AttrGetTPUser, reply *utils.TPUsers) error { return utils.NewErrMandatoryIeMissing(missing...) } usr := &engine.TpUser{ - Tpid: attr.TPid, + Tpid: attr.TPid, + Masked: true, } usr.SetId(attr.UserId) if tms, err := self.StorDb.GetTpUsers(usr); err != nil { diff --git a/data/storage/mysql/create_tariffplan_tables.sql b/data/storage/mysql/create_tariffplan_tables.sql index d03242600..786fc2ec3 100644 --- a/data/storage/mysql/create_tariffplan_tables.sql +++ b/data/storage/mysql/create_tariffplan_tables.sql @@ -197,20 +197,21 @@ CREATE TABLE `tp_action_triggers` ( `tpid` varchar(64) NOT NULL, `tag` varchar(64) NOT NULL, `unique_id` varchar(64) NOT NULL, - `balance_tag` varchar(64) NOT NULL, - `balance_type` varchar(24) NOT NULL, - `balance_direction` varchar(8) NOT NULL, `threshold_type` char(12) NOT NULL, `threshold_value` DECIMAL(20,4) NOT NULL, `recurrent` BOOLEAN NOT NULL, `min_sleep` varchar(16) NOT NULL, + `balance_tag` varchar(64) NOT NULL, + `balance_type` varchar(24) NOT NULL, + `balance_direction` varchar(8) NOT NULL, + `balance_category` varchar(32) NOT NULL, `balance_destination_tags` varchar(64) NOT NULL, - `balance_weight` DECIMAL(8,2) NOT NULL, + `balance_rating_subject` varchar(64) NOT NULL, + `balance_shared_group` varchar(64) NOT NULL, `balance_expiry_time` varchar(24) NOT NULL, `balance_timing_tags` varchar(128) NOT NULL, - `balance_rating_subject` varchar(64) NOT NULL, - `balance_category` varchar(32) NOT NULL, - `balance_shared_group` varchar(64) NOT NULL, + `balance_weight` DECIMAL(8,2) NOT NULL, + `balance_disabled` BOOL NOT NULL, `min_queued_items` int(11) NOT NULL, `actions_tag` varchar(64) NOT NULL, `weight` DECIMAL(8,2) NOT NULL, diff --git a/data/storage/postgres/create_tariffplan_tables.sql b/data/storage/postgres/create_tariffplan_tables.sql index 06cfbb9f0..f530064a0 100644 --- a/data/storage/postgres/create_tariffplan_tables.sql +++ b/data/storage/postgres/create_tariffplan_tables.sql @@ -192,20 +192,21 @@ CREATE TABLE tp_action_triggers ( tpid VARCHAR(64) NOT NULL, tag VARCHAR(64) NOT NULL, unique_id VARCHAR(64) NOT NULL, - balance_tag VARCHAR(64) NOT NULL, - balance_type VARCHAR(24) NOT NULL, - balance_direction VARCHAR(8) NOT NULL, threshold_type char(12) NOT NULL, threshold_value NUMERIC(20,4) NOT NULL, recurrent BOOLEAN NOT NULL, min_sleep VARCHAR(16) NOT NULL, + balance_tag VARCHAR(64) NOT NULL, + balance_type VARCHAR(24) NOT NULL, + balance_direction VARCHAR(8) NOT NULL, + balance_category VARCHAR(32) NOT NULL, balance_destination_tags VARCHAR(64) NOT NULL, - balance_weight NUMERIC(8,2) NOT NULL, + balance_rating_subject VARCHAR(64) NOT NULL, + balance_shared_group VARCHAR(64) NOT NULL, balance_expiry_time VARCHAR(24) NOT NULL, balance_timing_tags VARCHAR(128) NOT NULL, - balance_rating_subject VARCHAR(64) NOT NULL, - balance_category VARCHAR(32) NOT NULL, - balance_shared_group VARCHAR(64) NOT NULL, + balance_weight NUMERIC(8,2) NOT NULL, + balance_disabled BOOL NOT NULL, min_queued_items INTEGER NOT NULL, actions_tag VARCHAR(64) NOT NULL, weight NUMERIC(8,2) NOT NULL, diff --git a/data/tariffplans/cdrstats/ActionTriggers.csv b/data/tariffplans/cdrstats/ActionTriggers.csv index 77b3fbd10..5839ff3e8 100644 --- a/data/tariffplans/cdrstats/ActionTriggers.csv +++ b/data/tariffplans/cdrstats/ActionTriggers.csv @@ -1,6 +1,6 @@ -#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],BalanceTag[6],BalanceType[7],BalanceDirection[8],BalanceCategory[9],BalanceDestinationTag[10],BalanceRatingSubject[11],BalanceSharedGroup[12],BalanceExpiryTime[13],BalanceTimingTags[14],BalanceWeight[15],StatsMinQueuedItems[16],ActionsTag[17],Weight[18] -CDRST3_WARN_ASR,,*min_asr,45,true,1h,,,,,,,,,,,3,CDRST_LOG,10 -CDRST3_WARN_ACD,,*min_acd,10,true,1h,,,,,,,,,,,5,CDRST_LOG,10 -CDRST3_WARN_ACC,,*max_acc,10,true,10m,,,,,,,,,,,5,CDRST_LOG,10 -CDRST4_WARN_ASR,,*min_asr,30,true,0,,,,,,,,,,,5,CDRST_LOG,10 -CDRST4_WARN_ACD,,*min_acd,3,true,0,,,,,,,,,,,2,CDRST_LOG,10 +#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],BalanceTag[6],BalanceType[7],BalanceDirection[8],BalanceCategory[9],BalanceDestinationTag[10],BalanceRatingSubject[11],BalanceSharedGroup[12],BalanceExpiryTime[13],BalanceTimingTags[14],BalanceWeight[15],BalanceDisabled[16],StatsMinQueuedItems[17],ActionsTag[18],Weight[19] +CDRST3_WARN_ASR,,*min_asr,45,true,1h,,,,,,,,,,,,3,CDRST_LOG,10 +CDRST3_WARN_ACD,,*min_acd,10,true,1h,,,,,,,,,,,,5,CDRST_LOG,10 +CDRST3_WARN_ACC,,*max_acc,10,true,10m,,,,,,,,,,,,5,CDRST_LOG,10 +CDRST4_WARN_ASR,,*min_asr,30,true,0,,,,,,,,,,,,5,CDRST_LOG,10 +CDRST4_WARN_ACD,,*min_acd,3,true,0,,,,,,,,,,,,2,CDRST_LOG,10 diff --git a/data/tariffplans/prepaid1centpsec/ActionTriggers.csv b/data/tariffplans/prepaid1centpsec/ActionTriggers.csv index 5878093c5..75c532d48 100644 --- a/data/tariffplans/prepaid1centpsec/ActionTriggers.csv +++ b/data/tariffplans/prepaid1centpsec/ActionTriggers.csv @@ -1,9 +1,9 @@ -#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],BalanceTag[6],BalanceType[7],BalanceDirection[8],BalanceCategory[9],BalanceDestinationTag[10],BalanceRatingSubject[11],BalanceSharedGroup[12],BalanceExpiryTime[13],BalanceTimingTags[14],BalanceWeight[15],StatsMinQueuedItems[16],ActionsTag[17],Weight[18] -STANDARD_TRIGGERS,,*min_balance,2,false,0,,*monetary,*out,,,,,,,,,LOG_BALANCE,10 -STANDARD_TRIGGERS,,*max_balance,20,false,0,,*monetary,*out,,,,,,,,,LOG_BALANCE,10 -STANDARD_TRIGGERS,,*max_counter,15,false,0,,*monetary,*out,,FS_USERS,,,,,,,LOG_BALANCE,10 -CDRST1_WARN_ASR,,*min_asr,45,true,1h,,,,,,,,,,,3,CDRST_WARN_HTTP,10 -CDRST1_WARN_ACD,,*min_acd,10,true,1h,,,,,,,,,,,5,CDRST_WARN_HTTP,10 -CDRST1_WARN_ACC,,*max_acc,10,true,10m,,,,,,,,,,,5,CDRST_WARN_HTTP,10 -CDRST2_WARN_ASR,,*min_asr,30,true,0,,,,,,,,,,,5,CDRST_WARN_HTTP,10 -CDRST2_WARN_ACD,,*min_acd,3,true,0,,,,,,,,,,,2,CDRST_LOG,10 +#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],BalanceTag[6],BalanceType[7],BalanceDirection[8],BalanceCategory[9],BalanceDestinationTag[10],BalanceRatingSubject[11],BalanceSharedGroup[12],BalanceExpiryTime[13],BalanceTimingTags[14],BalanceWeight[15],BalanceDisabled[16],StatsMinQueuedItems[17],ActionsTag[18],Weight[19] +STANDARD_TRIGGERS,,*min_balance,2,false,0,,*monetary,*out,,,,,,,,,,LOG_BALANCE,10 +STANDARD_TRIGGERS,,*max_balance,20,false,0,,*monetary,*out,,,,,,,,,,LOG_BALANCE,10 +STANDARD_TRIGGERS,,*max_counter,15,false,0,,*monetary,*out,,FS_USERS,,,,,,,,LOG_BALANCE,10 +CDRST1_WARN_ASR,,*min_asr,45,true,1h,,,,,,,,,,,,3,CDRST_WARN_HTTP,10 +CDRST1_WARN_ACD,,*min_acd,10,true,1h,,,,,,,,,,,,5,CDRST_WARN_HTTP,10 +CDRST1_WARN_ACC,,*max_acc,10,true,10m,,,,,,,,,,,,5,CDRST_WARN_HTTP,10 +CDRST2_WARN_ASR,,*min_asr,30,true,0,,,,,,,,,,,,5,CDRST_WARN_HTTP,10 +CDRST2_WARN_ACD,,*min_acd,3,true,0,,,,,,,,,,,,2,CDRST_LOG,10 diff --git a/data/tariffplans/tutorial/ActionTriggers.csv b/data/tariffplans/tutorial/ActionTriggers.csv index d3d01c319..e9d756396 100644 --- a/data/tariffplans/tutorial/ActionTriggers.csv +++ b/data/tariffplans/tutorial/ActionTriggers.csv @@ -1,12 +1,12 @@ -#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],BalanceTag[6],BalanceType[7],BalanceDirection[8],BalanceCategory[9],BalanceDestinationId[10],BalanceRatingSubject[11],BalanceSharedGroup[12],BalanceExpiryTime[13],BalanceTimingIds[14],BalanceWeight[15],StatsMinQueuedItems[16],ActionsId[17],Weight[18] -STANDARD_TRIGGERS,,*min_balance,2,false,0,,*monetary,*out,,,,,,,,,LOG_WARNING,10 -STANDARD_TRIGGERS,,*max_counter,5,false,0,,*monetary,*out,,FS_USERS,,,,,,,LOG_WARNING,10 -STANDARD_TRIGGERS,,*max_balance,20,false,0,,*monetary,*out,,,,,,,,,LOG_WARNING,10 -STANDARD_TRIGGERS,,*max_balance,100,false,0,,*monetary,*out,,,,,,,,,DISABLE_AND_LOG,10 -CDRST1_WARN,,*min_asr,45,true,1m,,,,,,,,,,,3,LOG_WARNING,10 -CDRST1_WARN,,*min_acd,10,true,1m,,,,,,,,,,,5,LOG_WARNING,10 -CDRST1_WARN,,*max_acc,10,true,1m,,,,,,,,,,,5,LOG_WARNING,10 -CDRST1001_WARN,,*min_asr,65,true,1m,,,,,,,,,,,3,LOG_WARNING,10 -CDRST1001_WARN,,*min_acd,10,true,1m,,,,,,,,,,,5,LOG_WARNING,10 -CDRST1001_WARN,,*max_acc,5,true,1m,,,,,,,,,,,5,LOG_WARNING,10 -CDRST3_WARN,,*min_acd,60,false,1m,,,,,,,,,,,5,LOG_WARNING,10 +#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],BalanceTag[6],BalanceType[7],BalanceDirection[8],BalanceCategory[9],BalanceDestinationId[10],BalanceRatingSubject[11],BalanceSharedGroup[12],BalanceExpiryTime[13],BalanceTimingIds[14],BalanceWeight[15],BalanceDisabled[16],StatsMinQueuedItems[17],ActionsId[18],Weight[19] +STANDARD_TRIGGERS,,*min_balance,2,false,0,,*monetary,*out,,,,,,,,,,LOG_WARNING,10 +STANDARD_TRIGGERS,,*max_counter,5,false,0,,*monetary,*out,,FS_USERS,,,,,,,,LOG_WARNING,10 +STANDARD_TRIGGERS,,*max_balance,20,false,0,,*monetary,*out,,,,,,,,,,LOG_WARNING,10 +STANDARD_TRIGGERS,,*max_balance,100,false,0,,*monetary,*out,,,,,,,,,,DISABLE_AND_LOG,10 +CDRST1_WARN,,*min_asr,45,true,1m,,,,,,,,,,,,3,LOG_WARNING,10 +CDRST1_WARN,,*min_acd,10,true,1m,,,,,,,,,,,,5,LOG_WARNING,10 +CDRST1_WARN,,*max_acc,10,true,1m,,,,,,,,,,,,5,LOG_WARNING,10 +CDRST1001_WARN,,*min_asr,65,true,1m,,,,,,,,,,,,3,LOG_WARNING,10 +CDRST1001_WARN,,*min_acd,10,true,1m,,,,,,,,,,,,5,LOG_WARNING,10 +CDRST1001_WARN,,*max_acc,5,true,1m,,,,,,,,,,,,5,LOG_WARNING,10 +CDRST3_WARN,,*min_acd,60,false,1m,,,,,,,,,,,,5,LOG_WARNING,10 diff --git a/engine/action_trigger.go b/engine/action_trigger.go index c5b22ba0a..81f11066d 100644 --- a/engine/action_trigger.go +++ b/engine/action_trigger.go @@ -46,6 +46,7 @@ type ActionTrigger struct { BalanceRatingSubject string // filter for balance BalanceCategory string // filter for balance BalanceSharedGroup string // filter for balance + BalanceDisabled bool // filter for balance Weight float64 ActionsId string MinQueuedItems int // Trigger actions only if this number is hit (stats only) @@ -111,7 +112,7 @@ func (at *ActionTrigger) Match(a *Action) bool { } id := a.BalanceType == "" || at.BalanceType == a.BalanceType direction := a.Direction == "" || at.BalanceDirection == a.Direction - thresholdType, thresholdValue, destinationId, weight, ratingSubject, category, sharedGroup := true, true, true, true, true, true, true + thresholdType, thresholdValue, destinationId, weight, ratingSubject, category, sharedGroup, disabled := true, true, true, true, true, true, true, true if a.ExtraParameters != "" { t := struct { ThresholdType string @@ -121,6 +122,7 @@ func (at *ActionTrigger) Match(a *Action) bool { BalanceRatingSubject string BalanceCategory string BalanceSharedGroup string + BalanceDisabled bool }{} json.Unmarshal([]byte(a.ExtraParameters), &t) thresholdType = t.ThresholdType == "" || at.ThresholdType == t.ThresholdType @@ -130,8 +132,9 @@ func (at *ActionTrigger) Match(a *Action) bool { ratingSubject = t.BalanceRatingSubject == "" || at.BalanceRatingSubject == t.BalanceRatingSubject category = t.BalanceCategory == "" || at.BalanceCategory == t.BalanceCategory sharedGroup = t.BalanceSharedGroup == "" || at.BalanceSharedGroup == t.BalanceSharedGroup + disabled = at.BalanceDisabled == t.BalanceDisabled } - return id && direction && thresholdType && thresholdValue && destinationId && weight && ratingSubject && category && sharedGroup + return id && direction && thresholdType && thresholdValue && destinationId && weight && ratingSubject && category && sharedGroup && disabled } func (at *ActionTrigger) sortDestinationIds() string { diff --git a/engine/loader_csv_test.go b/engine/loader_csv_test.go index 8c8ae09f2..14f242899 100644 --- a/engine/loader_csv_test.go +++ b/engine/loader_csv_test.go @@ -178,16 +178,16 @@ POST_AT,NEG,*asap,10 ` actionTriggers = ` -STANDARD_TRIGGER,st0,*min_counter,10,false,0,,*voice,*out,,GERMANY_O2,,,,,,,SOME_1,10 -STANDARD_TRIGGER,st1,*max_balance,200,false,0,,*voice,*out,,GERMANY,,,,,,,SOME_2,10 -STANDARD_TRIGGERS,,*min_balance,2,false,0,,*monetary,*out,,,,,,,,,LOG_WARNING,10 -STANDARD_TRIGGERS,,*max_balance,20,false,0,,*monetary,*out,,,,,,,,,LOG_WARNING,10 -STANDARD_TRIGGERS,,*max_counter,5,false,0,,*monetary,*out,,FS_USERS,,,,,,,LOG_WARNING,10 -CDRST1_WARN_ASR,,*min_asr,45,true,1h,,,,,,,,,,,3,CDRST_WARN_HTTP,10 -CDRST1_WARN_ACD,,*min_acd,10,true,1h,,,,,,,,,,,5,CDRST_WARN_HTTP,10 -CDRST1_WARN_ACC,,*max_acc,10,true,10m,,,,,,,,,,,5,CDRST_WARN_HTTP,10 -CDRST2_WARN_ASR,,*min_asr,30,true,0,,,,,,,,,,,5,CDRST_WARN_HTTP,10 -CDRST2_WARN_ACD,,*min_acd,3,true,0,,,,,,,,,,,5,CDRST_WARN_HTTP,10 +STANDARD_TRIGGER,st0,*min_counter,10,false,0,,*voice,*out,,GERMANY_O2,,,,,,,,SOME_1,10 +STANDARD_TRIGGER,st1,*max_balance,200,false,0,,*voice,*out,,GERMANY,,,,,,,,SOME_2,10 +STANDARD_TRIGGERS,,*min_balance,2,false,0,,*monetary,*out,,,,,,,,,,LOG_WARNING,10 +STANDARD_TRIGGERS,,*max_balance,20,false,0,,*monetary,*out,,,,,,,,,,LOG_WARNING,10 +STANDARD_TRIGGERS,,*max_counter,5,false,0,,*monetary,*out,,FS_USERS,,,,,,,,LOG_WARNING,10 +CDRST1_WARN_ASR,,*min_asr,45,true,1h,,,,,,,,,,,,3,CDRST_WARN_HTTP,10 +CDRST1_WARN_ACD,,*min_acd,10,true,1h,,,,,,,,,,,,5,CDRST_WARN_HTTP,10 +CDRST1_WARN_ACC,,*max_acc,10,true,10m,,,,,,,,,,,,5,CDRST_WARN_HTTP,10 +CDRST2_WARN_ASR,,*min_asr,30,true,0,,,,,,,,,,,,5,CDRST_WARN_HTTP,10 +CDRST2_WARN_ACD,,*min_acd,3,true,0,,,,,,,,,,,,5,CDRST_WARN_HTTP,10 ` accountActions = ` vdf,minitsboy,*out,MORE_MINUTES,STANDARD_TRIGGER,, diff --git a/engine/model_converters.go b/engine/model_converters.go index c720e1fc9..6035328f6 100644 --- a/engine/model_converters.go +++ b/engine/model_converters.go @@ -231,6 +231,7 @@ func APItoModelActionTrigger(ats *utils.TPActionTriggers) (result []TpActionTrig BalanceRatingSubject: at.BalanceRatingSubject, BalanceCategory: at.BalanceCategory, BalanceSharedGroup: at.BalanceSharedGroup, + BalanceDisabled: at.BalanceDisabled, MinQueuedItems: at.MinQueuedItems, ActionsTag: at.ActionsId, Weight: at.Weight, diff --git a/engine/model_helpers.go b/engine/model_helpers.go index c6bce8970..ae28cb119 100644 --- a/engine/model_helpers.go +++ b/engine/model_helpers.go @@ -436,6 +436,7 @@ func (tps TpActionTriggers) GetActionTriggers() (map[string][]*utils.TPActionTri BalanceRatingSubject: tpAt.BalanceRatingSubject, BalanceCategory: tpAt.BalanceCategory, BalanceSharedGroup: tpAt.BalanceSharedGroup, + BalanceDisabled: tpAt.BalanceDisabled, Weight: tpAt.Weight, ActionsId: tpAt.ActionsTag, MinQueuedItems: tpAt.MinQueuedItems, diff --git a/engine/model_helpers_test.go b/engine/model_helpers_test.go index c2becfef6..62d50ad80 100644 --- a/engine/model_helpers_test.go +++ b/engine/model_helpers_test.go @@ -561,6 +561,7 @@ func TestTPActionPlanAsExportSlice(t *testing.T) { BalanceRatingSubject: "special1", BalanceCategory: "call", BalanceSharedGroup: "SHARED_1", + BalanceDisabled: false, MinQueuedItems: 0, ActionsId: "LOG_WARNING", Weight: 10}, @@ -579,14 +580,15 @@ func TestTPActionPlanAsExportSlice(t *testing.T) { BalanceRatingSubject: "special1", BalanceCategory: "call", BalanceSharedGroup: "SHARED_1", + BalanceDisabled: false, MinQueuedItems: 0, ActionsId: "LOG_WARNING", Weight: 10}, }, } expectedSlc := [][]string{ - []string{"STANDARD_TRIGGERS", "", "*min_balance", "2", "false", "0", "b1", "*monetary", "*out", "call", "", "special1", "SHARED_1", "*never", "T1", "0", "0", "LOG_WARNING", "10"}, - []string{"STANDARD_TRIGGERS", "", "*max_counter", "5", "false", "0", "b2", "*monetary", "*out", "call", "FS_USERS", "special1", "SHARED_1", "*never", "T1", "0", "0", "LOG_WARNING", "10"}, + []string{"STANDARD_TRIGGERS", "", "*min_balance", "2", "false", "0", "b1", "*monetary", "*out", "call", "", "special1", "SHARED_1", "*never", "T1", "0", "false", "0", "LOG_WARNING", "10"}, + []string{"STANDARD_TRIGGERS", "", "*max_counter", "5", "false", "0", "b2", "*monetary", "*out", "call", "FS_USERS", "special1", "SHARED_1", "*never", "T1", "0", "false", "0", "LOG_WARNING", "10"}, } ms := APItoModelActionTrigger(at) var slc [][]string diff --git a/engine/models.go b/engine/models.go index c8570e85c..3407546d2 100644 --- a/engine/models.go +++ b/engine/models.go @@ -201,9 +201,10 @@ type TpActionTrigger struct { BalanceExpiryTime string `index:"13" re:"\*\w+\s*|\+\d+[smh]\s*|\d+\s*"` BalanceTimingTags string `index:"14" re:"[0-9A-Za-z_;]*|\*any"` BalanceWeight float64 `index:"15" re:"\d+\.?\d*"` - MinQueuedItems int `index:"16" re:"\d+"` - ActionsTag string `index:"17" re:"\w+"` - Weight float64 `index:"18" re:"\d+\.?\d*"` + BalanceDisabled bool `index:"16" re:""` + MinQueuedItems int `index:"17" re:"\d+"` + ActionsTag string `index:"18" re:"\w+"` + Weight float64 `index:"19" re:"\d+\.?\d*"` CreatedAt time.Time } diff --git a/utils/apitpdata.go b/utils/apitpdata.go index dac063e27..20ca8a813 100644 --- a/utils/apitpdata.go +++ b/utils/apitpdata.go @@ -482,6 +482,7 @@ type TPActionTrigger struct { BalanceRatingSubject string // filter for balance BalanceCategory string // filter for balance BalanceSharedGroup string // filter for balance + BalanceDisabled bool // filter for balance MinQueuedItems int // Trigger actions only if this number is hit (stats only) ActionsId string // Actions which will execute on threshold reached Weight float64 // weight