Sample LCR rules in tutorial TP

This commit is contained in:
DanB
2015-04-29 12:28:54 +02:00
parent be1d789132
commit fa387f3515
7 changed files with 30 additions and 5 deletions

View File

@@ -1745,7 +1745,7 @@ func TestApierGetCacheStats3(t *testing.T) {
return
}
var rcvStats *utils.CacheStats
expectedStats := &utils.CacheStats{Destinations: 3, RatingPlans: 3, RatingProfiles: 3, Actions: 6, SharedGroups: 1, RatingAliases: 1, AccountAliases: 1, DerivedChargers: 1}
expectedStats := &utils.CacheStats{Destinations: 4, RatingPlans: 3, RatingProfiles: 8, Actions: 6, SharedGroups: 1, RatingAliases: 1, AccountAliases: 1, DerivedChargers: 1}
var args utils.AttrCacheStats
if err := rater.Call("ApierV1.GetCacheStats", args, &rcvStats); err != nil {
t.Error("Got error on ApierV1.GetCacheStats: ", err.Error())

View File

@@ -12,3 +12,13 @@ CDRST_1002,,,ACD,,,,,,,,,,,,,,,,,,
CDRST_1002,,,ACC,,,,,,,,,,,,,,,,,,
CDRST_1003,,,ASR,,,,,,,cgrates.org,,,,1003,,,default,,,,CDRST3_WARN
CDRST_1003,,,ACD,,,,,,,,,,,,,,,,,,
STATS_SUPPL1,,,ACD,,,,,,,,,,,,,supplier1,,,,,
STATS_SUPPL1,,,ASR,,,,,,,,,,,,,supplier1,,,,,
STATS_SUPPL1,,,ACC,,,,,,,,,,,,,supplier1,,,,,
STATS_SUPPL1,,,TCD,,,,,,,,,,,,,supplier1,,,,,
STATS_SUPPL1,,,TCC,,,,,,,,,,,,,supplier1,,,,,
STATS_SUPPL2,,,ACD,,,,,,,,,,,,,supplier2,,,,,
STATS_SUPPL2,,,ASR,,,,,,,,,,,,,supplier2,,,,,
STATS_SUPPL2,,,ACC,,,,,,,,,,,,,supplier2,,,,,
STATS_SUPPL2,,,TCD,,,,,,,,,,,,,supplier2,,,,,
STATS_SUPPL2,,,TCC,,,,,,,,,,,,,supplier2,,,,,
1 #Id[0] QueueLength[1] TimeWindow[2] Metric[3] SetupInterval[4] TOR[5] CdrHost[6] CdrSource[7] ReqType[8] Direction[9] Tenant[10] Category[11] Account[12] Subject[13] DestinationPrefix[14] UsageInterval[15] Supplier[16] MediationRunIds[17] RatedAccount[18] RatedSubject[19] CostInterval[20] Triggers[21]
12 CDRST_1002 ACC
13 CDRST_1003 ASR cgrates.org 1003 default CDRST3_WARN
14 CDRST_1003 ACD
15 STATS_SUPPL1 ACD supplier1
16 STATS_SUPPL1 ASR supplier1
17 STATS_SUPPL1 ACC supplier1
18 STATS_SUPPL1 TCD supplier1
19 STATS_SUPPL1 TCC supplier1
20 STATS_SUPPL2 ACD supplier2
21 STATS_SUPPL2 ASR supplier2
22 STATS_SUPPL2 ACC supplier2
23 STATS_SUPPL2 TCD supplier2
24 STATS_SUPPL2 TCC supplier2

View File

@@ -2,3 +2,4 @@
DST_1002,1002
DST_1003,1003
DST_FS,10
DST_2002,2002
1 #Tag Prefix
2 DST_1002 1002
3 DST_1003 1003
4 DST_FS 10
5 DST_2002 2002

View File

@@ -0,0 +1,9 @@
#Direction,Tenant,Category,Account,Subject,DestinationId,RPCategory,Strategy,StrategyParams,ActivationTime,Weight
*out,cgrates.org,call,1001,*any,DST_2002,lcr_profile1,*static,suppl2;suppl1,2014-01-14T00:00:00Z,10
*out,cgrates.org,call,1001,*any,*any,lcr_profile1,*static,suppl1;suppl2,2014-01-14T00:00:00Z,10
*out,cgrates.org,call,1002,*any,DST_2002,lcr_profile1,*highest_cost,,2014-01-14T00:00:00Z,10
*out,cgrates.org,call,1002,*any,*any,lcr_profile1,*qos,,2014-01-14T00:00:00Z,10
*out,cgrates.org,call,1003,*any,DST_2002,lcr_profile1,*qos_threshold,20;;2m;;;;;;;,2014-01-14T00:00:00Z,10
*out,cgrates.org,call,1003,*any,*any,lcr_profile1,*qos_threshold,40;;4m;;;;;;;,2014-01-14T00:00:00Z,10
*out,cgrates.org,call,*any,*any,DST_2002,lcr_profile2,*lowest_cost,,2014-01-14T00:00:00Z,10
*out,cgrates.org,call,*any,*any,*any,lcr_profile1,*lowest_cost,,2014-01-14T00:00:00Z,10
1 #Direction Tenant Category Account Subject DestinationId RPCategory Strategy StrategyParams ActivationTime Weight
2 *out cgrates.org call 1001 *any DST_2002 lcr_profile1 *static suppl2;suppl1 2014-01-14T00:00:00Z 10
3 *out cgrates.org call 1001 *any *any lcr_profile1 *static suppl1;suppl2 2014-01-14T00:00:00Z 10
4 *out cgrates.org call 1002 *any DST_2002 lcr_profile1 *highest_cost 2014-01-14T00:00:00Z 10
5 *out cgrates.org call 1002 *any *any lcr_profile1 *qos 2014-01-14T00:00:00Z 10
6 *out cgrates.org call 1003 *any DST_2002 lcr_profile1 *qos_threshold 20;;2m;;;;;;; 2014-01-14T00:00:00Z 10
7 *out cgrates.org call 1003 *any *any lcr_profile1 *qos_threshold 40;;4m;;;;;;; 2014-01-14T00:00:00Z 10
8 *out cgrates.org call *any *any DST_2002 lcr_profile2 *lowest_cost 2014-01-14T00:00:00Z 10
9 *out cgrates.org call *any *any *any lcr_profile1 *lowest_cost 2014-01-14T00:00:00Z 10

View File

@@ -2,3 +2,8 @@
*out,cgrates.org,call,*any,2014-01-14T00:00:00Z,RP_RETAIL1,,
*out,cgrates.org,call,1001;1006,2014-01-14T00:00:00Z,RP_RETAIL2,,
*out,cgrates.org,call,SPECIAL_1002,2014-01-14T00:00:00Z,RP_SPECIAL_1002,,
*out,cgrates.org,lcr_profile1,supplier1,2014-01-14T00:00:00Z,RP_RETAIL1,,STATS_SUPPL1
*out,cgrates.org,lcr_profile1,supplier2,2014-01-14T00:00:00Z,RP_RETAIL2,,STATS_SUPPL2
*out,cgrates.org,lcr_profile2,supplier1,2014-01-14T00:00:00Z,RP_RETAIL2,,STATS_SUPPL1
*out,cgrates.org,lcr_profile2,supplier2,2014-01-14T00:00:00Z,RP_RETAIL1,,STATS_SUPPL2
*out,cgrates.org,lcr_profile2,supplier3,2014-01-14T00:00:00Z,RP_SPECIAL_1002,,
1 #Direction Tenant Category Subject ActivationTime RatingPlanId RatesFallbackSubject CdrStatQueueIds
2 *out cgrates.org call *any 2014-01-14T00:00:00Z RP_RETAIL1
3 *out cgrates.org call 1001;1006 2014-01-14T00:00:00Z RP_RETAIL2
4 *out cgrates.org call SPECIAL_1002 2014-01-14T00:00:00Z RP_SPECIAL_1002
5 *out cgrates.org lcr_profile1 supplier1 2014-01-14T00:00:00Z RP_RETAIL1 STATS_SUPPL1
6 *out cgrates.org lcr_profile1 supplier2 2014-01-14T00:00:00Z RP_RETAIL2 STATS_SUPPL2
7 *out cgrates.org lcr_profile2 supplier1 2014-01-14T00:00:00Z RP_RETAIL2 STATS_SUPPL1
8 *out cgrates.org lcr_profile2 supplier2 2014-01-14T00:00:00Z RP_RETAIL1 STATS_SUPPL2
9 *out cgrates.org lcr_profile2 supplier3 2014-01-14T00:00:00Z RP_SPECIAL_1002

View File

@@ -139,7 +139,7 @@ func TestTutFsCallsCacheStats(t *testing.T) {
return
}
var rcvStats *utils.CacheStats
expectedStats := &utils.CacheStats{Destinations: 3, RatingPlans: 3, RatingProfiles: 3, Actions: 6, SharedGroups: 1, RatingAliases: 1, AccountAliases: 1, DerivedChargers: 1}
expectedStats := &utils.CacheStats{Destinations: 4, RatingPlans: 3, RatingProfiles: 8, Actions: 6, SharedGroups: 1, RatingAliases: 1, AccountAliases: 1, DerivedChargers: 1}
var args utils.AttrCacheStats
if err := tutFsCallsRpc.Call("ApierV1.GetCacheStats", args, &rcvStats); err != nil {
t.Error("Got error on ApierV1.GetCacheStats: ", err.Error())
@@ -356,7 +356,7 @@ func TestTutFsCallsCdrStats(t *testing.T) {
return
}
var queueIds []string
eQueueIds := []string{"*default", "CDRST1", "CDRST_1001", "CDRST_1002", "CDRST_1003"}
eQueueIds := []string{"*default", "CDRST1", "CDRST_1001", "CDRST_1002", "CDRST_1003", "STATS_SUPPL1", "STATS_SUPPL2"}
if err := tutFsCallsRpc.Call("CDRStatsV1.GetQueueIds", "", &queueIds); err != nil {
t.Error("Calling CDRStatsV1.GetQueueIds, got error: ", err.Error())
} else if len(eQueueIds) != len(queueIds) {

View File

@@ -137,7 +137,7 @@ func TestTutKamCallsCacheStats(t *testing.T) {
return
}
var rcvStats *utils.CacheStats
expectedStats := &utils.CacheStats{Destinations: 3, RatingPlans: 3, RatingProfiles: 3, Actions: 6, SharedGroups: 1, RatingAliases: 1, AccountAliases: 1, DerivedChargers: 1}
expectedStats := &utils.CacheStats{Destinations: 4, RatingPlans: 3, RatingProfiles: 8, Actions: 6, SharedGroups: 1, RatingAliases: 1, AccountAliases: 1, DerivedChargers: 1}
var args utils.AttrCacheStats
if err := tutKamCallsRpc.Call("ApierV1.GetCacheStats", args, &rcvStats); err != nil {
t.Error("Got error on ApierV1.GetCacheStats: ", err.Error())
@@ -354,7 +354,7 @@ func TestTutKamCallsCdrStats(t *testing.T) {
return
}
var queueIds []string
eQueueIds := []string{"*default", "CDRST1", "CDRST_1001", "CDRST_1002", "CDRST_1003"}
eQueueIds := []string{"*default", "CDRST1", "CDRST_1001", "CDRST_1002", "CDRST_1003", "STATS_SUPPL1", "STATS_SUPPL2"}
if err := tutKamCallsRpc.Call("CDRStatsV1.GetQueueIds", "", &queueIds); err != nil {
t.Error("Calling CDRStatsV1.GetQueueIds, got error: ", err.Error())
} else if len(eQueueIds) != len(queueIds) {