From: Mark Spencer Date: Fri, 16 Jul 2004 22:15:30 +0000 (+0000) Subject: Don't look for bearers when there are none. X-Git-Tag: 1.0.0-rc1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3abd26bfdfcaeeea3d0fdc5073d62b44aef31132;p=thirdparty%2Fasterisk.git Don't look for bearers when there are none. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3451 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_zap.c b/channels/chan_zap.c index c5ece9505c..ab46673f55 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -544,6 +544,12 @@ static struct zt_pvt { #endif } *iflist = NULL, *ifend = NULL; +#ifdef ZAPATA_PRI +#define GET_CHANNEL(p) ((p)->bearer ? (p)->bearer->channel : p->channel) +#else +#define GET_CHANNEL(p) ((p)->channel) +#endif + struct zt_pvt *round_robin[32]; #ifdef ZAPATA_PRI @@ -1143,7 +1149,7 @@ static int update_conf(struct zt_pvt *p) for (x=0;xslaves[x]) { if (useslavenative) - conf_add(p, &p->slaves[x]->subs[SUB_REAL], SUB_REAL, p->bearer ? p->bearer->channel : p->channel); + conf_add(p, &p->slaves[x]->subs[SUB_REAL], SUB_REAL, GET_CHANNEL(p)); else { conf_add(p, &p->slaves[x]->subs[SUB_REAL], SUB_REAL, 0); needconf++; @@ -1153,7 +1159,7 @@ static int update_conf(struct zt_pvt *p) /* If we're supposed to be in there, do so now */ if (p->inconference && !p->subs[SUB_REAL].inthreeway) { if (useslavenative) - conf_add(p, &p->subs[SUB_REAL], SUB_REAL, slave->bearer ? slave->bearer->channel : slave->channel); + conf_add(p, &p->subs[SUB_REAL], SUB_REAL, GET_CHANNEL(slave)); else { conf_add(p, &p->subs[SUB_REAL], SUB_REAL, 0); needconf++; @@ -1162,7 +1168,7 @@ static int update_conf(struct zt_pvt *p) /* If we have a master, add ourselves to his conference */ if (p->master) { if (isslavenative(p->master, NULL)) { - conf_add(p->master, &p->subs[SUB_REAL], SUB_REAL, p->master->bearer ? p->master->bearer->channel : p->master->channel); + conf_add(p->master, &p->subs[SUB_REAL], SUB_REAL, GET_CHANNEL(p->master)); } else { conf_add(p->master, &p->subs[SUB_REAL], SUB_REAL, 0); }