diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-06-19 17:34:36 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-06-19 17:34:36 +0000 |
commit | da10e87bd6c69c4374de470b7b286c36c823fdc2 (patch) | |
tree | 8ae3ddc2b5eff066497697c0c6ec1bc7ee6433ad /xpp/perl_modules | |
parent | c1ae88873823bdc2d884f72cc2b06eab017b97b1 (diff) |
XPP tools rename: part 2.
Removed obsolete astribank_hook (not needed) and print_modes (moved to
kernel).
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@4416 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'xpp/perl_modules')
-rw-r--r-- | xpp/perl_modules/Dahdi.pm (renamed from xpp/perl_modules/Zaptel.pm) | 24 | ||||
-rw-r--r-- | xpp/perl_modules/Dahdi/Chans.pm (renamed from xpp/perl_modules/Zaptel/Chans.pm) | 26 | ||||
-rw-r--r-- | xpp/perl_modules/Dahdi/Config/Defaults.pm (renamed from xpp/perl_modules/Zaptel/Config/Defaults.pm) | 9 | ||||
-rw-r--r-- | xpp/perl_modules/Dahdi/Hardware.pm (renamed from xpp/perl_modules/Zaptel/Hardware.pm) | 26 | ||||
-rw-r--r-- | xpp/perl_modules/Dahdi/Hardware/PCI.pm (renamed from xpp/perl_modules/Zaptel/Hardware/PCI.pm) | 14 | ||||
-rw-r--r-- | xpp/perl_modules/Dahdi/Hardware/USB.pm (renamed from xpp/perl_modules/Zaptel/Hardware/USB.pm) | 18 | ||||
-rw-r--r-- | xpp/perl_modules/Dahdi/Span.pm (renamed from xpp/perl_modules/Zaptel/Span.pm) | 54 | ||||
-rw-r--r-- | xpp/perl_modules/Dahdi/Utils.pm (renamed from xpp/perl_modules/Zaptel/Utils.pm) | 4 | ||||
-rw-r--r-- | xpp/perl_modules/Dahdi/Xpp.pm (renamed from xpp/perl_modules/Zaptel/Xpp.pm) | 28 | ||||
-rw-r--r-- | xpp/perl_modules/Dahdi/Xpp/Line.pm (renamed from xpp/perl_modules/Zaptel/Xpp/Line.pm) | 6 | ||||
-rw-r--r-- | xpp/perl_modules/Dahdi/Xpp/Xbus.pm (renamed from xpp/perl_modules/Zaptel/Xpp/Xbus.pm) | 12 | ||||
-rw-r--r-- | xpp/perl_modules/Dahdi/Xpp/Xpd.pm (renamed from xpp/perl_modules/Zaptel/Xpp/Xpd.pm) | 12 |
12 files changed, 117 insertions, 116 deletions
diff --git a/xpp/perl_modules/Zaptel.pm b/xpp/perl_modules/Dahdi.pm index ef36bae..a191556 100644 --- a/xpp/perl_modules/Zaptel.pm +++ b/xpp/perl_modules/Dahdi.pm @@ -1,4 +1,4 @@ -package Zaptel; +package Dahdi; # # Written by Oron Peled <oron@actcom.co.il> # Copyright (C) 2007, Xorcom @@ -8,21 +8,21 @@ package Zaptel; # $Id$ # use strict; -use Zaptel::Span; +use Dahdi::Span; =head1 NAME -Zaptel - Perl interface to Zaptel information +Dahdi - Perl interface to Dahdi information -This package allows access from Perl to information about Zaptel -hardware and loaded Zaptel devices. +This package allows access from Perl to information about Dahdi +hardware and loaded Dahdi devices. =head1 SYNOPSIS # Listing channels in analog spans: - use Zaptel; + use Dahdi; # scans system: - my @xbuses = Zaptel::spans(); + my @xbuses = Dahdi::spans(); for my $span (@spans) { next if ($span->is_digital); $span->num. " - [". $span->type ."] ". $span->name. "\n"; @@ -46,7 +46,7 @@ sub spans() { -d $proc_base or return (); foreach my $zfile (glob "$proc_base/*") { $zfile =~ s:$proc_base/::; - my $span = Zaptel::Span->new($zfile); + my $span = Dahdi::Span->new($zfile); push(@spans, $span); } @spans = sort { $a->num <=> $b->num } @spans; @@ -55,13 +55,13 @@ sub spans() { =head1 SEE ALSO -Span objects: L<Zaptel::Span>. +Span objects: L<Dahdi::Span>. -Zaptel channels objects: L<Zaptel::Chan>. +Dahdi channels objects: L<Dahdi::Chan>. -Zaptel hardware devices information: L<Zaptel::Hardware>. +Dahdi hardware devices information: L<Dahdi::Hardware>. -Xorcom Astribank -specific information: L<Zaptel::Xpp>. +Xorcom Astribank -specific information: L<Dahdi::Xpp>. =cut diff --git a/xpp/perl_modules/Zaptel/Chans.pm b/xpp/perl_modules/Dahdi/Chans.pm index 6f83f77..adb7975 100644 --- a/xpp/perl_modules/Zaptel/Chans.pm +++ b/xpp/perl_modules/Dahdi/Chans.pm @@ -1,4 +1,4 @@ -package Zaptel::Chans; +package Dahdi::Chans; # # Written by Oron Peled <oron@actcom.co.il> # Copyright (C) 2007, Xorcom @@ -8,14 +8,14 @@ package Zaptel::Chans; # $Id$ # use strict; -use Zaptel::Utils; +use Dahdi::Utils; =head1 NAME -Zaptel::Chans - Perl interface to a Zaptel channel information +Dahdi::Chans - Perl interface to a Dahdi channel information -This package allows access from perl to information about a Zaptel -channel. It is part of the Zaptel Perl package. +This package allows access from perl to information about a Dahdi +channel. It is part of the Dahdi Perl package. =head1 battery() @@ -36,12 +36,12 @@ Returns the number of this channel (in the span). =head1 num() -Returns the number of this channel as a Zaptel channel. +Returns the number of this channel as a Dahdi channel. =head signalling() -Returns the signalling set for this channel through /etc/zaptel.conf . -This is always empty before ztcfg was run. And shows the "other" type +Returns the signalling set for this channel through /etc/dahdi.conf . +This is always empty before dahdi_cfg was run. And shows the "other" type for FXS and for FXO. =head1 span() @@ -126,17 +126,17 @@ sub new($$$$$$) { =head1 probe_type() -In the case of some cards, the information in /proc/zaptel is not good +In the case of some cards, the information in /proc/dahdi is not good enough to tell the type of each channel. In this case an extra explicit probe is needed. -Currently this is implemented by using some invocations of ztcfg(8). +Currently this is implemented by using some invocations of dahdi_cfg(8). -It may later be replaced by ztscan(8). +It may later be replaced by dahdi_scan(8). =cut -my $ztcfg = $ENV{ZTCFG} || '/sbin/ztcfg'; +my $dahdi_cfg = $ENV{DAHDI_CFG} || '/sbin/dahdi_cfg'; sub probe_type($) { my $self = shift; my $fqn = $self->fqn; @@ -148,7 +148,7 @@ sub probe_type($) { undef %maybe; foreach my $sig (qw(fxo fxs)) { - my $cmd = "echo ${sig}ks=$num | $ztcfg -c /dev/fd/0"; + my $cmd = "echo ${sig}ks=$num | $dahdi_cfg -c /dev/fd/0"; $maybe{$sig} = system("$cmd >/dev/null 2>&1") == 0; } diff --git a/xpp/perl_modules/Zaptel/Config/Defaults.pm b/xpp/perl_modules/Dahdi/Config/Defaults.pm index 360ca0a..e720568 100644 --- a/xpp/perl_modules/Zaptel/Config/Defaults.pm +++ b/xpp/perl_modules/Dahdi/Config/Defaults.pm @@ -1,4 +1,4 @@ -package Zaptel::Config::Defaults; +package Dahdi::Config::Defaults; # # Written by Oron Peled <oron@actcom.co.il> # Copyright (C) 2007, Xorcom @@ -32,10 +32,11 @@ sub source_vars { my %system_files = ( "/etc/default/zaptel" => 'Debian and friends', "/etc/sysconfig/zaptel" => 'Red Hat and friends', + "/etc/dahdi/defaults" => 'Dahdi generic', ); - if(defined $ENV{ZAPTEL_DEFAULTS}) { - $default_file = $ENV{ZAPTEL_DEFAULTS}; + if(defined $ENV{DAHDI_DEFAULTS}) { + $default_file = $ENV{DAHDI_DEFAULTS}; } else { foreach my $f (keys %system_files) { if(-r $f) { @@ -49,7 +50,7 @@ sub source_vars { if (! $default_file) { return ("", ()); } - my %vars = Zaptel::Config::Defaults::do_source($default_file, @vars); + my %vars = Dahdi::Config::Defaults::do_source($default_file, @vars); return ($default_file, %vars); } diff --git a/xpp/perl_modules/Zaptel/Hardware.pm b/xpp/perl_modules/Dahdi/Hardware.pm index ff7aeea..6407760 100644 --- a/xpp/perl_modules/Zaptel/Hardware.pm +++ b/xpp/perl_modules/Dahdi/Hardware.pm @@ -1,4 +1,4 @@ -package Zaptel::Hardware; +package Dahdi::Hardware; # # Written by Oron Peled <oron@actcom.co.il> # Copyright (C) 2007, Xorcom @@ -8,19 +8,19 @@ package Zaptel::Hardware; # $Id$ # use strict; -use Zaptel::Hardware::USB; -use Zaptel::Hardware::PCI; +use Dahdi::Hardware::USB; +use Dahdi::Hardware::PCI; =head1 NAME -Zaptel::Hardware - Perl interface to a Zaptel devices listing +Dahdi::Hardware - Perl interface to a Dahdi devices listing - use Zaptel::Hardware; + use Dahdi::Hardware; - my $hardware = Zaptel::Hardware->scan; + my $hardware = Dahdi::Hardware->scan; - # mini zaptel_hardware: + # mini dahdi_hardware: foreach my $device ($hardware->device_list) { print "Vendor: device->{VENDOR}, Product: $device->{PRODUCT}\n" } @@ -39,7 +39,7 @@ Zaptel::Hardware - Perl interface to a Zaptel devices listing } -This module provides information about available Zaptel devices on the +This module provides information about available Dahdi devices on the system. It identifies devices by (USB/PCI) bus IDs. @@ -59,7 +59,7 @@ A one-line description of the device. =head2 driver -Name of a Zaptel device driver that should handle this device. This is +Name of a Dahdi device driver that should handle this device. This is based on a pre-made list. @@ -104,7 +104,7 @@ sub device_detected($$) { sub device_removed($) { my $dev = shift || die; my $name = $dev->hardware_name; - die "Missing zaptel device hardware name" unless $name; + die "Missing dahdi device hardware name" unless $name; } @@ -150,7 +150,7 @@ sub drivers($) { =head1 scan() -Scan the system for Zaptel devices (PCI and USB). Returns nothing but +Scan the system for Dahdi devices (PCI and USB). Returns nothing but must be run to initialize the module. =cut @@ -160,8 +160,8 @@ sub scan($) { my $self = {}; bless $self, $pack; - $self->{USB} = [ Zaptel::Hardware::USB->devices ]; - $self->{PCI} = [ Zaptel::Hardware::PCI->scan_devices ]; + $self->{USB} = [ Dahdi::Hardware::USB->devices ]; + $self->{PCI} = [ Dahdi::Hardware::PCI->scan_devices ]; return $self; } diff --git a/xpp/perl_modules/Zaptel/Hardware/PCI.pm b/xpp/perl_modules/Dahdi/Hardware/PCI.pm index a63b09f..f3d9360 100644 --- a/xpp/perl_modules/Zaptel/Hardware/PCI.pm +++ b/xpp/perl_modules/Dahdi/Hardware/PCI.pm @@ -1,4 +1,4 @@ -package Zaptel::Hardware::PCI; +package Dahdi::Hardware::PCI; # # Written by Oron Peled <oron@actcom.co.il> # Copyright (C) 2007, Xorcom @@ -8,16 +8,16 @@ package Zaptel::Hardware::PCI; # $Id$ # use strict; -use Zaptel::Utils; -use Zaptel::Hardware; +use Dahdi::Utils; +use Dahdi::Hardware; -our @ISA = qw(Zaptel::Hardware); +our @ISA = qw(Dahdi::Hardware); # Lookup algorithm: # First match 'vendor:product/subvendor:subproduct' key # Else match 'vendor:product/subvendor' key # Else match 'vendor:product' key -# Else not a zaptel hardware. +# Else not a dahdi hardware. my %pci_ids = ( # from wct4xxp '10ee:0314' => { DRIVER => 'wct4xxp', DESCRIPTION => 'Wildcard TE410P/TE405P (1st Gen)' }, @@ -130,7 +130,7 @@ sub new($$) { my $pack = shift or die "Wasn't called as a class method\n"; my $self = { @_ }; bless $self, $pack; - Zaptel::Hardware::device_detected($self, + Dahdi::Hardware::device_detected($self, sprintf("pci:%s", $self->{PRIV_DEVICE_NAME})); return $self; } @@ -188,7 +188,7 @@ sub scan_devices($) { $key = "$dev->{VENDOR}:$dev->{PRODUCT}" if !defined($pci_ids{$key}); next unless defined $pci_ids{$key}; - my $d = Zaptel::Hardware::PCI->new( + my $d = Dahdi::Hardware::PCI->new( BUS_TYPE => 'PCI', PRIV_DEVICE_NAME => $dev->{PRIV_DEVICE_NAME}, VENDOR => $dev->{VENDOR}, diff --git a/xpp/perl_modules/Zaptel/Hardware/USB.pm b/xpp/perl_modules/Dahdi/Hardware/USB.pm index a2dc08f..fed7c29 100644 --- a/xpp/perl_modules/Zaptel/Hardware/USB.pm +++ b/xpp/perl_modules/Dahdi/Hardware/USB.pm @@ -1,4 +1,4 @@ -package Zaptel::Hardware::USB; +package Dahdi::Hardware::USB; # # Written by Oron Peled <oron@actcom.co.il> # Copyright (C) 2007, Xorcom @@ -8,12 +8,12 @@ package Zaptel::Hardware::USB; # $Id$ # use strict; -use Zaptel::Utils; -use Zaptel::Hardware; -use Zaptel::Xpp; -use Zaptel::Xpp::Xbus; +use Dahdi::Utils; +use Dahdi::Hardware; +use Dahdi::Xpp; +use Dahdi::Xpp::Xbus; -our @ISA = qw(Zaptel::Hardware); +our @ISA = qw(Dahdi::Hardware); my %usb_ids = ( # from wcusb @@ -39,7 +39,7 @@ my %usb_ids = ( $ENV{PATH} .= ":/usr/sbin:/sbin:/usr/bin:/bin"; -my @xbuses = Zaptel::Xpp::xbuses('SORT_CONNECTOR'); +my @xbuses = Dahdi::Xpp::xbuses('SORT_CONNECTOR'); sub usb_sorter() { return $a->hardware_name cmp $b->hardware_name; @@ -68,7 +68,7 @@ sub new($$) { $self->{XBUS} = undef; $self->{LOADED} = undef; } - Zaptel::Hardware::device_detected($self, + Dahdi::Hardware::device_detected($self, sprintf("usb:%s", $self->{PRIV_DEVICE_NAME})); return $self; } @@ -97,7 +97,7 @@ sub devices($) { } my $model = $usb_ids{"$vendor:$product"}; next unless defined $model; - my $d = Zaptel::Hardware::USB->new( + my $d = Dahdi::Hardware::USB->new( IS_ASTRIBANK => ($model->{DRIVER} eq 'xpp_usb')?1:0, BUS_TYPE => 'USB', PRIV_DEVICE_NAME => $devname, diff --git a/xpp/perl_modules/Zaptel/Span.pm b/xpp/perl_modules/Dahdi/Span.pm index 9aceb78..e8faa9b 100644 --- a/xpp/perl_modules/Zaptel/Span.pm +++ b/xpp/perl_modules/Dahdi/Span.pm @@ -1,4 +1,4 @@ -package Zaptel::Span; +package Dahdi::Span; # # Written by Oron Peled <oron@actcom.co.il> # Copyright (C) 2007, Xorcom @@ -8,26 +8,26 @@ package Zaptel::Span; # $Id$ # use strict; -use Zaptel::Utils; -use Zaptel::Chans; -use Zaptel::Xpp::Xpd; +use Dahdi::Utils; +use Dahdi::Chans; +use Dahdi::Xpp::Xpd; =head1 NAME -Zaptel::Spans - Perl interface to a Zaptel span information +Dahdi::Spans - Perl interface to a Dahdi span information -This package allows access from perl to information about a Zaptel -channel. It is part of the Zaptel Perl package. +This package allows access from perl to information about a Dahdi +channel. It is part of the Dahdi Perl package. -A span is a logical unit of Zaptel channels. Normally a port in a +A span is a logical unit of Dahdi channels. Normally a port in a digital card or a whole analog card. -See documentation of module L<Zaptel> for usage example. Specifically -C<Zaptel::spans()> must be run initially. +See documentation of module L<Dahdi> for usage example. Specifically +C<Dahdi::spans()> must be run initially. =head1 by_number() -Get a span by its Zaptel span number. +Get a span by its Dahdi span number. =head1 Span Properties @@ -37,7 +37,7 @@ The span number. =head2 name() -The name field of a Zaptel span. E.g.: +The name field of a Dahdi span. E.g.: TE2/0/1 @@ -49,7 +49,7 @@ The description field of the span. e.g: =head2 chans() -The list of the channels (L<Zaptel::Chan> objects) of this span. +The list of the channels (L<Dahdi::Chan> objects) of this span. In a scalar context returns the number of channels this span has. =head2 bchans() @@ -58,7 +58,7 @@ Likewise a list of bchannels (or a count in a scalar context). =head2 is_sync_master() -Is this span the source of timing for Zaptel? +Is this span the source of timing for Dahdi? =head2 type() @@ -95,15 +95,15 @@ Suggested sane framing type (e.g.: "ccs", "esf") for this type of span. =head2 yellow(), crc4() Likewise, suggestions ofr the respective fields in the span= line in -zaptel.conf for this span. +dahdi.conf for this span. =head2 signalling() -Suggested zapata.conf signalling for channels of this span. +Suggested chan_dahdi.conf signalling for channels of this span. =head2 switchtype() -Suggested zapata.conf switchtype for channels of this span. +Suggested chan_dahdi.conf switchtype for channels of this span. =head1 Note @@ -123,7 +123,7 @@ sub chans($) { sub by_number($) { my $span_number = shift; die "Missing span number" unless defined $span_number; - my @spans = Zaptel::spans(); + my @spans = Dahdi::spans(); my ($span) = grep { $_->num == $span_number } @spans; return $span; @@ -148,11 +148,11 @@ my @pri_strings = ( 'T[24]XXP \(PCI\) Card ', # wct4xxp ); -our $ZAPBRI_NET = 'bri_net'; -our $ZAPBRI_CPE = 'bri_cpe'; +our $DAHDI_BRI_NET = 'bri_net'; +our $DAHDI_BRI_CPE = 'bri_cpe'; -our $ZAPPRI_NET = 'pri_net'; -our $ZAPPRI_CPE = 'pri_cpe'; +our $DAHDI_PRI_NET = 'pri_net'; +our $DAHDI_PRI_CPE = 'pri_cpe'; sub init_proto($$) { my $self = shift; @@ -175,7 +175,7 @@ sub new($$) { my $self = { NUM => $num }; bless $self, $pack; $self->{TYPE} = "UNKNOWN"; - my @xpds = Zaptel::Xpp::Xpd::xpds_by_spanno; + my @xpds = Dahdi::Xpp::Xpd::xpds_by_spanno; my $xpd = $xpds[$num]; if(defined $xpd) { die "Spanno mismatch: $xpd->spanno, $num" unless $xpd->spanno == $num; @@ -219,7 +219,7 @@ sub new($$) { die "$0: Unkown TERMTYPE [NT/TE]\n" if $self->is_digital and !defined $self->{TERMTYPE}; ($self->{NAME}, $self->{DESCRIPTION}) = (split(/\s+/, $head, 4))[2, 3]; - $self->{IS_ZAPTEL_SYNC_MASTER} = + $self->{IS_DAHDI_SYNC_MASTER} = ($self->{DESCRIPTION} =~ /\(MASTER\)/) ? 1 : 0; $self->{CHANS} = []; my @channels; @@ -230,7 +230,7 @@ sub new($$) { s/\s*$//; next unless /\S/; next unless /^\s*\d+/; # must be a real channel string. - my $c = Zaptel::Chans->new($self, $index, $_); + my $c = Dahdi::Chans->new($self, $index, $_); push(@channels, $c); $index++; } @@ -265,7 +265,7 @@ sub new($$) { if($chan_fqn =~ m(ZTHFC.*/|ztqoz.*/|XPP_BRI_.*/)) { # BRI $self->{FRAMING} = 'ccs'; $self->{SWITCHTYPE} = 'euroisdn'; - $self->{SIGNALLING} = ($self->{TERMTYPE} eq 'NT') ? $ZAPBRI_NET : $ZAPBRI_CPE ; + $self->{SIGNALLING} = ($self->{TERMTYPE} eq 'NT') ? $DAHDI_BRI_NET : $DAHDI_BRI_CPE ; } elsif($chan_fqn =~ m(ztgsm.*/)) { # Junghanns's GSM cards. $self->{FRAMING} = 'ccs'; $self->{SIGNALLING} = 'gsm'; @@ -286,7 +286,7 @@ sub new($$) { } else { die "'$self->{PROTO}' unsupported yet"; } - $self->{SIGNALLING} = ($self->{TERMTYPE} eq 'NT') ? $ZAPPRI_NET : $ZAPPRI_CPE ; + $self->{SIGNALLING} = ($self->{TERMTYPE} eq 'NT') ? $DAHDI_PRI_NET : $DAHDI_PRI_CPE ; } return $self; } diff --git a/xpp/perl_modules/Zaptel/Utils.pm b/xpp/perl_modules/Dahdi/Utils.pm index 8d13ad7..dcb7441 100644 --- a/xpp/perl_modules/Zaptel/Utils.pm +++ b/xpp/perl_modules/Dahdi/Utils.pm @@ -1,4 +1,4 @@ -package Zaptel::Utils; +package Dahdi::Utils; # Accessors (miniperl does not have Class:Accessor) our $AUTOLOAD; @@ -43,7 +43,7 @@ sub import { # # Export symbols, but not by accident of inheritance. # - die "Sombody inherited Zaptel::Utils" if $pkg ne 'Zaptel::Utils'; + die "Sombody inherited Dahdi::Utils" if $pkg ne 'Dahdi::Utils'; no strict 'refs'; *{ $callpkg . '::AUTOLOAD' } = \&AUTOLOAD; *{ $callpkg . '::xpp_dump' } = \&xpp_dump; diff --git a/xpp/perl_modules/Zaptel/Xpp.pm b/xpp/perl_modules/Dahdi/Xpp.pm index 8b7458f..08757e9 100644 --- a/xpp/perl_modules/Zaptel/Xpp.pm +++ b/xpp/perl_modules/Dahdi/Xpp.pm @@ -1,4 +1,4 @@ -package Zaptel::Xpp; +package Dahdi::Xpp; # # Written by Oron Peled <oron@actcom.co.il> # Copyright (C) 2007, Xorcom @@ -8,18 +8,18 @@ package Zaptel::Xpp; # $Id$ # use strict; -use Zaptel::Xpp::Xbus; +use Dahdi::Xpp::Xbus; =head1 NAME -Zaptel::Xpp - Perl interface to the Xorcom Astribank drivers. +Dahdi::Xpp - Perl interface to the Xorcom Astribank drivers. =head1 SYNOPSIS # Listing all Astribanks: - use Zaptel::Xpp; + use Dahdi::Xpp; # scans hardware: - my @xbuses = Zaptel::Xpp::xbuses("SORT_CONNECTOR"); + my @xbuses = Dahdi::Xpp::xbuses("SORT_CONNECTOR"); for my $xbus (@xbuses) { print $xbus->name." (".$xbus->label .", ". $xbus->connector .")\n"; for my $xpd ($xbus->xpds) { @@ -97,7 +97,7 @@ sub xbuses { $name =~ /XBUS-(\d\d)/ or die "Bad XBUS number: $name"; my $num = $1; @attr = map { split(/=/); } @attr; - my $xbus = Zaptel::Xpp::Xbus->new(NAME => $name, NUM => $num, @attr); + my $xbus = Dahdi::Xpp::Xbus->new(NAME => $name, NUM => $num, @attr); push(@xbuses, $xbus); } my $sorter; @@ -119,7 +119,7 @@ sub xbuses { sub xpd_of_span($) { my $span = shift or die "Missing span parameter"; return undef unless defined $span; - foreach my $xbus (Zaptel::Xpp::xbuses('SORT_CONNECTOR')) { + foreach my $xbus (Dahdi::Xpp::xbuses('SORT_CONNECTOR')) { foreach my $xpd ($xbus->xpds()) { return $xpd if $xpd->fqn eq $span->name; } @@ -161,7 +161,7 @@ sub sync { $newsync =~ s/.*/\U$&/; if($newsync =~ /^(\d+)$/) { $newsync = ($newapi)? "SYNC=$1" : "$1 0"; - } elsif($newsync ne 'ZAPTEL') { + } elsif($newsync ne 'DAHDI') { die "Bad sync parameter '$newsync'"; } open(F, ">$file") or die "Failed to open $file for writing: $!"; @@ -175,20 +175,20 @@ sub sync { =over -=item L<Zaptel::Xpp::Xbus> +=item L<Dahdi::Xpp::Xbus> Xbus (Astribank) object. -=item L<Zaptel::Xpp::Xpd> +=item L<Dahdi::Xpp::Xpd> -XPD (the rough equivalent of a Zaptel span) object. +XPD (the rough equivalent of a Dahdi span) object. -=item L<Zaptel::Xpp::Line> +=item L<Dahdi::Xpp::Line> Object for a line: an analog port or a time-slot in a adapter. -Equivalent of a channel in Zaptel. +Equivalent of a channel in Dahdi. -=item L<Zaptel> +=item L<Dahdi> General documentation in the master package. diff --git a/xpp/perl_modules/Zaptel/Xpp/Line.pm b/xpp/perl_modules/Dahdi/Xpp/Line.pm index 2472c3b..d627ea4 100644 --- a/xpp/perl_modules/Zaptel/Xpp/Line.pm +++ b/xpp/perl_modules/Dahdi/Xpp/Line.pm @@ -1,4 +1,4 @@ -package Zaptel::Xpp::Line; +package Dahdi::Xpp::Line; # # Written by Oron Peled <oron@actcom.co.il> # Copyright (C) 2008, Xorcom @@ -8,7 +8,7 @@ package Zaptel::Xpp::Line; # $Id$ # use strict; -use Zaptel::Utils; +use Dahdi::Utils; my $proc_base = "/proc/xpp"; @@ -63,7 +63,7 @@ sub create_all($$) { local $/ = "\n"; my @lines; for(my $i = 0; $i < $xpd->{CHANNELS}; $i++) { - my $line = Zaptel::Xpp::Line->new($xpd, $i); + my $line = Dahdi::Xpp::Line->new($xpd, $i); push(@lines, $line); } $xpd->{LINES} = \@lines; diff --git a/xpp/perl_modules/Zaptel/Xpp/Xbus.pm b/xpp/perl_modules/Dahdi/Xpp/Xbus.pm index e840f14..4e6b2b3 100644 --- a/xpp/perl_modules/Zaptel/Xpp/Xbus.pm +++ b/xpp/perl_modules/Dahdi/Xpp/Xbus.pm @@ -1,4 +1,4 @@ -package Zaptel::Xpp::Xbus; +package Dahdi::Xpp::Xbus; # # Written by Oron Peled <oron@actcom.co.il> # Copyright (C) 2007, Xorcom @@ -8,8 +8,8 @@ package Zaptel::Xpp::Xbus; # $Id$ # use strict; -use Zaptel::Utils; -use Zaptel::Xpp::Xpd; +use Dahdi::Utils; +use Dahdi::Xpp::Xpd; my $proc_base = "/proc/xpp"; @@ -21,7 +21,7 @@ sub xpds($) { sub by_number($) { my $busnumber = shift; die "Missing xbus number parameter" unless defined $busnumber; - my @xbuses = Zaptel::Xpp::xbuses(); + my @xbuses = Dahdi::Xpp::xbuses(); my ($xbus) = grep { $_->num == $busnumber } @xbuses; return $xbus; @@ -30,7 +30,7 @@ sub by_number($) { sub by_label($) { my $label = shift; die "Missing xbus label parameter" unless defined $label; - my @xbuses = Zaptel::Xpp::xbuses(); + my @xbuses = Dahdi::Xpp::xbuses(); my ($xbus) = grep { $_->label eq $label } @xbuses; return $xbus; @@ -79,7 +79,7 @@ sub new($$) { } @{$self->{XPDS}} = (); foreach my $dir (glob "$prefix/XPD-??") { - my $xpd = Zaptel::Xpp::Xpd->new($self, $dir); + my $xpd = Dahdi::Xpp::Xpd->new($self, $dir); push(@{$self->{XPDS}}, $xpd); } @{$self->{XPDS}} = sort { $a->id <=> $b->id } @{$self->{XPDS}}; diff --git a/xpp/perl_modules/Zaptel/Xpp/Xpd.pm b/xpp/perl_modules/Dahdi/Xpp/Xpd.pm index 5087f1f..9e22ed2 100644 --- a/xpp/perl_modules/Zaptel/Xpp/Xpd.pm +++ b/xpp/perl_modules/Dahdi/Xpp/Xpd.pm @@ -1,4 +1,4 @@ -package Zaptel::Xpp::Xpd; +package Dahdi::Xpp::Xpd; # # Written by Oron Peled <oron@actcom.co.il> # Copyright (C) 2007, Xorcom @@ -8,9 +8,9 @@ package Zaptel::Xpp::Xpd; # $Id$ # use strict; -use Zaptel::Utils; -use Zaptel::Xpp; -use Zaptel::Xpp::Line; +use Dahdi::Utils; +use Dahdi::Xpp; +use Dahdi::Xpp::Line; my $proc_base = "/proc/xpp"; @@ -67,7 +67,7 @@ sub dahdi_registration($$) { } sub xpds_by_spanno() { - my @xbuses = Zaptel::Xpp::xbuses("SORT_CONNECTOR"); + my @xbuses = Dahdi::Xpp::xbuses("SORT_CONNECTOR"); my @xpds = map { $_->xpds } @xbuses; @xpds = grep { $_->spanno } @xpds; @xpds = sort { $a->spanno <=> $b->spanno } @xpds; @@ -116,7 +116,7 @@ sub new($$) { $self->{IS_BRI} = ($type =~ /BRI_(NT|TE)/); $self->{IS_PRI} = ($type =~ /[ETJ]1_(NT|TE)/); $self->{IS_DIGITAL} = ( $self->{IS_BRI} || $self->{IS_PRI} ); - Zaptel::Xpp::Line->create_all($self, $procdir); + Dahdi::Xpp::Line->create_all($self, $procdir); return $self; } |