diff --git a/apier/v2/cdre.go b/apier/v2/cdre.go index 9fb133fab..b564fd18f 100644 --- a/apier/v2/cdre.go +++ b/apier/v2/cdre.go @@ -36,7 +36,7 @@ type AttrExportCdrsToFile struct { ExportID *string // Optional exportid ExportDirectory *string // If provided it overwrites the configured export directory ExportFileName *string // If provided the output filename will be set to this - FiltersIDs []string // Will overwrite exporter filters + FilterIDs []string // Will overwrite exporter filters ExportTemplate *string // Exported fields template <""|fld1,fld2|> Verbose bool // Disable CgrIds reporting in reply/ExportedCgrIds and reply/UnexportedCgrIds utils.RPCCDRsFilter // Inherit the CDR filter attributes @@ -71,8 +71,8 @@ func (apiv2 *APIerSv2) ExportCdrsToFile(attr AttrExportCdrsToFile, reply *utils. if attr.ExportDirectory != nil && len(*attr.ExportDirectory) != 0 { eDir = *attr.ExportDirectory } - if len(attr.FiltersIDs) != 0 { - exportTemplate.Filters = attr.FiltersIDs + if len(attr.FilterIDs) != 0 { + exportTemplate.Filters = attr.FilterIDs } exportID := strconv.FormatInt(time.Now().Unix(), 10) if attr.ExportID != nil && len(*attr.ExportID) != 0 { diff --git a/apier/v2/cdrs_it_test.go b/apier/v2/cdrs_it_test.go index cdf254c53..efa7e2591 100644 --- a/apier/v2/cdrs_it_test.go +++ b/apier/v2/cdrs_it_test.go @@ -68,6 +68,7 @@ var ( testv2CDRsGetCDRsDest, testV2ExportCDRsToFile, + testV2CDRsKillEngine, } ) @@ -930,7 +931,7 @@ func testV2ExportCDRsToFile(t *testing.T) { ExportFileName: utils.StringPointer("TestTutITExportCDR.csv"), ExportDirectory: utils.StringPointer("/tmp"), ExportTemplate: utils.StringPointer("*default"), - FiltersIDs: []string{"*string:~*req.DisconnectCause:ORIGINATOR_CANCEL"}, + FilterIDs: []string{"*string:~*req.DisconnectCause:ORIGINATOR_CANCEL"}, } if err := cdrsRpc.Call(utils.APIerSv2ExportCdrsToFile, attr, &replyExp); err != nil {