hello everyone. I am running asterisk and all of my CDRs are in the default csv. the system is so limited to ram (only 256) and I cannot run MySQL or any other program to give CDRs a fancy view. at the moment the only other software running is nginx for a static webpage with guidance on the system. I do now want to move to sql or similar databases because the machine cannot handle it (I have already tried and it wastes ram from calls). is there a way to present to a webpage the CDRs from the csv, please? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140424/fa0085b8/attachment.html>
On 24 Apr 2014, at 11:36, binary dreamer <dreamer.binary at gmail.com> wrote:> I am running asterisk and all of my CDRs are in the default csv. > the system is so limited to ram (only 256) and I cannot run MySQL or any other program to give CDRs a fancy view.As an aside, have you considered running your CDR storage/viewing on a separate machine? You don't have to log CDRs on the same box as you run asterisk.> at the moment the only other software running is nginx for a static webpage with guidance on the system. > is there a way to present to a webpage the CDRs from the csv, please?You can almost certainly do this if you want using the standard string handling functions in $middleware_of_choice, but the lack of indexing on text files will make this *very* slow for search queries etc.. The RAM/CPU requirements associated with loading huge chunks of text data into memory, manipulating them, then displaying the results will likely exceed that of a DB. Unless you only want a recent call log, you really want to do this in a database. Kind regards, Chris -- This email is made from 100% recycled electrons
On Thursday 24 Apr 2014, binary dreamer wrote:> hello everyone. > I am running asterisk and all of my CDRs are in the default csv. > the system is so limited to ram (only 256) and I cannot run MySQL or any > other program to give CDRs a fancy view. > at the moment the only other software running is nginx for a static webpage > with guidance on the system. > I do now want to move to sql or similar databases because the machine > cannot handle it (I have already tried and it wastes ram from calls). > > > is there a way to present to a webpage the CDRs from the csv, please?If you can't stretch to a separate machine to run a database (even a scrapper will do for this) and you can't increase the RAM in your Asterisk machine, then you will have to resort to manipulating the CSV file. Use a cron job to rotate the master CDR daily or weekly, to keep it from becoming unmanageably large. This needs to be done at a time when you are not expecting any incoming calls. You really need to stop Asterisk while you do this and restart it afterwards. The whole operation (cp Master.csv cdr_$DATE.csv; echo -n "" > Master.csv) should be over within a few ringing periods; so even if a call does come through in the meantime, Asterisk ought to just pick it up as soon as it restarts. Then write a simple CGI script to serve up the cdr*.csv files. As long as you send the appropriate content-type, then it ought just to open straight up in OpenOffice.org calc. -- AJS Note: Originating address only accepts e-mail from list! If replying off- list, change address to asterisk1list at earthshod dot co dot uk .