diff --git a/data/tariffplans/tutorial/ActionTriggers.csv b/data/tariffplans/tutorial/ActionTriggers.csv index 8816dbc68..d79fe4205 100644 --- a/data/tariffplans/tutorial/ActionTriggers.csv +++ b/data/tariffplans/tutorial/ActionTriggers.csv @@ -1,6 +1,4 @@ #Tag[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,false,0,,,,*monetary,,,,,,,,,,ACT_LOG_WARNING,10 -STANDARD_TRIGGERS,,*max_event_counter,5,false,0,,,,*monetary,,FS_USERS,,,,,,,,ACT_LOG_WARNING,10 STANDARD_TRIGGERS,,*max_balance,20,false,0,,,,*monetary,,,,,,,,,,ACT_LOG_WARNING,10 STANDARD_TRIGGERS,,*max_balance,100,false,0,,,,*monetary,,,,,,,,,,DISABLE_AND_LOG,10 diff --git a/docs/ees.rst b/docs/ees.rst index 2530635c2..c957d6ea7 100644 --- a/docs/ees.rst +++ b/docs/ees.rst @@ -40,15 +40,10 @@ type **\*http_post** Will post the CDR to a HTTP server. The export content will be a HTTP form encoded representation of the `internal CDR object `_. - **\*http_json_cdr** - Will post the CDR to a HTTP server. The export content will be a JSON serialized representation of the `internal CDR object `_. **\*http_json_map** Will post the CDR to a HTTP server. The export content will be a JSON serialized hmap with fields defined within the *fields* section of the template. - **\*amqp_json_cdr** - Will post the CDR to an AMQP_ queue. The export content will be a JSON serialized representation of the `internal CDR object `_. Uses AMQP_ protocol version 0.9.1. - **\*amqp_json_map** Will post the CDR to an AMQP_ queue. The export content will be a JSON serialized hmap with fields defined within the *fields* section of the template. Uses AMQP_ protocol version 1.0. @@ -85,7 +80,7 @@ export_path **\*file_csv**, **\*file_fwv** Standard unix-like filesystem path. - **\*http_post**, **\*http_json_cdr**, **\*http_json_map** + **\*http_post**, **\*http_json_map** Full HTTP URL **\*amqp_json_map**, **\*amqpv1_json_map** @@ -142,7 +137,7 @@ attempts Number of attempts before giving up on the export and writing the failed request to file. The failed request will be written to *failed_posts_dir*. fields - List of fields for the exported event. Not affecting templates like *\*http_json_cdr* or *\*amqp_json_cdr* with fixed content. + List of fields for the exported event. One **field template** will contain the following parameters: diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 47530c40e..8a8a3f040 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -486,11 +486,12 @@ Once the CDRs are mediated, they are available to be exported. To export them, y cgr-console 'export_cdrs ExportArgs={"ExportFormat":"*file_csv", "ExportPath":"/tmp"}' +Your exported files will be appear on your defined "export_path" folder after the command is executed. In this case the folder is /tmp Fraud detection --------------- -Since we have configured some action triggers (more than 20 units of balance topped-up or less than 2 and more than 5 units spent on *FS_USERS* we should be notified over syslog when things like unexpected events happen, e.g.: fraud with more than 20 units topped-up). Most important is the monitor for 100 units topped-up which will also trigger an account disable together with killing it's calls if prepaid debits are used. +We have configured some action triggers for our tariffplans where more than 20 units of balance topped-up triggers a notification over syslog, and most importantly, an action trigger to monitor for 100 or more units topped-up which will also trigger an account disable together with killing it's calls if prepaid debits are used. To verify this mechanism simply add some random units into one account's balance: diff --git a/ees/poster_it_test.go b/ees/poster_it_test.go index 939370658..90d0e2384 100644 --- a/ees/poster_it_test.go +++ b/ees/poster_it_test.go @@ -97,7 +97,7 @@ func TestHttpJsonPoster(t *testing.T) { Kafka: &config.KafkaOpts{}, RPC: &config.RPCOpts{}, }) - time.Sleep(5 * time.Millisecond) + time.Sleep(100 * time.Millisecond) fs, err := filepath.Glob("/tmp/EEs*") if err != nil { t.Fatal(err) @@ -114,7 +114,7 @@ func TestHttpJsonPoster(t *testing.T) { evBody, cancast := ev.Events[0].(*HTTPPosterRequest) if !cancast { - t.Error("Can't cast the event ") + t.Fatal("Can't cast the event") } if string(evBody.Body.([]uint8)) != string(jsn) { diff --git a/utils/consts.go b/utils/consts.go index 747d8a0c8..0c2d46748 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -312,9 +312,7 @@ const ( MetaConstant = "*constant" MetaFiller = "*filler" MetaHTTPPost = "*http_post" - MetaHTTPjsonCDR = "*http_json_cdr" MetaHTTPjsonMap = "*http_json_map" - MetaAMQPjsonCDR = "*amqp_json_cdr" MetaAMQPjsonMap = "*amqp_json_map" MetaAMQPV1jsonMap = "*amqpv1_json_map" MetaRPC = "*rpc"