Merged revisions 312949 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r312949 | rmudgett | 2011-04-05 13:45:24 -0500 (Tue, 05 Apr 2011) | 6 lines
  
  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.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2011-04-05 18:47:11 +00:00
parent ad30fa7569
commit 698a356737
3 changed files with 10 additions and 7 deletions

View File

@@ -178,8 +178,15 @@ static void sig_pri_set_digital(struct sig_pri_chan *p, int is_digital)
}
}
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);
@@ -5555,7 +5562,6 @@ static void *pri_dchannel(void *vpri)
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);
@@ -5584,7 +5590,6 @@ static void *pri_dchannel(void *vpri)
p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
}
sig_pri_set_alarm(p, 1);
p->resetting = 0;
}
}
sig_pri_span_devstate_changed(pri);
@@ -8488,7 +8493,6 @@ int sig_pri_start_pri(struct sig_pri_span *pri)
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) {