diff -urN asterisk-1.2.0.bkp/asterisk.c asterisk-1.2.0/asterisk.c --- asterisk-1.2.0.bkp/asterisk.c 2005-11-14 20:00:38.000000000 +0100 +++ asterisk-1.2.0/asterisk.c 2005-11-22 15:13:05.000000000 +0100 @@ -215,6 +215,7 @@ char ast_config_AST_CTL_OWNER[AST_CONFIG_MAX_PATH] = "\0"; char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH] = "\0"; char ast_config_AST_CTL[AST_CONFIG_MAX_PATH] = "asterisk.ctl"; +char ast_config_AST_SYSTEM_NAME[20]=""; static char *_argv[256]; static int shuttingdown = 0; @@ -1908,6 +1909,8 @@ /* What group to run as */ } else if (!strcasecmp(v->name, "rungroup")) { ast_copy_string(ast_config_AST_RUN_GROUP, v->value, sizeof(ast_config_AST_RUN_GROUP)); + } else if (!strcasecmp(v->name, "systemname")) { + strncpy(ast_config_AST_SYSTEM_NAME,v->value,sizeof(ast_config_AST_SYSTEM_NAME)); } v = v->next; } diff -urN asterisk-1.2.0.bkp/channel.c asterisk-1.2.0/channel.c --- asterisk-1.2.0.bkp/channel.c 2005-11-16 19:11:28.000000000 +0100 +++ asterisk-1.2.0/channel.c 2005-11-22 15:12:47.000000000 +0100 @@ -583,7 +583,10 @@ tmp->data = NULL; tmp->fin = global_fin; tmp->fout = global_fout; - snprintf(tmp->uniqueid, sizeof(tmp->uniqueid), "%li.%d", (long) time(NULL), uniqueint++); + if (*ast_config_AST_SYSTEM_NAME) + snprintf(tmp->uniqueid, sizeof(tmp->uniqueid), "%s-%li.%d", ast_config_AST_SYSTEM_NAME, (long) time(NULL), uniqueint++); + else + snprintf(tmp->uniqueid, sizeof(tmp->uniqueid), "%li.%d", (long) time(NULL), uniqueint++); headp = &tmp->varshead; ast_mutex_init(&tmp->lock); AST_LIST_HEAD_INIT_NOLOCK(headp); diff -urN asterisk-1.2.0.bkp/include/asterisk.h asterisk-1.2.0/include/asterisk.h --- asterisk-1.2.0.bkp/include/asterisk.h 2005-11-08 02:29:14.000000000 +0100 +++ asterisk-1.2.0/include/asterisk.h 2005-11-22 15:13:05.000000000 +0100 @@ -40,6 +40,7 @@ extern char ast_config_AST_CTL_OWNER[AST_CONFIG_MAX_PATH]; extern char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH]; extern char ast_config_AST_CTL[AST_CONFIG_MAX_PATH]; +extern char ast_config_AST_SYSTEM_NAME[20]; /* Provided by asterisk.c */ int ast_set_priority(int); diff -urN asterisk-1.2.0.bkp/pbx.c asterisk-1.2.0/pbx.c --- asterisk-1.2.0.bkp/pbx.c 2005-11-14 20:00:38.000000000 +0100 +++ asterisk-1.2.0/pbx.c 2005-11-22 17:38:32.000000000 +0100 @@ -1121,6 +1121,9 @@ } else if (c && !strcmp(var, "LANGUAGE")) { ast_copy_string(workspace, c->language, workspacelen); *ret = workspace; + } else if (c && !strcmp(var, "SYSTEMNAME")) { + ast_copy_string(workspace, ast_config_AST_SYSTEM_NAME, workspacelen); + *ret = workspace; } else { icky: if (headp) {