feat: IMS导出功能增加呼叫结果和原因字段

This commit is contained in:
TsMask
2025-04-28 19:25:22 +08:00
parent 2a0f0c46ca
commit 2a7baeb0b4
8 changed files with 254 additions and 145 deletions

View File

@@ -480,9 +480,9 @@ func (s BackupExportTableProcessor) exportIMS(hour int, columns []string, filePa
}
// 呼叫类型
callType := "sms"
if col == "callType" || col == "call_type" {
if v, ok := cdrJSON["callType"]; ok && v != nil {
callType := "sms"
callTypeLable := "SMS"
if v, ok := cdrJSON["callType"]; ok && v != nil {
callType = v.(string)
@@ -517,16 +517,21 @@ func (s BackupExportTableProcessor) exportIMS(hour int, columns []string, filePa
}
// 呼叫结果 非短信都有code作为结果 sms短信都ok
if col == "cause" {
if v, ok := cdrJSON["cause"]; ok && v != nil {
cause := fmt.Sprint(v)
callResult := "Success"
for _, v := range dictCDRSipCode {
if cause == v.DataValue {
callResult = i18n.TKey(language, v.DataLabel)
break
if callType == "sms" {
arr[i] = "Success"
continue
} else {
if v, ok := cdrJSON["cause"]; ok && v != nil {
callResult := "Other"
cause := fmt.Sprint(v)
for _, v := range dictCDRSipCode {
if cause == v.DataValue {
callResult = i18n.TKey(language, v.DataLabel)
break
}
}
arr[i] = callResult
}
arr[i] = fmt.Sprintf("%v", callResult)
}
}
// 呼叫时间