On Wednesday, February 1, 2012 at 12:03 AM, Anthony Minessale wrote:
ya, you're right.Fixed in tree....On Tue, Jan 31, 2012 at 3:51 AM, Seven Du <dujinfang@gmail.com> wrote:Hi,I tried to replace the following function which I copied somewhere in msrp.cwith switch_stun_random_string but I foundsometimes switch_stun_random_string returns identical strings on twosequential calls, with the following function I never found, so I still useit.By looking the code I understand srand seed is time based so it's possibleto return duplicate random string, but Ifound switch_stun_random_string used in some places other than stun, justcurious would it cause problems?void random_string(char *buf, switch_size_t size){long val[4];int x;for (x = 0; x < 4; x++)val[x] = random();snprintf(buf, size, "%08lx%08lx%08lx%08lx", val[0], val[1], val[2], val[3]);*(buf+size) = '\0';}Thanks.--About: http://about.me/dujinfangBlog: http://www.dujinfang.comSent with Sparrow_________________________________________________________________________Professional FreeSWITCH Consulting Services:FreeSWITCH-powered IP PBX: The CudaTel Communication ServerOfficial FreeSWITCH SitesFreeSWITCH-dev mailing list--Anthony Minessale IIFreeSWITCH http://www.freeswitch.org/ClueCon http://www.cluecon.com/Twitter: http://twitter.com/FreeSWITCH_wireAIM: anthmGTALK/JABBER/PAYPAL:anthony.minessale@gmail.comIRC: irc.freenode.net #freeswitchFreeSWITCH Developer Conferencegoogletalk:conf+888@conference.freeswitch.orgpstn:+19193869900_________________________________________________________________________Professional FreeSWITCH Consulting Services:FreeSWITCH-powered IP PBX: The CudaTel Communication ServerOfficial FreeSWITCH SitesFreeSWITCH-dev mailing list