0% found this document useful (0 votes)
9 views8 pages

CGRateS Diameter Agent Gy

Download as txt, pdf, or txt
Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1/ 8

"diameter_agent": {

"enabled": true,
// enables the diameter agent: <true|false>
"listen": "10.90.250.177:3868",
// address where to listen for diameter requests <x.y.z.y/x1.y1.z1.y1:1234>
"listen_net": "tcp",
// transport type for diameter <tcp|sctp>
"dictionaries_path": "/usr/share/cgrates/diameter/dict/", //
path towards directory holding additional dictionaries to load
"sessions_conns": ["*localhost"],
"origin_host": "CGR-DA.epc.mnc435.mcc311.3gppnetwork.org",
// diameter Origin-Host AVP used in replies
"origin_realm": "epc.mnc435.mcc311.3gppnetwork.org",
// diameter Origin-Realm AVP used in replies
"vendor_id": 0,
// diameter Vendor-Id AVP used in replies
"product_name": "CGRateS",
// diameter Product-Name AVP used in replies
"concurrent_requests": -1,
// limit the number of active requests processed by the server <-1|0-n>
"synced_conn_requests": false,
// process one request at the time per connection
"asr_template": "*asr",
// enable AbortSession message being sent to client on DisconnectSession
"rar_template": "*rar",
// template used to build the Re-Auth-Request
"forced_disconnect": "*asr",
// the request to send to diameter on DisconnectSession <*none|*asr|*rar>
"create_cdr": true,
"templates":{
// default message templates
"*err": [
{"tag": "SessionId", "path": "*rep.Session-Id",
"type": "*variable",
"value": "~*req.Session-Id", "mandatory":
true},
{"tag": "OriginHost", "path": "*rep.Origin-Host",
"type": "*variable",
"value": "~*vars.OriginHost", "mandatory":
true},
{"tag": "OriginRealm", "path": "*rep.Origin-Realm",
"type": "*variable",
"value": "~*vars.OriginRealm", "mandatory":
true},
],

"*asr": [
{"tag": "SessionId", "path": "*diamreq.Session-Id",
"type": "*variable",
"value": "~*req.Session-Id", "mandatory":
true},
{"tag": "OriginHost", "path": "*diamreq.Origin-Host",
"type": "*variable",
"value": "~*req.Destination-Host",
"mandatory": true},
{"tag": "OriginRealm", "path": "*diamreq.Origin-
Realm", "type": "*variable",
"value": "~*req.Destination-Realm",
"mandatory": true},
{"tag": "DestinationRealm", "path":
"*diamreq.Destination-Realm", "type": "*variable",
"value": "~*req.Origin-Realm", "mandatory":
true},
{"tag": "DestinationHost", "path":
"*diamreq.Destination-Host", "type": "*variable",
"value": "~*req.Origin-Host", "mandatory":
true},
{"tag": "AuthApplicationId", "path": "*diamreq.Auth-
Application-Id", "type": "*variable",
"value": "~*vars.*appid", "mandatory":
true},
{"tag": "UserName", "path": "*diamreq.User-Name",
"type": "*variable",
"value": "~*req.User-Name", "mandatory":
true},
{"tag": "OriginStateID", "path": "*diamreq.Origin-
State-Id", "type": "*constant",
"value": "1"},
]
},

"request_processors": [

{
"id": "data_init",
"filters": ["*string:~*vars.*cmd:CCR",
"*string:~*req.CC-Request-Type:1", "*prefix:~*req.Service-Context-
Id:32251@3gpp.org"],
"flags": ["*initiate", "*accounts", "*log"],
"request_fields":[
{
"tag": "ToR",
"path": "*cgreq.ToR",
"type": "*constant",
"value": "*data"
},
{
"tag": "OriginID",
"path": "*cgreq.OriginID",
"type": "*variable",
"value": "~*req.Session-Id",
"mandatory": true
},
{
"tag": "RequestType",
"path": "*cgreq.RequestType",
"type": "*constant",
"value": "*postpaid"
},
{
"tag": "Category",
"path": "*cgreq.Category",
"type": "*variable",
"value": "~*req.Service-
Information.PS-Information.Called-Station-Id"
},
{
"tag": "Account",
"path": "*cgreq.Account",
"type": "*variable",
"value": "~*req.Subscription-
Id.Subscription-Id-Data[~Subscription-Id-Type(0)]",
"mandatory": true
},
{
"tag": "Destination",
"path": "*cgreq.Destination",
"type": "*variable",
"value": "~*req.Service-
Information.PS-Information.Called-Station-Id"
},
{
"tag": "SetupTime",
"path": "*cgreq.SetupTime",
"type": "*variable",
"value": "~*req.Event-Timestamp",
"mandatory": true
},
{
"tag": "AnswerTime",
"path": "*cgreq.AnswerTime",
"type": "*variable",
"value": "~*req.Event-Timestamp",
"mandatory": true
},
{
"tag": "Usage",
"path": "*cgreq.Usage",
"type": "*constant",
"value": "1000000"
}
],
"reply_fields": [
{
"tag": "CCATemplate",
"type": "*template",
"value": "*cca"
},
{
"tag": "GrantedTimeUnits",
"type": "*constant",
"path": "*rep.Multiple-Services-
Credit-Control.Granted-Service-Unit.CC-Time",
"value": "5",
"mandatory": true
},
{
"tag": "GrantedInputUnits",
"type": "*constant",
"path": "*rep.Multiple-Services-
Credit-Control.Granted-Service-Unit.CC-Input-Octets",
"value": "1000000",
"mandatory": true
},
{
"tag": "GrantedOutputUnits",
"type": "*constant",
"path": "*rep.Multiple-Services-
Credit-Control.Granted-Service-Unit.CC-Output-Octets",
"value": "1000000",
"mandatory": true
},
{
"tag": "ResultCode",
"filters":
["*notempty:~*cgrep.Error:"],
"path": "*rep.Result-Code",
"type": "*constant",
"value": "5030",
"blocker": true
}
]
},
{
"id": "data_update",
"filters": ["*string:~*vars.*cmd:CCR",
"*string:~*req.CC-Request-Type:2", "*prefix:~*req.Service-Context-
Id:32251@3gpp.org"],
"flags": ["*update", "*accounts", "*log"],
"request_fields":[
{
"tag": "ToR",
"path": "*cgreq.ToR",
"type": "*constant",
"value": "*data"
},
{
"tag": "InitialOriginID",
"path": "*cgreq.InitialOriginID",
"type": "*variable",
"value": "~*req.Session-Id",
"mandatory": true
},
{
"tag": "OriginID",
"path": "*cgreq.OriginID",
"type": "*variable",
"value": "~*req.Session-Id",
"mandatory": true
},
{
"tag": "RequestType",
"path": "*cgreq.RequestType",
"type": "*constant",
"value": "*postpaid"
},
{
"tag": "Category",
"path": "*cgreq.Category",
"type": "*variable",
"value": "~*req.Service-
Information.PS-Information.Called-Station-Id"
},
{
"tag": "Account",
"path": "*cgreq.Account",
"type": "*variable",
"value": "~*req.Subscription-
Id.Subscription-Id-Data[~Subscription-Id-Type(0)]",
"mandatory": true
},
{
"tag": "Destination",
"path": "*cgreq.Destination",
"type": "*variable",
"value": "~*req.Service-
Information.PS-Information.Called-Station-Id"
},
{
"tag": "SetupTime",
"path": "*cgreq.SetupTime",
"type": "*variable",
"value": "~*req.Event-Timestamp",
"mandatory": true
},
{
"tag": "AnswerTime",
"path": "*cgreq.AnswerTime",
"type": "*variable",
"value": "~*req.Event-Timestamp",
"mandatory": true
},
{
"tag": "Usage",
"path": "*cgreq.Usage",
"type": "*constant",
"value": "1000000"
},
{
"tag": "LastUsed",
"path": "*cgreq.LastUsed",
"type": "*sum",
"value": "~*req.Multiple-Services-
Credit-Control.Used-Service-Unit.CC-Input-Octets;~*req.Multiple-Services-Credit-
Control.Used-Service-Unit.CC-Output-Octets"
}

],
"reply_fields": [
{
"tag": "CCATemplate",
"type": "*template",
"value": "*cca"
},
{
"tag": "GrantedTimeUnits",
"type": "*constant",
"path": "*rep.Multiple-Services-
Credit-Control.Granted-Service-Unit.CC-Time",
"value": "5",
"mandatory": true
},
{
"tag": "GrantedInputUnits",
"type": "*constant",
"path": "*rep.Multiple-Services-
Credit-Control.Granted-Service-Unit.CC-Input-Octets",
"value": "1000000",
"mandatory": true
},
{
"tag": "GrantedOutputUnits",
"type": "*constant",
"path": "*rep.Multiple-Services-
Credit-Control.Granted-Service-Unit.CC-Output-Octets",
"value": "1000000",
"mandatory": true
},
{
"tag": "ResultCode",
"filters":
["*notempty:~*cgrep.Error:"],
"path": "*rep.Result-Code",
"type": "*constant",
"value": "5030",
"blocker": true
}
]
},
{
"id": "data_terminate",
"filters": ["*string:~*vars.*cmd:CCR",
"*string:~*req.CC-Request-Type:3", "*prefix:~*req.Service-Context-
Id:32251@3gpp.org"
],
"flags": ["*terminate", "*accounts", "*log"],
"request_fields":[
{
"tag": "ToR",
"path": "*cgreq.ToR",
"type": "*constant",
"value": "*data"
},
{
"tag": "OriginID",
"path": "*cgreq.OriginID",
"type": "*variable",
"value": "~*req.Session-Id",
"mandatory": true
},
{
"tag": "OriginIDPrefix",
"path": "*cgreq.OriginIDPrefix",
"type": "*variable",
"value": "~*req.Session-Id",
"mandatory": true
},
{
"tag": "RequestType",
"path": "*cgreq.RequestType",
"type": "*constant",
"value": "*postpaid"
},
{
"tag": "Category",
"path": "*cgreq.Category",
"type": "*variable",
"value": "~*req.Service-
Information.PS-Information.Called-Station-Id"
},
{
"tag": "Account",
"path": "*cgreq.Account",
"type": "*variable",
"mandatory": true,
"value": "~*req.Subscription-
Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"
},
{
"tag": "Destination",
"path": "*cgreq.Destination",
"type": "*variable",
"value": "~*req.Service-
Information.PS-Information.Called-Station-Id"
},
{
"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": "LastUsed",
"path": "*cgreq.LastUsed",
"type": "*sum",
"value": "~*req.Multiple-Services-
Credit-Control.Used-Service-Unit.CC-Input-Octets;~*req.Multiple-Services-Credit-
Control.Used-Service-Unit.CC-Output-Octets"
}
],
"reply_fields": [
{
"tag": "CCATemplate",
"type": "*template",
"value": "*cca"
},
{
"tag": "ResultCode",
"filters":
["*notempty:~*cgrep.Error:"],
"path": "*rep.Result-Code",
"type": "*constant",
"value": "5030",
"blocker": true
}
]
},

You might also like