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

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Jun 11 12:37:58 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
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-11-2008 12:37 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?
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 06-11-08 12:37  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 121855

U   trunk/UPGRADE.txt
U   trunk/contrib/scripts/realtime_pgsql.sql
U   trunk/include/asterisk/cdr.h

------------------------------------------------------------------------
r121855 | tilghman | 2008-06-11 12:37:55 -0500 (Wed, 11 Jun 2008) | 3
lines

Expand CDR uniqueid field to 150 chars, to account for maximum systemname.
(Closes issue http://bugs.digium.com/view.php?id=12831)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=121855 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-11-08 12:37  svnbot         Note Added: 0088594                          
======================================================================




More information about the asterisk-bugs mailing list