{


"diameter_agent": {
	"request_processors": [
		{
			"id": "SMSProcessing",
			"filters": [
				"*string:~*vars.*cmd:CCR",
				"*string:~*req.CC-Request-Type:4",
				"*string:~*req.Service-Context-Id:sms"
			],
			"flags": ["*event", "*accounts", "*cdrs"],
			"request_fields":[
				{
					"tag": "ToR", "path": "*cgreq.ToR",
					"type": "*constant", "value": "*sms"
				},
				{
					"tag": "OriginID", "path": "*cgreq.OriginID",
					"type": "*variable", "mandatory": true, 
					"value": "~*req.Multiple-Services-Credit-Control.Service-Identifier"
				},
				{
					"tag": "OriginHost", "path": "*cgreq.OriginHost",
					"type": "*variable",  "value": "~*vars.OriginHost"
				},
				{
					"tag": "Source", "path": "*cgreq.Source",
					"type": "*constant", "mandatory": true, 
					"value": "DiameterAgent"
				},
				{
					"tag": "RequestType", "path": "*cgreq.RequestType",
					"type": "*constant", "value": "*prepaid"
				},
				{
					"tag": "Category", "path": "*cgreq.Category",
					"type": "*constant", "value": "sms"
				},
				{
					"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", "mandatory": true,
					"value": "~*req.Service-Information.SMS-Information.Recipient-Info.Recipient-Address.Address-Data:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+49${1}/"
				},
				{
					"tag": "SetupTime", "path": "*cgreq.SetupTime",
					"type": "*variable", "mandatory": true, 
					"value": "~*req.Event-Timestamp"
				},
				{
					"tag": "AnswerTime", "path": "*cgreq.AnswerTime",
					"type": "*variable", "mandatory": true,
					"value": "~*req.Event-Timestamp"
				},
				{
					"tag": "Usage", "path": "*cgreq.Usage",
					"type": "*variable", "mandatory": true,
					"value": "~*req.Multiple-Services-Credit-Control.Requested-Service-Unit.CC-Service-Specific-Units"
				},
				{
					"tag": "Originator-SCCP-Address", "path": "*cgreq.Originator-SCCP-Address",
					"type": "*variable", "mandatory": true, 
					"value": "~*req.Service-Information.SMS-Information.Originator-SCCP-Address"
				},
            ],
			"reply_fields":[
				{"tag": "CCATemplate", "type": "*template", "value": "*cca"},
				{
					"tag": "ResultCode","path": "*rep.Result-Code",
					"filters": ["*eq:~*cgrep.MaxUsage[*raw]:0"],
					"type": "*constant", "value": "4012",
					"blocker": true
				},
				{
					"tag": "ResultCode", "path": "*rep.Result-Code",
					"filters": ["*notempty:~*cgrep.Error:"],
					"type": "*constant", "value": "5030",
					"blocker": true
				}
			]
		}

	]
}

}