Updates to tutorial2 tests

This commit is contained in:
DanB
2020-01-09 18:49:29 +01:00
parent 44e4b7283b
commit ef09a57ef3
12 changed files with 105 additions and 19 deletions

View File

@@ -1,2 +1,4 @@
#Tenant,Account,ActionPlanID,ActionTriggersID,AllowNegative,Disabled
cgrates.org,1001,STANDARD_PLAN,STANDARD_TRIGGERS,,
cgrates.org,1002,STANDARD_PLAN,STANDARD_TRIGGERS,,
cgrates.org,1003,STANDARD_PLAN,STANDARD_TRIGGERS,,
1 #Tenant Account ActionPlanID ActionTriggersID AllowNegative Disabled
2 cgrates.org 1001 STANDARD_PLAN STANDARD_TRIGGERS
3 cgrates.org 1002 STANDARD_PLAN STANDARD_TRIGGERS
4 cgrates.org 1003 STANDARD_PLAN STANDARD_TRIGGERS

View File

@@ -1,3 +1,7 @@
#ID[0],UniqueID[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],ExpiryTime[6],ActivationTime[7],BalanceTag[8],BalanceType[9],BalanceCategories[10],BalanceDestinationIDs[11],BalanceRatingSubject[12],BalanceSharedGroup[13],BalanceExpiryTime[14],BalanceTimingIDs[15],BalanceWeight[16],BalanceBlocker[17],BalanceDisabled[18],ActionsID[19],Weight[20]
STANDARD_TRIGGERS,,*min_balance,2,,,,,,*monetary,,,,,,,,,,LOG_WARNING,10
# STANDARD_TRIGGERS *min_balance will call the action <TOPUP_BONUS_10SMS> when the monetary balance will go bellow 2 units
STANDARD_TRIGGERS,,*min_balance,2,,,,,,*monetary,,,,,,,,,,TOPUP_BONUS_10SMS,10
# STANDARD_TRIGGERS *max_balance will call <DISABLE_ACCOUNT> action when the monetary balance will go above 100 units
STANDARD_TRIGGERS,,*max_balance,100,,,,,,*monetary,,,,,,,,,,DISABLE_ACCOUNT,10
1 #ID[0] #ID[0],UniqueID[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],ExpiryTime[6],ActivationTime[7],BalanceTag[8],BalanceType[9],BalanceCategories[10],BalanceDestinationIDs[11],BalanceRatingSubject[12],BalanceSharedGroup[13],BalanceExpiryTime[14],BalanceTimingIDs[15],BalanceWeight[16],BalanceBlocker[17],BalanceDisabled[18],ActionsID[19],Weight[20] UniqueID[1] ThresholdType[2] ThresholdValue[3] Recurrent[4] MinSleep[5] ExpiryTime[6] ActivationTime[7] BalanceTag[8] BalanceType[9] BalanceCategories[10] BalanceDestinationIDs[11] BalanceRatingSubject[12] BalanceSharedGroup[13] BalanceExpiryTime[14] BalanceTimingIDs[15] BalanceWeight[16] BalanceBlocker[17] BalanceDisabled[18] ActionsID[19] Weight[20]
2 STANDARD_TRIGGERS # STANDARD_TRIGGERS *min_balance will call the action <TOPUP_BONUS_10SMS> when the monetary balance will go bellow 2 units *min_balance 2 *monetary LOG_WARNING 10
3 STANDARD_TRIGGERS,,*min_balance,2,,,,,,*monetary,,,,,,,,,,TOPUP_BONUS_10SMS,10
4 # STANDARD_TRIGGERS *max_balance will call <DISABLE_ACCOUNT> action when the monetary balance will go above 100 units
5 STANDARD_TRIGGERS,,*max_balance,100,,,,,,*monetary,,,,,,,,,,DISABLE_ACCOUNT,10
6
7 STANDARD_TRIGGERS *max_balance 100 *monetary DISABLE_ACCOUNT 10

View File

@@ -1,8 +1,28 @@
#ActionsId[0],Action[1],ExtraParameters[2],Filter[3],BalanceId[4],BalanceType[5],Categories[6],DestinationIds[7],RatingSubject[8],SharedGroup[9],ExpiryTime[10],TimingIds[11],Units[12],BalanceWeight[13],BalanceBlocker[14],BalanceDisabled[15],Weight[16]
# TOPUP_RST_MONETARY_10 resets the <*default> <*monetary> balance to 10 units
TOPUP_RST_MONETARY_10,*topup_reset,,,*default,*monetary,,,,,,,10,10,,,10
# TOPUP_RST_5M_VOICE resets the special <PER_CALL> *voice balance valid to destination <DST_10> with special rates <RPF_SPECIAL_BLC> to 10m
TOPUP_RST_5M_VOICE,*topup_reset,,,PER_CALL,*voice,,DST_10,RPF_SPECIAL_BLC,,,,10m,10,,,10
# TOPUP_RST_10M_VOICE resets *voice balance <FREE_MINS> with 0 costs rounded up to minute to 5m and priority 20
TOPUP_RST_10M_VOICE,*topup_reset,,,FREE_MINS,*voice,,,*zero1m,,,,5m,20,,,10
TOPUP_RST_100_SMS,*topup_reset,,,FREE_SMSes,*sms,,DST_50,,,,,100,20,,,10
# TOPUP_RST_100_SMS resets the <FREE_SMSes> *sms balance to 100 units and priority 20 in balance chain
TOPUP_RST_100_SMS,*topup_reset,,,FREE_SMSes,*sms,,,,,,,100,20,,,10
# TOPUP_BONUS_10SMS adds 10 units to <BONUS_SMSes> balance valid on DST_50 destination and priority 30 in balance chain
TOPUP_BONUS_10SMS,*topup,,,BONUS_SMSes,*sms,,DST_50,,,,,10,30,,,10
# TOPUP_RST_1024_DATA resets the <FREE_DATA> *data balance to 1024 units with priority 20 in the balance chain
TOPUP_RST_1024_DATA,*topup_reset,,,FREE_DATA,*data,,,,,,,1024,20,,,10
# LOG_WARNING will log to syslog the account attached to it
LOG_WARNING,*log,,,,,,,,,,,,,,,10
DISABLE_ACCOUNT,*disable_account,,,,,,,,,,,,,,,10
# DISABLE_ACCOUNT will set the Disabled Flag on the account called
DISABLE_ACCOUNT,*disable_account,,,,,,,,,,,,,,,10
# WARN_HTTP_ASYNC will call url asynchronously with the account provided as JSON body
WARN_HTTP_ASYNC,*call_url_async,http://$path/$to/$warn,,,,,,,,,,,,false,false,10
1 #ActionsId[0] #ActionsId[0],Action[1],ExtraParameters[2],Filter[3],BalanceId[4],BalanceType[5],Categories[6],DestinationIds[7],RatingSubject[8],SharedGroup[9],ExpiryTime[10],TimingIds[11],Units[12],BalanceWeight[13],BalanceBlocker[14],BalanceDisabled[15],Weight[16] Action[1] ExtraParameters[2] Filter[3] BalanceId[4] BalanceType[5] Categories[6] DestinationIds[7] RatingSubject[8] SharedGroup[9] ExpiryTime[10] TimingIds[11] Units[12] BalanceWeight[13] BalanceBlocker[14] BalanceDisabled[15] Weight[16]
2 # TOPUP_RST_MONETARY_10 resets the <*default> <*monetary> balance to 10 units
3 TOPUP_RST_MONETARY_10,*topup_reset,,,*default,*monetary,,,,,,,10,10,,,10
4 TOPUP_RST_MONETARY_10 # TOPUP_RST_5M_VOICE resets the special <PER_CALL> *voice balance valid to destination <DST_10> with special rates <RPF_SPECIAL_BLC> to 10m *topup_reset *default *monetary 10 10 10
5 TOPUP_RST_5M_VOICE,*topup_reset,,,PER_CALL,*voice,,DST_10,RPF_SPECIAL_BLC,,,,10m,10,,,10
6 # TOPUP_RST_10M_VOICE resets *voice balance <FREE_MINS> with 0 costs rounded up to minute to 5m and priority 20
7 TOPUP_RST_5M_VOICE TOPUP_RST_10M_VOICE,*topup_reset,,,FREE_MINS,*voice,,,*zero1m,,,,5m,20,,,10 *topup_reset PER_CALL *voice DST_10 RPF_SPECIAL_BLC 10m 10 10
8 # TOPUP_RST_100_SMS resets the <FREE_SMSes> *sms balance to 100 units and priority 20 in balance chain
9 TOPUP_RST_100_SMS,*topup_reset,,,FREE_SMSes,*sms,,,,,,,100,20,,,10
10 TOPUP_RST_10M_VOICE # TOPUP_BONUS_10SMS adds 10 units to <BONUS_SMSes> balance valid on DST_50 destination and priority 30 in balance chain *topup_reset FREE_MINS *voice *zero1m 5m 20 10
11 TOPUP_RST_100_SMS TOPUP_BONUS_10SMS,*topup,,,BONUS_SMSes,*sms,,DST_50,,,,,10,30,,,10 *topup_reset FREE_SMSes *sms DST_50 100 20 10
12 # TOPUP_RST_1024_DATA resets the <FREE_DATA> *data balance to 1024 units with priority 20 in the balance chain
13 TOPUP_RST_1024_DATA,*topup_reset,,,FREE_DATA,*data,,,,,,,1024,20,,,10
14 # LOG_WARNING will log to syslog the account attached to it
15 LOG_WARNING,*log,,,,,,,,,,,,,,,10
16 # DISABLE_ACCOUNT will set the Disabled Flag on the account called
17 DISABLE_ACCOUNT,*disable_account,,,,,,,,,,,,,,,10
18 # WARN_HTTP_ASYNC will call url asynchronously with the account provided as JSON body
19 TOPUP_RST_1024_DATA WARN_HTTP_ASYNC,*call_url_async,http://$path/$to/$warn,,,,,,,,,,,,false,false,10 *topup_reset FREE_DATA *data 1024 20 10
20
21
22 LOG_WARNING *log 10
23 DISABLE_ACCOUNT *disable_account 10
24
25
26
27
28

View File

@@ -0,0 +1,11 @@
# Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,FieldName,Type,Value,Blocker,Weight
# ATTR_CRG_SUPPLIER1 replaces Category->supplier1 and RequestType->*constant for *sessions and *cdrs events
cgrates.org,ATTR_CRG_SUPPLIER1,*sessions;*cdrs,,,,Category,*constant,supplier1,false,0
cgrates.org,ATTR_CRG_SUPPLIER1,,,,,RequestType,*constant,*rated,,
# ATTR_1001_AUTH returns the Password value for the account 1001 in context <auth>
cgrates.org,ATTR_1001_AUTH,auth,*string:~*req.Account:1001,,,Password,*constant,CGRateS.org,false,20
cgrates.org,ATTR_1002_AUTH,auth,*string:~*req.Account:1002,,,Password,*constant,CGRateS.org,false,20
cgrates.org,ATTR_1003_AUTH,auth,*string:~*req.Account:1003,,,Password,*constant,CGRateS.org,false,20
1 # Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,FieldName,Type,Value,Blocker,Weight
2 # ATTR_CRG_SUPPLIER1 replaces Category->supplier1 and RequestType->*constant for *sessions and *cdrs events
3 cgrates.org,ATTR_CRG_SUPPLIER1,*sessions;*cdrs,,,,Category,*constant,supplier1,false,0
4 cgrates.org,ATTR_CRG_SUPPLIER1,,,,,RequestType,*constant,*rated,,
5 # ATTR_1001_AUTH returns the Password value for the account 1001 in context <auth>
6 cgrates.org,ATTR_1001_AUTH,auth,*string:~*req.Account:1001,,,Password,*constant,CGRateS.org,false,20
7 cgrates.org,ATTR_1002_AUTH,auth,*string:~*req.Account:1002,,,Password,*constant,CGRateS.org,false,20
8 cgrates.org,ATTR_1003_AUTH,auth,*string:~*req.Account:1003,,,Password,*constant,CGRateS.org,false,20

View File

@@ -0,0 +1,8 @@
# Tenant,ID,FilterIDs,ActivationInterval,RunID,AttributeIDs,Weight
# CGR_DEFAULT is the default charger for events
cgrates.org,CGR_DEFAULT,,,*default,*none,0
# CGR_SUPPLIER1 creates an additional CDR for calculating supplier costs
# uses ATTR_CRG_SUPPLIER1 to replace Category and RequestType in events
cgrates.org,CRG_SUPPPLIER1,,,SUPPLIER1,ATTR_CRG_SUPPLIER1,0
1 # Tenant,ID,FilterIDs,ActivationInterval,RunID,AttributeIDs,Weight
2 # CGR_DEFAULT is the default charger for events
3 cgrates.org,CGR_DEFAULT,,,*default,*none,0
4 # CGR_SUPPLIER1 creates an additional CDR for calculating supplier costs
5 # uses ATTR_CRG_SUPPLIER1 to replace Category and RequestType in events
6 cgrates.org,CRG_SUPPPLIER1,,,SUPPLIER1,ATTR_CRG_SUPPLIER1,0

View File

@@ -8,4 +8,5 @@ DR_1002_60C,DST_1002,RT_60C,*up,4,,
DR_ANY_10C_CN,*any,RT_10C_CN,*up,4,,
DR_ANY_1024_1,*any,RT_1024_1,*up,4,,
DR_1002_10C1,DST_1002,RT_10C1,*up,4,,
DR_10_20C1,DST_10,RT_20C1,*up,4,,
DR_10_20C1,DST_10,RT_20C1,*up,4,,
DR_1CNT,*any,RT_1CNT,*up,4,,
1 #ID DestinationsID RatesID RoundingMethod RoundingDecimals MaxCost MaxCostStrategy
8 DR_ANY_10C_CN *any RT_10C_CN *up 4
9 DR_ANY_1024_1 *any RT_1024_1 *up 4
10 DR_1002_10C1 DST_1002 RT_10C1 *up 4
11 DR_10_20C1 DST_10 RT_20C1 *up 4
12 DR_1CNT *any RT_1CNT *up 4

View File

@@ -1,9 +1,26 @@
#ID,ConnectFee,Rate,RateUnit,RateIncrement,GroupIntervalStart
# RT_120C charges 0.20 units as connect fee and 1.2 in 1 minute increment in the first minute and second increments after that
RT_120C,0.2,1.2,1m,1m,0
RT_120C,,1.2,1m,1s,1m
# RT_60C charges 0.1 connect fee and 0.01 units each second
RT_60C,0.1,0.01,1s,1s,0
# RT_0 charges 0 units rounding each call per minute
RT_0,0,0,1m,1m,0
# RT_10C_CN charges 0.1 units as connect/call fee
RT_10C_CN,0.1,0,0,1s,0
# RT_1024_1 will be used to charge 1 unit per every 1024 of usage in increments of 1024
RT_1024_1,0,1,1024,1024,0
# RT_10C1 charges 0.1 units of cost every 1 unit of usage
RT_10C1,0,0.1,1,1,0
RT_20C1,0,0.2,1,1,0
# RT_20C1 charges 0.2 units of cost every 1 unit of usage
RT_20C1,0,0.2,1,1,0
# RT_1CNT charges 0.01 units of cost for each 1s of usage
RT_1CNT,0,0.01,1s,1s,0
1 #ID #ID,ConnectFee,Rate,RateUnit,RateIncrement,GroupIntervalStart ConnectFee Rate RateUnit RateIncrement GroupIntervalStart
2 # RT_120C charges 0.20 units as connect fee and 1.2 in 1 minute increment in the first minute and second increments after that
3 RT_120C,0.2,1.2,1m,1m,0
4 RT_120C RT_120C,,1.2,1m,1s,1m 0.2 1.2 1m 1m 0
5 RT_120C # RT_60C charges 0.1 connect fee and 0.01 units each second 1.2 1m 1s 1m
6 RT_60C,0.1,0.01,1s,1s,0
7 # RT_0 charges 0 units rounding each call per minute
8 RT_60C RT_0,0,0,1m,1m,0 0.1 0.01 1s 1s 0
9 # RT_10C_CN charges 0.1 units as connect/call fee
10 RT_10C_CN,0.1,0,0,1s,0
11 RT_0 # RT_1024_1 will be used to charge 1 unit per every 1024 of usage in increments of 1024 0 0 1m 1m 0
12 RT_1024_1,0,1,1024,1024,0
13 # RT_10C1 charges 0.1 units of cost every 1 unit of usage
14 RT_10C_CN RT_10C1,0,0.1,1,1,0 0.1 0 0 1s 0
15 # RT_20C1 charges 0.2 units of cost every 1 unit of usage
16 RT_20C1,0,0.2,1,1,0
17 RT_1024_1 # RT_1CNT charges 0.01 units of cost for each 1s of usage 0 1 1024 1024 0
18 RT_1CNT,0,0.01,1s,1s,0
19
20 RT_10C1 0 0.1 1 1 0
21 RT_20C1 0 0.2 1 1 0
22
23
24
25
26

View File

@@ -10,4 +10,5 @@ RP_1001,DR_1002_60C,*any,10
RP_SPECIAL_BLC,DR_ANY_10C_CN,*any,10
RP_DATA,DR_ANY_1024_1,*any,10
RP_SMS,DR_1002_10C1,*any,10
RP_SMS,DR_10_20C1,*any,10
RP_SMS,DR_10_20C1,*any,10
RP_1CNT,DR_1CNT,*any,0
1 #ID DestinationRatesID TimingID Weight
10 RP_SPECIAL_BLC DR_ANY_10C_CN *any 10
11 RP_DATA DR_ANY_1024_1 *any 10
12 RP_SMS DR_1002_10C1 *any 10
13 RP_SMS DR_10_20C1 *any 10
14 RP_1CNT DR_1CNT *any 0

View File

@@ -4,3 +4,4 @@ cgrates.org,call,1001,2019-03-01T00:00:00Z,RP_1001,*any
cgrates.org,call,RPF_SPECIAL_BLC,2019-03-01T00:00:00Z,RP_SPECIAL_BLC,
cgrates.org,data,*any,2019-03-01T00:00:00Z,RP_DATA,
cgrates.org,sms,*any,2019-03-01T00:00:00Z,RP_SMS,
cgrates.org,supplier1,*any,2019-03-01T00:00:00Z,RP_1CNT,
1 #Tenant Category Subject ActivationTime RatingPlanID FallbackSubject
4 cgrates.org call RPF_SPECIAL_BLC 2019-03-01T00:00:00Z RP_SPECIAL_BLC
5 cgrates.org data *any 2019-03-01T00:00:00Z RP_DATA
6 cgrates.org sms *any 2019-03-01T00:00:00Z RP_SMS
7 cgrates.org supplier1 *any 2019-03-01T00:00:00Z RP_1CNT