[reSIProcate] True uniqeness of Helper::computeCallID()
Byron Campen
bcampen at estacado.net
Wed Sep 27 20:30:48 CDT 2006
Hrm. Just some preliminary fiddling with the probabilities (alas, my
installation of octave is hosed) makes it look _extremely_ likely
that you would get repeats within a data set of 2 million (before the
hash, we aren't talking about hash collisions here). Just throwing in
a timestamp or a counter would make the pre-hash token effectively
unique, or you could go with a longer string of random hex (16 should
bring it down to a vanishingly small probability). Maybe we could
have Helper::computeCallId() take an optional int parameter that
would specify the length of random hex the caller wants to go in the
hash?
Best regards,
Byron Campen
> Has anyone had issue with the true uniqueness of
> Helper::computeCallID().
>
> I've used the value returned from this to push about two million
> calls into cdr records....however I am discovering that some new
> calls are attaching themselves to old cdr records.......
>
> The algorithm used in Helper.cxx is the base64 of md5 of hostname +
> Random::getRandomHex(8)
>
> My guess is there is a good chance that you will get a random
> number twice.
>
> Does anyone have an idea on how this can be improved or a quick
> code snippet for me to create a truly unique callid?
>
> Thanks in advance,
>
> David
>
> Share your special moments by uploading 500 photos per month to
> Windows Live Spaces Share it!
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at list.sipfoundry.org
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20060927/c7457a7f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2369 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20060927/c7457a7f/attachment.bin>
More information about the resiprocate-devel
mailing list