Index: zaptel/wct4xxp.c =================================================================== RCS file: /usr/cvsroot/zaptel/wct4xxp.c,v retrieving revision 1.32 diff -u -r1.32 wct4xxp.c --- zaptel/wct4xxp.c 7 Apr 2004 22:44:50 -0000 1.32 +++ zaptel/wct4xxp.c 7 Apr 2004 23:36:26 -0000 @@ -570,6 +570,9 @@ } wc->spans[x].chans = wc->chans[x]; wc->spans[x].flags = ZT_FLAG_RBS; + wc->spans[x].reds = 0; + wc->spans[x].blues = 0; + wc->spans[x].yellows = 0; wc->spans[x].linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF; wc->spans[x].ioctl = t4_ioctl; wc->spans[x].pvt = wc; @@ -1298,6 +1301,15 @@ wc->spans[span].alarms = alarms; /* Re-check the timing source when we enter/leave alarm, not withstanding yellow alarm */ + if (!(oldalarms & ZT_ALARM_RED) && (alarms & ZT_ALARM_RED)) { + wc->spans[span].reds++; + } + if (!(oldalarms & ZT_ALARM_BLUE) && (alarms & ZT_ALARM_BLUE)) { + wc->spans[span].blues++; + } + if (!(oldalarms & ZT_ALARM_YELLOW) && (alarms & ZT_ALARM_YELLOW)) { + wc->spans[span].yellows++; + } oldalarms &= ~ZT_ALARM_YELLOW; alarms &= ~ZT_ALARM_YELLOW; if ((!oldalarms && alarms) || (oldalarms && !alarms)) Index: zaptel/zaptel.c =================================================================== RCS file: /usr/cvsroot/zaptel/zaptel.c,v retrieving revision 1.63 diff -u -r1.63 zaptel.c --- zaptel/zaptel.c 19 Mar 2004 04:44:03 -0000 1.63 +++ zaptel/zaptel.c 7 Apr 2004 23:36:32 -0000 @@ -484,6 +484,8 @@ if (spans[span]->syncsrc && (spans[span]->syncsrc == spans[span]->spanno)) len += sprintf(page + len, "ClockSource "); len += sprintf(page + len, "\n"); + len += sprintf(page + len, "Counts: RED %d, BLUE %d, YELLOW %d\n", spans[span]->reds, spans[span]->blues, spans[span]->yellows); + if (spans[span]->bpvcount) len += sprintf(page + len, "\tBPV count: %d\n", spans[span]->bpvcount); if (spans[span]->crc4count) Index: zaptel/zaptel.h =================================================================== RCS file: /usr/cvsroot/zaptel/zaptel.h,v retrieving revision 1.30 diff -u -r1.30 zaptel.h --- zaptel/zaptel.h 26 Mar 2004 07:44:19 -0000 1.30 +++ zaptel/zaptel.h 7 Apr 2004 23:36:34 -0000 @@ -1141,6 +1141,9 @@ char desc[80]; /* Span description */ int deflaw; /* Default law (ZT_MULAW or ZT_ALAW) */ int alarms; /* Pending alarms on span */ + int reds; /* count of red alarms */ + int blues; /* count of blue alarms */ + int yellows; /* count of yellow alarms */ int flags; int irq; /* IRQ for this span's hardware */ int lbo; /* Span Line-Buildout */