{
// CGRateS Configuration file
//
// Used in apier_local_tests
// Starts rater, cdrs and mediator connecting over internal channel

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

"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,						// enable Rater service: <true|false>
},

"cdrs": {
	"enabled": true,			// start the CDR Server service:  <true|false>
	"store_cdrs": false,		// store cdrs in storDb
	"chargers_conns":["*internal"],
	"rals_conns": ["*internal"],
	"online_cdr_exports": ["http_localhost", "amqp_localhost", "http_test_file", "kafka_localhost", "eventcost_filter"],
	"ees_conns": ["*localhost"]
},

"chargers": {
	"enabled": true,
},

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


"ees": {
	"enabled": true,
	"failed_posts": {
	    "ttl": "1"
	},
	"exporters": [
		{
			"id": "http_localhost",
			"type": "*http_post",
			"export_path": "http://127.0.0.1:12080/cdr_http",
			"synchronous": true,
			"attempts": 1,
			"filters":["*string:~*opts.ExporterID:http_localhost"],
			"fields":[
				{"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": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime"},
				{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime"},
				{"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
				{"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"},
			],
		},
		{
			"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": 3,
			"fields":[
				{"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": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime"},
				{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime"},
				{"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
				{"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"},
			],
		},
		{
			"id": "http_test_file",
			"type": "*http_post",
			"export_path": "http://127.0.0.1:12080/invalid",
			"synchronous": true,
			"attempts": 1,
			"fields":[
				{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
			],
		},
		{
			"id": "kafka_localhost",
			"type": "*kafka_json_map",
			"export_path": "localhost:9092",
			"opts": {
				"kafkaTopic": "cgrates_cdrs",
			},
			"synchronous": true,
			"attempts": 1,
			"fields":[
				{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
			],
		},
		{
			"id": "eventcost_filter",
			"type": "*amqp_json_map",
			"export_path": "amqp://guest:guest@wrongurl:25672/",
			"opts": {
				"amqpQueueID": "cgrates_cdrs",
			},
			"filters":["*string:~*ec.Cost:100"],
			"synchronous": true,
			"attempts": 1,
			"fields":[
				{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
			],
		}
	],
},


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


}
