diff --git a/cgrates.json b/cgrates.json index c84f923..3f8ad95 100644 --- a/cgrates.json +++ b/cgrates.json @@ -82,12 +82,34 @@ }, "request_processors": [ { - "id": "Auth", + "id": "AuthGetPassword", "filters": ["*string:~*vars.*radReqType:*radAuth"], - "flags": ["*none", "*log"], - "request_fields": [], + "flags": ["*attributes", "*continue", "*log"], + "request_fields": [ + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.User-Name"} + ], + "reply_fields": [] + }, + { + "id": "AuthPAP", + "filters": ["*string:~*vars.*radReqType:*radAuth"], + "flags": ["*radauth", "*pap", "*log"], + "request_fields": [ + {"tag": "UserPassword", "path": "*vars.UserPassword", "type": "*variable", + "value": "~*req.Password"}, + {"tag": "StrippedPassword", "path": "*cgreq.Password", "type": "*variable", + "value": "~*req.User-Password{*strip:*suffix:*nil}"} + ], "reply_fields": [ - {"tag": "SessionTimeout", "path": "*rep.Session-Timeout", "type": "*constant", "value": "3600"} + {"tag": "RemoveOnError", "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"}, + {"tag": "SessionTimeout", "path": "*rep.Session-Timeout", "filters": ["*empty:~*cgrep.Error:"], + "type": "*constant", "value": "3600"}, + {"tag": "AcctInterimInterval", "path": "*rep.Acct-Interim-Interval", "filters": ["*empty:~*cgrep.Error:"], + "type": "*constant", "value": "30"} ] } ]