diff options
Diffstat (limited to 'kernel/xpp/utils/zconf/Zaptel/Span.pm')
-rw-r--r-- | kernel/xpp/utils/zconf/Zaptel/Span.pm | 64 |
1 files changed, 51 insertions, 13 deletions
diff --git a/kernel/xpp/utils/zconf/Zaptel/Span.pm b/kernel/xpp/utils/zconf/Zaptel/Span.pm index 7c08484..92dc4dd 100644 --- a/kernel/xpp/utils/zconf/Zaptel/Span.pm +++ b/kernel/xpp/utils/zconf/Zaptel/Span.pm @@ -36,7 +36,15 @@ my @bri_strings = ( ); my @pri_strings = ( - '(E1|T1|J1)_(NT|TE)' + '(E1|T1|J1)_(NT|TE)', + 'Tormenta 2 .*Quad (E1|T1)', # tor2. + 'Digium Wildcard .100P (T1|E1)/', # wct1xxp + 'ISA Tormenta Span 1', # torisa + 'TE110P T1/E1', # wcte11xp + 'Wildcard TE120P', # wcte12xp + 'Wildcard TE121', # wcte12xp + 'Wildcard TE122', # wcte12xp + 'T[24]XXP \(PCI\) Card ', # wct4xxp ); our $ZAPBRI_NET = 'bri_net'; @@ -45,6 +53,21 @@ our $ZAPBRI_CPE = 'bri_cpe'; our $ZAPPRI_NET = 'pri_net'; our $ZAPPRI_CPE = 'pri_cpe'; +sub init_proto($$) { + my $self = shift; + my $proto = shift; + + $self->{PROTO} = $proto; + if($proto eq 'E1') { + $self->{DCHAN_IDX} = 15; + $self->{BCHAN_LIST} = [ 0 .. 14, 16 .. 30 ]; + } elsif($proto eq 'T1') { + $self->{DCHAN_IDX} = 23; + $self->{BCHAN_LIST} = [ 0 .. 22 ]; + } + $self->{TYPE} = "${proto}_$self->{TERMTYPE}"; +} + sub new($$) { my $pack = shift or die "Wasn't called as a class method\n"; my $num = shift or die "Missing a span number parameter\n"; @@ -76,20 +99,19 @@ sub new($$) { } foreach my $cardtype (@pri_strings) { if($head =~ m/$cardtype/) { + my @info; + + push(@info, $1) if defined $1; + push(@info, $2) if defined $2; + my ($proto) = grep(/(E1|T1|J1)/, @info); + $proto = 'UNKNOWN' unless defined $proto; + my ($termtype) = grep(/(NT|TE)/, @info); + $termtype = 'TE' unless defined $termtype; + $self->{IS_DIGITAL} = 1; $self->{IS_PRI} = 1; - $self->{PROTO} = "$1"; - $self->{TERMTYPE} = $2; - $self->{TYPE} = "$1_$2"; - if($self->{PROTO} eq 'E1') { - $self->{DCHAN_IDX} = 15; - $self->{BCHAN_LIST} = [ 0 .. 14, 16 .. 30 ]; - } elsif($self->{PROTO} eq 'T1') { - $self->{DCHAN_IDX} = 23; - $self->{BCHAN_LIST} = [ 0 .. 22 ]; - } else { - die "'$self->{PROTO}' unsupported yet"; - } + $self->{TERMTYPE} = $termtype; + $self->init_proto($proto); last; } } @@ -112,6 +134,22 @@ sub new($$) { $index++; } close F; + if($self->is_pri()) { + # Check for PRI with unknown type strings + if($index == 31) { + if($self->{PROTO} eq 'UNKNOWN') { + $self->init_proto('E1'); + } elsif($self->{PROTO} ne 'E1') { + die "$index channels in a $self->{PROTO} span"; + } + } elsif($index == 24) { + if($self->{PROTO} eq 'UNKNOWN') { + $self->init_proto('T1'); # FIXME: J1? + } elsif($self->{PROTO} ne 'T1') { + die "$index channels in a $self->{PROTO} span"; + } + } + } @channels = sort { $a->num <=> $b->num } @channels; $self->{CHANS} = \@channels; $self->{YELLOW} = undef; |