diff --git a/agents/dnsagent.go b/agents/dnsagent.go index 3aba6a91e..6f1b6c164 100644 --- a/agents/dnsagent.go +++ b/agents/dnsagent.go @@ -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) { diff --git a/data/conf/samples/dnsagent_internal/suppliers.json b/data/conf/samples/dnsagent_internal/suppliers.json index 47351541e..734c16e82 100644 --- a/data/conf/samples/dnsagent_internal/suppliers.json +++ b/data/conf/samples/dnsagent_internal/suppliers.json @@ -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": "."}, ], }, diff --git a/data/conf/samples/dnsagent_mongo/attributes.json b/data/conf/samples/dnsagent_mongo/attributes.json index 0f44c82c3..a546b5542 100644 --- a/data/conf/samples/dnsagent_mongo/attributes.json +++ b/data/conf/samples/dnsagent_mongo/attributes.json @@ -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"}, ], }, diff --git a/data/conf/samples/dnsagent_mongo/dryrun.json b/data/conf/samples/dnsagent_mongo/dryrun.json index e454a3fd3..a8fce8adb 100644 --- a/data/conf/samples/dnsagent_mongo/dryrun.json +++ b/data/conf/samples/dnsagent_mongo/dryrun.json @@ -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": "."}, ], }, ], diff --git a/data/conf/samples/dnsagent_mongo/suppliers.json b/data/conf/samples/dnsagent_mongo/suppliers.json index 47351541e..734c16e82 100644 --- a/data/conf/samples/dnsagent_mongo/suppliers.json +++ b/data/conf/samples/dnsagent_mongo/suppliers.json @@ -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": "."}, ], }, diff --git a/data/conf/samples/dnsagent_mysql/attributes.json b/data/conf/samples/dnsagent_mysql/attributes.json index 0f44c82c3..a546b5542 100644 --- a/data/conf/samples/dnsagent_mysql/attributes.json +++ b/data/conf/samples/dnsagent_mysql/attributes.json @@ -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"}, ], }, diff --git a/data/conf/samples/dnsagent_mysql/dryrun.json b/data/conf/samples/dnsagent_mysql/dryrun.json index e454a3fd3..a8fce8adb 100644 --- a/data/conf/samples/dnsagent_mysql/dryrun.json +++ b/data/conf/samples/dnsagent_mysql/dryrun.json @@ -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": "."}, ], }, ], diff --git a/data/conf/samples/dnsagent_mysql/suppliers.json b/data/conf/samples/dnsagent_mysql/suppliers.json index 47351541e..734c16e82 100644 --- a/data/conf/samples/dnsagent_mysql/suppliers.json +++ b/data/conf/samples/dnsagent_mysql/suppliers.json @@ -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": "."}, ], },