[zaptel-commits] mattf: trunk r2848 - in /trunk: ./ ztdynamic.c

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


Author: mattf
Date: Wed Aug 15 17:13:59 2007
New Revision: 2848

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2848
Log:
Merged revisions 2847 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.4

........
r2847 | mattf | 2007-08-15 17:12:58 -0500 (Wed, 15 Aug 2007) | 1 line

Fix for 8277.  Inproper alarm handling on dynamic spans
........

Modified:
    trunk/   (props changed)
    trunk/ztdynamic.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/ztdynamic.c
URL: http://svn.digium.com/view/zaptel/trunk/ztdynamic.c?view=diff&rev=2848&r1=2847&r2=2848
==============================================================================
--- trunk/ztdynamic.c (original)
+++ trunk/ztdynamic.c Wed Aug 15 17:13:59 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