tap-cdr.c

This commit is contained in:
root
2025-01-22 21:53:19 +08:00
parent 6d9e440ec8
commit 48e5b94f1f
6 changed files with 28 additions and 7 deletions

View File

@@ -19,7 +19,9 @@ ftpSend -d
alarmAgent -d
nrtrde -d
sftpSend -d
tapcvt -d
cstaCollector -d
[slave_task]
iptrans -d
paraComm -d

10
bin/conf/tap.cfg Normal file
View File

@@ -0,0 +1,10 @@
[local]
name=NFK
currency=USD
utc_offset=+1200
tap_path=/opt
[partners]
name=PLWPC
plmnid=46000
place=CHINA
currency=CNY

BIN
bin/tapcvt Normal file

Binary file not shown.

View File

@@ -57,9 +57,9 @@ else
LD_LIBRARY_PATH=/usr/lib/mysql ; export LD_LIBRARY_PATH
fi
startProcList="iptrans omcMain paraComm subsComm logCollector omcCleaner smcli cdrCollector subsDataBackup ftpSend alarmAgent nrtrde sftpSend cstaCollector"
startProcList="iptrans omcMain paraComm subsComm logCollector omcCleaner smcli cdrCollector subsDataBackup ftpSend alarmAgent nrtrde sftpSend cstaCollector tapcvt"
#alive bsscomm
stopProcList="iptrans omcMain paraComm subsComm logCollector omcCleaner smcli cdrCollector subsDataBackup ftpSend alarmAgent nrtrde sftpSend cstaCollector"
stopProcList="iptrans omcMain paraComm subsComm logCollector omcCleaner smcli cdrCollector subsDataBackup ftpSend alarmAgent nrtrde sftpSend cstaCollector tapcvt"
statusProcList=$stopProcList
slaveStartProcList="iptrans omcMain"

View File

@@ -769,6 +769,9 @@ void create_record_table(cdr_src *psrc,MYSQL *pCdrConn)
sprintf(tmpstr,"TEXT");
strcat(createfieldlist,tmpstr);
break;
case 42: // 假设这是一个字符串类型的字段
strcat(createfieldlist, "VARCHAR(30)"); // 或者根据需要调整长度
break;
//integer
case 1:
//unsigned integer
@@ -1726,7 +1729,16 @@ void cdr_parse(cdr_sys *psys,int tagcode,ASN_BUF *asnbuf,int fieldIndex,char* fi
sprintf(fieldstr,",NULL");
}
break;
case 42:
if((len = get_tlv(pdef->fields[fieldIndex].tags[tagcode], tempbyte, asnbuf)) > 0)
{
sprintf(fieldstr, ",'%d.%d.%d.%d'", tempbyte[0], tempbyte[1], tempbyte[2], tempbyte[3]);
}
else
{
sprintf(fieldstr, ",NULL");
}
break;
}
}

View File

@@ -1266,12 +1266,9 @@ void clear_table(char *table_name)
return;
}
if (strstr(table_name, "cdrFromSGSN") != NULL) {
sprintf(mng_sqlstr,"delete from CDR_DB.%s WHERE TO_DAYS(changeTime)<TO_DAYS(NOW());",table_name);
}else{
sprintf(mng_sqlstr,"delete from CDR_DB.%s WHERE TO_DAYS(releaseTime)<TO_DAYS(NOW());",table_name);
}
if(mysql_getnores(pubConn,mng_sqlstr) != 0)
cdr_log("[ERR %d][clear_table]:%s",mysql_errno(pubConn),mng_sqlstr);