[asterisk-bugs] [Asterisk 0012831]: UNIQUE ID field length too small

noreply at bugs.digium.com noreply at bugs.digium.com
Tue Jun 10 23:46:01 CDT 2008


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.digium.com/view.php?id=12831 
====================================================================== 
Reported By:                rayjay
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12831
Category:                   CDR/General
Reproducibility:            always
Severity:                   tweak
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.20.1 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             06-10-2008 23:45 CDT
Last Modified:              06-10-2008 23:45 CDT
====================================================================== 
Summary:                    UNIQUE ID field length too small
Description: 
I have noticed that the uniqueid field is too small when you define a
'systemname' on your asterisk server.  In my case I define the systemname
as the IP address of the server, so this could be up to 15 characters long
e.g. 192.168.123.456.  The following code in main/channel.c then creates
the uniqueid string for CDR etc.

ast_string_field_build(tmp, uniqueid, "%s-%li.%d",
ast_config_AST_SYSTEM_NAME,
  (long) time(NULL), ast_atomic_fetchadd_int(&uniqueint, 1));

The problem is that uniqueid is only a char[32] in length.  So, here is an
example uniqueid from a call:

192.168.123.456-1213156048.123456

With the hyphen, epoch timestamp, the dot and then the ast_atomic integer
- the total length here is 33 characters so when I view my CDR the uniqueid
is truncated e.g. 192.168.123.456-1213156048.1234 - and suddenly my
uniqueid is no longer unique anymore?

I have been having issues when the final integer passes 99999 - which
because of Asterisk's stability :) - happens after just a few days and my
CDR starts to show duplicate uniqueid's :(

I think given the fact that the systemname can be up to 20 characters and
to allow for a million calls then we should make the uniqueid field at
least a 40 character string?
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-10-08 23:46  rayjay         Asterisk Version          => 1.4.20.1        
06-10-08 23:46  rayjay         SVN Branch (only for SVN checkou => N/A          
  
======================================================================




More information about the asterisk-bugs mailing list