Renaming to filterids field on exportcdrs

This commit is contained in:
gezimbll
2023-08-08 10:11:16 -04:00
committed by Dan Christian Bogos
parent bb9d32c5b6
commit 457ab9a3c6
2 changed files with 5 additions and 4 deletions

View File

@@ -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 {

View File

@@ -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 {