diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-12-18 14:31:07 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-12-18 14:31:07 +0000 |
commit | cfd61537b47387b0fb5c8228baad6cec16d8f6e6 (patch) | |
tree | 108deea65c09c7c273a9b981f8783efcd433eaea /xpp/utils/zconf/Zaptel/Span.pm | |
parent | 4391b4a6ee42bdfd8e097c5ee5485e9eb13f19a0 (diff) |
xpp r5151:
* xpd_pri: Basically ready.
* PCM synchronization changes:
- Each Astribank unit ticks independently. Each with its own PLL.
- HOST synchronization is gone. Loading of xpp will no longer cause
useless 250 ticks per second if you have no Astribank.
- Synchronization from the zaptel sync master requires setting
ZAPTEL as sync source (xpp_sync ZAPTEL).
* rx_tasklet is now a parameter of the module xpp, rather than of xpp_usb.
* New FPGA firmware: 5128 (1151) / 5122 (1141, 1131):
- Fixes synchronization issues.
- PRI module: E1 should now work.
* perl module and utilities:
- Modules no longer magically scan system on initialization.
- Scanning is by calling explicit methods.
- "Serial" has been renamed "Label". It is basically unique, but
should be modifieble.
- Some basic documentation of zaptel perl modules.
* Default sort order of zt_registration is back to SORT_CONNCTOR.
* zt_registration proc file now shows the number of span registered to
if registered. Try: grep . /proc/xpp/XBUS-*/XPD-*/zt_registration
* genzaptelconf: Allow using a custom command instead of
/etc/init.d/asterisk to start/stop asterisk.
* Fixed the typo "Slagish".
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@3506 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/utils/zconf/Zaptel/Span.pm')
-rw-r--r-- | xpp/utils/zconf/Zaptel/Span.pm | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/xpp/utils/zconf/Zaptel/Span.pm b/xpp/utils/zconf/Zaptel/Span.pm index 47a5a56..eacac8b 100644 --- a/xpp/utils/zconf/Zaptel/Span.pm +++ b/xpp/utils/zconf/Zaptel/Span.pm @@ -8,6 +8,7 @@ package Zaptel::Span; # $Id$ # use strict; +use XppUtils; use Zaptel::Chans; my $proc_base = "/proc/zaptel"; @@ -17,19 +18,6 @@ sub chans($) { return @{$span->{CHANS}}; } -# Accessors (miniperl does not have Class:Accessor) -our $AUTOLOAD; -sub AUTOLOAD { - my $self = shift; - my $name = uc($AUTOLOAD); - $name =~ s/.*://; # strip fully-qualified portion - if (@_) { - return $self->{$name} = shift; - } else { - return $self->{$name}; - } -} - sub by_number($) { my $span_number = shift; die "Missing span number" unless defined $span_number; @@ -47,7 +35,7 @@ my @bri_strings = ( ); my @pri_strings = ( - 'PRI_(NT|TE)' + '(E1|T1|J1)_(NT|TE)' ); our $ZAPBRI_NET = 'bri_net'; @@ -65,6 +53,9 @@ sub new($$) { open(F, "$proc_base/$num") or die "Failed to open '$proc_base/$num\n"; my $head = <F>; chomp $head; + $self->{IS_DIGITAL} = 0; + $self->{IS_BRI} = 0; + $self->{IS_PRI} = 0; foreach my $cardtype (@bri_strings) { if($head =~ m/$cardtype/) { $self->{IS_DIGITAL} = 1; @@ -80,11 +71,17 @@ sub new($$) { if($head =~ m/$cardtype/) { $self->{IS_DIGITAL} = 1; $self->{IS_PRI} = 1; - $self->{TERMTYPE} = $1; - $self->{TYPE} = "PRI_$1"; - { - $self->{DCHAN_IDX} = 15; # Depends on E1/T1/J1 + $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"; } last; } @@ -100,8 +97,7 @@ sub new($$) { s/^\s*//; s/\s*$//; next unless /\S/; - my ($chan, $name, $signalling, $info) = split(/\s+/, $_, 4); - my $c = Zaptel::Chans->new($self, $chan, $name, $signalling, $info); + my $c = Zaptel::Chans->new($self, $_); push(@{$self->{CHANS}}, $c); } close F; @@ -125,11 +121,19 @@ sub new($$) { if($self->is_pri()) { $self->{DCHAN} = ($self->chans())[$self->{DCHAN_IDX}]; $self->{BCHANS} = [ ($self->chans())[@{$self->{BCHAN_LIST}}] ]; - $self->{CODING} = 'hdb3'; + if($self->{PROTO} eq 'E1') { + $self->{CODING} = 'hdb3'; + $self->{FRAMING} = 'ccs'; + $self->{SWITCHTYPE} = 'euroisdn'; + } elsif($self->{PROTO} eq 'T1') { + $self->{CODING} = 'b8zs'; + $self->{FRAMING} = 'esf'; + $self->{SWITCHTYPE} = 'national'; + } else { + die "'$self->{PROTO}' unsupported yet"; + } $self->{YELLOW} = undef; - $self->{FRAMING} = 'ccs'; $self->{SIGNALLING} = ($self->{TERMTYPE} eq 'NT') ? $ZAPPRI_NET : $ZAPPRI_CPE ; - $self->{SWITCHTYPE} = 'euroisdn'; } return $self; } |