[Asterisk-Dev] dev conf topic: better CDRs
Chris Parker
cparker at segv.org
Wed Feb 23 14:56:34 MST 2005
On Feb 23, 2005, at 3:25 PM, Matthew Boehm wrote:
> 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?
Since RADIUS has solved a lot of this, it might be wise to look at how
in the RADIUS accounting world ( which has the same problems with a
unique-id not being globally unique ) this is handled.
In particular, FreeRADIUS ( http://www.freeradius.org/ ) and the
rlm_acct_unique module. It creates an MD5 unique hash from user
configurable ( at run-time ) attributes, which can be used to get a
lot closer global unique value.
-Chris
--
\\\|||/// \ Chris Parker - Segmentation Fault ( core dumped )
\ ~ ~ / \
| @ @ | \ http://www.segv.org | cparker at segv.org
oOo (_) oOo \
------------------------------------------------------------------------
# OS's are nothing more than device drivers! #
More information about the asterisk-dev
mailing list