From 2b3233aa865cfee97f565311d504ac766630c214 Mon Sep 17 00:00:00 2001 From: file Date: Wed, 30 May 2007 16:06:37 +0000 Subject: Change how channel names are generated a bit. (issue #9825 reported by eldadran) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@66602 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_zap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'channels/chan_zap.c') diff --git a/channels/chan_zap.c b/channels/chan_zap.c index ea02e99a9..9e159a9ec 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -5159,7 +5159,7 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int int res; int x,y; int features; - char *b2 = 0; + char *b2 = NULL; ZT_PARAMS ps; if (i->subs[index].owner) { ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[index]); @@ -5171,20 +5171,20 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int free(b2); #ifdef HAVE_PRI if (i->bearer || (i->pri && (i->sig == SIG_FXSKS))) - asprintf(&b2, "Zap/%d:%d-%d", i->pri->trunkgroup, i->channel, y); + b2 = ast_safe_string_alloc("%d:%d-%d", i->pri->trunkgroup, i->channel, y); else #endif if (i->channel == CHAN_PSEUDO) - asprintf(&b2, "Zap/pseudo-%ld", ast_random()); + b2 = ast_safe_string_alloc("pseudo-%ld", ast_random()); else - asprintf(&b2, "Zap/%d-%d", i->channel, y); + b2 = ast_safe_string_alloc("%d-%d", i->channel, y); for (x = 0; x < 3; x++) { if ((index != x) && i->subs[x].owner && !strcasecmp(b2, i->subs[x].owner->name)) break; } y++; } while (x < 3); - tmp = ast_channel_alloc(0, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, b2); + tmp = ast_channel_alloc(0, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, "Zap/%s", b2); if (b2) /*!> b2 can be freed now, it's been copied into the channel structure */ free(b2); if (!tmp) -- cgit v1.2.3