[asterisk-users] cdr viewer for csv

2014-04-24 Thread binary dreamer
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?
-- 
_
-- 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

Re: [asterisk-users] cdr viewer for csv

2014-04-24 Thread Chris Bagnall
On 24 Apr 2014, at 11:36, binary dreamer dreamer.bin...@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


-- 
_
-- 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


Re: [asterisk-users] cdr viewer for csv

2014-04-24 Thread binary dreamer
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
aster...@lists.minotaur.ccwrote:

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


 --
 _
 -- 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

Re: [asterisk-users] cdr viewer for csv

2014-04-24 Thread A J Stiles
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 .

-- 
_
-- 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


Re: [asterisk-users] cdr viewer for csv

2014-04-24 Thread binary dreamer
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_l...@earthshod.co.ukwrote:

 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 .

 --
 _
 -- 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

Re: [asterisk-users] cdr viewer for csv

2014-04-24 Thread Josh Metzger
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.bin...@gmail.comwrote:

 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_l...@earthshod.co.uk
  wrote:

 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 .

 --
 _
 -- 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

Re: [asterisk-users] cdr viewer for csv

2014-04-24 Thread A J Stiles
On Thursday 24 Apr 2014, binary dreamer wrote:
 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


Re: [asterisk-users] cdr viewer for csv

2014-04-24 Thread binary dreamer
really nice. but could tell me the way, play?


On Thu, Apr 24, 2014 at 3:37 PM, Josh Metzger joshdmetz...@gmail.comwrote:

 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.bin...@gmail.comwrote:

 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_l...@earthshod.co.uk wrote:

 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 .

 --
 _
 -- 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

-- 
_
-- 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

Re: [asterisk-users] cdr viewer for csv

2014-04-24 Thread A J Stiles
On Thursday 24 Apr 2014, binary dreamer wrote:
 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