[zaptel-commits] mattf: branch 1.4 r2847 - /branches/1.4/ztdynamic.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Wed Aug 15 17:12:58 CDT 2007


Author: mattf
Date: Wed Aug 15 17:12:58 2007
New Revision: 2847

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2847
Log:
Fix for 8277.  Inproper alarm handling on dynamic spans

Modified:
    branches/1.4/ztdynamic.c

Modified: branches/1.4/ztdynamic.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/ztdynamic.c?view=diff&rev=2847&r1=2846&r2=2847
==============================================================================
--- branches/1.4/ztdynamic.c (original)
+++ branches/1.4/ztdynamic.c Wed Aug 15 17:12:58 2007
@@ -105,7 +105,6 @@
 	char addr[40];
 	char dname[20];
 	int err;
-	int alarm;
 	int usecount;
 	int dead;
 	long rxjif;
@@ -149,12 +148,13 @@
 	while(z) {
 		if (z->timing) {
 			z->master = 0;
-			newhasmaster = 1;
-			if (!z->alarm && (z->timing < best) && !z->dead) {
+			if (!(z->span.alarms & ZT_ALARM_RED) &&
+			    (z->timing < best) && !z->dead) {
 				/* If not in alarm and they're
 				   a better timing source, use them */
 				master = z;
 				best = z->timing;
+				newhasmaster = 1;
 			}
 		}
 		z = z->next;
@@ -184,7 +184,7 @@
 
 	/* Byte 1: Flags */
 	*buf = 0;
-	if (z->alarm & ZT_ALARM_RED)
+	if (z->span.alarms & ZT_ALARM_RED)
 		*buf |= ZTD_FLAG_YELLOW_ALARM;
 	*buf |= ZTD_FLAG_SIGBITS_PRESENT;
 	buf++; msglen++;
@@ -402,6 +402,7 @@
 	if (newalarm != span->alarms) {
 		span->alarms = newalarm;
 		zt_alarm_notify(span);
+		checkmaster();
 	}
 	
 	/* Keep track of last received packet */




More information about the zaptel-commits mailing list