diff --git a/apier/v1/cdre.go b/apier/v1/cdre.go index 177636164..aec771e74 100644 --- a/apier/v1/cdre.go +++ b/apier/v1/cdre.go @@ -267,7 +267,16 @@ func (self *ApierV1) ExportCDRs(arg ArgExportCDRs, reply *RplExportedCDRs) (err if arg.ExportID != nil && len(*arg.ExportID) != 0 { exportID = *arg.ExportID } - fileName := fmt.Sprintf("cdre_%s.%s", exportID, exportFormat) + var expFormat string + switch exportFormat { + case utils.MetaFileFWV: + expFormat = "fwv" + case utils.MetaFileCSV: + expFormat = "csv" + default: + expFormat = exportFormat + } + fileName := fmt.Sprintf("cdre_%s.%s", exportID, expFormat) if arg.ExportFileName != nil && len(*arg.ExportFileName) != 0 { fileName = *arg.ExportFileName } diff --git a/apier/v2/cdre.go b/apier/v2/cdre.go index 46ec12f13..068dd8e5b 100644 --- a/apier/v2/cdre.go +++ b/apier/v2/cdre.go @@ -89,7 +89,16 @@ func (self *ApierV2) ExportCdrsToFile(attr AttrExportCdrsToFile, reply *Exported if attr.ExportID != nil && len(*attr.ExportID) != 0 { exportID = *attr.ExportID } - fileName := fmt.Sprintf("cdre_%s.%s", exportID, exportFormat) + var expFormat string + switch exportFormat { + case utils.MetaFileFWV: + expFormat = "fwv" + case utils.MetaFileCSV: + expFormat = "csv" + default: + expFormat = exportFormat + } + fileName := fmt.Sprintf("cdre_%s.%s", exportID, expFormat) if attr.ExportFileName != nil && len(*attr.ExportFileName) != 0 { fileName = *attr.ExportFileName }