aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormattf <mattf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-14 16:25:49 +0000
committermattf <mattf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-14 16:25:49 +0000
commit015b3808b780a0bd510ed56d34cf031dee5c4178 (patch)
treee3afc37d12745f430b1a33ad5b77b0baa3c21819
parent0e8ded54573ea3015d51be6500170fdb23fb9c28 (diff)
When handling glare on a PRI, move the requested channel rather than hang up the old one. Fix for 8957 and 9011.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@54373 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_zap.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 45ebb0c78..57f6e0cdb 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -8369,6 +8369,11 @@ static void *pri_dchannel(void *vpri)
pri_dump_event(pri->dchans[which], e);
if (e->e != PRI_EVENT_DCHAN_DOWN)
pri->dchanavail[which] |= DCHAN_UP;
+
+ if ((e->e != PRI_EVENT_DCHAN_UP) && (e->e != PRI_EVENT_DCHAN_DOWN) && (pri->pri != pri->dchans[which]))
+ /* Must be an NFAS group that has the secondary dchan active */
+ pri->pri = pri->dchans[which];
+
switch(e->e) {
case PRI_EVENT_DCHAN_UP:
if (option_verbose > 1)
@@ -8532,12 +8537,9 @@ static void *pri_dchannel(void *vpri)
PRI_SPAN(e->ring.channel), PRI_CHANNEL(e->ring.channel), pri->span);
break;
} else {
- ast_log(LOG_WARNING, "Ring requested on channel %d/%d already in use on span %d. Hanging up owner.\n",
+ /* This is where we handle initial glare */
+ ast_log(LOG_DEBUG, "Ring requested on channel %d/%d already in use or previously requested on span %d. Attempting to renegotiating channel.\n",
PRI_SPAN(e->ring.channel), PRI_CHANNEL(e->ring.channel), pri->span);
- 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);
chanpos = -1;
}
@@ -8748,8 +8750,12 @@ static void *pri_dchannel(void *vpri)
if (crv)
ast_mutex_unlock(&crv->lock);
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
- } else
- pri_hangup(pri->pri, e->ring.call, PRI_CAUSE_REQUESTED_CHAN_UNAVAIL);
+ } else {
+ if (e->ring.flexible)
+ pri_hangup(pri->pri, e->ring.call, PRI_CAUSE_NORMAL_CIRCUIT_CONGESTION);
+ else
+ pri_hangup(pri->pri, e->ring.call, PRI_CAUSE_REQUESTED_CHAN_UNAVAIL);
+ }
break;
case PRI_EVENT_RINGING:
chanpos = pri_find_principle(pri, e->ringing.channel);