summaryrefslogtreecommitdiff
path: root/xpp/utils/zconf/Zaptel/Span.pm
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-08-02 12:21:11 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-08-02 12:21:11 +0000
commitc88eaa22e13bd4c092b367a28e57064659660466 (patch)
tree2978dd7342b09b60bf9dbe5e333d043fb43d9114 /xpp/utils/zconf/Zaptel/Span.pm
parent183cf9c2af77e6444450cf5d2b5c62ca6b875fbe (diff)
Merge xpp r4372:
* Update to zaptel-1.2.18 and zaptel-1.4.3 (r4308 onward) * Fix a critical race with zaptel synchronization (r4362) * Added a /proc/xpp/cmds for statistics about command timing (r4360) * Fix a digit mapping bug with hardware dtmf detection (r4357) * In xpp/utils/Makefile add perl syntax checks to our scripts (r4337) * Better USB data error checking (r4336) * udev rules (xpp.rules) avoid false calls from wrong nodes (r4331) * Improve hardware detection and reporting in lszaptel, zaptel_hardware. zapconf is basically functional. * Leds are blinked synchronously on all Astribanks now (r4262) * Fix a BRI bug if OPTIMIZE_CHANMUTE was compiled into zaptel (r4258) (This feature was not yet accepted into official zaptel) * Removed compile warning about HZ != 1000 (r4218) * Firmware updates. * fpga_load now supports USB pathes without zeros (r4211) * XPD numbers have changed to '<Unit><Subunit>' (r4196) * Proper support for ZT_VMWI ioctl, if used in zaptel (r4092) * Fix FXO power denial detection (r4054) * FXO could accidentally go off-hook with some compilers (r4048) (From branches/1.2 r2732, r2735 - branches/1.4 2736) git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2813 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/utils/zconf/Zaptel/Span.pm')
-rw-r--r--xpp/utils/zconf/Zaptel/Span.pm34
1 files changed, 33 insertions, 1 deletions
diff --git a/xpp/utils/zconf/Zaptel/Span.pm b/xpp/utils/zconf/Zaptel/Span.pm
index 8496910..47a5a56 100644
--- a/xpp/utils/zconf/Zaptel/Span.pm
+++ b/xpp/utils/zconf/Zaptel/Span.pm
@@ -46,28 +46,51 @@ my @bri_strings = (
'HFC-S PCI A ISDN.* \[(NT|TE)\] '
);
+my @pri_strings = (
+ 'PRI_(NT|TE)'
+ );
+
our $ZAPBRI_NET = 'bri_net';
our $ZAPBRI_CPE = 'bri_cpe';
+our $ZAPPRI_NET = 'pri_net';
+our $ZAPPRI_CPE = 'pri_cpe';
+
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";
my $self = { NUM => $num };
bless $self, $pack;
+ $self->{TYPE} = "UNKNOWN";
open(F, "$proc_base/$num") or die "Failed to open '$proc_base/$num\n";
my $head = <F>;
chomp $head;
foreach my $cardtype (@bri_strings) {
if($head =~ m/$cardtype/) {
+ $self->{IS_DIGITAL} = 1;
$self->{IS_BRI} = 1;
$self->{TERMTYPE} = $1;
+ $self->{TYPE} = "BRI_$1";
$self->{DCHAN_IDX} = 2;
$self->{BCHAN_LIST} = [ 0, 1 ];
last;
}
}
+ foreach my $cardtype (@pri_strings) {
+ 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->{BCHAN_LIST} = [ 0 .. 14, 16 .. 30 ];
+ }
+ last;
+ }
+ }
die "$0: Unkown TERMTYPE [NT/TE]\n"
- if $self->is_bri and !defined $self->{TERMTYPE};
+ 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;
@@ -99,6 +122,15 @@ sub new($$) {
$self->{SIGNALLING} = 'gsm';
}
}
+ if($self->is_pri()) {
+ $self->{DCHAN} = ($self->chans())[$self->{DCHAN_IDX}];
+ $self->{BCHANS} = [ ($self->chans())[@{$self->{BCHAN_LIST}}] ];
+ $self->{CODING} = 'hdb3';
+ $self->{YELLOW} = undef;
+ $self->{FRAMING} = 'ccs';
+ $self->{SIGNALLING} = ($self->{TERMTYPE} eq 'NT') ? $ZAPPRI_NET : $ZAPPRI_CPE ;
+ $self->{SWITCHTYPE} = 'euroisdn';
+ }
return $self;
}