summaryrefslogtreecommitdiff
path: root/xpp/utils/zconf/Zaptel/Span.pm
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-10 20:10:14 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-10 20:10:14 +0000
commit386886c5f539500e16e912009583d4cd3903c069 (patch)
treeea8770c42e8e31a46fb1db17286ca9118842d345 /xpp/utils/zconf/Zaptel/Span.pm
parent0d01869a1227b56da6982b123ce9aa60810e6693 (diff)
xpp.r5254:
* Improved polarity reversal hangups in FXO (r5194). Fixed false detection of polarity reversals. * Optimize xframe allocation, by not zeroing the whole memory (in get_xframe()). * Fixed erronous error message that appeared sometimes from fpga_load during USB renumeration. * Zaptel::Chans now provides battery() reporting for some FXO channels (Astribank FXO and wcfxo). Merged revisions 3643 via svnmerge from http://svn.digium.com/svn/zaptel/branches/1.2 git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3646 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/utils/zconf/Zaptel/Span.pm')
-rw-r--r--xpp/utils/zconf/Zaptel/Span.pm17
1 files changed, 14 insertions, 3 deletions
diff --git a/xpp/utils/zconf/Zaptel/Span.pm b/xpp/utils/zconf/Zaptel/Span.pm
index f8e5f01..380dc7f 100644
--- a/xpp/utils/zconf/Zaptel/Span.pm
+++ b/xpp/utils/zconf/Zaptel/Span.pm
@@ -10,6 +10,7 @@ package Zaptel::Span;
use strict;
use Zaptel::Utils;
use Zaptel::Chans;
+use Zaptel::Xpp::Xpd;
my $proc_base = "/proc/zaptel";
@@ -50,6 +51,12 @@ sub new($$) {
my $self = { NUM => $num };
bless $self, $pack;
$self->{TYPE} = "UNKNOWN";
+ my @xpds = Zaptel::Xpp::Xpd::xpds_by_spanno;
+ my $xpd = $xpds[$num];
+ if(defined $xpd) {
+ die "Spanno mismatch: $xpd->spanno, $num" unless $xpd->spanno == $num;
+ $self->{XPD} = $xpd;
+ }
open(F, "$proc_base/$num") or die "Failed to open '$proc_base/$num\n";
my $head = <F>;
chomp $head;
@@ -92,16 +99,20 @@ sub new($$) {
$self->{IS_ZAPTEL_SYNC_MASTER} =
($self->{DESCRIPTION} =~ /\(MASTER\)/) ? 1 : 0;
$self->{CHANS} = [];
+ my @channels;
+ my $index = 0;
while(<F>) {
chomp;
s/^\s*//;
s/\s*$//;
next unless /\S/;
- my $c = Zaptel::Chans->new($self, $_);
- push(@{$self->{CHANS}}, $c);
+ my $c = Zaptel::Chans->new($self, $index, $_);
+ push(@channels, $c);
+ $index++;
}
close F;
-
+ @channels = sort { $a->num <=> $b->num } @channels;
+ $self->{CHANS} = \@channels;
$self->{YELLOW} = undef;
$self->{CRC4} = undef;
if($self->is_bri()) {