/
cgrates.json
executable file
·153 lines (124 loc) · 5.32 KB
/
cgrates.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{
// CGRateS Configuration file
//
// Used for cgradmin
// Starts rater, scheduler
"general": {
"log_level": 7,
"default_tenant": "cgrates.org",
},
"listen": {
"rpc_json": ":2012", // RPC JSON listening address
"rpc_gob": ":2013", // RPC GOB listening address
"http": ":2080", // HTTP listening address
},
"data_db": { // database used to store runtime data (eg: accounts, cdr stats)
"db_type": "redis", // data_db type: <redis|mongo>
"db_port": 6379, // data_db port to reach the database
"db_name": "10", // data_db database name to connect to
},
"stor_db": {
"db_password": "CGRateS.org",
},
"rals": {
"enabled": true,
},
"schedulers": {
"enabled": true,
},
"cdrs": {
"enabled": true,
"rals_conns": ["*localhost"],
"chargers_conns": ["*localhost"],
"attributes_conns": ["*localhost"],
},
"attributes": {
"enabled": true,
},
"chargers": {
"enabled": true,
"attributes_conns": ["*localhost"],
},
"sessions": {
"enabled": true,
"attributes_conns": ["*localhost"],
"chargers_conns": ["*localhost"],
"rals_conns": ["*localhost"],
"cdrs_conns": ["*localhost"],
},
"apiers": {
"enabled": true,
"scheduler_conns": ["*localhost"],
},
"ers": {
"enabled": true,
"readers": [
{
"id": "blog_example_csv_parser",
"enabled": true,
"run_delay": "-1",
"type": "*file_csv",
"opts": {
"csvFieldSeparator":",",
"csvLazyQuotes": true,
//csvLazyQuotes Counts the row length and if does not match this value declares an error
//-1 means to look at the first row and use that as the row length
"csvRowLength": -1
},
"source_path": "/var/spool/cgrates/blog_example_csv_parser/in",
"processed_path": "/var/spool/cgrates/blog_example_csv_parser/out",
"concurrent_requests": 1024, //How many files to process at the same time
"flags": [
"*cdrs",
"*log"
],
"tenant": "cgrates.org",
"filters": [
"*string:~*req.2:Nick", //Only process CDRs where Customer == "Nick"
],
"fields":[
//Type of Record (Voice)
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"},
//Category set to "call" to match RatingProfile_VoiceCalls from our RatingProfile
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"},
//RequestType is *rated as we won't be deducting from an account balance
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated"},
//Unique ID for this call - We get this from the CallID field in the CSV
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable","value":"~*req.7"},
//Account is the Source of the call
{"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.4"},
//Destination is B Party Number - We use 'Called Party Number'
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.5"},
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.5"},
//Call Setup Time (In this case, CGrateS can already process this as a datetime object)
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.0"},
//Usage in seconds - We use 'Call duration'
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.3"},
//We can include extra columns with extra data - Like this one:
{"tag": "Animal", "path": "*cgreq.Animal", "type": "*variable", "value": "~*req.6"},
{"tag": "Value0", "path": "*cgreq.Value0", "type": "*variable", "value": "~*req.0"},
{"tag": "Value1", "path": "*cgreq.Value1", "type": "*variable", "value": "~*req.1"},
{"tag": "Value2", "path": "*cgreq.Value2", "type": "*variable", "value": "~*req.2"},
{"tag": "Value3", "path": "*cgreq.Value3", "type": "*variable", "value": "~*req.3"},
{"tag": "Value4", "path": "*cgreq.Value4", "type": "*variable", "value": "~*req.4"},
{"tag": "Value5", "path": "*cgreq.Value5", "type": "*variable", "value": "~*req.5"},
{"tag": "Value6", "path": "*cgreq.Value6", "type": "*variable", "value": "~*req.6"},
{"tag": "Value7", "path": "*cgreq.Value7", "type": "*variable", "value": "~*req.7"},
{"tag": "Value8", "path": "*cgreq.Value8", "type": "*variable", "value": "~*req.8"},
{"tag": "Value9", "path": "*cgreq.Value9", "type": "*variable", "value": "~*req.9"},
{"tag": "Value10", "path": "*cgreq.Value10", "type": "*variable", "value": "~*req.10"},
{"tag": "Value11", "path": "*cgreq.Value11", "type": "*variable", "value": "~*req.11"},
{"tag": "Value12", "path": "*cgreq.Value12", "type": "*variable", "value": "~*req.12"},
{"tag": "Value13", "path": "*cgreq.Value13", "type": "*variable", "value": "~*req.13"},
{"tag": "Value14", "path": "*cgreq.Value14", "type": "*variable", "value": "~*req.14"},
{"tag": "Value15", "path": "*cgreq.Value15", "type": "*variable", "value": "~*req.15"},
{"tag": "Value16", "path": "*cgreq.Value16", "type": "*variable", "value": "~*req.16"},
{"tag": "Value17", "path": "*cgreq.Value17", "type": "*variable", "value": "~*req.17"},
{"tag": "Value18", "path": "*cgreq.Value18", "type": "*variable", "value": "~*req.18"},
{"tag": "Value19", "path": "*cgreq.Value19", "type": "*variable", "value": "~*req.19"},
{"tag": "Value20", "path": "*cgreq.Value20", "type": "*variable", "value": "~*req.20"},
]
}
]
}
}