[asterisk-users] Question about core CDR system for multilpe servers

Steve Edwards asterisk.org at sedwards.com
Thu Jun 4 12:29:08 CDT 2009


Un-top-posting...

> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Gustavo A 
> Gonzalez Sent: Thursday, June 04, 2009 10:23 AM
>
> Hi all! I’m not sure if it is the correct place but, I’ve five boxes 
> running asterisk and each one with his own cdr mysql database. What Im 
> looking for is to get a core CDR system that holds information stored on 
> each asterisk server. Have you any suggestion/process to accomplish 
> that?. Thanks!!!
>
On Thu, 4 Jun 2009, Danny Nicholas wrote:

> Do you want a "live repository" or just a common gathering of the data? 
> If LR then you should set up a deamon on each box to transfer records as 
> they occur using something like the DBI functionality of PERL.  If not, 
> then just do a mysql dump periodically and ssh the files to the common 
> server.

A few snippets from a production script...

# mark the records to be exported
         mysql ${USER_AUTH}\
                 --database example\
                 --execute="update cdrs set disposition = 'EXPORTING'"

# dump the cdrs
         mysqldump\
                 ${USER_AUTH}\
                 --skip-opt\
                 --no-create-info\
                 --where="disposition = 'EXPORTING'"\
                 example\
                 cdrs\
                 >${HOST_DOMAIN}.sql

# compress the dump file
         gzip ${HOST_DOMAIN}.sql
         mv ${HOST_DOMAIN}.sql.gz ${HOST_DOMAIN}.sql.gz-${DATE}

# scp the compressed dump file
         scp ${HOST_DOMAIN}.sql.gz-${DATE} example at example.com

# delete the exported records
         mysql ${USER_AUTH}\
                 --database example\
                 --execute="delete cdrs where disposition = 'EXPORTING'"

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000


More information about the asterisk-users mailing list