summaryrefslogtreecommitdiff
path: root/kernel/xpp/utils/zconf/Zaptel/Span.pm
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2009-03-19 20:08:29 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2009-03-19 20:08:29 +0000
commitd8562c778088ff6ab3383df5ceead41eff4bf124 (patch)
tree43e394ae225fd7183018c2ae08d3fb1e5bcb12cb /kernel/xpp/utils/zconf/Zaptel/Span.pm
parentb6b3226735f5e3b3fb000fa92daa7a574265c817 (diff)
xpp: a massive backport from DAHDI. From Xorcom branch-rel-6839-r6908 .
Sun Mar 1 2009 Oron Peled <oron@actcom.co.il> - xpp.r6795 * Fix cases where the command_queue overflowed during initialization. - Also add a 'command_queue_length' parameter to xpp.ko * More migrations to sysfs: - Add a 'transport' attribute to our astribank devices which points to the usb device we use. E.g: /sys/bus/astribanks/devices/xbus-00/transport is symlinked to ../../../../../../devices/pci0000:00/0000:00:10.4/usb5/5-4 - Move /proc/xpp/XBUS-??/XPD-??/span to /sys/bus/xpds/devices/??:?:?/span - Migrate from /proc/xpp/sync to: /sys/bus/astribanks/drivers/xppdrv/sync - New 'offhook' attribute in: /sys/bus/xpds/devices/??:?:?/offhook * PRI: change the "timing" priority to match the convention used by other PRI cards -- I.e: lower numbers (not 0) have higher priority. * FXO: - Power denial: create two module parameters instead of hard-coded constants (power_denial_safezone, power_denial_minlen). For sites that get non-standard power-denial signals from central office on offhook. - Don't hangup on power-denial, just notify Dahdi and wait for - Fix caller-id detection for the case central office sends it before first ring without any indication before. Asterisk's desicion. Mon, Dec 8 2008 Oron Peled <oron@actcom.co.il> - xpp.r6430 * PRI: - Match our span clocking priorities (in system.conf) to Digium -- this is a reversal of the previous state. Now lower numbers (greater than 0) are better. - Synchronization fixes for PRI ports other than 0. - Fix T1 CRC for some countries (e.g: China). * FXS: fix bug in VMWI detection if using old asterisk which does not provide ZT_VMWI ioctl(). * FXO: - Improve caller_id_style module parameter. This provide a workaround for countries that send this information without any notification (reverse polarity, ring, etc.) - Don't force on-hook upon power-denial. So, loopstart devices would ignore these as expected. * Implement a flow-control to prevent user space (init_card_* scripts) from pressuring our command queue. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4631 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'kernel/xpp/utils/zconf/Zaptel/Span.pm')
-rw-r--r--kernel/xpp/utils/zconf/Zaptel/Span.pm71
1 files changed, 62 insertions, 9 deletions
diff --git a/kernel/xpp/utils/zconf/Zaptel/Span.pm b/kernel/xpp/utils/zconf/Zaptel/Span.pm
index be49c28..c771a26 100644
--- a/kernel/xpp/utils/zconf/Zaptel/Span.pm
+++ b/kernel/xpp/utils/zconf/Zaptel/Span.pm
@@ -133,12 +133,13 @@ my @bri_strings = (
'BRI_(NT|TE)',
'(?:quad|octo)BRI PCI ISDN Card.* \[(NT|TE)\]\ ',
'octoBRI \[(NT|TE)\] ',
- 'HFC-S PCI A ISDN.* \[(NT|TE)\] '
+ 'HFC-S PCI A ISDN.* \[(NT|TE)\] ',
+ '(B4XXP) \(PCI\) Card', # Does not expose NT/TE type
);
my @pri_strings = (
- '(E1|T1|J1)_(NT|TE)',
'Tormenta 2 .*Quad (E1|T1)', # tor2.
+ 'Xorcom XPD.*: (E1|T1)', # Astribank PRI
'Digium Wildcard .100P (T1|E1)/', # wct1xxp
'ISA Tormenta Span 1', # torisa
'TE110P T1/E1', # wcte11xp
@@ -189,10 +190,12 @@ sub new($$) {
$self->{IS_PRI} = 0;
foreach my $cardtype (@bri_strings) {
if($head =~ m/$cardtype/) {
+ my $termtype = $1;
+ $termtype = 'TE' if ( $1 eq 'B4XXP' );
$self->{IS_DIGITAL} = 1;
$self->{IS_BRI} = 1;
- $self->{TERMTYPE} = $1;
- $self->{TYPE} = "BRI_$1";
+ $self->{TERMTYPE} = $termtype;
+ $self->{TYPE} = "BRI_$termtype";
$self->{DCHAN_IDX} = 2;
$self->{BCHAN_LIST} = [ 0, 1 ];
last;
@@ -207,7 +210,7 @@ sub new($$) {
my ($proto) = grep(/(E1|T1|J1)/, @info);
$proto = 'UNKNOWN' unless defined $proto;
my ($termtype) = grep(/(NT|TE)/, @info);
- $termtype = 'TE' unless defined $termtype;
+ $termtype = 'UNKNOWN' unless defined $termtype;
$self->{IS_DIGITAL} = 1;
$self->{IS_PRI} = 1;
@@ -216,8 +219,6 @@ sub new($$) {
last;
}
}
- die "$0: Unkown TERMTYPE [NT/TE]\n"
- if $self->is_digital and !defined $self->{TERMTYPE};
($self->{NAME}, $self->{DESCRIPTION}) = (split(/\s+/, $head, 4))[2, 3];
$self->{IS_ZAPTEL_SYNC_MASTER} =
($self->{DESCRIPTION} =~ /\(MASTER\)/) ? 1 : 0;
@@ -262,7 +263,7 @@ sub new($$) {
# Infer some info from channel name:
my $first_chan = ($self->chans())[0] || die "$0: No channels in span #$num\n";
my $chan_fqn = $first_chan->fqn();
- if($chan_fqn =~ m(ZTHFC.*/|ztqoz.*/|XPP_BRI_.*/)) { # BRI
+ if($chan_fqn =~ m(ZTHFC.*/|ztqoz.*/|XPP_BRI_.*|B4/.*)) { # BRI
$self->{FRAMING} = 'ccs';
$self->{SWITCHTYPE} = 'euroisdn';
$self->{SIGNALLING} = ($self->{TERMTYPE} eq 'NT') ? $ZAPBRI_NET : $ZAPBRI_CPE ;
@@ -286,7 +287,6 @@ sub new($$) {
} else {
die "'$self->{PROTO}' unsupported yet";
}
- $self->{SIGNALLING} = ($self->{TERMTYPE} eq 'NT') ? $ZAPPRI_NET : $ZAPPRI_CPE ;
}
return $self;
}
@@ -297,4 +297,57 @@ sub bchans($) {
return @{$self->{BCHANS}};
}
+sub set_termtype($$) {
+ my $span = shift || die;
+ my $termtype = shift || die;
+ $span->{TERMTYPE} = $termtype;
+ $span->{SIGNALLING} = ($termtype eq 'NT') ? $ZAPPRI_NET : $ZAPPRI_CPE ;
+ $span->{TYPE} = $span->proto . "_$termtype";
+}
+
+sub pri_set_fromconfig($$) {
+ my $span = shift || die;
+ my $genconf = shift || die;
+ my $name = $span->name;
+# if(defined $termtype) {
+# die "Termtype for $name already defined as $termtype\n";
+# }
+ my $pri_termtype = $genconf->{pri_termtype};
+ my @pri_specs;
+ if(defined $pri_termtype) {
+ @pri_specs = @{$pri_termtype};
+ }
+ 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) {
+ push(@patlist, "NUM/$xbus_name/$xpd_name");
+# push(@patlist, "CONNECTOR/$ENV{XBUS_CONNECTOR}/$xpd_name");
+ }
+ #print STDERR "PATLIST=@patlist\n";
+ my $match_termtype;
+SPEC:
+ for(my $i = 0; $i < @pri_specs; $i++) {
+ my $spec = $pri_specs[$i];
+ #print STDERR "spec: $spec\n";
+ my ($match, $termtype) = split(/\s+/, $spec);
+ next unless defined $match and defined $termtype;
+ # Convert "globs" to regex
+ $match =~ s/\*/.*/g;
+ $match =~ s/\?/./g;
+ #print STDERR "match: $match\n";
+ foreach my $pattern (@patlist) {
+ #print STDERR "testmatch: $pattern =~ $match\n";
+ if($pattern =~ $match) {
+ #print STDERR "$xpd_name: MATCH '$pattern' ~ '$match' termtype=$termtype\n";
+ $match_termtype = $termtype;
+ last SPEC;
+ }
+ }
+ }
+ die "Unknown pri_termtype" unless defined $match_termtype;
+ $span->set_termtype($match_termtype);
+}
+
+
1;