Update DNSAgent template for attributes and correct form of NAPTRReplacement

This commit is contained in:
TeoV
2019-05-09 14:37:51 +03:00
committed by Dan Christian Bogos
parent 2a90b270f6
commit ce1418a19f
3 changed files with 10 additions and 10 deletions

View File

@@ -179,7 +179,7 @@ func (da *DNSAgent) processRequest(reqProcessor *config.RequestProcessor,
case utils.MetaDryRun:
utils.Logger.Info(
fmt.Sprintf("<%s> DRY_RUN, processorID: %s, CGREvent: %s",
utils.DiameterAgent, reqProcessor.ID, utils.ToJSON(cgrEv)))
utils.DNSAgent, reqProcessor.ID, utils.ToJSON(cgrEv)))
case utils.MetaAuth:
authArgs := sessions.NewV1AuthorizeArgs(
reqProcessor.Flags.HasKey(utils.MetaAttributes),
@@ -276,13 +276,13 @@ func (da *DNSAgent) processRequest(reqProcessor *config.RequestProcessor,
}
if reqProcessor.Flags.HasKey(utils.MetaLog) {
utils.Logger.Info(
fmt.Sprintf("<%s> LOG, Diameter reply: %s",
utils.DiameterAgent, agReq.Reply))
fmt.Sprintf("<%s> LOG, DNSAgent reply: %s",
utils.DNSAgent, agReq.Reply))
}
if reqType == utils.MetaDryRun {
utils.Logger.Info(
fmt.Sprintf("<%s> DRY_RUN, Diameter reply: %s",
utils.DiameterAgent, agReq.Reply))
fmt.Sprintf("<%s> DRY_RUN, DNSAgent reply: %s",
utils.DNSAgent, agReq.Reply))
}
return true, nil
}

View File

@@ -46,9 +46,9 @@ var sTestsDNS = []func(t *testing.T){
testDNSitApierRpcConn,
testDNSitTPFromFolder,
testDNSitClntConn,
//testDNSitClntNAPTRDryRun,
testDNSitClntNAPTRDryRun,
testDNSitClntNAPTRAttributes,
//testDNSitClntNAPTRSuppliers,
testDNSitClntNAPTRSuppliers,
testDNSitStopEngine,
}
@@ -165,8 +165,8 @@ func testDNSitClntNAPTRAttributes(t *testing.T) {
if answr.Order != 100 {
t.Errorf("received: <%q>", answr.Order)
}
if answr.Replacement != "sip:\\1@172.16.1.1." {
t.Errorf("received: <%q>", answr.Replacement)
if answr.Replacement != "sip:1\\@172.16.1.1." {
t.Errorf("Expected :<%q> , received: <%q>", "sip:1\\@172.16.1.1.", answr.Replacement)
}
}
}

View File

@@ -24,7 +24,7 @@
{"tag": "NAPTRRegexp", "field_id": "Regexp",
"type": "*constant", "value": "^.*$"},
{"tag": "NAPTRReplacement", "field_id": "Replacement",
"type": "*variable", "value": "*cgrep.Attributes.CGREvent.Event.NAPTRAddress"},
"type": "*variable", "value": "~*cgrep.Attributes.NAPTRAddress"},
],
},
],