mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Update readthedocs tutorial
This commit is contained in:
committed by
Dan Christian Bogos
parent
e730ef4eb2
commit
8ab43944a2
@@ -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]
|
#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,20,false,0,,,,*monetary,,,,,,,,,,ACT_LOG_WARNING,10
|
||||||
STANDARD_TRIGGERS,,*max_balance,100,false,0,,,,*monetary,,,,,,,,,,DISABLE_AND_LOG,10
|
STANDARD_TRIGGERS,,*max_balance,100,false,0,,,,*monetary,,,,,,,,,,DISABLE_AND_LOG,10
|
||||||
|
|
||||||
|
|||||||
|
@@ -40,15 +40,10 @@ type
|
|||||||
**\*http_post**
|
**\*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 <https://godoc.org/github.com/cgrates/cgrates/engine#CDR>`_.
|
Will post the CDR to a HTTP server. The export content will be a HTTP form encoded representation of the `internal CDR object <https://godoc.org/github.com/cgrates/cgrates/engine#CDR>`_.
|
||||||
|
|
||||||
**\*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 <https://godoc.org/github.com/cgrates/cgrates/engine#CDR>`_.
|
|
||||||
|
|
||||||
**\*http_json_map**
|
**\*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.
|
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 <https://godoc.org/github.com/cgrates/cgrates/engine#CDR>`_. Uses AMQP_ protocol version 0.9.1.
|
|
||||||
|
|
||||||
**\*amqp_json_map**
|
**\*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.
|
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**
|
**\*file_csv**, **\*file_fwv**
|
||||||
Standard unix-like filesystem path.
|
Standard unix-like filesystem path.
|
||||||
|
|
||||||
**\*http_post**, **\*http_json_cdr**, **\*http_json_map**
|
**\*http_post**, **\*http_json_map**
|
||||||
Full HTTP URL
|
Full HTTP URL
|
||||||
|
|
||||||
**\*amqp_json_map**, **\*amqpv1_json_map**
|
**\*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*.
|
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
|
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:
|
One **field template** will contain the following parameters:
|
||||||
|
|||||||
@@ -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"}'
|
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
|
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:
|
To verify this mechanism simply add some random units into one account's balance:
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ func TestHttpJsonPoster(t *testing.T) {
|
|||||||
Kafka: &config.KafkaOpts{},
|
Kafka: &config.KafkaOpts{},
|
||||||
RPC: &config.RPCOpts{},
|
RPC: &config.RPCOpts{},
|
||||||
})
|
})
|
||||||
time.Sleep(5 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
fs, err := filepath.Glob("/tmp/EEs*")
|
fs, err := filepath.Glob("/tmp/EEs*")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@@ -114,7 +114,7 @@ func TestHttpJsonPoster(t *testing.T) {
|
|||||||
|
|
||||||
evBody, cancast := ev.Events[0].(*HTTPPosterRequest)
|
evBody, cancast := ev.Events[0].(*HTTPPosterRequest)
|
||||||
if !cancast {
|
if !cancast {
|
||||||
t.Error("Can't cast the event ")
|
t.Fatal("Can't cast the event")
|
||||||
}
|
}
|
||||||
|
|
||||||
if string(evBody.Body.([]uint8)) != string(jsn) {
|
if string(evBody.Body.([]uint8)) != string(jsn) {
|
||||||
|
|||||||
@@ -312,9 +312,7 @@ const (
|
|||||||
MetaConstant = "*constant"
|
MetaConstant = "*constant"
|
||||||
MetaFiller = "*filler"
|
MetaFiller = "*filler"
|
||||||
MetaHTTPPost = "*http_post"
|
MetaHTTPPost = "*http_post"
|
||||||
MetaHTTPjsonCDR = "*http_json_cdr"
|
|
||||||
MetaHTTPjsonMap = "*http_json_map"
|
MetaHTTPjsonMap = "*http_json_map"
|
||||||
MetaAMQPjsonCDR = "*amqp_json_cdr"
|
|
||||||
MetaAMQPjsonMap = "*amqp_json_map"
|
MetaAMQPjsonMap = "*amqp_json_map"
|
||||||
MetaAMQPV1jsonMap = "*amqpv1_json_map"
|
MetaAMQPV1jsonMap = "*amqpv1_json_map"
|
||||||
MetaRPC = "*rpc"
|
MetaRPC = "*rpc"
|
||||||
|
|||||||
Reference in New Issue
Block a user