mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
SupplierS using AttributeS to replace data, updating ClueLRN data files
This commit is contained in:
@@ -789,7 +789,7 @@ func startSupplierService(internalSupplierSChan chan rpcclient.RpcClientConnecti
|
||||
filterSChan <- filterS
|
||||
var attrSConn, resourceSConn, statSConn *rpcclient.RpcClientPool
|
||||
if len(cfg.SupplierSCfg().AttributeSConns) != 0 {
|
||||
resourceSConn, err = engine.NewRPCPool(rpcclient.POOL_FIRST, cfg.TLSClientKey, cfg.TLSClientCerificate,
|
||||
attrSConn, err = engine.NewRPCPool(rpcclient.POOL_FIRST, cfg.TLSClientKey, cfg.TLSClientCerificate,
|
||||
cfg.ConnectAttempts, cfg.Reconnects, cfg.ConnectTimeout, cfg.ReplyTimeout,
|
||||
cfg.SupplierSCfg().AttributeSConns, internalAttrSChan, cfg.InternalTtl)
|
||||
if err != nil {
|
||||
|
||||
@@ -45,13 +45,14 @@
|
||||
|
||||
"attributes": {
|
||||
"enabled": true,
|
||||
"process_runs": 5, // number of run loops when processing event
|
||||
},
|
||||
|
||||
|
||||
"suppliers": {
|
||||
"enabled": true,
|
||||
"attributes_conns": [
|
||||
{"address": "*internal"}
|
||||
{"address": "127.0.0.1:2012", "transport":"*json"}
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
@@ -5,4 +5,4 @@ cgrates.org,LRN_LATA_Dst13128543000,lrn,*string:Destination:13128543000;*rsr::Or
|
||||
cgrates.org,LRN_LATA_Cli9174269000,lrn,*string:Account:9174269000;*rsr::DestinationLATA(!^$),,CallerLATA,*any,132,true,false,30
|
||||
cgrates.org,LRN_JURISDICTION_NY,lrn,FLTR_INTRALATA_NEWYORK,,LRNJurisdiction,*any,INTRA,true,false,50
|
||||
cgrates.org,LRN_JURISDICTION_IL,lrn,FLTR_INTRALATA_ILLINOIS,,LRNJurisdiction,*any,INTRA,true,false,50
|
||||
cgrates.org,LRN_JURISDICTION_INTER,lrn,*string:Destination:9174269000;*rsr::CallerLATA(!^$),,LRNJurisdiction,*any,INTER,true,false,40
|
||||
cgrates.org,LRN_JURISDICTION_INTER,lrn,*string:Destination:13128543000;*rsr::CallerLATA(!^$),,LRNJurisdiction,*any,INTER,true,false,40
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#Tenant,ID,FilterIDs,ActivationInterval,Sorting,SortingParamameters,SupplierID,SupplierFilterIDs,SupplierAccountIDs,SupplierRatingPlanIDs,SupplierResourceIDs,SupplierStatIDs,SupplierWeight,SupplierBlocker,SupplierParameters,Weight
|
||||
cgrates.org,SPL_CLUELRN_INTER,*string:Account:9174269000;*string:LRNJuristiction:INTER,2017-11-27T00:00:00Z,*least_cost,,LEVEL3,,,RP_LEVEL3_INTER,,,,false,,10
|
||||
cgrates.org,SPL_CLUELRN_INTER,*string:Account:9174269000;*string:LRNJurisdiction:INTER,2017-11-27T00:00:00Z,*least_cost,,LEVEL3,,,RP_LEVEL3_INTER,,,,false,,10
|
||||
cgrates.org,SPL_CLUELRN_INTER,,,,,TMOBILE,,,RP_TMOBILE_INTER,,,,false,,
|
||||
cgrates.org,SPL_CLUELRN_INTER,,,,,COMCAST,,,RP_COMCAST_INTER,,,,false,,
|
||||
|
||||
|
@@ -359,6 +359,21 @@ func (spS *SupplierService) V1GetSuppliers(args *ArgsGetSuppliers, reply *Sorted
|
||||
} else if args.CGREvent.Event == nil {
|
||||
return utils.NewErrMandatoryIeMissing("Event")
|
||||
}
|
||||
if spS.attributeS != nil {
|
||||
if args.CGREvent.Context == nil { // populate if not already in
|
||||
args.CGREvent.Context = utils.StringPointer(utils.MetaSuppliers)
|
||||
}
|
||||
attrArgs := &AttrArgsProcessEvent{
|
||||
CGREvent: args.CGREvent,
|
||||
}
|
||||
var rplyEv AttrSProcessEventReply
|
||||
if err := spS.attributeS.Call(utils.AttributeSv1ProcessEvent,
|
||||
attrArgs, &rplyEv); err == nil && len(rplyEv.AlteredFields) != 0 {
|
||||
args.CGREvent = *rplyEv.CGREvent
|
||||
} else if err.Error() != utils.ErrNotFound.Error() {
|
||||
return utils.NewErrAttributeS(err)
|
||||
}
|
||||
}
|
||||
sSps, err := spS.sortedSuppliersForEvent(args)
|
||||
if err != nil {
|
||||
if err != utils.ErrNotFound {
|
||||
|
||||
Reference in New Issue
Block a user