mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 07:38:45 +05:00
Update integration test for DNSAgent
This commit is contained in:
committed by
Dan Christian Bogos
parent
d396051d77
commit
1de1222698
@@ -189,7 +189,6 @@ func (da *DNSAgent) processRequest(reqProcessor *config.RequestProcessor,
|
||||
break
|
||||
}
|
||||
}
|
||||
fmt.Println(utils.ToJSON(cgrEv))
|
||||
cgrArgs := cgrEv.ExtractArgs(reqProcessor.Flags.HasKey(utils.MetaDispatchers),
|
||||
reqType == utils.MetaAuth || reqType == utils.MetaMessage || reqType == utils.MetaEvent)
|
||||
if reqProcessor.Flags.HasKey(utils.MetaLog) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"*string:~*vars.E164Address:4986517174965"],
|
||||
"flags": ["*message", "*suppliers","*continue"],
|
||||
"request_fields":[
|
||||
{"tag": "ToR", "path": "Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile
|
||||
{"tag": "ToR", "path": "*cgreq.Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "DispatchReply", "type": "*none",
|
||||
@@ -22,17 +22,17 @@
|
||||
"*gte:~*cgrep.Suppliers.Count:1"],
|
||||
"flags": ["*none","*continue"], // do not send request to CGRateS
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "path": "Order",
|
||||
{"tag": "NAPTROrder", "path": "*rep.Order",
|
||||
"type": "*constant", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "Preference",
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference",
|
||||
"type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "Flags",
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags",
|
||||
"type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "Service",
|
||||
{"tag": "NAPTRService", "path": "*rep.Service",
|
||||
"type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable",
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*variable",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[0].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "Replacement",
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "value": "."},
|
||||
],
|
||||
},
|
||||
@@ -44,16 +44,16 @@
|
||||
"flags": ["*none","*continue"],
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "type": "*constant", "new_branch": true,
|
||||
"path": "Order", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "Preference",
|
||||
"path": "*rep.Order", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference",
|
||||
"type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "Flags",
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags",
|
||||
"type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "Service",
|
||||
{"tag": "NAPTRService", "path": "*rep.Service",
|
||||
"type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable",
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*variable",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[1].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "Replacement",
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "value": "."},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -5,23 +5,23 @@
|
||||
{
|
||||
"id": "NAPTRAttributes",
|
||||
"filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.E164Address:4986517174964"],
|
||||
"flags": ["*auth", "*attributes"],
|
||||
"flags": ["*auth", "*attributes","*log"],
|
||||
"request_fields":[
|
||||
{"tag": "E164Address", "path": "E164Address",
|
||||
{"tag": "E164Address", "path": "*cgreq.E164Address",
|
||||
"type": "*constant", "value": "4986517174964"},
|
||||
{"tag": "NAPTRAddress", "path": "NAPTRAddress",
|
||||
{"tag": "NAPTRAddress", "path": "*cgreq.NAPTRAddress",
|
||||
"type": "*constant", "value": "*attributes"}
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "path": "Order",
|
||||
{"tag": "NAPTROrder", "path": "*rep.Order",
|
||||
"type": "*constant", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "Preference",
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference",
|
||||
"type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "Flags",
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags",
|
||||
"type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "Service",
|
||||
{"tag": "NAPTRService", "path": "*rep.Service",
|
||||
"type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegex", "path": "Regexp",
|
||||
{"tag": "NAPTRRegex", "path": "*rep.Regexp",
|
||||
"type": "*variable", "value": "~*cgrep.Attributes.NAPTRAddress"},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
{
|
||||
"id": "DryRunNAPTR",
|
||||
"filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.E164Address:4986517174963"],
|
||||
"flags": ["*dryrun"],
|
||||
"flags": ["*dryrun","*log"],
|
||||
"request_fields":[
|
||||
{"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*sms"},
|
||||
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"},
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "path": "Order", "type": "*constant", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "Regexp", "type": "*constant", "value": "!^(.*)$!sip:\\1@172.16.1.10.!"},
|
||||
{"tag": "NAPTRReplacement", "path": "Replacement", "type": "*constant", "value": "."},
|
||||
{"tag": "NAPTROrder", "path": "*rep.Order", "type": "*constant", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference", "type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags", "type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "*rep.Service", "type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*constant", "value": "!^(.*)$!sip:\\1@172.16.1.10.!"},
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement", "type": "*constant", "value": "."},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"*string:~*vars.E164Address:4986517174965"],
|
||||
"flags": ["*message", "*suppliers","*continue"],
|
||||
"request_fields":[
|
||||
{"tag": "ToR", "path": "Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile
|
||||
{"tag": "ToR", "path": "*cgreq.Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "DispatchReply", "type": "*none",
|
||||
@@ -22,17 +22,17 @@
|
||||
"*gte:~*cgrep.Suppliers.Count:1"],
|
||||
"flags": ["*none","*continue"], // do not send request to CGRateS
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "path": "Order",
|
||||
{"tag": "NAPTROrder", "path": "*rep.Order",
|
||||
"type": "*constant", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "Preference",
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference",
|
||||
"type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "Flags",
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags",
|
||||
"type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "Service",
|
||||
{"tag": "NAPTRService", "path": "*rep.Service",
|
||||
"type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable",
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*variable",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[0].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "Replacement",
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "value": "."},
|
||||
],
|
||||
},
|
||||
@@ -44,16 +44,16 @@
|
||||
"flags": ["*none","*continue"],
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "type": "*constant", "new_branch": true,
|
||||
"path": "Order", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "Preference",
|
||||
"path": "*rep.Order", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference",
|
||||
"type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "Flags",
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags",
|
||||
"type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "Service",
|
||||
{"tag": "NAPTRService", "path": "*rep.Service",
|
||||
"type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable",
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*variable",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[1].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "Replacement",
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "value": "."},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -5,23 +5,23 @@
|
||||
{
|
||||
"id": "NAPTRAttributes",
|
||||
"filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.E164Address:4986517174964"],
|
||||
"flags": ["*auth", "*attributes"],
|
||||
"flags": ["*auth", "*attributes","*log"],
|
||||
"request_fields":[
|
||||
{"tag": "E164Address", "path": "E164Address",
|
||||
{"tag": "E164Address", "path": "*cgreq.E164Address",
|
||||
"type": "*constant", "value": "4986517174964"},
|
||||
{"tag": "NAPTRAddress", "path": "NAPTRAddress",
|
||||
{"tag": "NAPTRAddress", "path": "*cgreq.NAPTRAddress",
|
||||
"type": "*constant", "value": "*attributes"}
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "path": "Order",
|
||||
{"tag": "NAPTROrder", "path": "*rep.Order",
|
||||
"type": "*constant", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "Preference",
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference",
|
||||
"type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "Flags",
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags",
|
||||
"type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "Service",
|
||||
{"tag": "NAPTRService", "path": "*rep.Service",
|
||||
"type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegex", "path": "Regexp",
|
||||
{"tag": "NAPTRRegex", "path": "*rep.Regexp",
|
||||
"type": "*variable", "value": "~*cgrep.Attributes.NAPTRAddress"},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
{
|
||||
"id": "DryRunNAPTR",
|
||||
"filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.E164Address:4986517174963"],
|
||||
"flags": ["*dryrun"],
|
||||
"flags": ["*dryrun","*log"],
|
||||
"request_fields":[
|
||||
{"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*sms"},
|
||||
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"},
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "path": "Order", "type": "*constant", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "Regexp", "type": "*constant", "value": "!^(.*)$!sip:\\1@172.16.1.10.!"},
|
||||
{"tag": "NAPTRReplacement", "path": "Replacement", "type": "*constant", "value": "."},
|
||||
{"tag": "NAPTROrder", "path": "*rep.Order", "type": "*constant", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference", "type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags", "type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "*rep.Service", "type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*constant", "value": "!^(.*)$!sip:\\1@172.16.1.10.!"},
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement", "type": "*constant", "value": "."},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"*string:~*vars.E164Address:4986517174965"],
|
||||
"flags": ["*message", "*suppliers","*continue"],
|
||||
"request_fields":[
|
||||
{"tag": "ToR", "path": "Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile
|
||||
{"tag": "ToR", "path": "*cgreq.Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "DispatchReply", "type": "*none",
|
||||
@@ -22,17 +22,17 @@
|
||||
"*gte:~*cgrep.Suppliers.Count:1"],
|
||||
"flags": ["*none","*continue"], // do not send request to CGRateS
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "path": "Order",
|
||||
{"tag": "NAPTROrder", "path": "*rep.Order",
|
||||
"type": "*constant", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "Preference",
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference",
|
||||
"type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "Flags",
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags",
|
||||
"type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "Service",
|
||||
{"tag": "NAPTRService", "path": "*rep.Service",
|
||||
"type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable",
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*variable",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[0].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "Replacement",
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "value": "."},
|
||||
],
|
||||
},
|
||||
@@ -44,16 +44,16 @@
|
||||
"flags": ["*none","*continue"],
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "type": "*constant", "new_branch": true,
|
||||
"path": "Order", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "Preference",
|
||||
"path": "*rep.Order", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference",
|
||||
"type": "*constant", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "Flags",
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags",
|
||||
"type": "*constant", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "Service",
|
||||
{"tag": "NAPTRService", "path": "*rep.Service",
|
||||
"type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable",
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*variable",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[1].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "Replacement",
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "value": "."},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user