[dahdi-commits] rmeyerriecks: tools/trunk r9517 - /tools/trunk/dahdi_maint.c
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Wed Dec 8 16:14:33 CST 2010
Author: rmeyerriecks
Date: Wed Dec 8 16:14:29 2010
New Revision: 9517
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9517
Log:
dahdi_maint: Added the loopup/loopdown functionality
Put back in the loopup and loopdown functionality which had been removed
from dahdi_tool
According to the spec AT&T TR 54016 we should keep the loopback
actuate and release signals on the line for 5 seconds.
Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>
Acked-by: Shaun Ruffell <sruffell at digium.com>
Modified:
tools/trunk/dahdi_maint.c
Modified: tools/trunk/dahdi_maint.c
URL: http://svnview.digium.com/svn/dahdi/tools/trunk/dahdi_maint.c?view=diff&rev=9517&r1=9516&r2=9517
==============================================================================
--- tools/trunk/dahdi_maint.c (original)
+++ tools/trunk/dahdi_maint.c Wed Dec 8 16:14:29 2010
@@ -56,7 +56,9 @@
"networkpayload|off>\n"\
"\t\tlocalhost - loop back towards host\n"\
"\t\tnetworkline - network line loopback\n"\
- "\t\tnetworkpayload - network payload loopback\n");
+ "\t\tnetworkpayload - network payload loopback\n"\
+ "\t\tloopup - transmit loopup signal\n"\
+ "\t\tloopdown - transmit loopdown signal\n");
fprintf(stderr, " -i, --insert <fas|multi|crc|cas|prbs|bipolar>"\
"\n\t\tinsert an error of a specific type\n");
fprintf(stderr, " -r, --reset "\
@@ -163,6 +165,12 @@
} else if (!strcasecmp(larg, "networkpayload")) {
printf("Span %d: network payload loopback ON\n", span);
m.command = DAHDI_MAINT_NETWORKPAYLOADLOOP;
+ } else if (!strcasecmp(larg, "loopup")) {
+ printf("Span %d: transmitting loopup signal\n", span);
+ m.command = DAHDI_MAINT_LOOPUP;
+ } else if (!strcasecmp(larg, "loopdown")) {
+ printf("Span %d: transmitting loopdown signal\n", span);
+ m.command = DAHDI_MAINT_LOOPDOWN;
} else if (!strcasecmp(larg, "off")) {
printf("Span %d: loopback OFF\n", span);
m.command = DAHDI_MAINT_NONE;
@@ -171,9 +179,21 @@
}
res = ioctl(ctl, DAHDI_MAINT, &m);
- if (res)
+ if (res) {
printf("This type of looping not supported by the"\
" driver for this span\n");
+ return 1;
+ }
+
+ /* Leave the loopup/loopdown signal on the line for
+ * five seconds according to AT&T TR 54016
+ */
+ if ((m.command == DAHDI_MAINT_LOOPUP) ||
+ (m.command == DAHDI_MAINT_LOOPDOWN)) {
+ sleep(5);
+ m.command = DAHDI_MAINT_NONE;
+ ioctl(ctl, DAHDI_MAINT, &m);
+ }
}
if (iflag) {
More information about the dahdi-commits
mailing list