Files
cgrates/data/tutorials/osips_diam/etc/cgrates/cc-postpaid.json
ionutboangiu 40eaa8739c Add tut entry for opensips+diameter
INCOMPLETE
- shared cgrates configuration for three different scenarios
- every scenario has its own opensips configuration. For more info
check README or read comments inside the configuration
- added script for converting unix time to suitable Event-Timestamp
format
- added a dictionary.opensips entry for making Credit-Control diameter
requests possible
2024-05-05 14:25:14 +02:00

139 lines
4.8 KiB
JSON

{
"diameter_agent": {
"request_processors": [
{
"id": "SessionProcessCDR",
"filters": [
"*string:~*vars.*cmd:CCR",
"*string:~*req.CC-Request-Type:4",
"*prefix:~*req.Service-Context-Id:voice"
],
"flags": ["*cdrs", "*log"],
"request_fields":[
{
"tag": "ToR",
"path": "*cgreq.ToR",
"type": "*constant",
"value": "*voice"
},
{
"tag": "OriginID",
"path": "*cgreq.OriginID",
"type": "*variable",
"value": "~*req.Session-Id",
"mandatory": true
},
{
"tag": "OriginHost",
"path": "*cgreq.OriginHost",
"type": "*variable",
"value": "~*req.Origin-Host",
"mandatory": true
},
{
"tag": "RequestType",
"path": "*cgreq.RequestType",
"type": "*constant",
"value": "*postpaid"
},
{
"tag": "Account",
"path": "*cgreq.Account",
"type": "*variable",
"value": "~*req.Service-Information.IMS-Information.Calling-Party-Address",
"mandatory": true
},
{
"tag": "Destination",
"path": "*cgreq.Destination",
"type": "*variable",
"value": "~*req.Service-Information.IMS-Information.Called-Party-Address",
"mandatory": true
},
{
"tag": "AnswerTime",
"path": "*cgreq.AnswerTime",
"type": "*variable",
"value": "~*req.Event-Timestamp",
"mandatory": true
},
{
"tag": "Usage",
"path": "*cgreq.Usage",
"type": "*cc_usage",
"mandatory": true,
"value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"
},
{
"tag": "LastUsed",
"path": "*cgreq.LastUsed",
"type": "*variable",
"value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/",
"mandatory": true
},
{
"tag": "SubscriberID",
"path": "*cgreq.SubscriberId",
"type": "*variable",
"value": "~*req.Subscription-Id.Subscription-Id-Data",
"mandatory": true
}
],
"reply_fields":[
{
"tag": "Session-Id",
"path": "*rep.Session-Id",
"type": "*variable",
"value": "~*req.Session-Id"
},
{
"tag": "Origin-Host",
"path": "*rep.Origin-Host",
"type": "*variable",
"value": "~*req.Origin-Host"
},
{
"tag": "Origin-Realm",
"path": "*rep.Origin-Realm",
"type": "*variable",
"value": "~*req.Origin-Realm"
},
{
"tag": "Auth-Application-Id",
"path": "*rep.Auth-Application-Id",
"type": "*variable",
"value": "~*req.Auth-Application-Id"
},
{
"tag": "CC-Request-Type",
"path": "*rep.CC-Request-Type",
"type": "*variable",
"value": "~*req.CC-Request-Type"
},
{
"tag": "CC-Request-Number",
"path": "*rep.CC-Request-Number",
"type": "*variable",
"value": "~*req.CC-Request-Number"
},
{
"tag": "ResultCode",
"filters": ["*notempty:~*cgrep.Error:"],
"path": "*rep.Result-Code",
"type": "*constant",
"value": "5030",
"blocker": true
},
{
"tag": "ResultCode",
"path": "*rep.Result-Code",
"type": "*constant",
"value": "2001"
}
]
}
]
}
}