aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-14 23:42:36 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-14 23:42:36 +0000
commit69f7e69869d726709046bffd71fd109b7dc4560d (patch)
tree14af2c1d8853ddb0857db29b448f72736e4cab44 /channel.c
parenta6a33b46c2b26cc5a7688943418f16939689a4ef (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: http://svn.digium.com/svn/asterisk/trunk@10088 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/channel.c b/channel.c
index 98590d0b8..7495e88b6 100644
--- a/channel.c
+++ b/channel.c
@@ -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);