mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Add *group type in AgentRequest + update changelog
This commit is contained in:
committed by
Dan Christian Bogos
parent
f1580a3770
commit
e3e8693c45
@@ -170,12 +170,14 @@ func (ar *AgentRequest) SetFields(tplFlds []*config.FCTemplate) (err error) {
|
||||
}
|
||||
} else {
|
||||
valSet = nMFields.([]*config.NMItem) // start from previous stored fields
|
||||
if tplFld.Type == utils.META_COMPOSED {
|
||||
switch tplFld.Type {
|
||||
case utils.META_COMPOSED:
|
||||
prevNMItem := valSet[len(valSet)-1] // could be we need nil protection here
|
||||
*nMItm = *prevNMItem // inherit the particularities, ie AttributeName
|
||||
nMItm.Data = utils.IfaceAsString(prevNMItem.Data) + utils.IfaceAsString(out)
|
||||
valSet = valSet[:len(valSet)-1] // discard the last item since we have captured it in nmItem
|
||||
} else {
|
||||
case utils.MetaGroup: // in case of *group type simply append to valSet
|
||||
default:
|
||||
valSet = nil
|
||||
}
|
||||
}
|
||||
@@ -221,7 +223,7 @@ func (ar *AgentRequest) ParseField(
|
||||
case utils.MetaRemoteHost:
|
||||
out = ar.RemoteHost().String()
|
||||
isString = true
|
||||
case utils.MetaVariable, utils.META_COMPOSED:
|
||||
case utils.MetaVariable, utils.META_COMPOSED, utils.MetaGroup:
|
||||
out, err = cfgFld.Value.ParseDataProvider(ar, utils.NestingSep)
|
||||
isString = true
|
||||
case utils.META_USAGE_DIFFERENCE:
|
||||
|
||||
@@ -1442,3 +1442,45 @@ func TestAgReqOverwrite(t *testing.T) {
|
||||
"OverwrittenAccountWithComposed", (rcv.([]*config.NMItem))[0].Data)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAgReqGroupType(t *testing.T) {
|
||||
cfg, _ := config.NewDefaultCGRConfig()
|
||||
data := engine.NewInternalDB(nil, nil, true, cfg.DataDbCfg().Items)
|
||||
dm := engine.NewDataManager(data, config.CgrConfig().CacheCfg(), nil)
|
||||
filterS := engine.NewFilterS(cfg, nil, dm)
|
||||
agReq := NewAgentRequest(nil, nil, nil, nil, nil, "cgrates.org", "", filterS, nil, nil)
|
||||
// populate request, emulating the way will be done in HTTPAgent
|
||||
agReq.CGRRequest.Set([]string{utils.ToR}, utils.VOICE, false, false)
|
||||
agReq.CGRRequest.Set([]string{utils.Account}, "1001", false, false)
|
||||
agReq.CGRRequest.Set([]string{utils.Destination}, "1002", false, false)
|
||||
agReq.CGRRequest.Set([]string{utils.AnswerTime},
|
||||
time.Date(2013, 12, 30, 15, 0, 1, 0, time.UTC), false, false)
|
||||
agReq.CGRRequest.Set([]string{utils.RequestType}, utils.META_PREPAID, false, false)
|
||||
|
||||
agReq.CGRReply = config.NewNavigableMap(nil)
|
||||
|
||||
tplFlds := []*config.FCTemplate{
|
||||
&config.FCTemplate{Tag: "Account",
|
||||
Path: utils.MetaCgrep + utils.NestingSep + utils.Account, Type: utils.MetaGroup,
|
||||
Value: config.NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Account",
|
||||
Path: utils.MetaCgrep + utils.NestingSep + utils.Account, Type: utils.MetaGroup,
|
||||
Value: config.NewRSRParsersMustCompile("test", true, utils.INFIELD_SEP)},
|
||||
}
|
||||
|
||||
if err := agReq.SetFields(tplFlds); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if rcv, err := agReq.CGRReply.GetField([]string{utils.Account}); err != nil {
|
||||
t.Error(err)
|
||||
} else if sls, canCast := rcv.([]*config.NMItem); !canCast {
|
||||
t.Errorf("Cannot cast to []*config.NMItem %+v", rcv)
|
||||
} else if len(sls) != 2 {
|
||||
t.Errorf("expecting: %+v, \n received: %+v ", 1, len(sls))
|
||||
} else if sls[0].Data != "cgrates.org" {
|
||||
t.Errorf("expecting: %+v, \n received: %+v ", "cgrates.org", sls[0].Data)
|
||||
} else if sls[1].Data != "test" {
|
||||
t.Errorf("expecting: %+v, \n received: %+v ", "test", sls[0].Data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
cgrates (0.10) UNRELEASED; urgency=medium
|
||||
|
||||
[ Alexandru Tripon ]
|
||||
* [FilterS] Removed rals_conns in favor of reading the account
|
||||
directly from DataDB
|
||||
* [SessionS] Added check for missing CGRevent
|
||||
* [DiameterAgent] Using String function from diam.Message instead of
|
||||
ToJSON for request String method
|
||||
|
||||
[ Voivozeanu Teofil ]
|
||||
* [AgentRequest] Add support for *group type and correctly overwrite
|
||||
the values in case of *variable
|
||||
|
||||
-- Alexandru Tripon <alexandru.tripon@itsyscom.com> Tue, 18 Feb 2020 08:44:41 +0200
|
||||
|
||||
@@ -181,14 +181,14 @@
|
||||
{
|
||||
"tag": "RatingGroup",
|
||||
"path": "*rep.Multiple-Services-Credit-Control.Rating-Group",
|
||||
"type": "*constant",
|
||||
"type": "*group",
|
||||
"value": "2",
|
||||
"new_branch": true
|
||||
},
|
||||
{
|
||||
"tag": "CCTotalOctets2",
|
||||
"path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets",
|
||||
"type": "*variable",
|
||||
"type": "*group",
|
||||
"value": "~*cgreq.UsedUnits2"
|
||||
},
|
||||
],
|
||||
|
||||
@@ -181,14 +181,14 @@
|
||||
{
|
||||
"tag": "RatingGroup",
|
||||
"path": "*rep.Multiple-Services-Credit-Control.Rating-Group",
|
||||
"type": "*constant",
|
||||
"type": "*group",
|
||||
"value": "2",
|
||||
"new_branch": true
|
||||
},
|
||||
{
|
||||
"tag": "CCTotalOctets2",
|
||||
"path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets",
|
||||
"type": "*variable",
|
||||
"type": "*group",
|
||||
"value": "~*cgreq.UsedUnits2"
|
||||
},
|
||||
],
|
||||
|
||||
@@ -181,14 +181,14 @@
|
||||
{
|
||||
"tag": "RatingGroup",
|
||||
"path": "*rep.Multiple-Services-Credit-Control.Rating-Group",
|
||||
"type": "*constant",
|
||||
"type": "*group",
|
||||
"value": "2",
|
||||
"new_branch": true
|
||||
},
|
||||
{
|
||||
"tag": "CCTotalOctets2",
|
||||
"path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets",
|
||||
"type": "*variable",
|
||||
"type": "*group",
|
||||
"value": "~*cgreq.UsedUnits2"
|
||||
},
|
||||
],
|
||||
|
||||
@@ -61,9 +61,9 @@
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group",
|
||||
"type": "*constant", "value": "2","new_branch": true},
|
||||
"type": "*group", "value": "2","new_branch": true},
|
||||
{"tag": "CCTotalOctets2", "path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets",
|
||||
"type": "*variable", "value": "~*cgreq.UsedUnits2"},
|
||||
"type": "*group", "value": "~*cgreq.UsedUnits2"},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
@@ -61,9 +61,9 @@
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group",
|
||||
"type": "*constant", "value": "2","new_branch": true},
|
||||
"type": "*group", "value": "2","new_branch": true},
|
||||
{"tag": "CCTotalOctets2", "path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets",
|
||||
"type": "*variable", "value": "~*cgreq.UsedUnits2"},
|
||||
"type": "*group", "value": "~*cgreq.UsedUnits2"},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
@@ -61,9 +61,9 @@
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group",
|
||||
"type": "*constant", "value": "2","new_branch": true},
|
||||
"type": "*group", "value": "2","new_branch": true},
|
||||
{"tag": "CCTotalOctets2", "path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets",
|
||||
"type": "*variable", "value": "~*cgreq.UsedUnits2"},
|
||||
"type": "*group", "value": "~*cgreq.UsedUnits2"},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group",
|
||||
"type": "*constant", "value": "2","new_branch": true},
|
||||
"type": "*group", "value": "2","new_branch": true},
|
||||
{"tag": "CCTotalOctets2", "path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets",
|
||||
"type": "*variable", "value": "~*cgreq.UsedUnits2"},
|
||||
"type": "*group", "value": "~*cgreq.UsedUnits2"},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
@@ -23,17 +23,17 @@
|
||||
"flags": ["*none","*continue"], // do not send request to CGRateS
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "path": "*rep.Order",
|
||||
"type": "*constant", "value": "100"},
|
||||
"type": "*group", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference",
|
||||
"type": "*constant", "value": "10"},
|
||||
"type": "*group", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags",
|
||||
"type": "*constant", "value": "U"},
|
||||
"type": "*group", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "*rep.Service",
|
||||
"type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*variable",
|
||||
"type": "*group", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*group",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[0].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "value": "."},
|
||||
"type": "*group", "value": "."},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -43,18 +43,18 @@
|
||||
"*gte:~*cgrep.Suppliers.Count:2"],
|
||||
"flags": ["*none","*continue"],
|
||||
"reply_fields":[
|
||||
{"tag": "NAPTROrder", "type": "*constant", "new_branch": true,
|
||||
{"tag": "NAPTROrder", "type": "*group", "new_branch": true,
|
||||
"path": "*rep.Order", "value": "100"},
|
||||
{"tag": "NAPTRPreference", "path": "*rep.Preference",
|
||||
"type": "*constant", "value": "10"},
|
||||
"type": "*group", "value": "10"},
|
||||
{"tag": "NAPTRFlags", "path": "*rep.Flags",
|
||||
"type": "*constant", "value": "U"},
|
||||
"type": "*group", "value": "U"},
|
||||
{"tag": "NAPTRService", "path": "*rep.Service",
|
||||
"type": "*constant", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*variable",
|
||||
"type": "*group", "value": "E2U+SIP"},
|
||||
{"tag": "NAPTRRegexp", "path": "*rep.Regexp", "type": "*group",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[1].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "value": "."},
|
||||
"type": "*group", "value": "."},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
{
|
||||
|
||||
"dns_agent": {
|
||||
"request_processors": [
|
||||
{
|
||||
"id": "NAPTRSuppliersQuery",
|
||||
"filters": ["*string:~*vars.QueryType:NAPTR",
|
||||
"*string:~*vars.E164Address:4986517174965"],
|
||||
"flags": ["*message", "*suppliers","*continue"],
|
||||
"request_fields":[
|
||||
{"tag": "ToR", "path": "*cgreq.Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "DispatchReply", "type": "*none",
|
||||
"blocker": true}, // enforces continue_on_success so we can check answer with filters
|
||||
],
|
||||
},
|
||||
{
|
||||
"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": "*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": "*variable",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[0].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "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": "*constant", "new_branch": true,
|
||||
"path": "*rep.Order", "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": "*variable",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[1].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "value": "."},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
"dns_agent": {
|
||||
"request_processors": [
|
||||
{
|
||||
"id": "NAPTRSuppliersQuery",
|
||||
"filters": ["*string:~*vars.QueryType:NAPTR",
|
||||
"*string:~*vars.E164Address:4986517174965"],
|
||||
"flags": ["*message", "*suppliers","*continue"],
|
||||
"request_fields":[
|
||||
{"tag": "ToR", "path": "*cgreq.Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "DispatchReply", "type": "*none",
|
||||
"blocker": true}, // enforces continue_on_success so we can check answer with filters
|
||||
],
|
||||
},
|
||||
{
|
||||
"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": "."},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
{
|
||||
|
||||
"dns_agent": {
|
||||
"request_processors": [
|
||||
{
|
||||
"id": "NAPTRSuppliersQuery",
|
||||
"filters": ["*string:~*vars.QueryType:NAPTR",
|
||||
"*string:~*vars.E164Address:4986517174965"],
|
||||
"flags": ["*message", "*suppliers","*continue"],
|
||||
"request_fields":[
|
||||
{"tag": "ToR", "path": "*cgreq.Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "DispatchReply", "type": "*none",
|
||||
"blocker": true}, // enforces continue_on_success so we can check answer with filters
|
||||
],
|
||||
},
|
||||
{
|
||||
"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": "*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": "*variable",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[0].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "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": "*constant", "new_branch": true,
|
||||
"path": "*rep.Order", "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": "*variable",
|
||||
"value": "~*cgrep.Suppliers.SortedSuppliers[1].SupplierParameters"},
|
||||
{"tag": "NAPTRReplacement", "path": "*rep.Replacement",
|
||||
"type": "*constant", "value": "."},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
"dns_agent": {
|
||||
"request_processors": [
|
||||
{
|
||||
"id": "NAPTRSuppliersQuery",
|
||||
"filters": ["*string:~*vars.QueryType:NAPTR",
|
||||
"*string:~*vars.E164Address:4986517174965"],
|
||||
"flags": ["*message", "*suppliers","*continue"],
|
||||
"request_fields":[
|
||||
{"tag": "ToR", "path": "*cgreq.Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "DispatchReply", "type": "*none",
|
||||
"blocker": true}, // enforces continue_on_success so we can check answer with filters
|
||||
],
|
||||
},
|
||||
{
|
||||
"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": "."},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
"flags": ["*dryrun"],
|
||||
"request_fields":[],
|
||||
"reply_fields":[
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*variable",
|
||||
{"tag": "Field1", "path": "*rep.Item1.1", "type": "*group",
|
||||
"value": "Val2", "mandatory": true},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -652,6 +652,7 @@ const (
|
||||
MetaLoaders = "*loaders"
|
||||
TmpSuffix = ".tmp"
|
||||
MetaDiamreq = "*diamreq"
|
||||
MetaGroup = "*group"
|
||||
)
|
||||
|
||||
// Migrator Action
|
||||
|
||||
Reference in New Issue
Block a user