105 lines
6.0 KiB
JSON
105 lines
6.0 KiB
JSON
{
|
|
"radius_agent": {
|
|
"request_processors": [
|
|
{
|
|
"id": "MikrotikPPPoEAcctStart",
|
|
"filters": ["*string:~*req.Acct-Status-Type:Start"],
|
|
"flags": ["*initiate", "*attributes", "*resources", "*accounts"],
|
|
"request_fields": [
|
|
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"},
|
|
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"},
|
|
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant",
|
|
"value": "*prepaid", "mandatory": true},
|
|
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable",
|
|
"value": "~*req.Acct-Session-Id", "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": "*variable",
|
|
"value": "~*req.User-Name", "mandatory": true},
|
|
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant",
|
|
"value": "data"},
|
|
{"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": "CallingStationId", "path": "*cgreq.CallingStationId", "type": "*variable",
|
|
"value": "~*req.Calling-Station-Id"},
|
|
{"tag": "FramedIPAddress", "path": "*cgreq.FramedIPAddress", "type": "*variable",
|
|
"value": "~*req.Framed-IP-Address"},
|
|
{"tag": "RemoteAddr", "path": "*cgreq.RemoteAddr", "type": "*variable",
|
|
"value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}
|
|
],
|
|
"reply_fields": []
|
|
},
|
|
{
|
|
"id": "MikrotikPPPoEAcctInterim",
|
|
"filters": ["*string:~*req.Acct-Status-Type:Interim-Update"],
|
|
"flags": ["*update", "*accounts"],
|
|
"request_fields": [
|
|
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"},
|
|
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"},
|
|
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant",
|
|
"value": "*prepaid", "mandatory": true},
|
|
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable",
|
|
"value": "~*req.Acct-Session-Id", "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": "*variable",
|
|
"value": "~*req.User-Name", "mandatory": true},
|
|
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant",
|
|
"value": "data"},
|
|
{"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": "Usage", "path": "*cgreq.Usage", "type": "*variable",
|
|
"value": "~*req.Acct-Session-Time{*duration_seconds}"},
|
|
{"tag": "LastUsed", "path": "*cgreq.LastUsed", "type": "*sum",
|
|
"value": "~*req.Acct-Input-Octets;~*req.Acct-Output-Octets"}
|
|
],
|
|
"reply_fields": []
|
|
},
|
|
{
|
|
"id": "MikrotikPPPoEAcctStop",
|
|
"filters": ["*string:~*req.Acct-Status-Type:Stop"],
|
|
"flags": ["*terminate", "*resources", "*accounts", "*cdrs"],
|
|
"request_fields": [
|
|
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"},
|
|
{"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"},
|
|
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant",
|
|
"value": "*prepaid", "mandatory": true},
|
|
{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable",
|
|
"value": "~*req.Acct-Session-Id", "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": "*variable",
|
|
"value": "~*req.User-Name", "mandatory": true},
|
|
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant",
|
|
"value": "data"},
|
|
{"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": "Usage", "path": "*cgreq.Usage", "type": "*variable",
|
|
"value": "~*req.Acct-Session-Time{*duration_seconds}", "mandatory": true},
|
|
{"tag": "DataUsed", "path": "*cgreq.DataUsed", "type": "*sum",
|
|
"value": "~*req.Acct-Input-Octets;~*req.Acct-Output-Octets"},
|
|
{"tag": "CallingStationId", "path": "*cgreq.CallingStationId", "type": "*variable",
|
|
"value": "~*req.Calling-Station-Id"},
|
|
{"tag": "FramedIPAddress", "path": "*cgreq.FramedIPAddress", "type": "*variable",
|
|
"value": "~*req.Framed-IP-Address"},
|
|
{"tag": "RemoteAddr", "path": "*cgreq.RemoteAddr", "type": "*variable",
|
|
"value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}
|
|
],
|
|
"reply_fields": []
|
|
}
|
|
]
|
|
}
|
|
}
|