[asterisk-commits] mattf: branch 1.4 r54375 - in /branches/1.4: ./ channels/chan_zap.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 14 09:56:41 MST 2007


Author: mattf
Date: Wed Feb 14 10:56:40 2007
New Revision: 54375

URL: http://svn.digium.com/view/asterisk?view=rev&rev=54375
Log:
Merged revisions 54373 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r54373 | mattf | 2007-02-14 10:25:49 -0600 (Wed, 14 Feb 2007) | 2 lines

When handling glare on a PRI, move the requested channel rather than hang up the old one. Fix for 8957 and 9011.

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/channels/chan_zap.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_zap.c?view=diff&rev=54375&r1=54374&r2=54375
==============================================================================
--- branches/1.4/channels/chan_zap.c (original)
+++ branches/1.4/channels/chan_zap.c Wed Feb 14 10:56:40 2007
@@ -8424,6 +8424,11 @@
 				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) 
@@ -8590,12 +8595,9 @@
 								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;
 						}
@@ -8806,8 +8808,12 @@
 					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);



More information about the asterisk-commits mailing list