Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] cdr viewer for csv


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
dreamer.binary at gmai...
Guest





PostPosted: Thu Apr 24, 2014 5:36 am    Post subject: [asterisk-users] cdr viewer for csv Reply with quote

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?
Back to top
asterisk at lists.mino...
Guest





PostPosted: Thu Apr 24, 2014 5:46 am    Post subject: [asterisk-users] cdr viewer for csv Reply with quote

On 24 Apr 2014, at 11:36, binary dreamer <dreamer.binary@gmail.com> wrote:
Quote:
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.

Quote:
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


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
dreamer.binary at gmai...
Guest





PostPosted: Thu Apr 24, 2014 6:31 am    Post subject: [asterisk-users] cdr viewer for csv Reply with quote

Thanks a lot for the reply.
this is a PBX for my soho. it does not worth to run a separate machine.
all I want is to present the csv file in a webpage to be human readable.
the calls will not exceed 70 per week.



On Thu, Apr 24, 2014 at 1:46 PM, Chris Bagnall <asterisk@lists.minotaur.cc (asterisk@lists.minotaur.cc)> wrote:
Quote:
On 24 Apr 2014, at 11:36, binary dreamer <dreamer.binary@gmail.com (dreamer.binary@gmail.com)> wrote:
Quote:
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.

Quote:
at the moment the only other software running is nginx for a static webpage with guidance on the system.

Quote:
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


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
asterisk_list at earth...
Guest





PostPosted: Thu Apr 24, 2014 7:19 am    Post subject: [asterisk-users] cdr viewer for csv Reply with quote

On Thursday 24 Apr 2014, binary dreamer wrote:
Quote:
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 .

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
dreamer.binary at gmai...
Guest





PostPosted: Thu Apr 24, 2014 7:28 am    Post subject: [asterisk-users] cdr viewer for csv Reply with quote

already logrotate is doing the file split every month.
how do you serve it in a webpage and which CGI script?



On Thu, Apr 24, 2014 at 3:18 PM, A J Stiles <asterisk_list@earthshod.co.uk (asterisk_list@earthshod.co.uk)> wrote:
Quote:
On Thursday 24 Apr 2014, binary dreamer wrote:
Quote:
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 .

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Back to top
joshdmetzger at gmail.com
Guest





PostPosted: Thu Apr 24, 2014 7:37 am    Post subject: [asterisk-users] cdr viewer for csv Reply with quote

With such a low amount of calls per month and with the extreme memory limitations, it might be easier to write a script to pull out the data and generate a static html page.  Run it daily / weekly / whenever you need it.




On Thu, Apr 24, 2014 at 8:28 AM, binary dreamer <dreamer.binary@gmail.com (dreamer.binary@gmail.com)> wrote:
Quote:
already logrotate is doing the file split every month.
how do you serve it in a webpage and which CGI script?



On Thu, Apr 24, 2014 at 3:18 PM, A J Stiles <asterisk_list@earthshod.co.uk (asterisk_list@earthshod.co.uk)> wrote:
Quote:
On Thursday 24 Apr 2014, binary dreamer wrote:
Quote:
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 .

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users








--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
asterisk_list at earth...
Guest





PostPosted: Thu Apr 24, 2014 7:59 am    Post subject: [asterisk-users] cdr viewer for csv Reply with quote

On Thursday 24 Apr 2014, binary dreamer wrote:
Quote:
already logrotate is doing the file split every month.
how do you serve it in a webpage and which CGI script?

You need a web server. You say you already have nginx; I'm not familiar with
this, but it probably will do what you need. Read the documentation to find
out where CGI scripts should be placed by default. Note that most Linux
distributions standardise the locations of things like this across several
packages; so whichever webserver you installed, CGI scripts will always be in
the same folder. And if you installed from your distribution's repository,
this might not be in the same place mentioned in the documentation for the
"pristine" package. So when searching, be sure to mention your distribution
by name.

Simplest ever CGI script:

---------- >8 ----------
#!/bin/bash
echo "Content-type: text/plain"
echo ""
env
exit 0
---------- 8< ----------

Save this in your cgi-bin folder, give it 755 permissons (so anybody can read
and execute it), and call it up from a desktop machine on your LAN. Keep re-
reading the instructions until you get it working without a 500 error.

Now you just need to write a script in your favourite language to pull out the
bits you want and display the result. Don't forget to begin with a content-
type declaration followed by a blank line.

--
AJS

Note: Originating address only accepts e-mail from list! If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
dreamer.binary at gmai...
Guest





PostPosted: Thu Apr 24, 2014 8:19 am    Post subject: [asterisk-users] cdr viewer for csv Reply with quote

really nice. but could tell me the way, play?


On Thu, Apr 24, 2014 at 3:37 PM, Josh Metzger <joshdmetzger@gmail.com (joshdmetzger@gmail.com)> wrote:
Quote:
With such a low amount of calls per month and with the extreme memory limitations, it might be easier to write a script to pull out the data and generate a static html page.  Run it daily / weekly / whenever you need it.




On Thu, Apr 24, 2014 at 8:28 AM, binary dreamer <dreamer.binary@gmail.com (dreamer.binary@gmail.com)> wrote:
Quote:
already logrotate is doing the file split every month.
how do you serve it in a webpage and which CGI script?



On Thu, Apr 24, 2014 at 3:18 PM, A J Stiles <asterisk_list@earthshod.co.uk (asterisk_list@earthshod.co.uk)> wrote:
Quote:
On Thursday 24 Apr 2014, binary dreamer wrote:
Quote:
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 .

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users








--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users






--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
asterisk_list at earth...
Guest





PostPosted: Thu Apr 24, 2014 11:14 am    Post subject: [asterisk-users] cdr viewer for csv Reply with quote

On Thursday 24 Apr 2014, binary dreamer wrote:
Quote:
really nice. but could tell me the way, play?

I think we have gone as far as we can with this matter on this list, which is
strictly for non-commercial discussion only.

If you would still like to contact me off-list, please change the underscore in
my e-mail address to a figure "one".


--
AJS

Note: Originating address only accepts e-mail from list! If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services