Files
cgrates/data/conf/samples/diamagent_internal/voice.json
2020-01-30 10:21:48 +01:00

103 lines
5.5 KiB
JSON

{
"diameter_agent": {
"request_processors": [
{
"id": "VoiceInit",
"filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1",
"*prefix:~*req.Service-Context-Id:voice"],
"flags": ["*initiate", "*accounts", "*attributes"],
"request_fields":[
{"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice"},
{"tag": "OriginID", "path": "OriginID", "type": "*variable",
"value": "~*req.Session-Id", "mandatory": true},
{"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host",
"mandatory": true},
{"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"},
{"tag": "Category", "path": "Category", "type": "*constant", "value": "call"},
{"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"},
{"tag": "Destination", "path": "Destination", "type": "*variable",
"value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true},
{"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable",
"value": "~*req.Event-Timestamp", "mandatory": true},
{"tag": "Usage", "path": "Usage", "type": "*variable",
"value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true},
{"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable",
"value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true},
],
"reply_fields":[
{"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"],
"path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true},
{"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"},
{"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable",
"value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true},
],
},
{
"id": "VoiceUpdate",
"filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2",
"*prefix:~*req.Service-Context-Id:voice"],
"flags": ["*update", "*accounts", "*attributes"],
"request_fields":[
{"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice"},
{"tag": "OriginID", "path": "OriginID", "type": "*variable",
"value": "~*req.Session-Id", "mandatory": true},
{"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host",
"mandatory": true},
{"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"},
{"tag": "Category", "path": "Category", "type": "*constant", "value": "call"},
{"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"},
{"tag": "Destination", "path": "Destination", "type": "*variable",
"value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true},
{"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable",
"value": "~*req.Event-Timestamp", "mandatory": true},
{"tag": "Usage", "path": "Usage", "type": "*variable",
"value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true},
{"tag": "LastUsed", "path": "LastUsed", "type": "*variable",
"value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true},
{"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable",
"value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true},
],
"reply_fields":[
{"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"],
"path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true},
{"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"},
{"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable",
"value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true},
],
},
{
"id": "VoiceTerminate",
"filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:3",
"*prefix:~*req.Service-Context-Id:voice"],
"flags": ["*terminate", "*accounts", "*attributes", "*cdrs"],
"request_fields":[
{"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice"},
{"tag": "OriginID", "path": "OriginID", "type": "*variable",
"value": "~*req.Session-Id", "mandatory": true},
{"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host",
"mandatory": true},
{"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"},
{"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"},
{"tag": "Destination", "path": "Destination", "type": "*variable",
"value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true},
{"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable",
"value": "~*req.Event-Timestamp", "mandatory": true},
{"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true,
"value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"},
{"tag": "LastUsed", "path": "LastUsed", "type": "*variable",
"value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true},
{"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable",
"value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true},
],
"reply_fields":[
{"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"],
"path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true},
{"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"},
],
},
],
},
}