asterisk lenny 1.4.21.2~dfsg-3 / bristuff/uniqueid-40-manager patch

Philipp Kempgen philipp.kempgen at amooma.de
Tue Nov 3 19:54:06 UTC 2009


Wolfgang Pichler schrieb:

> The uniqueid-40-manager patch which gets applied to asterisk in debian
> lenny does cause some problems when setting no asterisk system name in
> the config - because it builds the uniqueid for cahnnels originated by
> manager by the following way:

> +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 - if ast_config_AST_SYSTEM_NAME is empty - it will
> generate a negative uniqueid...

I don't see how a uniqueid starting in "-" could cause problems.
It's just a string after all rather than a numerical value so it's
neither positive nor negative.

OTOH skipping the leading "-" if the system name is empty would
probably not hurt either.

> Could you please change the patch the following way
> 
>    if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {
>         snprintf(uniqueid, 63, "%s-%d-%li.%d",
> ast_config_AST_SYSTEM_NAME, ast_mainpid, (long)time(NULL),
> ast_atomic_fetchadd_int(&uniqueint, 1));
>    } else {
>         snprintf(uniqueid, 63, "%d-%li.%d", ast_mainpid,
> (long)time(NULL), ast_atomic_fetchadd_int(&uniqueint, 1));
>    }
> 
> this would give original behaviour back...

If you still think this is a bug (even if it might be of severity =
wishlist) it should be reported on the bug tracker I guess.
http://bugs.debian.org


    Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  ->  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 ->  http://www.amoocon.de
-- 



More information about the Pkg-voip-maintainers mailing list