diff --git a/data/tariffplans/tutorial2/AccountActions.csv b/data/tariffplans/tutorial2/AccountActions.csv index ba2493fb6..a5220e631 100644 --- a/data/tariffplans/tutorial2/AccountActions.csv +++ b/data/tariffplans/tutorial2/AccountActions.csv @@ -1,3 +1,3 @@ #Tenant,Account,ActionPlanId,ActionTriggersId,AllowNegative,Disabled -cgrates.org,1001,PACKAGE_10,,, -cgrates.org,1002,PACKAGE_10,,, +cgrates.org,1001,AP_PACKAGE_10,,, +cgrates.org,1002,AP_PACKAGE_10,,, diff --git a/data/tariffplans/tutorial2/ActionPlans.csv b/data/tariffplans/tutorial2/ActionPlans.csv index 03eba3fb6..b10e827b5 100644 --- a/data/tariffplans/tutorial2/ActionPlans.csv +++ b/data/tariffplans/tutorial2/ActionPlans.csv @@ -1,2 +1,2 @@ #Id,ActionsId,TimingId,Weight -PACKAGE_10,TOPUP_RST_10,*asap,10 \ No newline at end of file +AP_PACKAGE_10,ACT_TOPUP_RST_10,*asap,10 \ No newline at end of file diff --git a/data/tariffplans/tutorial2/Actions.csv b/data/tariffplans/tutorial2/Actions.csv index d95702054..a8f5b728a 100644 --- a/data/tariffplans/tutorial2/Actions.csv +++ b/data/tariffplans/tutorial2/Actions.csv @@ -1,3 +1,3 @@ #ActionsId[0],Action[1],ExtraParameters[2],Filter[3],BalanceId[4],BalanceType[5],Directions[6],Categories[7],DestinationIds[8],RatingSubject[9],SharedGroup[10],ExpiryTime[11],TimingIds[12],Units[13],BalanceWeight[14],BalanceBlocker[15],BalanceDisabled[16],Weight[17] -TOPUP_RST_10,*topup_reset,,,,*monetary,*out,,*any,,,*unlimited,,10,10,false,false,10 -LOG_WARNING,*log,,,,,,,,,,,,,,false,false,10 \ No newline at end of file +ACT_TOPUP_RST_10,*topup_reset,,,,*monetary,*out,,*any,,,*unlimited,,10,10,false,false,10 +ACT_LOG_WARNING,*log,,,,,,,,,,,,,,false,false,10 \ No newline at end of file diff --git a/data/tariffplans/tutorial2/Attributes.csv b/data/tariffplans/tutorial2/Attributes.csv deleted file mode 100644 index a4dea7fc8..000000000 --- a/data/tariffplans/tutorial2/Attributes.csv +++ /dev/null @@ -1,3 +0,0 @@ -#Tenant,ID,Contexts,FilterIDs,ActivationInterval,FieldName,Initial,Substitute,Append,Weight -cgrates.org,ATTR_1,*sessions;*cdrs,*string:Account:1007,2014-01-14T00:00:00Z,Account,*any,1001,false,10 -cgrates.org,ATTR_1,,,,Subject,*any,1001,true, diff --git a/data/tariffplans/tutorial2/DestinationRates.csv b/data/tariffplans/tutorial2/DestinationRates.csv index db20d5ded..1e7356366 100644 --- a/data/tariffplans/tutorial2/DestinationRates.csv +++ b/data/tariffplans/tutorial2/DestinationRates.csv @@ -1,5 +1,6 @@ #Id,DestinationId,RatesTag,RoundingMethod,RoundingDecimals,MaxCost,MaxCostStrategy -DR_1001_10CNT,DST_1001,RT_10CNT,*up,4,0, +DR_1001_20CNT,DST_1001,RT_20CNT,*up,4,0, DR_1002_20CNT,DST_1002,RT_20CNT,*up,4,0, DR_1003_MAXCOST_DISC,DST_1003,RT_1CNT_PER_SEC,*up,4,0.12,*disconnect +DR_1001_10CNT,DST_1001,RT_10CNT,*up,4,0, diff --git a/data/tariffplans/tutorial2/RatingPlans.csv b/data/tariffplans/tutorial2/RatingPlans.csv index 33883eb34..8781dd5b2 100644 --- a/data/tariffplans/tutorial2/RatingPlans.csv +++ b/data/tariffplans/tutorial2/RatingPlans.csv @@ -1,4 +1,5 @@ #Id,DestinationRatesId,TimingTag,Weight -RP_1001,DR_1002_20CNT,ALWAYS,10 -RP_1001,DR_1003_MAXCOST_DISC,ALWAYS,10 -RP_1002,DR_1001_10CNT,ALWAYS,10 \ No newline at end of file +RP_1001,DR_1002_20CNT,*any,10 +RP_1001,DR_1003_MAXCOST_DISC,*any,10 +RP_1002,DR_1001_20CNT,*any,10 +RP_1002_LOW,DR_1001_10CNT,*any,10 \ No newline at end of file diff --git a/data/tariffplans/tutorial2/Suppliers.csv b/data/tariffplans/tutorial2/Suppliers.csv index bb9884cfd..e489bdf41 100644 --- a/data/tariffplans/tutorial2/Suppliers.csv +++ b/data/tariffplans/tutorial2/Suppliers.csv @@ -1,5 +1,5 @@ #Tenant,ID,FilterIDs,ActivationInterval,Sorting,SortingParamameters,SupplierID,SupplierFilterIDs,SupplierAccountIDs,SupplierRatingPlanIDs,SupplierResourceIDs,SupplierStatIDs,SupplierWeight,SupplierBlocker,SupplierParameters,Weight -cgrates.org,SPL_LEASTCOST_2,,2017-11-27T00:00:00Z,*weight,,supplier1,,,RP_1001,,,10,,,10 -cgrates.org,SPL_LEASTCOST_1,FLTR_1,2017-11-27T00:00:00Z,*least_cost,,supplier1,,,RP_1002,,,10,false,,10 -cgrates.org,SPL_LEASTCOST_1,,,,,supplier2,,,RP_1001,,,20,,, -cgrates.org,SPL_LEASTCOST_1,,,,,supplier3,,,RP_1002,,,15,,, +cgrates.org,SPL_WEIGHT,FLTR_ACNT_1001,2017-11-27T00:00:00Z,*weight,,supplier1,,,RP_1002,,,10,,,10 +cgrates.org,SPL_WEIGHT,,,,,supplier2,,,RP_1001,,,20,,,10 +cgrates.org,SPL_LEASTCOST_1,FLTR_ACNT_1002,2017-11-27T00:00:00Z,*least_cost,,supplier1,,,RP_1002,,,10,false,,10 +cgrates.org,SPL_LEASTCOST_1,,,,,supplier2,,,RP_1002_LOW,,,10,,, diff --git a/data/tariffplans/tutorial2/Thresholds.csv b/data/tariffplans/tutorial2/Thresholds.csv index 93e0bb440..2963c292d 100644 --- a/data/tariffplans/tutorial2/Thresholds.csv +++ b/data/tariffplans/tutorial2/Thresholds.csv @@ -1,4 +1,4 @@ #Tenant[0],Id[1],FilterIDs[2],ActivationInterval[3],Recurrent[4],MinHits[5],MinSleep[6],Blocker[7],Weight[8],ActionIDs[9],Async[10] -cgrates.org,THD_ACNT_1001,FLTR_ACNT_1001,2014-07-29T15:00:00Z,false,1,1s,false,10,LOG_WARNING,false -cgrates.org,THD_ACNT_1002,FLTR_ACNT_1002,2014-07-29T15:00:00Z,true,1,1s,false,10,LOG_WARNING,false +cgrates.org,THD_ACNT_1001,FLTR_ACNT_1001,2014-07-29T15:00:00Z,false,1,1s,false,10,ACT_LOG_WARNING,false +cgrates.org,THD_ACNT_1002,FLTR_ACNT_1002,2014-07-29T15:00:00Z,true,1,1s,false,10,ACT_LOG_WARNING,false diff --git a/data/tariffplans/tutorial2/Timings.csv b/data/tariffplans/tutorial2/Timings.csv deleted file mode 100644 index 775f347c0..000000000 --- a/data/tariffplans/tutorial2/Timings.csv +++ /dev/null @@ -1,2 +0,0 @@ -#Tag,Years,Months,MonthDays,WeekDays,Time -ALWAYS,*any,*any,*any,*any,00:00:00 \ No newline at end of file diff --git a/general_tests/tut_fs_calls_test.go b/general_tests/tut_fs_calls_test.go index a09ce1885..4d5396977 100755 --- a/general_tests/tut_fs_calls_test.go +++ b/general_tests/tut_fs_calls_test.go @@ -234,7 +234,10 @@ func testCallStartPjsuaListener(t *testing.T) { &engine.PjsuaAccount{Id: "sip:1001@192.168.56.202", Username: "1001", Password: "CGRateS.org", Realm: "*", Registrar: "sip:192.168.56.202:5060"}, &engine.PjsuaAccount{Id: "sip:1002@192.168.56.202", - Username: "1002", Password: "CGRateS.org", Realm: "*", Registrar: "sip:192.168.56.202:5060"}} + Username: "1002", Password: "CGRateS.org", Realm: "*", Registrar: "sip:192.168.56.202:5060"}, + &engine.PjsuaAccount{Id: "sip:1003@192.168.56.202", + Username: "1003", Password: "CGRateS.org", Realm: "*", Registrar: "sip:192.168.56.202:5060"}, + } if tutFsCallsPjSuaListener, err = engine.StartPjsuaListener( acnts, 5070, time.Duration(*waitRater)*time.Millisecond); err != nil { t.Fatal(err) @@ -361,7 +364,7 @@ func testCall1001Cdrs(t *testing.T) { if cdr.CostSource != utils.MetaSessionS { t.Errorf("Unexpected CostSource for CDR: %+v", cdr.CostSource) } - } else { + } else if cdr.Destination == "1003" { if cdr.Usage != "12s" && cdr.Usage != "13s" { // Usage as seconds t.Errorf("Unexpected Usage for CDR: %+v", cdr.Usage) } @@ -369,9 +372,7 @@ func testCall1001Cdrs(t *testing.T) { t.Errorf("Unexpected CostSource for CDR: %+v", cdr.CostSource) } } - } - } } @@ -402,8 +403,8 @@ func testCall1002Cdrs(t *testing.T) { func testCallStatMetrics(t *testing.T) { var metrics map[string]string expectedMetrics := map[string]string{ - utils.MetaTCC: "0.91589", - utils.MetaTCD: "2m12s", + utils.MetaTCC: "1.35009", + utils.MetaTCD: "2m25s", } if err := tutFsCallsRpc.Call(utils.StatSv1GetQueueStringMetrics, &utils.TenantID{Tenant: "cgrates.org", ID: "Stats2"}, &metrics); err != nil {