How unique is uuid in the cdr records? Coming from asterisk where uid is about as unique as a black bowling ball.... Can I count on uuid to be totally unique in my billing records? -- Regards, John Matich Telecube Pty Ltd www.telecube.com.au <http://www.telecube.com.au> Ph: 13CUBE (132823)
It depends on what implementation of the UUID library the build system has detected. If you've had the libuuid from e2fsprogs (Linux at the very least) installed and headers present, the build system will link against that. That implementation generates random UUID's for the most part. If you didn't have libuuid and its headers installed, the build system will use APR's own implementation for generating the UUID's; those generated UUID's are known to be sequential in nature. From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Telecube - John Sent: Sunday, May 19, 2013 6:58 AM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] UUID - how unique is it? How unique is uuid in the cdr records? Coming from asterisk where uid is about as unique as a black bowling ball.... Can I count on uuid to be totally unique in my billing records? -- Regards, John Matich Telecube Pty Ltd www.telecube.com.au Ph: 13CUBE (132823)
libuuid generates one of several types of uuid. One simply makes all bits random from /dev/urandom. Collisions are unlikely but still possible. The time one allocates some bits to the mac and others to the unix timestamp, then the rest is sequential. That one means different servers will never generate collisions (assuming all use the same scheme), and collisions can't happen within the program on the server. That can be made between multiple programs using the library too. http://linux.die.net/man/3/uuid_generate Personally I would prefer the later but for privacy reasons (the mac) the first is the libraries default. Not sure which FS uses... On Sunday, May 19, 2013, Jeff Leung wrote:
It depends on what implementation of the UUID library the build system has detected.
If you’ve had the libuuid from e2fsprogs (Linux at the very least) installed and headers present, the build system will link against that. That implementation generates random UUID’s for the most part. If you didn’t have libuuid and its headers installed, the build system will use APR’s own implementation for generating the UUID’s; those generated UUID’s are known to be sequential in nature.****
** **
*From:* freeswitch-users-bounces@lists.freeswitch.org <javascript:_e({}, 'cvml', 'freeswitch-users-bounces@lists.freeswitch.org');> [mailto: freeswitch-users-bounces@lists.freeswitch.org <javascript:_e({}, 'cvml', 'freeswitch-users-bounces@lists.freeswitch.org');>] *On Behalf Of *Telecube - John *Sent:* Sunday, May 19, 2013 6:58 AM *To:* freeswitch-users@lists.freeswitch.org <javascript:_e({}, 'cvml', 'freeswitch-users@lists.freeswitch.org');> *Subject:* [Freeswitch-users] UUID - how unique is it?****
** **
How unique is uuid in the cdr records?
Coming from asterisk where uid is about as unique as a black bowling ball....
Can I count on uuid to be totally unique in my billing records?****
-- Regards, John Matich Telecube Pty Ltd www.telecube.com.au Ph: 13CUBE (132823)****
If you're running multiple FS instances, you could also use both the FS server UUID in addition to the session UUID together. That'd mean storing more data but it would probably be on the order of winning a $500 million USD Powerball game twice within the same month... -Yossi
And if you can make that repeatable using libuuid, please do let me know ;) Regards, Ben Langfeld On 19 May 2013 19:41, Yossi Neiman <mishehu@freeswitch.org> wrote:
If you're running multiple FS instances, you could also use both the FS server UUID in addition to the session UUID together. That'd mean storing more data but it would probably be on the order of winning a $500 million USD Powerball game twice within the same month...
-Yossi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Sorry I meant to say with the daemon. (uuidd). That would be unique between multiple instances too. If the time one is used its already unique to the server. But as I said, I'm not sure if that's the one FS uses. On Monday, May 20, 2013, Yossi Neiman wrote:
If you're running multiple FS instances, you could also use both the FS server UUID in addition to the session UUID together. That'd mean storing more data but it would probably be on the order of winning a $500 million USD Powerball game twice within the same month...
-Yossi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <javascript:;> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <javascript:;> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
The apr uuid stuff already has a portion of the uuid thats per-instance. I've seen a lot of details in this thread that are not accurate to my recollection of this code. Has anyone actually dug in and looked at it? Its been a while by my recollection is each instance gets a certain number of bits from random at startup, then its a combination of time + counter. The only collision possibility would be the random at startup portion which would be much less likely than getting struck by lightning. Mike On May 20, 2013, at 2:20 AM, Steven Ayre <steveayre@gmail.com> wrote:
Sorry I meant to say with the daemon. (uuidd). That would be unique between multiple instances too. If the time one is used its already unique to the server. But as I said, I'm not sure if that's the one FS uses.
On Monday, May 20, 2013, Yossi Neiman wrote: If you're running multiple FS instances, you could also use both the FS server UUID in addition to the session UUID together. That'd mean storing more data but it would probably be on the order of winning a $500 million USD Powerball game twice within the same month...
-Yossi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
RE: the per session uuid: I've looked at the code recently, and I already don't recall the exact details. :-) However, if you have libuuid installed, it (apr and/or apr-util) defaults to using libuuid's functions and acts as nothing more than a shim. I think part of the computation is based upon /dev/urandom and part on the timestamp and possibly a counter, but I might be merging things in my head incorrectly as that might be the non-libuuid segment of the code... It's highly random, but as with any finite set, there is always a remote possibility of a collision. The FS core UUID is instantiated at start-up of FS, so every time FS is restarted, it gets a new FS core UUID. -Yossi On 05/20/2013 07:18 AM, Michael Jerris wrote:
The apr uuid stuff already has a portion of the uuid thats per-instance. I've seen a lot of details in this thread that are not accurate to my recollection of this code. Has anyone actually dug in and looked at it? Its been a while by my recollection is each instance gets a certain number of bits from random at startup, then its a combination of time + counter. The only collision possibility would be the random at startup portion which would be much less likely than getting struck by lightning.
Mike
On May 20, 2013, at 2:20 AM, Steven Ayre <steveayre@gmail.com <mailto:steveayre@gmail.com>> wrote:
Sorry I meant to say with the daemon. (uuidd). That would be unique between multiple instances too. If the time one is used its already unique to the server. But as I said, I'm not sure if that's the one FS uses.
On Monday, May 20, 2013, Yossi Neiman wrote:
If you're running multiple FS instances, you could also use both the FS server UUID in addition to the session UUID together. That'd mean storing more data but it would probably be on the order of winning a $500 million USD Powerball game twice within the same month...
-Yossi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <javascript:;> http://www.freeswitchsolutions.com <http://www.freeswitchsolutions.com/>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com <http://www.cudatel.com/>
Official FreeSWITCH Sites http://www.freeswitch.org <http://www.freeswitch.org/> http://wiki.freeswitch.org <http://wiki.freeswitch.org/> http://www.cluecon.com <http://www.cluecon.com/>
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <javascript:;> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org <http://www.freeswitch.org/>
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
In my case ( where there are multiple servers ) I pre-ended the server ID, before the UUID just to reduce the possibility of collisions. I guess it just depends how many calls you figure your going to have on your platform. On 19 May 2013 23:57, Telecube - John <john@telecube.com.au> wrote:
How unique is uuid in the cdr records?
Coming from asterisk where uid is about as unique as a black bowling ball....
Can I count on uuid to be totally unique in my billing records? -- Regards, John Matich Telecube Pty Ltd www.telecube.com.au Ph: 13CUBE (132823)
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Sincerely Jay
Hi guys, Thanks for the responses, I think I'll stick with the current process of writing a db entry for each call that comes in and using that insert id as the call event id. That guarantees uniqueness but requires an extra trip to the db to get it. Cheers, John On 20/05/13 9:53 AM, jay binks wrote:
In my case ( where there are multiple servers ) I pre-ended the server ID, before the UUID just to reduce the possibility of collisions.
I guess it just depends how many calls you figure your going to have on your platform.
On 19 May 2013 23:57, Telecube - John <john@telecube.com.au <mailto:john@telecube.com.au>> wrote:
How unique is uuid in the cdr records?
Coming from asterisk where uid is about as unique as a black bowling ball....
Can I count on uuid to be totally unique in my billing records? -- Regards, John Matich Telecube Pty Ltd www.telecube.com.au <http://www.telecube.com.au> Ph: 13CUBE (132823 <tel:%28132823>)
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Sincerely
Jay
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Sun, May 19, 2013 at 7:57 AM, Telecube - John <john@telecube.com.au> wrote:
Can I count on uuid to be totally unique in my billing records?
Just for fun... Number of stars believed to exist in known universe: 70,000,000,000,000,000,000,000 Number of *drops* of water estimated to be the world's oceans (U.S. Navy): 222,000,000,000,000,000,000,000,000 Number of *unique* UUIDs: 340,282,366,920,938,463,463,374,607,431,768,211,456 So, your chances of a collision with *hundreds* of *billions* of truly random UUIDs is inconceivably low. The only thing you really have to worry about are humans and the code they write ;) Best, Gabe
+rep I like this answer :-) - John On 21/05/13 12:58 PM, Gabriel Gunderson wrote:
On Sun, May 19, 2013 at 7:57 AM, Telecube - John <john@telecube.com.au> wrote:
Can I count on uuid to be totally unique in my billing records? Just for fun...
Number of stars believed to exist in known universe: 70,000,000,000,000,000,000,000
Number of *drops* of water estimated to be the world's oceans (U.S. Navy): 222,000,000,000,000,000,000,000,000
Number of *unique* UUIDs: 340,282,366,920,938,463,463,374,607,431,768,211,456
So, your chances of a collision with *hundreds* of *billions* of truly random UUIDs is inconceivably low.
The only thing you really have to worry about are humans and the code they write ;)
Best, Gabe
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I had looked this on wikipedia a few days ago, it said - In other words, only after generating 1 billion UUIDs every second for the next 100 years, the probability of creating just one duplicate would be about 50%. http://zh.wikipedia.org/wiki/UUID -- Seven Du http://www.freeswitch.org.cn http://about.me/dujinfang http://www.dujinfang.com Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Tuesday, May 21, 2013 at 11:16 AM, Telecube - John wrote:
+rep
I like this answer
:-)
- John On 21/05/13 12:58 PM, Gabriel Gunderson wrote:
On Sun, May 19, 2013 at 7:57 AM, Telecube - John <john@telecube.com.au (mailto:john@telecube.com.au)> wrote:
Can I count on uuid to be totally unique in my billing records?
Just for fun...
Number of stars believed to exist in known universe: 70,000,000,000,000,000,000,000
Number of *drops* of water estimated to be the world's oceans (U.S. Navy): 222,000,000,000,000,000,000,000,000
Number of *unique* UUIDs: 340,282,366,920,938,463,463,374,607,431,768,211,456
So, your chances of a collision with *hundreds* of *billions* of truly random UUIDs is inconceivably low.
The only thing you really have to worry about are humans and the code they write ;)
Best, Gabe
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org (mailto:consulting@freeswitch.org) http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org (mailto:FreeSWITCH-users@lists.freeswitch.org) http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org (mailto:consulting@freeswitch.org) http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org (mailto:FreeSWITCH-users@lists.freeswitch.org) http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (10)
-
Ben Langfeld
-
Gabriel Gunderson
-
jay binks
-
Jeff Leung
-
Michael Jerris
-
Olle E. Johansson
-
Seven Du
-
Steven Ayre
-
Telecube - John
-
Yossi Neiman