mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
CDRExporter filename fixed (.csv and .fwv)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user