{ "dns_agent": { "request_processors": [ { "id": "NAPTRRoutesQuery", "filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.QueryName{*e164}:4986517174965"], "flags": ["*message", "*routes","*continue"], "request_fields":[ {"tag": "ToR", "path": "*cgreq.Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile ], "reply_fields":[ {"tag": "DispatchReply", "type": "*none", "blocker": true}, // enforces continue_on_success so we can check answer with filters ], }, { "id": "NAPTRSuppliersOneSupplier", "filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.QueryName{*e164}:4986517174965", "*gte:~*cgrep.RouteProfiles.Length:1", "*gte:~*cgrep.RouteProfiles[0].Routes.Length:1"], "flags": ["*none","*continue"], // do not send request to CGRateS "reply_fields":[ {"tag": "NAPTROrder", "path": "*rep.Answer.Order", "type": "*group", "value": "100"}, {"tag": "NAPTRPreference", "path": "*rep.Answer.Preference", "type": "*group", "value": "10"}, {"tag": "NAPTRFlags", "path": "*rep.Answer.Flags", "type": "*group", "value": "U"}, {"tag": "NAPTRService", "path": "*rep.Answer.Service", "type": "*group", "value": "E2U+SIP"}, {"tag": "NAPTRRegexp", "path": "*rep.Answer.Regexp", "type": "*group", "value": "~*cgrep.RouteProfiles[0].Routes[0].RouteParameters"}, {"tag": "NAPTRReplacement", "path": "*rep.Answer.Replacement", "type": "*group", "value": "."}, ], }, { "id": "NAPTRSuppliersTwoSuppliers", "filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.QueryName{*e164}:4986517174965", "*gte:~*cgrep.RouteProfiles.Length:1", "*gte:~*cgrep.RouteProfiles[0].Routes.Length:2"], "flags": ["*none","*continue"], "reply_fields":[ {"tag": "NAPTROrder", "type": "*group", "new_branch": true, "path": "*rep.Answer.Order", "value": "100"}, {"tag": "NAPTRPreference", "path": "*rep.Answer.Preference", "type": "*group", "value": "10"}, {"tag": "NAPTRFlags", "path": "*rep.Answer.Flags", "type": "*group", "value": "U"}, {"tag": "NAPTRService", "path": "*rep.Answer.Service", "type": "*group", "value": "E2U+SIP"}, {"tag": "NAPTRRegexp", "path": "*rep.Answer.Regexp", "type": "*group", "value": "~*cgrep.RouteProfiles[0].Routes[1].RouteParameters"}, {"tag": "NAPTRReplacement", "path": "*rep.Answer.Replacement", "type": "*group", "value": "."}, ], }, ], }, }