Files
cgrates-radius/authchap.json
2025-12-23 18:08:31 +05:00

52 lines
2.6 KiB
JSON

{
"radius_agent": {
"request_processors": [
{
"id": "CGRCHAPAuth",
"filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585362"],
"flags": ["*authorize", "*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": "*composed",
"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": "*composed",
"value": "~*req.Called-Station-Id", "mandatory": true},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*composed",
"value": "~*req.Event-Timestamp", "mandatory": true},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed",
"value": "~*req.Event-Timestamp", "mandatory": true},
{"tag": "PasswordFromAttributes", "path": "*cgreq.PasswordFromAttributes", "type": "*constant",
"value": "*attributes"}
],
"reply_fields":[
{"tag": "MaxUsage", "path": "*rep.SIP-AVP", "type": "*composed",
"value": "session_max_time#;~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true},
],
},
{
"id": "RadiusCHAPAuthProcessor",
"filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585362"],
"flags": ["*radauth", "*chap", "*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"}
]
},
],
}
}