[dahdi-commits] dbailey: tools/trunk r5728 - /tools/trunk/fxstest.c

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Mon Jan 19 09:19:31 CST 2009


Author: dbailey
Date: Mon Jan 19 09:19:31 2009
New Revision: 5728

URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=5728
Log:
Add test to excercise VMWI 
Enhance polarity test by making sure the line is in an active state before testing
(issue #14104)
Reported by: alecdavis
Patches:
      dahditools-14104.diff.txt uploaded by dbailey (license )
Tested by: alecdavis


Modified:
    tools/trunk/fxstest.c

Modified: tools/trunk/fxstest.c
URL: http://svn.digium.com/svn-view/dahdi/tools/trunk/fxstest.c?view=diff&rev=5728&r1=5727&r2=5728
==============================================================================
--- tools/trunk/fxstest.c (original)
+++ tools/trunk/fxstest.c Mon Jan 19 09:19:31 2009
@@ -58,7 +58,8 @@
 		       "       regdump - dumps ProSLIC registers\n"
 		       "       tones - plays a series of tones\n"
 		       "       polarity - tests polarity reversal\n"
-		       "       ring - rings phone\n");
+		       "       ring - rings phone\n"
+		       "       vmwi - toggles VMWI lamp\n");
 		exit(1);
 	}
 	fd = open(argv[1], O_RDWR);
@@ -66,8 +67,27 @@
 		fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno));
 		exit(1);
 	}
-	if (!strcasecmp(argv[2], "ring")) {
-		fprintf(stderr, "Ringing phone...\n");
+	
+	if (!strcasecmp(argv[2], "vmwi")) {
+		fprintf(stderr, "Twiddling vmwi...\n");
+		x = DAHDI_VMWI_LREV | 1;
+		res = ioctl(fd, DAHDI_VMWI, &x);
+		if (res) {
+			fprintf(stderr, "Unable to set VMWI...\n");
+		} else {
+			fprintf(stderr, "Set 1 Voice Message...\n");
+			sleep(5);
+			x = DAHDI_VMWI_LREV | 2;
+			ioctl(fd, DAHDI_VMWI, &x);
+			fprintf(stderr, "Set 2 Voice Messages...\n");
+			sleep(5);
+			x = DAHDI_VMWI_LREV;
+			ioctl(fd, DAHDI_VMWI, &x);
+			fprintf(stderr, "Set No Voice messages...\n");
+			sleep(2);
+		}
+	} else if (!strcasecmp(argv[2], "ring")) {
+					fprintf(stderr, "Ringing phone...\n");
 		x = DAHDI_RING;
 		res = ioctl(fd, DAHDI_HOOK, &x);
 		if (res) {
@@ -78,6 +98,13 @@
 		}
 	} else if (!strcasecmp(argv[2], "polarity")) {
 		fprintf(stderr, "Twiddling polarity...\n");
+		/* Insure that the channel is in active mode */
+		x = DAHDI_RING;
+		res = ioctl(fd, DAHDI_HOOK, &x);
+		usleep(100000);
+		x = 0;
+		res = ioctl(fd, DAHDI_HOOK, &x);
+
 		x = 0;
 		res = ioctl(fd, DAHDI_SETPOLARITY, &x);
 		if (res) {




More information about the dahdi-commits mailing list