summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-07-21 12:07:20 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-07-21 12:07:20 +0000
commit2fd33dae6b495ddf237f8ec5eefacfb04af99fc0 (patch)
tree377055ef44123a804ad3090a2d6f8a6e5a84435d
parent7d0bd298050dfb142ad1ab63861df9d46f8be637 (diff)
Allow using CONNECTOR/LABEL in genconf_parameters
Allow using CONNECTOR/LABEL in addition to SPAN and NUM for pri_termtype in genconf_parameters Merged revisions 8923 via svnmerge from http://svn.digium.com/svn/dahdi/tools/trunk git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/branches/2.3@8960 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--xpp/genconf_parameters20
-rw-r--r--xpp/perl_modules/Dahdi/Span.pm15
2 files changed, 31 insertions, 4 deletions
diff --git a/xpp/genconf_parameters b/xpp/genconf_parameters
index e48e2b8..c27f960 100644
--- a/xpp/genconf_parameters
+++ b/xpp/genconf_parameters
@@ -147,3 +147,23 @@
#pri_termtype
# SPAN/* NT
#
+# Astribanks can be matched by span and also by their:
+# LABEL + XPD number:
+# this is burned into the Astribank and won't change
+# if it's connected via different USB port/hub
+# CONNECTOR + XPD number:
+# The USB path to which the Astribank is connected.
+# Replacing an Astribank and connecting to the same USB port/hub
+# would not change this property. However, any change in USB
+# wiring (e.g: adding another hub) may alter this.
+# NUM (XBUS number) + XPD number:
+# The XBUS number. This is not stable and may even change
+# between boots.
+#
+#pri_termtype
+# LABEL/usb:INT01216/XPD-0[123] NT
+# LABEL/usb:INT00375/XPD-0[123] NT
+# CONNECTOR/@usb-0000:00:1d.7-1/XPD-0[123] NT
+# CONNECTOR/@usb-0000:00:1d.7-2/XPD-0[123] NT
+# NUM/XBUS-01/XPD-0[123] NT
+# NUM/XBUS-03/XPD-0[123] NT
diff --git a/xpp/perl_modules/Dahdi/Span.pm b/xpp/perl_modules/Dahdi/Span.pm
index b5c6823..9dd3347 100644
--- a/xpp/perl_modules/Dahdi/Span.pm
+++ b/xpp/perl_modules/Dahdi/Span.pm
@@ -323,10 +323,17 @@ sub pri_set_fromconfig($$) {
}
push(@pri_specs , 'SPAN/* TE'); # Default
my @patlist = ( "SPAN/" . $span->num );
- my ($xbus_name, $xpd_name) = ($name =~ m|(XBUS-\d+)/(XPD-\d+)|);
- if(defined $xbus_name) {
+ my $xpd = $span->{XPD};
+ if(defined $xpd) {
+ my $xbus = $xpd->xbus;
+ my $xbus_name = $xbus->name;
+ my $xpd_name = "XPD-" . $xpd->id;
+ my $label = $xbus->label;
+ my $connector = $xbus->connector;
+ #print "DEBUG: '$xbus_name/$xpd_name' LABEL='$label' CONNECTOR='$connector'\n";
push(@patlist, "NUM/$xbus_name/$xpd_name");
-# push(@patlist, "CONNECTOR/$ENV{XBUS_CONNECTOR}/$xpd_name");
+ push(@patlist, "LABEL/$label/$xpd_name");
+ push(@patlist, "CONNECTOR/$connector/$xpd_name");
}
#print STDERR "PATLIST=@patlist\n";
my $match_termtype;
@@ -343,7 +350,7 @@ SPEC:
foreach my $pattern (@patlist) {
#print STDERR "testmatch: $pattern =~ $match\n";
if($pattern =~ $match) {
- #print STDERR "$xpd_name: MATCH '$pattern' ~ '$match' termtype=$termtype\n";
+ #print STDERR "MATCH '$pattern' ~ '$match' termtype=$termtype\n";
$match_termtype = $termtype;
last SPEC;
}