diff --git a/agents/librad.go b/agents/librad.go index c6e63aaca..ba61b6e12 100644 --- a/agents/librad.go +++ b/agents/librad.go @@ -119,31 +119,38 @@ func (pk *radiusDP) RemoteHost() net.Addr { return utils.NewNetAddr(pk.req.RemoteAddr().Network(), pk.req.RemoteAddr().String()) } -//radauthReq is used to authorize a request -//if User-Password avp is present use PAP auth -//if CHAP-Password is presented use CHAP auth -func radauthReq(req *radigo.Packet, aReq *AgentRequest, rpl *radigo.Packet) (bool, error) { +//radauthReq is used to authorize a request based on flags +func radauthReq(flags utils.FlagsWithParams, req *radigo.Packet, aReq *AgentRequest, rpl *radigo.Packet) (bool, error) { // try to get UserPassword from Vars as slice of NMItems nmItems, err := aReq.Vars.FieldAsInterface([]string{utils.UserPassword}) if err != nil { return false, err } - userPassAvps := req.AttributesWithName("User-Password", utils.EmptyString) - chapAVPs := req.AttributesWithName("CHAP-Password", utils.EmptyString) - msChallenge := req.AttributesWithName("MS-CHAP-Challenge", "Microsoft") - msResponse := req.AttributesWithName("MS-CHAP-Response", "Microsoft") - if len(userPassAvps) == 0 && len(chapAVPs) == 0 && len(msChallenge) == 0 && len(msResponse) == 0 { - return false, fmt.Errorf("cannot find User-Password or CHAP-Password AVP in request") - } switch { - case len(userPassAvps) != 0: + case flags.HasKey(utils.MetaPAP): + userPassAvps := req.AttributesWithName(UserPasswordAVP, utils.EmptyString) + if len(userPassAvps) == 0 { + return false, utils.NewErrMandatoryIeMissing(UserPasswordAVP) + } if userPassAvps[0].StringValue != nmItems.([]*config.NMItem)[0].Data { return false, nil } - case len(chapAVPs) != 0: + case flags.HasKey(utils.MetaCHAP): + chapAVPs := req.AttributesWithName(CHAPPasswordAVP, utils.EmptyString) + if len(chapAVPs) == 0 { + return false, utils.NewErrMandatoryIeMissing(CHAPPasswordAVP) + } return radigo.AuthenticateCHAP([]byte(utils.IfaceAsString(nmItems.([]*config.NMItem)[0].Data)), req.Authenticator[:], chapAVPs[0].RawValue), nil - case len(msChallenge) != 0 && len(msResponse) != 0: + case flags.HasKey(utils.MetaMSCHAPV2): + msChallenge := req.AttributesWithName(MSCHAPChallengeAVP, MicrosoftVendor) + if len(msChallenge) == 0 { + return false, utils.NewErrMandatoryIeMissing(MSCHAPChallengeAVP) + } + msResponse := req.AttributesWithName(MSCHAPResponseAVP, MicrosoftVendor) + if len(msResponse) == 0 { + return false, utils.NewErrMandatoryIeMissing(MSCHAPResponseAVP) + } vsaMSResponde := msResponse[0].Value.(*radigo.VSA) vsaMSChallange := msChallenge[0].Value.(*radigo.VSA) @@ -179,7 +186,9 @@ func radauthReq(req *radigo.Packet, aReq *AgentRequest, rpl *radigo.Packet) (boo success[0] = ident copy(success[1:], authenticatorResponse) // this AVP need to be added to be verified on the client side - rpl.AddAVPWithName("MS-CHAP2-Success", string(success), "Microsoft") + rpl.AddAVPWithName(MSCHAP2SuccessAVP, string(success), MicrosoftVendor) + default: + return false, utils.NewErrMandatoryIeMissing(utils.Flags) } return true, nil diff --git a/agents/radagent.go b/agents/radagent.go index 201979d4a..0ac0599df 100644 --- a/agents/radagent.go +++ b/agents/radagent.go @@ -29,10 +29,16 @@ import ( ) const ( - MetaRadReqType = "*radReqType" - MetaRadAuth = "*radAuth" - MetaRadAcctStart = "*radAcctStart" - MetaRadReplyCode = "*radReplyCode" + MetaRadReqType = "*radReqType" + MetaRadAuth = "*radAuth" + MetaRadAcctStart = "*radAcctStart" + MetaRadReplyCode = "*radReplyCode" + UserPasswordAVP = "User-Password" + CHAPPasswordAVP = "CHAP-Password" + MSCHAPChallengeAVP = "MS-CHAP-Challenge" + MSCHAPResponseAVP = "MS-CHAP-Response" + MicrosoftVendor = "Microsoft" + MSCHAP2SuccessAVP = "MS-CHAP2-Success" ) func NewRadiusAgent(cgrCfg *config.CGRConfig, filterS *engine.FilterS, @@ -304,8 +310,8 @@ func (ra *RadiusAgent) processRequest(req *radigo.Packet, reqProcessor *config.R } case utils.MetaCDRs: // allow this method case utils.MetaRadauth: - if pass, err := radauthReq(req, agReq, rpl); err != nil { - return false, err + if pass, err := radauthReq(reqProcessor.Flags, req, agReq, rpl); err != nil { + agReq.CGRReply.Set([]string{utils.Error}, err.Error(), false, false) } else if !pass { agReq.CGRReply.Set([]string{utils.Error}, utils.RadauthFailed, false, false) } diff --git a/agents/radagent_it_test.go b/agents/radagent_it_test.go index b4834496d..c05f453f4 100644 --- a/agents/radagent_it_test.go +++ b/agents/radagent_it_test.go @@ -56,6 +56,8 @@ var ( testRAitAuthCHAPFail, testRAitAuthMSCHAPV2Success, testRAitAuthMSCHAPV2Fail, + testRAitChallenge, + testRAitChallengeResponse, testRAitAcctStart, testRAitAcctStop, testRAitStopCgrEngine, @@ -64,7 +66,7 @@ var ( // Test start here func TestRAit(t *testing.T) { - //engine.KillEngine(0) + engine.KillEngine(0) switch *dbType { case utils.MetaInternal: raonfigDIR = "radagent_internal" @@ -85,7 +87,6 @@ func TestRAit(t *testing.T) { } } -/* func TestRAitDispatcher(t *testing.T) { if *encoding == utils.MetaGOB { t.SkipNow() @@ -102,7 +103,6 @@ func TestRAitDispatcher(t *testing.T) { engine.KillEngine(100) isDispatcherActive = false } -*/ func testRAitInitCfg(t *testing.T) { raCfgPath = path.Join(*dataDir, "conf", "samples", raonfigDIR) @@ -309,7 +309,7 @@ func testRAitAuthCHAPSuccess(t *testing.T) { if err := authReq.AddAVPWithName("Acct-Session-Id", "e4921177ab0e3586c37f6a185864b71a@0:0:0:0:0:0:0:0", ""); err != nil { t.Error(err) } - if err := authReq.AddAVPWithName("Sip-From-Tag", "51585361", ""); err != nil { + if err := authReq.AddAVPWithName("Sip-From-Tag", "51585362", ""); err != nil { t.Error(err) } if err := authReq.AddAVPWithName("NAS-IP-Address", "127.0.0.1", ""); err != nil { @@ -353,7 +353,7 @@ func testRAitAuthCHAPFail(t *testing.T) { if err := authReq.AddAVPWithName("Acct-Session-Id", "e4921177ab0e3586c37f6a185864b71a@0:0:0:0:0:0:0:0", ""); err != nil { t.Error(err) } - if err := authReq.AddAVPWithName("Sip-From-Tag", "51585361", ""); err != nil { + if err := authReq.AddAVPWithName("Sip-From-Tag", "51585362", ""); err != nil { t.Error(err) } if err := authReq.AddAVPWithName("NAS-IP-Address", "127.0.0.1", ""); err != nil { @@ -409,7 +409,7 @@ func testRAitAuthMSCHAPV2Success(t *testing.T) { if err := authReq.AddAVPWithName("Acct-Session-Id", "e4921177ab0e3586c37f6a185864b71a@0:0:0:0:0:0:0:0", ""); err != nil { t.Error(err) } - if err := authReq.AddAVPWithName("Sip-From-Tag", "51585361", ""); err != nil { + if err := authReq.AddAVPWithName("Sip-From-Tag", "51585363", ""); err != nil { t.Error(err) } if err := authReq.AddAVPWithName("NAS-IP-Address", "127.0.0.1", ""); err != nil { @@ -472,7 +472,7 @@ func testRAitAuthMSCHAPV2Fail(t *testing.T) { if err := authReq.AddAVPWithName("Acct-Session-Id", "e4921177ab0e3586c37f6a185864b71a@0:0:0:0:0:0:0:0", ""); err != nil { t.Error(err) } - if err := authReq.AddAVPWithName("Sip-From-Tag", "51585361", ""); err != nil { + if err := authReq.AddAVPWithName("Sip-From-Tag", "51585363", ""); err != nil { t.Error(err) } if err := authReq.AddAVPWithName("NAS-IP-Address", "127.0.0.1", ""); err != nil { @@ -495,6 +495,91 @@ func testRAitAuthMSCHAPV2Fail(t *testing.T) { } } +func testRAitChallenge(t *testing.T) { + if raAuthClnt, err = radigo.NewClient("udp", "127.0.0.1:1812", "CGRateS.org", dictRad, 1, nil); err != nil { + t.Fatal(err) + } + authReq := raAuthClnt.NewRequest(radigo.AccessRequest, 1) // emulates Kamailio packet out of radius_load_caller_avps() + if err := authReq.AddAVPWithName("User-Name", "1001", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("Service-Type", "SIP-Caller-AVPs", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("Called-Station-Id", "1002", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("Acct-Session-Id", "e4921177ab0e3586c37f6a185864b71a@0:0:0:0:0:0:0:0", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("Sip-From-Tag", "12345678", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("NAS-IP-Address", "127.0.0.1", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("Event-Timestamp", "1497106115", ""); err != nil { + t.Error(err) + } + reply, err := raAuthClnt.SendRequest(authReq) + if err != nil { + t.Fatal(err) + } + if reply.Code != radigo.AccessChallenge { + t.Errorf("Received reply: %+v", utils.ToJSON(reply)) + } + if len(reply.AVPs) != 1 { // make sure the client receive the message + t.Errorf("Received AVPs: %+v", utils.ToJSON(reply.AVPs)) + } else if !reflect.DeepEqual([]byte("Missing User-Password"), reply.AVPs[0].RawValue) { + t.Errorf("Received: %s", string(reply.AVPs[0].RawValue)) + } +} + +func testRAitChallengeResponse(t *testing.T) { + if raAuthClnt, err = radigo.NewClient("udp", "127.0.0.1:1812", "CGRateS.org", dictRad, 1, nil); err != nil { + t.Fatal(err) + } + authReq := raAuthClnt.NewRequest(radigo.AccessRequest, 1) // emulates Kamailio packet out of radius_load_caller_avps() + if err := authReq.AddAVPWithName("User-Name", "1001", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("User-Password", "CGRateSPassword1", ""); err != nil { + t.Error(err) + } + // encode the password as required so we can decode it properly + authReq.AVPs[1].RawValue = radigo.EncodeUserPassWord([]byte("CGRateSPassword1"), []byte("CGRateS.org"), authReq.Authenticator[:]) + if err := authReq.AddAVPWithName("Service-Type", "SIP-Caller-AVPs", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("Called-Station-Id", "1002", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("Acct-Session-Id", "e4921177ab0e3586c37f6a185864b71a@0:0:0:0:0:0:0:0", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("Sip-From-Tag", "12345678", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("NAS-IP-Address", "127.0.0.1", ""); err != nil { + t.Error(err) + } + if err := authReq.AddAVPWithName("Event-Timestamp", "1497106115", ""); err != nil { + t.Error(err) + } + reply, err := raAuthClnt.SendRequest(authReq) + if err != nil { + t.Fatal(err) + } + if reply.Code != radigo.AccessAccept { + t.Errorf("Received reply: %+v", utils.ToJSON(reply)) + } + if len(reply.AVPs) != 1 { // make sure max duration is received + t.Errorf("Received AVPs: %+v", utils.ToJSON(reply.AVPs)) + } else if !reflect.DeepEqual([]byte("session_max_time#10800"), reply.AVPs[0].RawValue) { + t.Errorf("Received: %s", string(reply.AVPs[0].RawValue)) + } +} + func testRAitAcctStart(t *testing.T) { if raAcctClnt, err = radigo.NewClient("udp", "127.0.0.1:1813", "CGRateS.org", dictRad, 1, nil); err != nil { t.Fatal(err) diff --git a/data/conf/samples/dispatchers/radagent/accounting.json b/data/conf/samples/dispatchers/radagent/accounting.json new file mode 100644 index 000000000..90c6e18ad --- /dev/null +++ b/data/conf/samples/dispatchers/radagent/accounting.json @@ -0,0 +1,62 @@ +{ + +"radius_agent": { + "request_processors": [ + { + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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":[], + }, + ], + }, + +}, \ No newline at end of file diff --git a/data/conf/samples/dispatchers/radagent/authchallenge.json b/data/conf/samples/dispatchers/radagent/authchallenge.json new file mode 100644 index 000000000..43f258ca7 --- /dev/null +++ b/data/conf/samples/dispatchers/radagent/authchallenge.json @@ -0,0 +1,62 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "Challenge", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678", + "*empty:~*req.User-Password:"], + "flags": ["*none", "*log"], + "reply_fields":[ + {"tag": "Code", "path": "*rep.*radReplyCode", + "type": "*constant", "value": "AccessChallenge"}, + {"tag": "ReplyMessage", "path": "*rep.Reply-Message", + "type": "*constant", "value": "Missing User-Password"} + ], + }, + { + "id": "CGRAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678"], + "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": "*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": "RadiusAuthProcessorChallenge", + "filters": ["*string:~*vars.*radReqType:*radAuth","*string:~*req.Sip-From-Tag:12345678"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/dispatchers/radagent/authchap.json b/data/conf/samples/dispatchers/radagent/authchap.json new file mode 100644 index 000000000..21816ee65 --- /dev/null +++ b/data/conf/samples/dispatchers/radagent/authchap.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRCHAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585362"], + "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": "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/dispatchers/radagent/authmschapv2.json b/data/conf/samples/dispatchers/radagent/authmschapv2.json new file mode 100644 index 000000000..6b9c741d1 --- /dev/null +++ b/data/conf/samples/dispatchers/radagent/authmschapv2.json @@ -0,0 +1,51 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "CGRMSCHAPV2PAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "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": "*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": "RadiusAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "flags": ["*radauth", "*mschapv2", "*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"} + ] + }, + + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/dispatchers/radagent/authpapauth.json b/data/conf/samples/dispatchers/radagent/authpapauth.json new file mode 100644 index 000000000..cacd5c806 --- /dev/null +++ b/data/conf/samples/dispatchers/radagent/authpapauth.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRPAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "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": "*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": "RadiusPAPAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/dispatchers/radagent/cgrates.json b/data/conf/samples/dispatchers/radagent/cgrates.json index 1937f240f..138ce03c1 100644 --- a/data/conf/samples/dispatchers/radagent/cgrates.json +++ b/data/conf/samples/dispatchers/radagent/cgrates.json @@ -54,107 +54,6 @@ "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": { diff --git a/data/conf/samples/radagent_internal/accounting.json b/data/conf/samples/radagent_internal/accounting.json new file mode 100644 index 000000000..90c6e18ad --- /dev/null +++ b/data/conf/samples/radagent_internal/accounting.json @@ -0,0 +1,62 @@ +{ + +"radius_agent": { + "request_processors": [ + { + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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":[], + }, + ], + }, + +}, \ No newline at end of file diff --git a/data/conf/samples/radagent_internal/authchallenge.json b/data/conf/samples/radagent_internal/authchallenge.json new file mode 100644 index 000000000..43f258ca7 --- /dev/null +++ b/data/conf/samples/radagent_internal/authchallenge.json @@ -0,0 +1,62 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "Challenge", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678", + "*empty:~*req.User-Password:"], + "flags": ["*none", "*log"], + "reply_fields":[ + {"tag": "Code", "path": "*rep.*radReplyCode", + "type": "*constant", "value": "AccessChallenge"}, + {"tag": "ReplyMessage", "path": "*rep.Reply-Message", + "type": "*constant", "value": "Missing User-Password"} + ], + }, + { + "id": "CGRAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678"], + "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": "*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": "RadiusAuthProcessorChallenge", + "filters": ["*string:~*vars.*radReqType:*radAuth","*string:~*req.Sip-From-Tag:12345678"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_internal/authchap.json b/data/conf/samples/radagent_internal/authchap.json new file mode 100644 index 000000000..21816ee65 --- /dev/null +++ b/data/conf/samples/radagent_internal/authchap.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRCHAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585362"], + "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": "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_internal/authmschapv2.json b/data/conf/samples/radagent_internal/authmschapv2.json new file mode 100644 index 000000000..6b9c741d1 --- /dev/null +++ b/data/conf/samples/radagent_internal/authmschapv2.json @@ -0,0 +1,51 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "CGRMSCHAPV2PAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "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": "*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": "RadiusAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "flags": ["*radauth", "*mschapv2", "*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"} + ] + }, + + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_internal/authpapauth.json b/data/conf/samples/radagent_internal/authpapauth.json new file mode 100644 index 000000000..cacd5c806 --- /dev/null +++ b/data/conf/samples/radagent_internal/authpapauth.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRPAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "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": "*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": "RadiusPAPAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_internal/cgrates.json b/data/conf/samples/radagent_internal/cgrates.json index 87bf5dd09..51be18b56 100644 --- a/data/conf/samples/radagent_internal/cgrates.json +++ b/data/conf/samples/radagent_internal/cgrates.json @@ -66,106 +66,6 @@ "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": "*variable", - "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": "*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.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": "*variable", - "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": "*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.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":[], - }, - ], }, diff --git a/data/conf/samples/radagent_internal_gob/accounting.json b/data/conf/samples/radagent_internal_gob/accounting.json new file mode 100644 index 000000000..90c6e18ad --- /dev/null +++ b/data/conf/samples/radagent_internal_gob/accounting.json @@ -0,0 +1,62 @@ +{ + +"radius_agent": { + "request_processors": [ + { + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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":[], + }, + ], + }, + +}, \ No newline at end of file diff --git a/data/conf/samples/radagent_internal_gob/authchallenge.json b/data/conf/samples/radagent_internal_gob/authchallenge.json new file mode 100644 index 000000000..43f258ca7 --- /dev/null +++ b/data/conf/samples/radagent_internal_gob/authchallenge.json @@ -0,0 +1,62 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "Challenge", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678", + "*empty:~*req.User-Password:"], + "flags": ["*none", "*log"], + "reply_fields":[ + {"tag": "Code", "path": "*rep.*radReplyCode", + "type": "*constant", "value": "AccessChallenge"}, + {"tag": "ReplyMessage", "path": "*rep.Reply-Message", + "type": "*constant", "value": "Missing User-Password"} + ], + }, + { + "id": "CGRAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678"], + "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": "*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": "RadiusAuthProcessorChallenge", + "filters": ["*string:~*vars.*radReqType:*radAuth","*string:~*req.Sip-From-Tag:12345678"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_internal_gob/authchap.json b/data/conf/samples/radagent_internal_gob/authchap.json new file mode 100644 index 000000000..21816ee65 --- /dev/null +++ b/data/conf/samples/radagent_internal_gob/authchap.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRCHAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585362"], + "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": "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_internal_gob/authmschapv2.json b/data/conf/samples/radagent_internal_gob/authmschapv2.json new file mode 100644 index 000000000..6b9c741d1 --- /dev/null +++ b/data/conf/samples/radagent_internal_gob/authmschapv2.json @@ -0,0 +1,51 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "CGRMSCHAPV2PAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "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": "*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": "RadiusAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "flags": ["*radauth", "*mschapv2", "*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"} + ] + }, + + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_internal_gob/authpapauth.json b/data/conf/samples/radagent_internal_gob/authpapauth.json new file mode 100644 index 000000000..cacd5c806 --- /dev/null +++ b/data/conf/samples/radagent_internal_gob/authpapauth.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRPAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "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": "*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": "RadiusPAPAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_internal_gob/cgrates.json b/data/conf/samples/radagent_internal_gob/cgrates.json index de820ee01..2b7c3963d 100644 --- a/data/conf/samples/radagent_internal_gob/cgrates.json +++ b/data/conf/samples/radagent_internal_gob/cgrates.json @@ -74,106 +74,6 @@ "radius_agent": { "enabled": true, "sessions_conns": ["conn1"], - "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": "*variable", - "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": "*variable", - "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": "*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.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": "*variable", - "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": "*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.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":[], - } - ] }, diff --git a/data/conf/samples/radagent_mongo/accounting.json b/data/conf/samples/radagent_mongo/accounting.json new file mode 100644 index 000000000..90c6e18ad --- /dev/null +++ b/data/conf/samples/radagent_mongo/accounting.json @@ -0,0 +1,62 @@ +{ + +"radius_agent": { + "request_processors": [ + { + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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":[], + }, + ], + }, + +}, \ No newline at end of file diff --git a/data/conf/samples/radagent_mongo/authchallenge.json b/data/conf/samples/radagent_mongo/authchallenge.json new file mode 100644 index 000000000..43f258ca7 --- /dev/null +++ b/data/conf/samples/radagent_mongo/authchallenge.json @@ -0,0 +1,62 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "Challenge", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678", + "*empty:~*req.User-Password:"], + "flags": ["*none", "*log"], + "reply_fields":[ + {"tag": "Code", "path": "*rep.*radReplyCode", + "type": "*constant", "value": "AccessChallenge"}, + {"tag": "ReplyMessage", "path": "*rep.Reply-Message", + "type": "*constant", "value": "Missing User-Password"} + ], + }, + { + "id": "CGRAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678"], + "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": "*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": "RadiusAuthProcessorChallenge", + "filters": ["*string:~*vars.*radReqType:*radAuth","*string:~*req.Sip-From-Tag:12345678"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mongo/authchap.json b/data/conf/samples/radagent_mongo/authchap.json new file mode 100644 index 000000000..21816ee65 --- /dev/null +++ b/data/conf/samples/radagent_mongo/authchap.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRCHAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585362"], + "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": "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mongo/authmschapv2.json b/data/conf/samples/radagent_mongo/authmschapv2.json new file mode 100644 index 000000000..6b9c741d1 --- /dev/null +++ b/data/conf/samples/radagent_mongo/authmschapv2.json @@ -0,0 +1,51 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "CGRMSCHAPV2PAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "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": "*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": "RadiusAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "flags": ["*radauth", "*mschapv2", "*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"} + ] + }, + + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mongo/authpapauth.json b/data/conf/samples/radagent_mongo/authpapauth.json new file mode 100644 index 000000000..cacd5c806 --- /dev/null +++ b/data/conf/samples/radagent_mongo/authpapauth.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRPAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "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": "*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": "RadiusPAPAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mongo/cgrates.json b/data/conf/samples/radagent_mongo/cgrates.json index 8fc2c92dc..089135eac 100644 --- a/data/conf/samples/radagent_mongo/cgrates.json +++ b/data/conf/samples/radagent_mongo/cgrates.json @@ -69,106 +69,6 @@ "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": "*variable", - "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": "*variable", - "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": "*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.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": "*variable", - "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": "*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.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":[], - } - ] }, diff --git a/data/conf/samples/radagent_mongo_gob/accounting.json b/data/conf/samples/radagent_mongo_gob/accounting.json new file mode 100644 index 000000000..90c6e18ad --- /dev/null +++ b/data/conf/samples/radagent_mongo_gob/accounting.json @@ -0,0 +1,62 @@ +{ + +"radius_agent": { + "request_processors": [ + { + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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":[], + }, + ], + }, + +}, \ No newline at end of file diff --git a/data/conf/samples/radagent_mongo_gob/authchallenge.json b/data/conf/samples/radagent_mongo_gob/authchallenge.json new file mode 100644 index 000000000..43f258ca7 --- /dev/null +++ b/data/conf/samples/radagent_mongo_gob/authchallenge.json @@ -0,0 +1,62 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "Challenge", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678", + "*empty:~*req.User-Password:"], + "flags": ["*none", "*log"], + "reply_fields":[ + {"tag": "Code", "path": "*rep.*radReplyCode", + "type": "*constant", "value": "AccessChallenge"}, + {"tag": "ReplyMessage", "path": "*rep.Reply-Message", + "type": "*constant", "value": "Missing User-Password"} + ], + }, + { + "id": "CGRAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678"], + "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": "*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": "RadiusAuthProcessorChallenge", + "filters": ["*string:~*vars.*radReqType:*radAuth","*string:~*req.Sip-From-Tag:12345678"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mongo_gob/authchap.json b/data/conf/samples/radagent_mongo_gob/authchap.json new file mode 100644 index 000000000..21816ee65 --- /dev/null +++ b/data/conf/samples/radagent_mongo_gob/authchap.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRCHAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585362"], + "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": "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mongo_gob/authmschapv2.json b/data/conf/samples/radagent_mongo_gob/authmschapv2.json new file mode 100644 index 000000000..6b9c741d1 --- /dev/null +++ b/data/conf/samples/radagent_mongo_gob/authmschapv2.json @@ -0,0 +1,51 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "CGRMSCHAPV2PAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "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": "*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": "RadiusAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "flags": ["*radauth", "*mschapv2", "*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"} + ] + }, + + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mongo_gob/authpapauth.json b/data/conf/samples/radagent_mongo_gob/authpapauth.json new file mode 100644 index 000000000..cacd5c806 --- /dev/null +++ b/data/conf/samples/radagent_mongo_gob/authpapauth.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRPAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "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": "*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": "RadiusPAPAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mongo_gob/cgrates.json b/data/conf/samples/radagent_mongo_gob/cgrates.json index 7decb638b..89f8b5a3d 100644 --- a/data/conf/samples/radagent_mongo_gob/cgrates.json +++ b/data/conf/samples/radagent_mongo_gob/cgrates.json @@ -77,106 +77,6 @@ "radius_agent": { "enabled": true, "sessions_conns": ["conn1"], - "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": "*variable", - "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": "*variable", - "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": "*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.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": "*variable", - "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": "*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.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":[], - } - ] }, diff --git a/data/conf/samples/radagent_mysql/accounting.json b/data/conf/samples/radagent_mysql/accounting.json new file mode 100644 index 000000000..90c6e18ad --- /dev/null +++ b/data/conf/samples/radagent_mysql/accounting.json @@ -0,0 +1,62 @@ +{ + +"radius_agent": { + "request_processors": [ + { + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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":[], + }, + ], + }, + +}, \ No newline at end of file diff --git a/data/conf/samples/radagent_mysql/authchallenge.json b/data/conf/samples/radagent_mysql/authchallenge.json new file mode 100644 index 000000000..43f258ca7 --- /dev/null +++ b/data/conf/samples/radagent_mysql/authchallenge.json @@ -0,0 +1,62 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "Challenge", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678", + "*empty:~*req.User-Password:"], + "flags": ["*none", "*log"], + "reply_fields":[ + {"tag": "Code", "path": "*rep.*radReplyCode", + "type": "*constant", "value": "AccessChallenge"}, + {"tag": "ReplyMessage", "path": "*rep.Reply-Message", + "type": "*constant", "value": "Missing User-Password"} + ], + }, + { + "id": "CGRAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678"], + "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": "*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": "RadiusAuthProcessorChallenge", + "filters": ["*string:~*vars.*radReqType:*radAuth","*string:~*req.Sip-From-Tag:12345678"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mysql/authchap.json b/data/conf/samples/radagent_mysql/authchap.json new file mode 100644 index 000000000..21816ee65 --- /dev/null +++ b/data/conf/samples/radagent_mysql/authchap.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRCHAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585362"], + "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": "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mysql/authmschapv2.json b/data/conf/samples/radagent_mysql/authmschapv2.json new file mode 100644 index 000000000..6b9c741d1 --- /dev/null +++ b/data/conf/samples/radagent_mysql/authmschapv2.json @@ -0,0 +1,51 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "CGRMSCHAPV2PAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "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": "*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": "RadiusAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "flags": ["*radauth", "*mschapv2", "*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"} + ] + }, + + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mysql/authpapauth.json b/data/conf/samples/radagent_mysql/authpapauth.json new file mode 100644 index 000000000..cacd5c806 --- /dev/null +++ b/data/conf/samples/radagent_mysql/authpapauth.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRPAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "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": "*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": "RadiusPAPAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mysql/cgrates.json b/data/conf/samples/radagent_mysql/cgrates.json index 979f99e30..5a607c5c7 100644 --- a/data/conf/samples/radagent_mysql/cgrates.json +++ b/data/conf/samples/radagent_mysql/cgrates.json @@ -65,106 +65,6 @@ "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": "*variable", - "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": "*variable", - "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": "*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.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": "*variable", - "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": "*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.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":[], - } - ] }, diff --git a/data/conf/samples/radagent_mysql_gob/accounting.json b/data/conf/samples/radagent_mysql_gob/accounting.json new file mode 100644 index 000000000..90c6e18ad --- /dev/null +++ b/data/conf/samples/radagent_mysql_gob/accounting.json @@ -0,0 +1,62 @@ +{ + +"radius_agent": { + "request_processors": [ + { + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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": "*composed", + "value": "~*req.NAS-IP-Address", "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.Ascend-User-Acct-Time", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", + "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":[], + }, + ], + }, + +}, \ No newline at end of file diff --git a/data/conf/samples/radagent_mysql_gob/authchallenge.json b/data/conf/samples/radagent_mysql_gob/authchallenge.json new file mode 100644 index 000000000..43f258ca7 --- /dev/null +++ b/data/conf/samples/radagent_mysql_gob/authchallenge.json @@ -0,0 +1,62 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "Challenge", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678", + "*empty:~*req.User-Password:"], + "flags": ["*none", "*log"], + "reply_fields":[ + {"tag": "Code", "path": "*rep.*radReplyCode", + "type": "*constant", "value": "AccessChallenge"}, + {"tag": "ReplyMessage", "path": "*rep.Reply-Message", + "type": "*constant", "value": "Missing User-Password"} + ], + }, + { + "id": "CGRAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:12345678"], + "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": "*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": "RadiusAuthProcessorChallenge", + "filters": ["*string:~*vars.*radReqType:*radAuth","*string:~*req.Sip-From-Tag:12345678"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mysql_gob/authchap.json b/data/conf/samples/radagent_mysql_gob/authchap.json new file mode 100644 index 000000000..21816ee65 --- /dev/null +++ b/data/conf/samples/radagent_mysql_gob/authchap.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRCHAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585362"], + "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": "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mysql_gob/authmschapv2.json b/data/conf/samples/radagent_mysql_gob/authmschapv2.json new file mode 100644 index 000000000..6b9c741d1 --- /dev/null +++ b/data/conf/samples/radagent_mysql_gob/authmschapv2.json @@ -0,0 +1,51 @@ +{ + "radius_agent": { + "request_processors": [ + { + "id": "CGRMSCHAPV2PAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "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": "*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": "RadiusAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585363"], + "flags": ["*radauth", "*mschapv2", "*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"} + ] + }, + + ], + } +} \ No newline at end of file diff --git a/data/conf/samples/radagent_mysql_gob/authpapauth.json b/data/conf/samples/radagent_mysql_gob/authpapauth.json new file mode 100644 index 000000000..cacd5c806 --- /dev/null +++ b/data/conf/samples/radagent_mysql_gob/authpapauth.json @@ -0,0 +1,51 @@ +{ + + "radius_agent": { + "request_processors": [ + { + "id": "CGRPAPAuth", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "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": "*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": "RadiusPAPAuthProcessor", + "filters": ["*string:~*vars.*radReqType:*radAuth", "*string:~*req.Sip-From-Tag:51585361"], + "flags": ["*radauth", "*pap", "*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"} + ] + }, + ], + } +} \ No newline at end of file diff --git a/go.mod b/go.mod index 27fc75e47..691449685 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/cgrates/fsock v0.0.0-20190623100231-317895b42f1a github.com/cgrates/kamevapi v0.0.0-20191001125829-7dbc3ad58817 github.com/cgrates/ltcache v0.0.0-20181016092649-92fb7fa77cca - github.com/cgrates/radigo v0.0.0-20200321121249-9e416fdf1479 + github.com/cgrates/radigo v0.0.0-20200324152710-35e651804ad1 github.com/cgrates/rpcclient v0.0.0-20200107134035-188454eb71b3 github.com/creack/pty v1.1.7 github.com/fiorix/go-diameter v3.0.3-0.20190716165154-f4823472d0e0+incompatible diff --git a/go.sum b/go.sum index 11d61bd34..a20e328ab 100644 --- a/go.sum +++ b/go.sum @@ -59,8 +59,8 @@ github.com/cgrates/kamevapi v0.0.0-20191001125829-7dbc3ad58817 h1:1Tdv6H/usqmkQV github.com/cgrates/kamevapi v0.0.0-20191001125829-7dbc3ad58817/go.mod h1:pgHqPlPcEDIQbbs9wyBk7YZTcaVdxMqf3v04XU+mngI= github.com/cgrates/ltcache v0.0.0-20181016092649-92fb7fa77cca h1:Ejj4m0Ccl8dMMVnoHk4nQMlbR3w24llqQDy66DO9E0A= github.com/cgrates/ltcache v0.0.0-20181016092649-92fb7fa77cca/go.mod h1:q7c996DUu8OrJRnewVSQzM+y/bRcxZAHoo+zCD8bFBo= -github.com/cgrates/radigo v0.0.0-20200321121249-9e416fdf1479 h1:UNareDs0BcycjiSy2ltRlsiaeoohDdt9OQOg55ak5Jc= -github.com/cgrates/radigo v0.0.0-20200321121249-9e416fdf1479/go.mod h1:mTCzHAYfgZlRe0HorDz+jy2JTrNvNuKkHBAUjDZBWq8= +github.com/cgrates/radigo v0.0.0-20200324152710-35e651804ad1 h1:QvA6Nbwq9kTd7hsvu1xo5kwia68cLwnp0sYCq1u40TU= +github.com/cgrates/radigo v0.0.0-20200324152710-35e651804ad1/go.mod h1:HZbsg3Y+xw4lsfCqX9rzj429wrg0XOug6pFT3B6VHZY= github.com/cgrates/rpcclient v0.0.0-20200107134035-188454eb71b3 h1:esWCSaLD2j+zfK9JpyPXFSe3c97MQFhfKp9jDiss1mU= github.com/cgrates/rpcclient v0.0.0-20200107134035-188454eb71b3/go.mod h1:xXLqAKVvcdWeDYwHJYwDgAI3ZOg5LZYxzb72kLjsLZU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -221,6 +221,8 @@ golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 h1:Gv7RPwsi3eZ2Fgewe3CBsuOebPwO27PoXzRpJPsvSSM= golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200320181102-891825fb96df h1:lDWgvUvNnaTnNBc/dwOty86cFeKoKWbwy2wQj0gIxbU= +golang.org/x/crypto v0.0.0-20200320181102-891825fb96df/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= diff --git a/utils/consts.go b/utils/consts.go index 7ebaf2258..9c914129f 100755 --- a/utils/consts.go +++ b/utils/consts.go @@ -710,6 +710,9 @@ const ( MetaRadauth = "*radauth" UserPassword = "UserPassword" RadauthFailed = "RADAUTH_FAILED" + MetaPAP = "*pap" + MetaCHAP = "*chap" + MetaMSCHAPV2 = "*mschapv2" ) // Migrator Action