mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
165 lines
6.3 KiB
JSON
165 lines
6.3 KiB
JSON
{
|
|
// CGRateS Configuration file
|
|
//
|
|
|
|
"general": {
|
|
"node_id": "DispatcherS1",
|
|
"log_level": 7,
|
|
"reconnects": 1,
|
|
},
|
|
|
|
|
|
"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": "mongo", // stor database type to use: <mysql|postgres>
|
|
"db_port": 27017, // the port to reach the stordb
|
|
"db_name": "datadb",
|
|
"db_password": "",
|
|
},
|
|
|
|
"stor_db": {
|
|
"db_type": "mongo", // stor database type to use: <mysql|postgres>
|
|
"db_port": 27017, // the port to reach the stordb
|
|
"db_name": "stordb",
|
|
"db_password": "",
|
|
},
|
|
|
|
"attributes": {
|
|
"enabled": true
|
|
},
|
|
|
|
"schedulers": {
|
|
"enabled": true,
|
|
},
|
|
|
|
"rals": {
|
|
"enabled": true,
|
|
},
|
|
|
|
"dispatchers":{
|
|
"enabled": true,
|
|
},
|
|
|
|
"sessions": {
|
|
"enabled": true,
|
|
"debit_interval": "10s",
|
|
},
|
|
|
|
|
|
"radius_agent": {
|
|
"enabled": true,
|
|
"sessions_conns": ["*localhost"],
|
|
"request_processors": [
|
|
{
|
|
"id": "KamailioAuth",
|
|
"filters": ["*string:~*vars.*radReqType:*radAuth"],
|
|
"flags": ["*auth", "*attributes", "*accounts", "*continue"],
|
|
"request_fields":[
|
|
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"},
|
|
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant",
|
|
"value": "*prepaid", "mandatory": true},
|
|
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed",
|
|
"value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag", "mandatory": true},
|
|
{"tag": "Account", "path": "*cgreq.Account", "type": "*variable",
|
|
"value": "~*req.User-Name", "mandatory": true},
|
|
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable",
|
|
"value": "~*req.User-Name", "mandatory": true},
|
|
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable",
|
|
"value": "~*req.Called-Station-Id", "mandatory": true},
|
|
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable",
|
|
"value": "~*req.Event-Timestamp", "mandatory": true},
|
|
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable",
|
|
"value": "~*req.Event-Timestamp", "mandatory": true},
|
|
{"tag": "PasswordFromAttributes", "path": "*cgreq.PasswordFromAttributes", "type": "*constant",
|
|
"value": "*attributes"}
|
|
],
|
|
"reply_fields":[
|
|
{"tag": "MaxUsage", "path": "*rep.SIP-AVP", "type": "*variable",
|
|
"value": "session_max_time#;~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true},
|
|
],
|
|
},
|
|
{
|
|
"id": "RadiusAuthProcessor",
|
|
"filters": ["*string:~*vars.*radReqType:*radAuth"],
|
|
"flags": ["*radauth", "*log"],
|
|
"request_fields":[
|
|
{"tag": "UserPassword", "path": "*vars.UserPassword", "type": "*variable",
|
|
"value": "~*cgrep.Attributes.PasswordFromAttributes"},
|
|
],
|
|
"reply_fields":[
|
|
{"tag":"RemoveAddedFields", "filters": ["*notempty:~*cgrep.Error:"], "type": "*removeall", "path": "*rep"},
|
|
{"tag": "Code", "path": "*rep.*radReplyCode", "filters": ["*notempty:~*cgrep.Error:"],
|
|
"type": "*constant", "value": "AccessReject"},
|
|
{"tag": "ReplyMessage", "path": "*rep.Reply-Message", "filters": ["*notempty:~*cgrep.Error:"],
|
|
"type": "*variable", "value": "~*cgrep.Error"}
|
|
]
|
|
},
|
|
{
|
|
"id": "KamailioAccountingStart",
|
|
"filters": ["*string:~*req.Acct-Status-Type:Start"],
|
|
"flags": ["*initiate", "*attributes", "*resources", "*accounts"],
|
|
"request_fields":[
|
|
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"},
|
|
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant",
|
|
"value": "*prepaid", "mandatory": true},
|
|
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed",
|
|
"value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true},
|
|
{"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable",
|
|
"value": "~*req.NAS-IP-Address", "mandatory": true},
|
|
{"tag": "Account", "path": "*cgreq.Account", "type": "*variable",
|
|
"value": "~*req.User-Name", "mandatory": true},
|
|
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*composed",
|
|
"value": "~*req.User-Name", "mandatory": true},
|
|
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable",
|
|
"value": "~*req.Called-Station-Id", "mandatory": true},
|
|
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable",
|
|
"value": "~*req.Ascend-User-Acct-Time", "mandatory": true},
|
|
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable",
|
|
"value": "~*req.Ascend-User-Acct-Time", "mandatory": true},
|
|
{"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"},
|
|
],
|
|
"reply_fields":[],
|
|
},
|
|
{
|
|
"id": "KamailioAccountingStop",
|
|
"filters": ["*string:~*req.Acct-Status-Type:Stop"],
|
|
"flags": ["*terminate", "*resources", "*accounts", "*cdrs"],
|
|
"request_fields":[
|
|
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"},
|
|
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant",
|
|
"value": "*prepaid", "mandatory": true},
|
|
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed",
|
|
"value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true},
|
|
{"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable",
|
|
"value": "~*req.NAS-IP-Address", "mandatory": true},
|
|
{"tag": "Account", "path": "*cgreq.Account", "type": "*variable",
|
|
"value": "~*req.User-Name", "mandatory": true},
|
|
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*composed",
|
|
"value": "~*req.User-Name", "mandatory": true},
|
|
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable",
|
|
"value": "~*req.Called-Station-Id", "mandatory": true},
|
|
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable",
|
|
"value": "~*req.Ascend-User-Acct-Time", "mandatory": true},
|
|
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable",
|
|
"value": "~*req.Ascend-User-Acct-Time", "mandatory": true},
|
|
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference",
|
|
"value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true},
|
|
{"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"},
|
|
],
|
|
"reply_fields":[],
|
|
},
|
|
],
|
|
|
|
},
|
|
|
|
"apiers": {
|
|
"enabled": true,
|
|
"scheduler_conns": ["*internal"],
|
|
},
|
|
}
|