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

Wolfgang Pichler wpichler at yosd.at
Mon Nov 2 05:49:36 UTC 2009


Dear sirs,

don't know if this is the right place to place a suggestion - so
please be honest if not...


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...

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...


Many thanks

best regards,
Wolfgang Pichler



More information about the Pkg-voip-maintainers mailing list