[asterisk-commits] rmudgett: branch 1.8 r312949 - /branches/1.8/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 5 13:45:29 CDT 2011


Author: rmudgett
Date: Tue Apr  5 13:45:24 2011
New Revision: 312949

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=312949
Log:
Crash if ISDN span layer 1 is down on initial load.

Regression from -r312575 B channel shifting during negotiation.

* Also combine updating the alarm flag with clearing the resetting flag.

Modified:
    branches/1.8/channels/chan_dahdi.c
    branches/1.8/channels/sig_pri.c
    branches/1.8/channels/sig_pri.h

Modified: branches/1.8/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_dahdi.c?view=diff&rev=312949&r1=312948&r2=312949
==============================================================================
--- branches/1.8/channels/chan_dahdi.c (original)
+++ branches/1.8/channels/chan_dahdi.c Tue Apr  5 13:45:24 2011
@@ -12677,9 +12677,7 @@
 				switch (tmp->sig) {
 #ifdef HAVE_PRI
 				case SIG_PRI_LIB_HANDLE_CASES:
-					ast_mutex_lock(&tmp->lock);
-					sig_pri_chan_alarm_notify(tmp->sig_pvt, si.alarms);
-					ast_mutex_unlock(&tmp->lock);
+					sig_pri_set_alarm(tmp->sig_pvt, !si.alarms);
 					break;
 #endif
 #if defined(HAVE_SS7)

Modified: branches/1.8/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sig_pri.c?view=diff&rev=312949&r1=312948&r2=312949
==============================================================================
--- branches/1.8/channels/sig_pri.c (original)
+++ branches/1.8/channels/sig_pri.c Tue Apr  5 13:45:24 2011
@@ -159,8 +159,15 @@
 	}
 }
 
-static void sig_pri_set_alarm(struct sig_pri_chan *p, int in_alarm)
-{
+void sig_pri_set_alarm(struct sig_pri_chan *p, int in_alarm)
+{
+	/*
+	 * Clear the channel restart flag when the channel alarm changes
+	 * to prevent the flag from getting stuck when the link goes
+	 * down.
+	 */
+	p->resetting = 0;
+
 	p->inalarm = in_alarm;
 	if (p->calls->set_alarm) {
 		p->calls->set_alarm(p->chan_pvt, in_alarm);
@@ -4695,7 +4702,6 @@
 				for (i = 0; i < pri->numchans; i++) {
 					if (pri->pvts[i]) {
 						sig_pri_set_alarm(pri->pvts[i], 0);
-						pri->pvts[i]->resetting = 0;
 					}
 				}
 				sig_pri_span_devstate_changed(pri);
@@ -4724,7 +4730,6 @@
 									p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
 							}
 							sig_pri_set_alarm(p, 1);
-							p->resetting = 0;
 						}
 					}
 					sig_pri_span_devstate_changed(pri);
@@ -7565,7 +7570,6 @@
 void sig_pri_chan_alarm_notify(struct sig_pri_chan *p, int noalarm)
 {
 	pri_grab(p, p->pri);
-	p->resetting = 0;
 	sig_pri_set_alarm(p, !noalarm);
 	if (!noalarm) {
 		if (pri_get_timer(p->pri->pri, PRI_TIMER_T309) < 0) {

Modified: branches/1.8/channels/sig_pri.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sig_pri.h?view=diff&rev=312949&r1=312948&r2=312949
==============================================================================
--- branches/1.8/channels/sig_pri.h (original)
+++ branches/1.8/channels/sig_pri.h Tue Apr  5 13:45:24 2011
@@ -507,6 +507,7 @@
 void sig_pri_stop_pri(struct sig_pri_span *pri);
 int sig_pri_start_pri(struct sig_pri_span *pri);
 
+void sig_pri_set_alarm(struct sig_pri_chan *p, int in_alarm);
 void sig_pri_chan_alarm_notify(struct sig_pri_chan *p, int noalarm);
 
 void pri_event_alarm(struct sig_pri_span *pri, int index, int before_start_pri);




More information about the asterisk-commits mailing list