diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-23 15:52:29 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-23 15:52:29 +0000 |
commit | 22cfecfb05a7a717dfe62766a4abbfb791a2edf8 (patch) | |
tree | 2cf8e215dceb87febef9b2458f18f93c8625f0fb /channels | |
parent | 1fd4a59f8b2223f7f727b06803552069ef7b508f (diff) |
ensure that after a channel is created, if it happened to be in 'channel alarm' state, when that alarm clears we won't generate a spurious 'alarm cleared' message
(closes issue #12160)
Reported by: tzafrir
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@132942 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_dahdi.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index ddba8016e..93ead486c 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -7586,12 +7586,25 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf, ioctl(tmp->subs[SUB_REAL].dfd,DAHDI_SETTONEZONE,&tmp->tonezone); #ifdef HAVE_PRI /* the dchannel is down so put the channel in alarm */ - if (tmp->pri && !pri_is_up(tmp->pri)) + if (tmp->pri && !pri_is_up(tmp->pri)) { tmp->inalarm = 1; + } #endif if ((res = get_alarms(tmp)) != DAHDI_ALARM_NONE) { tmp->inalarm = 1; handle_alarms(tmp, res); + } else { + /* yes, this looks strange... the unknown_alarm flag is only used to + control whether an 'alarm cleared' message gets generated when we + get an indication that the channel is no longer in alarm status. + however, the channel *could* be in an alarm status that we aren't + aware of (since get_alarms() only reports span alarms, not channel + alarms). setting this flag will cause any potential 'alarm cleared' + message to be suppressed, but if a real alarm occurs before that + happens, this flag will get cleared by it and the situation will + be normal. + */ + tmp->unknown_alarm = 1; } } |