Add integration tests for Auth and Challange with Radius

This commit is contained in:
TeoV
2020-03-25 17:41:03 +02:00
committed by Dan Christian Bogos
parent d8f50310c8
commit 83a41eb191
47 changed files with 2075 additions and 632 deletions

View File

@@ -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

View File

@@ -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)
}

View File

@@ -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)

View File

@@ -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":[],
},
],
},
},

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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": {

View File

@@ -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":[],
},
],
},
},

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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":[],
},
],
},

View File

@@ -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":[],
},
],
},
},

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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":[],
}
]
},

View File

@@ -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":[],
},
],
},
},

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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":[],
}
]
},

View File

@@ -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":[],
},
],
},
},

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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":[],
}
]
},

View File

@@ -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":[],
},
],
},
},

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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":[],
}
]
},

View File

@@ -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":[],
},
],
},
},

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

View File

@@ -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"}
]
},
],
}
}

2
go.mod
View File

@@ -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

6
go.sum
View File

@@ -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=

View File

@@ -710,6 +710,9 @@ const (
MetaRadauth = "*radauth"
UserPassword = "UserPassword"
RadauthFailed = "RADAUTH_FAILED"
MetaPAP = "*pap"
MetaCHAP = "*chap"
MetaMSCHAPV2 = "*mschapv2"
)
// Migrator Action