]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make sure to clear red alarm after polarity reversal.
authorJeff Peeler <jpeeler@digium.com>
Wed, 3 Mar 2010 19:04:11 +0000 (19:04 +0000)
committerJeff Peeler <jpeeler@digium.com>
Wed, 3 Mar 2010 19:04:11 +0000 (19:04 +0000)
From the issue:
The automatic overnight line tests (or manual ones) used on UK (BT) lines causes
a red alarm on a dahdi / TDM400P connected channel. This is because the line
uses voltage tests (battery loss) and polarity reversal. The polarity reversal
causes chan_dahdi to initiate v23 CallerID processing but during this the event
DAHDI_EVENT_NOALARM is ignored so that the alarm is never cleared.

(closes issue #14163)
Reported by: jedi98
Patches:
      chan_dahdi-1.4-inalarm.diff uploaded by jedi98 (license 653)
Tested by: mattbrown, Chainsaw, mikeeccleston

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@250480 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c

index 954c7235213c81c1e9ef840f781c087fc560f970..257a888f4b790180ca439a5bbabe1647444264aa 100644 (file)
@@ -6653,6 +6653,9 @@ static void *ss_thread(void *data)
                                                if (i & DAHDI_IOMUX_SIGEVENT) {
                                                        res = dahdi_get_event(p->subs[index].dfd);
                                                        ast_log(LOG_NOTICE, "Got event %d (%s)...\n", res, event2str(res));
+                                                       if (res == DAHDI_EVENT_NOALARM) {
+                                                               p->inalarm = 0;
+                                                       }
 
                                                        if (p->cid_signalling == CID_SIG_V23_JP) {
 #ifdef DAHDI_EVENT_RINGBEGIN
@@ -6756,6 +6759,9 @@ static void *ss_thread(void *data)
                                                        if (i & DAHDI_IOMUX_SIGEVENT) {
                                                                res = dahdi_get_event(p->subs[index].dfd);
                                                                ast_log(LOG_NOTICE, "Got event %d (%s)...\n", res, event2str(res));
+                                                               if (res == DAHDI_EVENT_NOALARM) {
+                                                                       p->inalarm = 0;
+                                                               }
                                                                res = 0;
                                                                /* Let us detect distinctive ring */
                
@@ -6861,6 +6867,9 @@ static void *ss_thread(void *data)
                                        if (i & DAHDI_IOMUX_SIGEVENT) {
                                                res = dahdi_get_event(p->subs[index].dfd);
                                                ast_log(LOG_NOTICE, "Got event %d (%s)...\n", res, event2str(res));
+                                               if (res == DAHDI_EVENT_NOALARM) {
+                                                       p->inalarm = 0;
+                                               }
                                                /* If we get a PR event, they hung up while processing calerid */
                                                if ( res == DAHDI_EVENT_POLARITY && p->hanguponpolarityswitch && p->polarity == POLARITY_REV) {
                                                        ast_log(LOG_DEBUG, "Hanging up due to polarity reversal on channel %d while detecting callerid\n", p->channel);
@@ -6932,6 +6941,9 @@ static void *ss_thread(void *data)
                                                if (i & DAHDI_IOMUX_SIGEVENT) {
                                                        res = dahdi_get_event(p->subs[index].dfd);
                                                        ast_log(LOG_NOTICE, "Got event %d (%s)...\n", res, event2str(res));
+                                                       if (res == DAHDI_EVENT_NOALARM) {
+                                                               p->inalarm = 0;
+                                                       }
                                                        res = 0;
                                                        /* Let us detect callerid when the telco uses distinctive ring */