diff --git a/agents/dmtagent_it_test.go b/agents/dmtagent_it_test.go index 0340be100..8ec97b1ba 100644 --- a/agents/dmtagent_it_test.go +++ b/agents/dmtagent_it_test.go @@ -604,8 +604,8 @@ func TestDmtAgentSendCCRSimpaEvent(t *testing.T) { t.Error(err) } else if len(avps) == 0 { t.Error("Result-Code") - } else if strResult := avpValAsString(avps[0]); strResult != "5030" { // Result-Code set in the template - t.Errorf("Expecting 5030, received: %s", strResult) + } else if strResult := avpValAsString(avps[0]); strResult != "2001" { // Result-Code set in the template + t.Errorf("Expecting 2001, received: %s", strResult) } } diff --git a/agents/libdmt.go b/agents/libdmt.go index d96ac580c..471c6a9c5 100644 --- a/agents/libdmt.go +++ b/agents/libdmt.go @@ -216,6 +216,8 @@ func metaHandler(m *diam.Message, tag, arg string, dur time.Duration) (string, e return "", nil } +// metaValueExponent will multiply the float value with the exponent provided. +// Expects 2 arguments in template separated by | func metaValueExponent(m *diam.Message, argsTpl utils.RSRFields, roundingDecimals int) (string, error) { valStr := composedFieldvalue(m, argsTpl, 0) handlerArgs := strings.Split(valStr, utils.HandlerArgSep) diff --git a/data/conf/samples/dmtagent/simpa.json b/data/conf/samples/dmtagent/simpa.json index 2af7482bd..6a1fb9503 100644 --- a/data/conf/samples/dmtagent/simpa.json +++ b/data/conf/samples/dmtagent/simpa.json @@ -6,7 +6,7 @@ { "id": "simpa_event", // formal identifier of this processor "dry_run": false, // do not send the events to SMG, just log them - "request_filter": "Service-Context-Id(^simpa);CC-RequestType(4)", // filter requests processed by this processor + "request_filter": "Service-Context-Id(^simpa);CC-Request-Type(4)", // filter requests processed by this processor "continue_on_success": false, // continue to the next template if executed "ccr_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "^*generic", "mandatory": true}, @@ -14,10 +14,9 @@ {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "^*prepaid", "mandatory": true}, {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "^*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "^cgrates.org", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "^call", "mandatory": true}, + {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "^generic", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "Subscription-Id>Subscription-Id-Data", "field_filter":"Subscription-Id>Subscription-Id-Type(0)", "mandatory": true}, {"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "Subscription-Id>Subscription-Id-Data", "field_filter":"Subscription-Id>Subscription-Id-Type(0)", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "Service-Information>SMS-Information>Recipient-Address>Address-Data", "mandatory": true}, {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true}, {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true}, {"tag": "Usage", "field_id": "Usage", "type": "*handler", "handler_id": "*value_exponent", diff --git a/data/tariffplans/tutorial/DestinationRates.csv b/data/tariffplans/tutorial/DestinationRates.csv index 2602159d0..ee3352fc3 100644 --- a/data/tariffplans/tutorial/DestinationRates.csv +++ b/data/tariffplans/tutorial/DestinationRates.csv @@ -8,3 +8,4 @@ DR_FS_10CNT,DST_FS,RT_10CNT,*up,4,0, DR_SPECIAL_1002,DST_1002,RT_1CNT,*up,4,0, DR_1007_MAXCOST_DISC,DST_1007,RT_1CNT_PER_SEC,*up,4,0.62,*disconnect DR_1007_MAXCOST_FREE,DST_1007,RT_1CNT_PER_SEC,*up,4,0.62,*free +DR_GENERIC,*any,RT_GENERIC_1,*up,4,0, diff --git a/data/tariffplans/tutorial/Rates.csv b/data/tariffplans/tutorial/Rates.csv index c333bff3e..f4ca8a14f 100644 --- a/data/tariffplans/tutorial/Rates.csv +++ b/data/tariffplans/tutorial/Rates.csv @@ -7,3 +7,4 @@ RT_40CNT,0.8,0.4,60s,30s,0s RT_40CNT,0,0.2,60s,10s,60s RT_1CNT,0,0.01,60s,60s,0s RT_1CNT_PER_SEC,0,0.01,1s,1s,0s +RT_GENERIC_1,0,1,1,1,0 diff --git a/data/tariffplans/tutorial/RatingPlans.csv b/data/tariffplans/tutorial/RatingPlans.csv index 80bb48ee7..b983bf4ba 100644 --- a/data/tariffplans/tutorial/RatingPlans.csv +++ b/data/tariffplans/tutorial/RatingPlans.csv @@ -18,3 +18,4 @@ RP_RETAIL2,DR_FS_10CNT,OFFPEAK_EVENING,10 RP_RETAIL2,DR_FS_10CNT,OFFPEAK_WEEKEND,10 RP_RETAIL2,DR_1007_MAXCOST_FREE,ALWAYS,10 RP_SPECIAL_1002,DR_SPECIAL_1002,ALWAYS,10 +RP_GENERIC,DR_GENERIC,*any,10 \ No newline at end of file diff --git a/data/tariffplans/tutorial/RatingProfiles.csv b/data/tariffplans/tutorial/RatingProfiles.csv index db4434165..0d1d56064 100644 --- a/data/tariffplans/tutorial/RatingProfiles.csv +++ b/data/tariffplans/tutorial/RatingProfiles.csv @@ -7,3 +7,4 @@ *out,cgrates.org,lcr_profile2,suppl1,2014-01-14T00:00:00Z,RP_RETAIL2,,STATS_SUPPL1 *out,cgrates.org,lcr_profile2,suppl2,2014-01-14T00:00:00Z,RP_RETAIL1,,STATS_SUPPL2 *out,cgrates.org,lcr_profile2,suppl3,2014-01-14T00:00:00Z,RP_SPECIAL_1002,, +*out,cgrates.org,generic,*any,2014-01-14T00:00:00Z,RP_GENERIC,,