Your message dated Wed, 5 May 2010 23:29:10 +1000
with message-id <[email protected]>
and subject line Fwd: Re: Processed: reassign 554820 to asterisk
has caused the Debian Bug report #554820,
regarding asterisk-1.4.21.2: uniqueid does not get created consistent
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
554820: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=554820
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: asterisk-1.4.21.2
Version: 1.4.21.2~dfsg-3
Severity: normal
Tags: patch

In main/channel.c there are two places where a new uniqueid gets
generated. The first one is in ast_channel_alloc - this gets normally
called when a new channel gets generated.
In this function it does generate the uniqueid the following way

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

If a system name is set - then take "SYSTEM_NAME-time().atomic_int"
else take only "time().atomic_int".

The patch bristuff/uniqueid-40-manager did introduced a new function
where a uniqueid gets generated when a new channel gets allocated by
the use of the manager api. It is also in channel.c.
The function in question is:

/*! \brief Create a uniqueid */
char *ast_alloc_uniqueid(void) {
  char *uniqueid;
  uniqueid = malloc(64);
  if (!uniqueid) return NULL;
  snprintf(uniqueid, 63, "%s-%d-%li.%d", ast_config_AST_SYSTEM_NAME,
ast_mainpid, (long)time(NULL), ast_atomic_fetchadd_int(&uniqueint,
1));
  return uniqueid;
}

As you can see - the uniqueid generation is different.

I do suggest to change the function ast_alloc_uniqueid to:

/*! \brief Create a uniqueid */
char *ast_alloc_uniqueid(void) {
  char *uniqueid;
  uniqueid = malloc(64);
  if (!uniqueid) return NULL;
  if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {
       snprintf(uniqueid, 63, "%s-%li.%d", ast_config_AST_SYSTEM_NAME,
(long)time(NULL), ast_atomic_fetchadd_int(&uniqueint, 1));
  } else {
       snprintf(uniqueid, 63, "%li.%d", (long)time(NULL),
ast_atomic_fetchadd_int(&uniqueint, 1));
  }
  return uniqueid;
}


And maybe change the channel alloc function to use this function to
elimate double code...



-- System Information:
Debian Release: 5.0.3
 APT prefers stable
 APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash



--- End Message ---
--- Begin Message ---
Package: asterisk
Version: 1:1.6.1.0~dfsg~rc3-1

----------  Forwarded Message  ----------

Subject: Re: Processed: reassign 554820 to asterisk
Date: Saturday 07 November 2009, 21:06:53
From: Faidon Liambotis <[email protected]>
To: [email protected]

fixed 554820 1:1.6.1.0~dfsg~rc3-1
thanks








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

Attachment: signature.asc
Description: This is a digitally signed message part.


--- End Message ---

Reply via email to