Asterisk “如何更改CDR日志”;Master.csv“文件,星号日志,以数据为准

Asterisk “如何更改CDR日志”;Master.csv“文件,星号日志,以数据为准,asterisk,sip,voip,cdr,Asterisk,Sip,Voip,Cdr,祝大家节日快乐,希望你们一切顺利 我有一个小问题: 我想将我的Master.csv文件格式更改为date-wise csv文件,因为它将易于管理且可读。 另外,请告诉我如何将星号日志文件格式更改为日期格式。 星号日志路径详细信息: /var/log/asterisk/ files are messages, queue_log, full and also zip too 您可以通过任何外部脚本重写星号日志文件格式 例如,这样的脚本可以用perl编写,而且非常简单。根据您在编写此类脚本时所做的

祝大家节日快乐,希望你们一切顺利

我有一个小问题: 我想将我的
Master.csv
文件
格式更改为
date-wise csv文件
,因为它将易于管理且可读。 另外,请告诉我如何将
星号日志文件格式
更改为
日期格式
星号日志路径详细信息:

/var/log/asterisk/ files are messages, queue_log, full and also zip too

您可以通过任何外部脚本重写星号日志文件格式

例如,这样的脚本可以用perl编写,而且非常简单。根据您在编写此类脚本时所做的努力,完整的解决方案在此不再讨论

您可以使用cdr自定义模块更改Master.csv


谢谢你的建议。但我需要csv文件,以日期为准,例如,它显示为Master.csv,并且每天的文件都会附加到现有的文件中。我想要像Master\u dd\u mm\u yyyy.csvlogrotate这样的文件格式,它将帮助你每天更改文件名。
[mappings]
Master.csv => "${CDR(clid)}","${CDR(src)}","${CDR(dst)}","${CDR(dcontext)}","${CDR(channel)}","${CDR(dstchannel)}","${CDR(lastapp)}","${CDR(lastdata)}","${CDR(start)}","${CDR(answer)}","${CDR(end)}","${CDR(duration)}","${CDR(billsec)}","${CDR(disposition)}","${CDR(amaflags)}","${CDR(accountcode)}","${CDR(uniqueid)}","${CDR(userfield)}"


Let's have a closer look at the variables we can define here:

${CDR(clid)} = callerid for the call (with the name)
${CDR(src)} = callerid number for the call
${CDR(dst)} = destination extension
${CDR(dcontext)} = Destination context
${CDR(channel)} = Src channel
${CDR(dstchannel)} = Destination channel if appropriate
${CDR(lastapp)} = this is the last application in the dialplan used, on an outgoing call this will be DIAL.
${CDR(lastdata)} = these are the parameters given to the last application used in the dialplan
${CDR(start)} = time of the start of the call
${CDR(answer)} = time when the call was answered
${CDR(end)} = time when the call got hung up
${CDR(duration)} = duration of the call
${CDR(billsec)} = duration of the actual call (without the ringing)
${CDR(disposition)} = status of the call (ANSWERED, BUSY, NO ANSWER)
${CDR(amaflags)} = flag for the type of CDR (can be set in a.o. sip.conf)
default: Sets the system default.
omit: Do not record calls.
billing: Mark the entry for billing
documentation: Mark the entry for documentation.

${CDR(accountcode)} = the accountcode as set for this channel with for example SetAccountcode in the dialplan (Extensions.conf) or in the channel configuration file (e.g. per user in sip.conf, iax.conf and per channel in zaptel.conf)
${CDR(uniqueid)} = a unique id for this call
{CDR(userfield)} = a userfield set by the dialplan command SetCDRUserfield

As you can see, it is possible to define different "layouts" for different files.
The default file is Master.csv, but if you specify a different accountcode (with SetAccount or in sip.conf or iax.conf or zaptel.conf) the filename will change.