CDRExporter filename fixed (.csv and .fwv)

This commit is contained in:
TeoV
2017-11-17 13:23:57 +02:00
committed by DanB
parent 332c489d0f
commit 2e6a0f4d01
2 changed files with 20 additions and 2 deletions

View File

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

View File

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