[asterisk-users] Multi operator platform Asterisk {manage}

ABBAS SHAKEEL shakeel.abbas.qau at gmail.com
Fri Aug 21 00:11:15 CDT 2009


Thanks Steve for this great info ... thanks alot.

On Wed, Aug 19, 2009 at 6:26 PM, Steve Edwards <asterisk.org at sedwards.com>wrote:

> On Wed, 19 Aug 2009, ABBAS SHAKEEL wrote:
>
> > Rsync looks really great !
>
> Yep. Something I wish I learned about earlier in my career :)
>
> > How you are get CDR records etc from the remote servers for reporting
> > purpose ..... I was thinking to have one centralized database ? but your
> > comments let me think about distributed database ?
>
> I like having a database at each datacenter for autonomy and performance.
>
> Periodically, the master database executes a script with the following
> snippet (error checking and irrelevant details removed for brevity):
>
> # for each host
>         for     HOST in ${HOST_LIST}
>         do
>
> ${DATE} "+%T Mark the records on ${HOST} to be collected."
>                 mysql\
>                         ${USER_AUTH}\
>                         --database=@DATABASE_DATABASE@\
>                         --execute="update cdrs set disposition =
> 'COLLECTING'"\
>                         --execute=" where disposition is NULL;"\
>                         --host=${HOST}\
>                         ${END_OF_LIST}
>
> ${DATE} "+%T Dump the marked records from ${HOST}."
>                 mysqldump\
>                         ${USER_AUTH}\
>                         --databases @DATABASE_DATABASE@\
>                         --host=${HOST}\
>                         --no-create-info\
>                         --skip-opt\
>                         --tables cdrs\
>                         --where="disposition = 'COLLECTING'"\
>                         >/tmp/${HOST}.sql\
>                         ${END_OF_LIST}
>
> ${DATE} "+%T Load the records from ${HOST} into our database."
>                 mysql\
>                         ${USER_AUTH}\
>                         --database=@DATABASE_DATABASE@\
>                         --host=localhost\
>                         </tmp/${HOST}.sql\
>                         ${END_OF_LIST}
>
> ${DATE} "+%T Compressing the dump file from ${HOST}."
>                 gzip /tmp/${HOST}.sql
>                 mv /tmp/${HOST}.sql.gz /tmp/${HOST}.sql.gz-${TIMESTAMP}
>
> ${DATE} "+%T Delete the collected records from ${HOST}."
>                 mysql ${USER_AUTH}\
>                         --database=@DATABASE_DATABASE@\
>                         --execute="delete from cdrs where disposition =
> 'COLLECTING';"\
>                         --host=${HOST}\
>                         ${END_OF_LIST}
>
> ${DATE} "+%T Set the disposition on this host."
>                 mysql ${USER_AUTH}\
>                         --database=${DATABASE_DATABASE}\
>                         --execute="update cdrs set disposition =
> 'COLLECTED'"\
>                         --execute=" where disposition = 'COLLECTING';"\
>                         --host=localhost\
>                         ${END_OF_LIST}
>
> # end of hosts loop
>         done
>
> --
> Thanks in advance,
> -------------------------------------------------------------------------
> Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
> Newline                                              Fax: +1-760-731-3000
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> AstriCon 2009 - October 13 - 15 Phoenix, Arizona
> Register Now: http://www.astricon.net
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>



-- 
Best Regards
Shakeel Abbas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090821/481b06b9/attachment.htm 


More information about the asterisk-users mailing list