summaryrefslogtreecommitdiff
path: root/xpp/perl_modules/Dahdi/Chans.pm
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-01-18 10:22:27 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-01-18 10:22:27 +0000
commite45d247d903f548a7aa927b9d13244f3f972dd21 (patch)
tree4c22e56694d71f8da9b9f4bbd9a21127c82c885e /xpp/perl_modules/Dahdi/Chans.pm
parentd1679d45cd5664b707ece84431ca1d20f5637180 (diff)
XPP tool updates to match r5663: sysfs migration.
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@5671 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'xpp/perl_modules/Dahdi/Chans.pm')
-rw-r--r--xpp/perl_modules/Dahdi/Chans.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/xpp/perl_modules/Dahdi/Chans.pm b/xpp/perl_modules/Dahdi/Chans.pm
index e2f4033..b2fdc15 100644
--- a/xpp/perl_modules/Dahdi/Chans.pm
+++ b/xpp/perl_modules/Dahdi/Chans.pm
@@ -140,7 +140,7 @@ sub new($$$$$$) {
$type = "FXS"; # likely Rhino
} elsif ($fqn =~ m{\bFXO/.*}) {
$type = "FXO"; # likely Rhino
- } elsif ($fqn =~ m{---/.*}) {
+ } elsif ($fqn =~ m{\b---/.*}) {
$type = "EMPTY"; # likely Rhino, empty slot.
} elsif ($fqn =~ m{\b(TE[24]|WCT1|Tor2|TorISA|WP[TE]1|cwain[12])/.*}) {
# TE[24]: Digium wct4xxp
@@ -158,11 +158,11 @@ sub new($$$$$$) {
} elsif ($fqn =~ m{\bztgsm/.*}) {
# Junghanns GSM card
$type = "GSM";
- } elsif(defined $signalling) {
- $type = 'FXS' if $signalling =~ /^FXS/;
- $type = 'FXO' if $signalling =~ /^FXO/;
+ } elsif($signalling ne '') {
+ $type = 'FXO' if $signalling =~ /^FXS/;
+ $type = 'FXS' if $signalling =~ /^FXO/;
} else {
- $type = undef;
+ $type = $self->probe_type();
}
$self->type($type);
$self->span()->type($type)
@@ -218,7 +218,7 @@ sub battery($) {
my $self = shift or die;
my $span = $self->span or die;
- return undef unless $self->type eq 'FXO';
+ return undef unless defined $self->type && $self->type eq 'FXO';
return $self->{BATTERY} if defined $self->{BATTERY};
my $xpd = $span->xpd;