diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-08-04 15:52:49 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-08-04 15:52:49 +0000 |
commit | 64f72ae8855f0eb7985a1b4b09c0eda769d739c8 (patch) | |
tree | 87de502479311b224f6c52bca5f3128f7504768d /kernel/xpp/utils/zconf/Zaptel | |
parent | eeff62d36576880696ca8c64e415a13ca7437386 (diff) |
Merged revisions 4451-4455 via svnmerge from
http://svn.digium.com/svn/zaptel/branches/1.2
........
r4451 | tzafrir | 2008-08-04 18:11:01 +0300 (Mon, 04 Aug 2008) | 9 lines
Firmware update: 5959 (DTMF and BRI ID)
(From DAHDI rev. 4695)
* Fix some cases of double digits.
* Fix some rare cases of a BRI unit providing incorrect directionality.
* Extra debugging code in card_fxs.c to trace future DTMF issues.
* Properly note DAHDI (as opposed to Zaptel) ioctls.
........
r4452 | tzafrir | 2008-08-04 18:36:19 +0300 (Mon, 04 Aug 2008) | 2 lines
Make it formally bashism.
........
r4453 | tzafrir | 2008-08-04 18:38:10 +0300 (Mon, 04 Aug 2008) | 2 lines
Kbuild: A more robust check for the bri_dchan patch.
........
r4454 | tzafrir | 2008-08-04 18:39:01 +0300 (Mon, 04 Aug 2008) | 2 lines
Minor BRI initlization improvements.
........
r4455 | tzafrir | 2008-08-04 18:43:32 +0300 (Mon, 04 Aug 2008) | 7 lines
Add channel alarms in Zaptel-perl and lszaptel specifically.
* Zaptel::Chans now provides a method alarms() for a list (or number of)
alarms.
* lszaptel uses it for a more correct display of channel status.
* Also update PCI hardware list.
........
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4456 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'kernel/xpp/utils/zconf/Zaptel')
-rw-r--r-- | kernel/xpp/utils/zconf/Zaptel/Chans.pm | 32 | ||||
-rw-r--r-- | kernel/xpp/utils/zconf/Zaptel/Hardware/PCI.pm | 3 |
2 files changed, 32 insertions, 3 deletions
diff --git a/kernel/xpp/utils/zconf/Zaptel/Chans.pm b/kernel/xpp/utils/zconf/Zaptel/Chans.pm index 6f83f77..aa552a2 100644 --- a/kernel/xpp/utils/zconf/Zaptel/Chans.pm +++ b/kernel/xpp/utils/zconf/Zaptel/Chans.pm @@ -17,6 +17,12 @@ Zaptel::Chans - Perl interface to a Zaptel channel information This package allows access from perl to information about a Zaptel channel. It is part of the Zaptel Perl package. +=head1 alarms() + +In an array context returns a list of alarm strings (RED, BLUE, etc.) +for this channel (an empty list == false if there are no alarms). +In scalar context returns the number of alarms for a specific channel. + =head1 battery() Returns 1 if channel reports to have battery (A remote PBX connected to @@ -54,6 +60,8 @@ Returns the type of the channel: 'FXS', 'FXO', 'EMPTY', etc. =cut +my @alarm_types = qw(BLUE YELLOW RED LOOP RECOVERING NOTOPEN); + sub new($$$$$$) { my $pack = shift or die "Wasn't called as a class method\n"; my $span = shift or die "Missing a span parameter\n"; @@ -69,18 +77,29 @@ sub new($$$$$$) { $num or die "Missing a channel number parameter\n"; $fqn or die "Missing a channel fqn parameter\n"; my $signalling = ''; + my @alarms = (); my $info = ''; if(defined $rest) { + # remarks in parenthesis (In use), (no pcm) + while($rest =~ s/(\([^)]+\))\s*//) { + $info .= " $1"; + } + # Alarms + foreach my $alarm (@alarm_types) { + if($rest =~ s/\s*(\b${alarm}\b)\s*//) { + push(@alarms, $1); + } + } if($rest =~ s/^\s*(\w+)\s*//) { $signalling = $1; } - if($rest =~ s/(.*)//) { - $info = $1; - } + die "Unrecognized garbage '$rest' in $fqn\n" + if length($rest); } $self->{NUM} = $num; $self->{FQN} = $fqn; $self->{SIGNALLING} = $signalling; + $self->{ALARMS} = \@alarms; $self->{INFO} = $info; my $type; if($fqn =~ m|\bXPP_(\w+)/.*$|) { @@ -184,6 +203,13 @@ sub battery($) { return $line->battery; } +sub alarms($) { + my $self = shift or die; + my @alarms = @{$self->{ALARMS}}; + + return @alarms; +} + sub blink($$) { my $self = shift or die; my $on = shift; diff --git a/kernel/xpp/utils/zconf/Zaptel/Hardware/PCI.pm b/kernel/xpp/utils/zconf/Zaptel/Hardware/PCI.pm index a63b09f..c03b0d1 100644 --- a/kernel/xpp/utils/zconf/Zaptel/Hardware/PCI.pm +++ b/kernel/xpp/utils/zconf/Zaptel/Hardware/PCI.pm @@ -118,6 +118,9 @@ my %pci_ids = ( '1923:0100' => { DRIVER => 'wanpipe', DESCRIPTION => 'Sangoma Technologies Corp. A104d QUAD T1/E1 AFT card' }, '1923:0300' => { DRIVER => 'wanpipe', DESCRIPTION => 'Sangoma Technologies Corp. A101 single-port T1/E1' }, '1923:0400' => { DRIVER => 'wanpipe', DESCRIPTION => 'Sangoma Technologies Corp. A104u Quad T1/E1 AFT' }, + + # Yeastar (from output of modinfo): + 'e159:0001/2151' => { DRIVER => 'ystdm8xx', DESCRIPTION => 'Yeastar YSTDM8xx'}, ); $ENV{PATH} .= ":/usr/sbin:/sbin:/usr/bin:/bin"; |