[Asterisk-cvs] asterisk/channels chan_zap.c,1.387,1.388
markster at lists.digium.com
markster at lists.digium.com
Mon Dec 13 10:14:42 CST 2004
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv16076/channels
Modified Files:
chan_zap.c
Log Message:
GR-303 conferencing fixes
Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.387
retrieving revision 1.388
diff -u -d -r1.387 -r1.388
--- chan_zap.c 11 Dec 2004 23:00:20 -0000 1.387
+++ chan_zap.c 13 Dec 2004 15:11:36 -0000 1.388
@@ -1158,6 +1158,7 @@
ZT_CONFINFO zi;
memset(&zi, 0, sizeof(zi));
p->confno = -1;
+ memset(&p->subs[SUB_REAL].curconf, 0, sizeof(p->subs[SUB_REAL].curconf));
if (p->subs[SUB_REAL].zfd > -1) {
if (ioctl(p->subs[SUB_REAL].zfd, ZT_SETCONF, &zi))
ast_log(LOG_WARNING, "Failed to reset conferencing on channel %d!\n", p->channel);
@@ -1896,7 +1897,7 @@
int pri_assign_bearer(struct zt_pvt *crv, struct zt_pri *pri, struct zt_pvt *bearer)
{
bearer->owner = &inuse;
- bearer->master = crv;
+ bearer->realcall = crv;
crv->subs[SUB_REAL].zfd = bearer->subs[SUB_REAL].zfd;
if (crv->subs[SUB_REAL].owner)
crv->subs[SUB_REAL].owner->fds[0] = crv->subs[SUB_REAL].zfd;
@@ -2229,6 +2230,7 @@
update_conf(p->bearer);
reset_conf(p->bearer);
p->bearer->owner = NULL;
+ p->bearer->realcall = NULL;
p->bearer = NULL;
p->subs[SUB_REAL].zfd = -1;
p->pri = NULL;
@@ -7560,8 +7562,8 @@
} else
ast_log(LOG_WARNING, "The PRI Call have not been destroyed\n");
}
- if (p->master) {
- pri_hangup_all(p->master, pri);
+ if (p->realcall) {
+ pri_hangup_all(p->realcall, pri);
} else if (p->owner)
p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
p->inalarm = 1;
@@ -7585,8 +7587,8 @@
pri->pvts[chanpos]->call = NULL;
}
/* Force soft hangup if appropriate */
- if (pri->pvts[chanpos]->master)
- pri_hangup_all(pri->pvts[chanpos]->master, pri);
+ if (pri->pvts[chanpos]->realcall)
+ pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
else if (pri->pvts[chanpos]->owner)
pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
@@ -7601,8 +7603,8 @@
pri_destroycall(pri->pri, pri->pvts[x]->call);
pri->pvts[x]->call = NULL;
}
- if (pri->pvts[chanpos]->master)
- pri_hangup_all(pri->pvts[chanpos]->master, pri);
+ if (pri->pvts[chanpos]->realcall)
+ pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
else if (pri->pvts[x]->owner)
pri->pvts[x]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
ast_mutex_unlock(&pri->pvts[x]->lock);
@@ -7656,8 +7658,8 @@
} else {
ast_log(LOG_WARNING, "Ring requested on channel %d/%d already in use on span %d. Hanging up owner.\n",
PRI_SPAN(e->ring.channel), PRI_CHANNEL(e->ring.channel), pri->span);
- if (pri->pvts[chanpos]->master)
- pri_hangup_all(pri->pvts[chanpos]->master, pri);
+ if (pri->pvts[chanpos]->realcall)
+ pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
else
pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
@@ -7922,7 +7924,7 @@
chanpos = -1;
} else {
ast_mutex_lock(&pri->pvts[chanpos]->lock);
- if (pri->pvts[chanpos]->master && (pri->pvts[chanpos]->master->sig == SIG_FXSKS)) {
+ if (pri->pvts[chanpos]->realcall && (pri->pvts[chanpos]->realcall->sig == SIG_FXSKS)) {
ast_log(LOG_DEBUG, "Starting up GR-303 trunk now that we got CONNECT...\n");
x = ZT_START;
res = ioctl(pri->pvts[chanpos]->subs[SUB_REAL].zfd, ZT_HOOK, &x);
@@ -7966,8 +7968,8 @@
if (!pri->pvts[chanpos]->alreadyhungup) {
/* we're calling here zt_hangup so once we get there we need to clear p->call after calling pri_hangup */
pri->pvts[chanpos]->alreadyhungup = 1;
- if (pri->pvts[chanpos]->master)
- pri_hangup_all(pri->pvts[chanpos]->master, pri);
+ if (pri->pvts[chanpos]->realcall)
+ pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
else if (pri->pvts[chanpos]->owner) {
/* Queue a BUSY instead of a hangup if our cause is appropriate */
pri->pvts[chanpos]->owner->hangupcause = e->hangup.cause;
@@ -8022,8 +8024,8 @@
chanpos = pri_fixup_principle(pri, chanpos, e->hangup.call);
if (chanpos > -1) {
ast_mutex_lock(&pri->pvts[chanpos]->lock);
- if (pri->pvts[chanpos]->master)
- pri_hangup_all(pri->pvts[chanpos]->master, pri);
+ if (pri->pvts[chanpos]->realcall)
+ pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
else if (pri->pvts[chanpos]->owner) {
pri->pvts[chanpos]->owner->hangupcause = e->hangup.cause;
switch(e->hangup.cause) {
@@ -8096,8 +8098,8 @@
ast_mutex_lock(&pri->pvts[chanpos]->lock);
ast_log(LOG_DEBUG, "Assuming restart ack is really for channel %d/%d span %d\n", pri->pvts[chanpos]->logicalspan,
pri->pvts[chanpos]->prioffset, pri->span);
- if (pri->pvts[chanpos]->master)
- pri_hangup_all(pri->pvts[chanpos]->master, pri);
+ if (pri->pvts[chanpos]->realcall)
+ pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
else if (pri->pvts[chanpos]->owner) {
ast_log(LOG_WARNING, "Got restart ack on channel %d/%d with owner on span %d\n", pri->pvts[chanpos]->logicalspan,
pri->pvts[chanpos]->prioffset, pri->span);
@@ -8122,8 +8124,8 @@
if (chanpos > -1) {
if (pri->pvts[chanpos]) {
ast_mutex_lock(&pri->pvts[chanpos]->lock);
- if (pri->pvts[chanpos]->master)
- pri_hangup_all(pri->pvts[chanpos]->master, pri);
+ if (pri->pvts[chanpos]->realcall)
+ pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
else if (pri->pvts[chanpos]->owner) {
ast_log(LOG_WARNING, "Got restart ack on channel %d/%d span %d with owner\n",
PRI_SPAN(e->restartack.channel), PRI_CHANNEL(e->restartack.channel), pri->span);
More information about the svn-commits
mailing list