Don't create the channel if there already is one...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4366 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
60023b1d75
commit
87ba0ae10a
|
@ -4465,6 +4465,10 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
|
|||
int x,y;
|
||||
int features;
|
||||
ZT_PARAMS ps;
|
||||
if (i->subs[index].owner) {
|
||||
ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[index]);
|
||||
return NULL;
|
||||
}
|
||||
tmp = ast_channel_alloc(0);
|
||||
if (tmp) {
|
||||
ps.channo = i->channel;
|
||||
|
@ -4569,9 +4573,6 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
|
|||
strncpy(tmp->accountcode, i->accountcode, sizeof(tmp->accountcode)-1);
|
||||
if (i->amaflags)
|
||||
tmp->amaflags = i->amaflags;
|
||||
if (i->subs[index].owner) {
|
||||
ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[index]);
|
||||
}
|
||||
i->subs[index].owner = tmp;
|
||||
strncpy(tmp->context, i->context, sizeof(tmp->context)-1);
|
||||
/* Copy call forward info */
|
||||
|
|
Reference in New Issue