{
// Sample CGRateS Configuration file for EEs
//
// Copyright (C) ITsysCOM GmbH

"general": {
	"log_level": 7,
	"poster_attempts": 2
},


"data_db": {
	"db_type": "mongo",
	"db_name": "10",
	"db_port": 27017,
},


"stor_db": {
	"db_type": "mongo",
	"db_name": "cgrates",
	"db_port": 27017,
	"db_password": "",
},


"rals": {
	"enabled": true
},


"attributes": {
	"enabled": true,
},


"chargers": {
	"enabled": true,
	"attributes_conns": ["*internal"],
},


"cdrs": {
	"enabled": true,
	"chargers_conns":["*internal"],
	"rals_conns": ["*internal"],
	"session_cost_retries": 0,
	"online_cdr_exports": ["http_localhost", "amqp_localhost", "aws_test_file", "sqs_test_file", "kafka_localhost", "s3_test_file"],
	"ees_conns": ["*localhost"]
},


"ees": {
	"enabled": true,
	"failed_posts": {
	    "ttl": "1s"
	},
	"exporters": [
		{
			"id": "http_localhost",
			"type": "*http_post",
			"export_path": "http://127.0.0.1:12081/cdr_http",
			"attempts": 1,
			"failed_posts_dir": "/var/spool/cgrates/failed_posts2",
			"synchronous": true,
			"fields":[
				{"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"},
			],
		},
		{
			"id": "amqp_localhost",
			"type": "*amqp_json_map",
			"export_path": "amqp://guest:guest@localhost:5672/",
			"opts": {
				"amqpQueueID": "cgrates_cdrs",
				"amqpExchange": "exchangename",
				"amqpExchangeType": "fanout",
				"amqpRoutingKey": "cgr_cdrs",
			},
			"attempts": 20,
			"failed_posts_dir": "/var/spool/cgrates/failed_posts2",
			"synchronous": true,
			"fields":[
				{"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"},
			],
		},
		{
			"id": "aws_test_file",
			"type": "*amqpv1_json_map",
			"export_path": "amqps://guest:guest@localhost:95672/",
			"opts": {
				"amqpQueueID": "cgrates_cdrs",
			},
			"attempts": 1,
			"failed_posts_dir": "/var/spool/cgrates/failed_posts2",
			"synchronous": true,
			"fields":[
				{"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"},
			],
		},
		{
			"id": "sqs_test_file",
			"type": "*sqs_json_map",
			// export_path for sqs:  "endpoint"
			"export_path": "sqs.eu-west-2.amazonaws.com",
			"opts": {
				// posible options for sqs:
				"awsRegion": "eu-west-2",
				"awsKey": "testkey",
				"awsSecret": "testsecret",
				"sqsQueueID": "cgrates-cdrs",
			},
			"attempts": 1,
			"failed_posts_dir": "/var/spool/cgrates/failed_posts2",
			"synchronous": true,
			"fields":[
				{"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"},
			],
		},
		{
			"id": "kafka_localhost",
			"type": "*kafka_json_map",
			"export_path": "127.0.0.1:9092",
			"opts":{
				"kafkaTopic": "cgrates_cdrs",
			},
			"attempts": 10,
			"failed_posts_dir": "/var/spool/cgrates/failed_posts2",
			"synchronous": true,
			"fields":[
				{"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"},
			],
		},
		{
			"id": "s3_test_file",
			"type": "*s3_json_map",
			// export_path for s3:  "endpoint"
			"export_path": "s3.us-east-2.amazonaws.com",
			"opts": {
				// posible options for s3:
				"awsRegion": "eu-west-2",
				"awsKey": "testkey",
				"awsSecret": "testsecret",
				"s3BucketID": "cgrates-cdrs",
			},
			"attempts": 1,
			"failed_posts_dir": "/var/spool/cgrates/failed_posts2",
			"synchronous": true,
			"fields":[
				{"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"},
			],
		},
	],
},


"templates": {
	"requiredFields": [
		{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
		{"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
		{"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
		{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
		{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
		{"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
		{"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
		{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
		{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
		{"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
		{"tag": "OrderID", "path": "*exp.OrderID", "type": "*variable", "value": "~*req.OrderID","filter":"*string:~*opts.AddOrderID:true"}
	]
},


"apiers": {
	"enabled": true,
},


}
