[asterisk-commits] dhubbard: branch 1.6.0 r112715 - in /branches/1.6.0: ./ main/asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 3 20:08:31 CDT 2008


Author: dhubbard
Date: Thu Apr  3 20:08:31 2008
New Revision: 112715

URL: http://svn.digium.com/view/asterisk?view=rev&rev=112715
Log:
Merged revisions 112653,112656,112714 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r112653 | dhubbard | 2008-04-03 17:13:11 -0500 (Thu, 03 Apr 2008) | 1 line

add a Zaptel timer check to verify the timer is responding when Zaptel support is compiled into Asterisk and Zaptel drivers are loaded.  This will help people not waste their valuable time debugging side effects.
........
r112656 | dhubbard | 2008-04-03 17:19:43 -0500 (Thu, 03 Apr 2008) | 1 line

satisfy buildbot
........
r112714 | dhubbard | 2008-04-03 19:57:33 -0500 (Thu, 03 Apr 2008) | 1 line

sleep long enough for the zaptel timer error message to display before exit
........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/main/asterisk.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/asterisk.c?view=diff&rev=112715&r1=112714&r2=112715
==============================================================================
--- branches/1.6.0/main/asterisk.c (original)
+++ branches/1.6.0/main/asterisk.c Thu Apr  3 20:08:31 2008
@@ -121,6 +121,7 @@
 #include "asterisk/linkedlists.h"
 #include "asterisk/devicestate.h"
 #include "asterisk/module.h"
+#include "asterisk/zapata.h"
 
 #include "asterisk/doxyref.h"		/* Doxygen documentation */
 
@@ -3183,7 +3184,35 @@
 		printf("%s", term_quit());
 		exit(1);
 	}
-
+#ifdef HAVE_ZAPTEL
+	{
+		int fd;
+		int x = 160;
+		fd = open("/dev/zap/timer", O_RDWR);
+		if (fd >= 0) {
+			if (ioctl(fd, ZT_TIMERCONFIG, &x)) {
+				ast_log(LOG_ERROR, "You have Zaptel built and drivers loaded, but the Zaptel timer test failed to set ZT_TIMERCONFIG to %d.\n", x);
+				exit(1);
+			}
+			if ((x = ast_wait_for_input(fd, 300)) < 0) {
+				ast_log(LOG_ERROR, "You have Zaptel built and drivers loaded, but the Zaptel timer could not be polled during the Zaptel timer test.\n");
+				exit(1);
+			}
+			if (!x) {
+				const char zaptel_timer_error[] = {
+					"Asterisk has detected a problem with your Zaptel configuration and will shutdown for your protection.  You have options:"
+					"\n\t1. You only have to compile Zaptel support into Asterisk if you need it.  One option is to recompile without Zaptel support."
+					"\n\t2. You only have to load Zaptel drivers if you want to take advantage of Zaptel services.  One option is to unload zaptel modules if you don't need them."
+					"\n\t3. If you need Zaptel services, you must correctly configure Zaptel."
+				};
+				ast_log(LOG_ERROR, "%s\n", zaptel_timer_error);
+				usleep(100);
+				exit(1);
+			}
+			close(fd);
+		}
+	}
+#endif
 	threadstorage_init();
 
 	astobj2_init();




More information about the asterisk-commits mailing list