mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
CDRS - require content_fields only for *http_json_map and *http_post replication
This commit is contained in:
@@ -337,6 +337,12 @@ func (self *CGRConfig) checkConfigSanity() error {
|
||||
return errors.New("CDRStatS not enabled but requested by CDRS component.")
|
||||
}
|
||||
}
|
||||
for _, rplCfg := range self.CDRSCdrReplication {
|
||||
if utils.IsSliceMember([]string{utils.MetaHTTPjsonMap, utils.META_HTTP_POST}, rplCfg.Transport) &&
|
||||
len(rplCfg.ContentFields) == 0 {
|
||||
return fmt.Errorf("<CDRS> No content fields defined for replication to address: <%s>", rplCfg.Address)
|
||||
}
|
||||
}
|
||||
}
|
||||
// CDRC sanity checks
|
||||
for _, cdrcCfgs := range self.CdrcProfiles {
|
||||
|
||||
@@ -448,11 +448,6 @@ func (self *CdrServer) getCostFromRater(cdr *CDR) (*CallCost, error) {
|
||||
// ToDo: Add websocket support
|
||||
func (self *CdrServer) replicateCdr(cdr *CDR) error {
|
||||
for _, rplCfg := range self.cgrCfg.CDRSCdrReplication {
|
||||
if len(rplCfg.ContentFields) == 0 {
|
||||
utils.Logger.Warning(fmt.Sprintf(
|
||||
"<CDRReplicator> No content fields defined for replication to address: <%s>, ignoring", rplCfg.Address))
|
||||
return nil
|
||||
}
|
||||
passesFilters := true
|
||||
for _, cdfFltr := range rplCfg.CdrFilter {
|
||||
if !cdfFltr.FilterPasses(cdr.FieldAsString(cdfFltr)) {
|
||||
|
||||
Reference in New Issue
Block a user