2015-02-26 5 views
0

Приветственный день всем вам, Надеюсь, у вас все хорошо.Как изменить журналы CDR «Master.csv», журналы звездочки, на данные Wise

У меня есть небольшие вопросы: Я хотел изменить свой формат Master.csvfile в date-wise csv file, потому что это будет легко управлять и будет читаться тоже. Также расскажите мне, как изменить asterisk logs file format на date-wise. Asterisk logs path details:

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

ответ

0

Вы можете переписать формат файла журнала Звездочка любого внешнего скрипта.

Такой скрипт можно перенести в perl, например, и очень просто. В соответствии с правилами SO вы показываете, что ваши усилия в triing делают такой скрипт, полные решения здесь оффтопны.

Вы можете изменить Master.csv с помощью корд-пользовательский модуль

http://www.asteriskguru.com/tutorials/cdr_custom_conf.html

[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. 
+0

Спасибо за ваше предложение. – Manoj

+0

Но мне нужен файл csv to date wise, например, он показывает, как Master.csv, и каждый день файл добавляется к существующему. Мне нужен формат файла, такой как Master_dd_mm_yyyy.csv – Manoj

+0

logrotate поможет вам менять имя файла каждый день. – arheops

Смежные вопросы