Added test for DNSAgent

This commit is contained in:
Trial97
2021-10-06 12:57:15 +03:00
committed by Dan Christian Bogos
parent c36e498a7f
commit 8904dc1769
6 changed files with 89 additions and 13 deletions

View File

@@ -20,6 +20,25 @@
{"tag": "Opts3", "path": "*rep.Option[0].Uri", "type": "*constant", "value": "sip:cgrates@cgrates.com"},
],
},
{
"id": "OptsWithAttributes",
"filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.QueryName{*e164}:5986517174967"],
"flags": ["*event","*attributes"],
"request_fields":[
{"tag": "Origin", "path": "*cgreq.Origin", "type": "*variable", "value": "~*req.Option[0].Uri{*sipuri_user}"},
{"tag": "Domanin", "path": "*cgreq.Domanin", "type": "*variable", "value": "~*vars.QueryName{*e164Domain}"},
{"tag": "NewSipURI", "path": "*cgreq.SipURI", "type": "*constant", "value": "*attributes"},
],
"reply_fields":[
{"tag": "NAPTROrder", "path": "*rep.Answer.Order", "type": "*constant", "value": "100"},
{"tag": "NAPTRPreference", "path": "*rep.Answer.Preference", "type": "*constant", "value": "10"},
{"tag": "NAPTRFlags", "path": "*rep.Answer.Flags", "type": "*constant", "value": "U"},
{"tag": "NAPTRService", "path": "*rep.Answer.Service", "type": "*constant", "value": "E2U+SIP"},
{"tag": "NAPTRRegexp", "path": "*rep.Answer.Regexp", "type": "*constant", "value": "!^(.*)$!sip:\\1@172.16.1.10.!"},
{"tag": "NAPTRReplacement", "path": "*rep.Answer.Replacement", "type": "*constant", "value": "."},
{"tag": "Opts", "path": "*rep.Option.Uri", "type": "*variable", "value": "~*cgrep.Attributes[*raw].SipURI", "mandatory": true},
],
},
],
},

View File

@@ -1,3 +1,4 @@
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,Path,Type,Value,Blocker,Weight
cgrates.org,ATTR_NAPTR_ADDR,*any,*string:~*req.E164Address:4986517174964,,,*req.NAPTRAddress,*constant,sip:\1@172.16.1.1.,false,20
cgrates.org,ATTR_NAPTR_SIP_URI,*any,*string:~*req.Origin:cgrates,,,*req.SipURI,*variable,sip:cgrates@;~*req.Domanin,false,20
1 #Tenant ID Contexts FilterIDs ActivationInterval AttributeFilterIDs Path Type Value Blocker Weight
2 cgrates.org ATTR_NAPTR_ADDR *any *string:~*req.E164Address:4986517174964 *req.NAPTRAddress *constant sip:\1@172.16.1.1. false 20
3 cgrates.org ATTR_NAPTR_SIP_URI *any *string:~*req.Origin:cgrates *req.SipURI *variable sip:cgrates@;~*req.Domanin false 20
4