Files
cgrates/data/conf/samples/dnsagent_internal/suppliers.json

98 lines
3.3 KiB
JSON

{
"dns_agent": {
"request_processors": [
{
"id": "NAPTRSuppliersQuery",
"filters": ["*string:~*vars.QueryType:NAPTR",
"*string:~*vars.E164Address:4986517174965"],
"flags": ["*event", "*suppliers","*continue"],
"request_fields":[
{"tag": "ToR", "path": "*cgreq.Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile
],
},
{
"id": "NAPTRRoutesQuery2", // this processor will add Account 1002 in event to test the NotFound StatQueue
"filters": ["*string:~*vars.QueryType:NAPTR",
"*string:~*vars.E164Address:5986517174965"],
"flags": ["*event", "*suppliers","*continue"],
"request_fields":[
{"tag": "ToR", "path": "*cgreq.Account", "type": "*constant", "value": "1002"},
],
},
{
"id": "NAPTRStatSupplierNotFound",
"filters": ["*string:~*vars.QueryType:NAPTR",
"*string:~*cgrep.Error:SUPPLIERS_ERROR:NOT_FOUND"],
"flags": ["*event", "*stats"],
"request_fields":[
{
"tag": "ErrSupplierNotFound",
"path": "*cgreq.ErrSupplierNotFound",
"type": "*constant",
"value": "NotFoundSuppliers",
}
],
},
{
"id": "NAPTRSuppliersOneSupplier",
"filters": ["*string:~*vars.QueryType:NAPTR",
"*string:~*vars.E164Address:4986517174965",
"*gte:~*cgrep.Suppliers.Count:1"],
"flags": ["*none","*continue"], // do not send request to CGRateS
"reply_fields":[
{"tag": "NAPTROrder", "path": "*rep.Order",
"type": "*group", "value": "100"},
{"tag": "NAPTRPreference", "path": "*rep.Preference",
"type": "*group", "value": "10"},
{"tag": "NAPTRFlags", "path": "*rep.Flags",
"type": "*group", "value": "U"},
{"tag": "NAPTRService", "path": "*rep.Service",
"type": "*group", "value": "E2U+SIP"},
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*group",
"value": "~*cgrep.Suppliers.SortedSuppliers[0].SupplierParameters"},
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
"type": "*group", "value": "."},
],
},
{
"id": "NAPTRSuppliersTwoSuppliers",
"filters": ["*string:~*vars.QueryType:NAPTR",
"*string:~*vars.E164Address:4986517174965",
"*gte:~*cgrep.Suppliers.Count:2"],
"flags": ["*none","*continue"],
"reply_fields":[
{"tag": "NAPTROrder", "type": "*group", "new_branch": true,
"path": "*rep.Order", "value": "100"},
{"tag": "NAPTRPreference", "path": "*rep.Preference",
"type": "*group", "value": "10"},
{"tag": "NAPTRFlags", "path": "*rep.Flags",
"type": "*group", "value": "U"},
{"tag": "NAPTRService", "path": "*rep.Service",
"type": "*group", "value": "E2U+SIP"},
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*group",
"value": "~*cgrep.Suppliers.SortedSuppliers[1].SupplierParameters"},
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
"type": "*group", "value": "."},
],
},
{
"id": "NAPTRStatSupplier", // this process will pick the first supplier and will send a ProcessEvent to StatQueue
"filters": ["*string:~*vars.QueryType:NAPTR",
"*string:~*vars.E164Address:4986517174965",
"*gte:~*cgrep.Suppliers.Count:1"],
"flags": ["*event", "*stats", "*continue"],
"request_fields":[
{
"tag": "FirstSupplier",
"path": "*cgreq.FirstSupplier",
"type": "*variable",
"value": "~*cgrep.Suppliers.SortedSuppliers[0].SupplierID",
}
],
}
],
},
}