summaryrefslogtreecommitdiff
path: root/dahdi_scan.c
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2009-07-27 21:05:16 +0000
committerSean Bright <sean@malleable.com>2009-07-27 21:05:16 +0000
commitd0a8ca32606d8afe50ec1d4fca8bc550df42b8a0 (patch)
tree20fbf83a363bff3fb50c780204b0d83152f767c3 /dahdi_scan.c
parent4618733321748c2be9f62a496ffbd1c0dada7c91 (diff)
Pass correct channel number to DAHDI_GET_PARAMS when passing span numbers to dahdi_scan.
When filtering, we weren't taking into account the number of channels in the spans that we were skipping. (closes issue #15553) Reported by: tony Patches: 20090723_issue15553.patch uploaded by seanbright (license 71) Tested by: seanbright git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@6902 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'dahdi_scan.c')
-rw-r--r--dahdi_scan.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/dahdi_scan.c b/dahdi_scan.c
index f844b41..d1564f4 100644
--- a/dahdi_scan.c
+++ b/dahdi_scan.c
@@ -60,8 +60,14 @@ int main(int argc, char *argv[])
span_filter[filter_count++] = s;
}
}
-
+
for (x = 1; x < DAHDI_MAX_SPANS; x++) {
+
+ memset(&s, 0, sizeof(s));
+ s.spanno = x;
+ if (ioctl(ctl, DAHDI_SPANSTAT, &s))
+ continue;
+
if (filter_count > 0) {
int match = 0;
for (z = 0; z < filter_count; z++) {
@@ -71,13 +77,10 @@ int main(int argc, char *argv[])
}
}
if (!match) {
+ basechan += s.totalchans;
continue;
}
}
- memset(&s, 0, sizeof(s));
- s.spanno = x;
- if (ioctl(ctl, DAHDI_SPANSTAT, &s))
- continue;
alarms[0] = '\0';
if (s.alarms) {