diff --git a/config/config.go b/config/config.go index 13013822b..631c25df3 100644 --- a/config/config.go +++ b/config/config.go @@ -488,7 +488,7 @@ func loadConfig(c *conf.ConfigFile) (*CGRConfig, error) { destFld, _ := c.GetString("cdrc", "destination_field") setupTimeFld, _ := c.GetString("cdrc", "setup_time_field") answerTimeFld, _ := c.GetString("cdrc", "answer_time_field") - durFld, _ := c.GetString("cdrc", "duration_field") + durFld, _ := c.GetString("cdrc", "usage_field") extraFlds, _ := c.GetString("cdrc", "extra_fields") if cfg.CdrcCdrFields, err = ParseCdrcCdrFields(accIdFld, reqtypeFld, directionFld, tenantFld, categoryFld, acntFld, subjectFld, destFld, setupTimeFld, answerTimeFld, durFld, extraFlds); err != nil { diff --git a/config/helpers.go b/config/helpers.go index 1d46973be..2c5f5bf1d 100644 --- a/config/helpers.go +++ b/config/helpers.go @@ -106,7 +106,7 @@ func ParseCfgDerivedCharging(c *conf.ConfigFile) (dcs utils.DerivedChargers, err if aTimeFlds, err = ConfigSlice(cfgVal); err != nil { return nil, err } - cfgVal, _ = c.GetString("derived_charging", "duration_fields") + cfgVal, _ = c.GetString("derived_charging", "usage_fields") if durFlds, err = ConfigSlice(cfgVal); err != nil { return nil, err } diff --git a/config/helpers_test.go b/config/helpers_test.go index 9d7348a1f..9ea4271f7 100644 --- a/config/helpers_test.go +++ b/config/helpers_test.go @@ -50,7 +50,7 @@ subject_fields = test1, test2 destination_fields = test1, test2 setup_time_fields = test1, test2 answer_time_fields = test1, test2 -duration_fields = test1, test2 +usage_fields = test1, test2 `) edcs := utils.DerivedChargers{ &utils.DerivedCharger{RunId: "run1", ReqTypeField: "test1", DirectionField: "test1", TenantField: "test1", CategoryField: "test1", @@ -77,7 +77,7 @@ subject_field = subject1 destination_field = destination1 setup_time_field = setuptime1 answer_time_field = answertime1 -duration_field = duration1 +usage_field = duration1 extra_fields = extra1:extraval1,extra2:extraval1 `) eCdrcCdrFlds := map[string]*utils.RSRField{ diff --git a/config/test_data.txt b/config/test_data.txt index 399c6c766..d4f81c2bb 100644 --- a/config/test_data.txt +++ b/config/test_data.txt @@ -73,7 +73,7 @@ subject_field = test # Subject field identifier. Use index numbers in case of destination_field = test # Destination field identifier. Use index numbers in case of .csv cdrs. setup_time_field = test # Answer time field identifier. Use index numbers in case of .csv cdrs. answer_time_field = test # Answer time field identifier. Use index numbers in case of .csv cdrs. -duration_field = test # Duration field identifier. Use index numbers in case of .csv cdrs. +usage_field = test # Duration field identifier. Use index numbers in case of .csv cdrs. extra_fields = test:test # Field identifiers of the fields to add in extra fields section, special format in case of .csv "index1|field1,index2|field2" [mediator] @@ -105,7 +105,7 @@ subject_fields = test # Name of fields to be used during additional sessions co destination_fields = test # Name of destination fields to be used during additional sessions control <""|*default|field_name>. setup_time_fields = test # Name of setup_time fields to be used during additional sessions control <""|*default|field_name>. answer_time_fields = test # Name of answer_time fields to be used during additional sessions control <""|*default|field_name>. -duration_fields = test # Name of duration fields to be used during additional sessions control <""|*default|field_name>. +usage_fields = test # Name of duration fields to be used during additional sessions control <""|*default|field_name>. combined_chargers = true # Combine accounts specific derived_chargers with server configured ones . [history_server] diff --git a/data/conf/cgrates.cfg b/data/conf/cgrates.cfg index 1eed2c987..e381988d3 100644 --- a/data/conf/cgrates.cfg +++ b/data/conf/cgrates.cfg @@ -51,13 +51,13 @@ # mediator = # Address where to reach the Mediator. Empty for disabling mediation. <""|internal> [cdre] -# cdr_format = csv # Exported CDRs format -# mask_destination_id = # Destination id containing called addresses to be masked on export -# mask_length = 0 # Length of the destination suffix to be masked -# cost_shift_digits = 0 # Shift cost on export with the number of digits digits defined here (eg: convert from Eur to cent). -# export_dir = /var/log/cgrates/cdrexport/csv # Path where the exported CDRs will be placed -# export_template = cgrid,mediation_runid,accid,cdrhost,reqtype,direction,tenant,category,account,subject,destination,setup_time,answer_time,duration,cost - # Exported fields template <""|fld1,fld2|*xml:instance_name> +# cdr_format = csv # Exported CDRs format +# mask_destination_id = # Destination id containing called addresses to be masked on export +# mask_length = 0 # Length of the destination suffix to be masked +# cost_shift_digits = 0 # Shift cost on export with the number of digits digits defined here (eg: convert from Eur to cent). +# export_dir = /var/log/cgrates/cdre # Path where the exported CDRs will be placed +# export_template = cgrid,mediation_runid,accid,cdrhost,reqtype,direction,tenant,category,account,subject,destination,setup_time,answer_time,usage,cost + # Exported fields template <""|fld1,fld2|*xml:instance_name> [cdrc] # enabled = false # Enable CDR client functionality # cdrs = internal # Address where to reach CDR server. @@ -77,7 +77,7 @@ # destination_field = 7 # Destination field identifier. Use index numbers in case of .csv cdrs. # setup_time_field = 8 # Setup time field identifier. Use index numbers in case of .csv cdrs. # answer_time_field = 9 # Answer time field identifier. Use index numbers in case of .csv cdrs. -# duration_field = 10 # Duration field identifier. Use index numbers in case of .csv cdrs. +# usage_field = 10 # Usage field identifier. Use index numbers in case of .csv cdrs. # extra_fields = # Extra fields identifiers. For .csv, format: :[...,:] [mediator] @@ -109,7 +109,7 @@ # destination_fields = # Name of destination fields to be used during additional sessions control <""|*default|field_name>. # setup_time_fields = # Name of setup_time fields to be used during additional sessions control <""|*default|field_name>. # answer_time_fields = # Name of answer_time fields to be used during additional sessions control <""|*default|field_name>. -# duration_fields = # Name of duration fields to be used during additional sessions control <""|*default|field_name>. +# usage_fields = # Name of usage fields to be used during additional sessions control <""|*default|field_name>. # combined_chargers = true # Combine accounts specific derived_chargers with server configured ones . [history_server] diff --git a/data/conf/samples/mediator_test1.cfg b/data/conf/samples/mediator_test1.cfg index a5549492f..c0a33e969 100644 --- a/data/conf/samples/mediator_test1.cfg +++ b/data/conf/samples/mediator_test1.cfg @@ -28,8 +28,7 @@ subject_fields = ^dc2 # Name of fields to be used during additional sessions c destination_fields = *default # Name of destination fields to be used during additional sessions control <""|*default|field_name>. setup_time_fields = *default # Name of setup_time fields to be used during additional sessions control <""|*default|field_name>. answer_time_fields = *default # Name of answer_time fields to be used during additional sessions control <""|*default|field_name>. -duration_fields = *default # Name of duration fields to be used during additional sessions control <""|*default|field_name>. -# combined_chargers = true # Combine accounts specific derived_chargers with server configured ones . +usage_fields = *default # Name of usage fields to be used during additional sessions control <""|*default|field_name>.