diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2006-02-14 23:42:36 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2006-02-14 23:42:36 +0000 |
commit | 124b00c4a4b971d8f4e34c3bbd73c992ad84d20c (patch) | |
tree | 14af2c1d8853ddb0857db29b448f72736e4cab44 /channel.c | |
parent | ec7df7e55771e991d2102d97e9c384acd6317179 (diff) |
add 'systemname' option to prefix channel unique IDs with (issue #5825)
convert chan->uniqueid to a stringfield from a fixed-size buffer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channel.c')
-rw-r--r-- | channel.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -670,7 +670,10 @@ struct ast_channel *ast_channel_alloc(int needqueue) tmp->fin = global_fin; tmp->fout = global_fout; ast_mutex_lock(&uniquelock); - snprintf(tmp->uniqueid, sizeof(tmp->uniqueid), "%li.%d", (long) time(NULL), uniqueint++); + if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) + ast_string_field_build(tmp, uniqueid, "%li.%d", (long) time(NULL), uniqueint++); + else + ast_string_field_build(tmp, uniqueid, "%s-%li.%d", ast_config_AST_SYSTEM_NAME, (long) time(NULL), uniqueint++); ast_mutex_unlock(&uniquelock); headp = &tmp->varshead; ast_mutex_init(&tmp->lock); |