[svn-commits] jpeeler: branch jpeeler/bug16709 r250349 - /team/jpeeler/bug16709/channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Mar 3 11:10:38 CST 2010


Author: jpeeler
Date: Wed Mar  3 11:10:34 2010
New Revision: 250349

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=250349
Log:
since alarms are reported per DAHDI span, remove the spanstat check which I thought was necessary

Modified:
    team/jpeeler/bug16709/channels/chan_dahdi.c

Modified: team/jpeeler/bug16709/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/jpeeler/bug16709/channels/chan_dahdi.c?view=diff&rev=250349&r1=250348&r2=250349
==============================================================================
--- team/jpeeler/bug16709/channels/chan_dahdi.c (original)
+++ team/jpeeler/bug16709/channels/chan_dahdi.c Wed Mar  3 11:10:34 2010
@@ -3034,11 +3034,11 @@
 
 static void handle_clear_alarms(struct dahdi_pvt *p)
 {
-	if(report_alarms & REPORT_CHANNEL_ALARMS) {
+	if (report_alarms & REPORT_CHANNEL_ALARMS) {
 		ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", p->channel);
 		manager_event(EVENT_FLAG_SYSTEM, "AlarmClear", "Channel: %d\r\n", p->channel);
 	}
-	if(report_alarms & REPORT_SPAN_ALARMS && p->manages_span_alarms) {
+	if (report_alarms & REPORT_SPAN_ALARMS && p->manages_span_alarms) {
 		ast_log(LOG_NOTICE, "Alarm cleared on span %d\n", p->span);
 		manager_event(EVENT_FLAG_SYSTEM, "SpanAlarmClear", "Span: %d\r\n", p->span);
 	}
@@ -6990,14 +6990,9 @@
 
 static void handle_alarms(struct dahdi_pvt *p, int alms)
 {
-	struct dahdi_spaninfo di;
-	int res;
 	const char *alarm_str = alarm2str(alms);
 
-	memset(&di, 0, sizeof(di));
-	di.spanno = p->span;
-
-	if(report_alarms & REPORT_CHANNEL_ALARMS) {
+	if (report_alarms & REPORT_CHANNEL_ALARMS) {
 		ast_log(LOG_WARNING, "Detected alarm on channel %d: %s\n", p->channel, alarm_str);
 		manager_event(EVENT_FLAG_SYSTEM, "Alarm",
 					  "Alarm: %s\r\n"
@@ -7005,18 +7000,12 @@
 					  alarm_str, p->channel);
 	}
 
-	if(report_alarms & REPORT_SPAN_ALARMS && p->manages_span_alarms) {
-		if ((res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SPANSTAT, &di)) >= 0) {
-			if (di.alarms != DAHDI_ALARM_NONE) {
-				ast_log(LOG_WARNING, "Detected alarm on span %d: %s\n", p->span, alarm_str);
-				manager_event(EVENT_FLAG_SYSTEM, "SpanAlarm",
-							  "Alarm: %s\r\n"
-							  "Span: %d\r\n",
-							  alarm_str, p->span);
-			}
-		} else {
-			ast_log(LOG_WARNING, "Unable to determine alarm on channel %d: %s\n", p->channel, strerror(errno));
-		}
+	if (report_alarms & REPORT_SPAN_ALARMS && p->manages_span_alarms) {
+		ast_log(LOG_WARNING, "Detected alarm on span %d: %s\n", p->span, alarm_str);
+		manager_event(EVENT_FLAG_SYSTEM, "SpanAlarm",
+					  "Alarm: %s\r\n"
+					  "Span: %d\r\n",
+					  alarm_str, p->span);
 	}
 }
 
@@ -16770,7 +16759,7 @@
 		}
 	}
 
-	/* mark the first channels of each span to watch for their span alarms */
+	/* mark the first channels of each DAHDI span to watch for their span alarms */
 	for (tmp = iflist, y=-1; tmp; tmp = tmp->next) {
 		if (!tmp->destroy && tmp->span != y) {
 			tmp->manages_span_alarms = 1;




More information about the svn-commits mailing list