[Asterisk-Dev] dev conf topic: better CDRs

Matthew Boehm mboehm at cytelcom.com
Wed Feb 23 14:25:15 MST 2005


Since uniqueid is generated from time(), the probability of 5 (or more)
asterisk servers being in perfect microsecond sync with eachother seems
highly unlikely. Agreeded? But still, mathematically it is possible that two
calls on two different machines end at the same time and 1 failes to write
to database because of UNIQUE constraint. I'd hate to see an entire server
blowup from that.

I was thinking of adding something that MySQL uses when doing replication.
You assign a unique 'serverid' to each server's config. Could you add that
to cdr_*.conf for each machine; then use that id in the uniqueid
calculation?

Something worth exploring?

-Matthew

----- Original Message ----- 
From: "Derrick D. Daugherty" <derrick+asterisk at blinky-lights.org>
To: "Asterisk Developers Mailing List" <asterisk-dev at lists.digium.com>
Sent: Wednesday, February 23, 2005 2:53 PM
Subject: Re: [Asterisk-Dev] dev conf topic: better CDRs


> Cracks in my tinfoil beanie around Wed, Feb 23, 2005 at 02:16:02PM -0600
> allowed Matthew Boehm <mboehm at cytelcom.com> to seep these bits into my
brain:
> > I've already got CDRs off the asterisk box. They are being dumped into a
> > dedicated mysql server. A problem that I am worried about is having
multiple
> > asterisk boxes writing CDRs to the same table.
> >
> > Just exactly how unique is the unique id in a CDR? Is there a way to
"seed"
> > each server so that the random id is more random?
>
> it's not unique enough.
>
> channel.c:
> snprintf(tmp->uniqueid, sizeof(tmp->uniqueid), "%li.%d", (long)time(NULL),
uniqueint++);
>
> either
>    o alter uniqueid definition to identify your proxy somehow
>    o use different tables
>    o add a cdrsrcproxyID column to a central table and alter how you write
>      your cdrs to include that.
>
> ^D
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list