[Asterisk-Users] Your thoughts..

Chris Albertson chrisalbertson90278 at yahoo.com
Fri Nov 14 12:17:56 MST 2003


One of the major reasons you use a DBMS is to solve this
exact kind of problem.  Basically what you want is both

1) concurent access by two processes (asterick and your
   accounting program

2) Each process to see "conssitant" data.  this is a reader
should never "see" half-writtencall records.

I don't see the problem.  A call log is produced with
just one SQL select querry on the database.  
Assuming call records are written
within a transaction, any process that queries the DBMS
will only get data from commited transactions and simply
will not see yet to be commited call data.

If Asterisk fails to enclose it's incerts to the DBMS
in a transaction this is a bug that can be easly fixed



--- WipeOut <wipe_out at onetel.com> wrote:
> I need to get your thoughts on something.. :)
> 
> I am trying to create a system to process the CDR call logs for 
> department accounting..
> 
> I think there are two ways of doing it.. Either I can create an AGI
> that 
> will run on the "h" extension and will lookup the last entry that 
> matches the account code of the call that just ended in the MySQL CDR
> 
> and calculate the call cost immediately..
> Or
> I can use a cron job say every 5 mins to move the Master.csv file to
> a 
> temporary location and then process all the lines in the csv and put
> the 
> results into the DB and then delete the Master.csv from that
> temporary 
> location..
> 
> Which way will be better in terms of reliability and performance?
> 
> What will the issues be if the Master.csv is being updated at the
> exact 
> moment my cron job tries to move it? is there any file locking or a 
> method of delaying Asterisk's write or the cron's move operation till
> 
> the file is availible?
> 
> Thanks for you thoughts..
> 
> Later
> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users


=====
Chris Albertson
  Home:   310-376-1029  chrisalbertson90278 at yahoo.com
  Cell:   310-990-7550
  Office: 310-336-5189  Christopher.J.Albertson at aero.org
  KG6OMK

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree



More information about the asterisk-users mailing list