[Asterisk-Dev] dev conf topic: better CDRs

Race Vanderdecken asteriskdev at codetyrant.com
Wed Feb 23 16:08:51 MST 2005


The GUID also uses the MAC address of the server NIC if I remember
correctly, so Unique should hold across the net. It is a big number. You
can also create a bigger GUID if you want.

Is there a bounty for more CDR work?

Race "The Tyrant" Vandedecken

-----Original Message-----
From: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Matthew
Boehm
Sent: Wednesday, February 23, 2005 4:25 PM
To: Derrick D. Daugherty; Asterisk Developers Mailing List
Subject: Re: [Asterisk-Dev] dev conf topic: better CDRs

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

_______________________________________________
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