summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xpp/Makefile47
-rwxr-xr-xxpp/astribank_hook57
-rwxr-xr-xxpp/dahdi_drivers6
-rwxr-xr-xxpp/dahdi_genconf124
-rwxr-xr-xxpp/dahdi_hardware32
-rwxr-xr-xxpp/dahdi_registration24
-rwxr-xr-xxpp/genzaptelconf108
-rw-r--r--xpp/genzaptelconf.840
-rwxr-xr-xxpp/lsdahdi22
-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
-rw-r--r--xpp/print_modes.c33
-rw-r--r--xpp/xpp.rules4
-rwxr-xr-xxpp/xpp_blink26
-rw-r--r--xpp/xpp_fxloader4
-rw-r--r--xpp/xpp_modprobe2
-rwxr-xr-xxpp/xpp_sync36
27 files changed, 346 insertions, 452 deletions
diff --git a/xpp/Makefile b/xpp/Makefile
index 2e3624c..81a14c0 100644
--- a/xpp/Makefile
+++ b/xpp/Makefile
@@ -10,10 +10,10 @@ INSTALL_DATA = install -m 644
#
# These variables should be passed to us. But until then...
#
-ZAPTEL_DIR ?= $(shell if [ -f "../../zaptel.h" ]; then echo "../.."; else echo "../../.."; fi)
-ZAP_KERNEL ?= $(shell if [ -d "$(ZAPTEL_DIR)/kernel" ]; then echo "$(ZAPTEL_DIR)/kernel"; else echo "$(ZAPTEL_DIR)"; fi)
+DAHDI_TOOLSDIR ?= ..
+DAHDI_KERNELDIR =
--include $(ZAPTEL_DIR)/makeopts
+include $(DAHDI_TOOLSDIR)/makeopts
INSTALL_DATA = $(INSTALL) -m 644
@@ -26,50 +26,43 @@ INSTALL ?= install
INSTALL_DATA = $(INSTALL) -m 644
SBINDIR = $(prefix)/sbin
-DATADIR = $(datadir)/zaptel
+DATADIR = $(datadir)/dahdi
MANDIR = $(mandir)/man8
HOTPLUG_USB_DIR = /etc/hotplug/usb
UDEV_RULES_DIR = /etc/udev/rules.d
PERLLIBDIR := $(shell eval `perl -V:sitelib`; echo "$$sitelib")
-PERL_DIRS := $(shell cd zconf; find * -name '[A-Z]*' -type d| xargs)
+PERL_DIRS := $(shell cd perl_modules; find * -name '[A-Z]*' -type d| xargs)
PERL_MODS_PAT := *.pm $(PERL_DIRS:%=%/*.pm)
-PERL_MODS := $(shell cd zconf; echo $(PERL_MODS_PAT))
+PERL_MODS := $(shell cd perl_modules; echo $(PERL_MODS_PAT))
XPD_FIRMWARE = $(wildcard ../firmwares/*.hex)
-XPD_INIT_DATA = $(XPD_FIRMWARE) init_fxo_modes
+XPD_INIT_DATA = $(XPD_FIRMWARE)
XPD_INIT = $(wildcard ../init_card_?_*) xpp_fxloader
# Variables that should be defined above, but need sane defaults:
# FIXME: Are those values really sane?
HOSTCC ?= $(CC)
-ifeq (,$(PBX_LIBUSB))
-# No PBX_LIBUSB? Maybe we compile against zaptel-1.2
-# Let's make a poor man detection of libusb
-PBX_LIBUSB = $(shell if [ -r /usr/include/usb.h ]; then echo 1; else echo 0; fi)
-endif
-
-WCTDM=$(shell for i in $(ZAP_KERNEL)/wctdm.c $(ZAP_KERNEL)/fxo_modes.h; do [ -f "$$i" ] && echo "$$i"; done)
CFLAGS = -g -Wall $(EXTRA_CFLAGS)
%.8: %
pod2man --section 8 $^ > $@ || $(RM) $@
PERL_SCRIPTS = \
- zt_registration \
+ dahdi_registration \
xpp_sync \
- lszaptel \
+ lsdahdi \
xpp_blink \
- zapconf \
- zaptel_hardware \
+ dahdi_genconf \
+ dahdi_hardware \
#
PERL_MANS = $(PERL_SCRIPTS:%=%.8)
-TARGETS = init_fxo_modes print_modes perlcheck
+TARGETS = perlcheck
PROG_INSTALL = genzaptelconf
MAN_INSTALL = $(PROG_INSTALL:%=%.8)
-ifeq (1,$(PBX_LIBUSB))
+ifeq (1,$(PBX_USB))
TARGETS += libhexfile.a fpga_load test_parse
PROG_INSTALL += fpga_load
endif
@@ -104,7 +97,7 @@ ifneq (,$(PERLLIBDIR))
done
for i in $(PERL_MODS); \
do \
- $(INSTALL_DATA) "zconf/$$i" "$(DESTDIR)$(PERLLIBDIR)/$$i"; \
+ $(INSTALL_DATA) "perl_modules/$$i" "$(DESTDIR)$(PERLLIBDIR)/$$i"; \
done
endif
@@ -126,18 +119,8 @@ test_parse.o: test_parse.c hexfile.h
test_parse: test_parse.o libhexfile.a
$(CC) -L. -o $@ $@.o $(EXTRA_LIBS) -lhexfile -lusb
-print_modes: print_modes.c wctdm_fxomodes.h
- $(HOSTCC) -o $@ $(CFLAGS) $<
-
-wctdm_fxomodes.h: $(WCTDM)
- @echo Building FXO modes from: $(WCTDM)
- perl -n -e 'print if (/^static struct fxo_mode {$$/ .. /};$$/)' $(WCTDM) >$@ || rm -f $@
-
-init_fxo_modes: print_modes
- ./$< >$@
-
perlcheck: $(PERL_SCRIPTS)
- for i in $^; do perl -I./zconf -c $$i || exit 1; done
+ for i in $^; do perl -I./perl_modules -c $$i || exit 1; done
touch $@
clean:
diff --git a/xpp/astribank_hook b/xpp/astribank_hook
deleted file mode 100755
index 8dd13c9..0000000
--- a/xpp/astribank_hook
+++ /dev/null
@@ -1,57 +0,0 @@
-#! /bin/sh
-
-# This is an example of an Astribank device hook. The xpp.rules file
-# calls /usr/share/zaptel/astribank_hook after a new Astribank is ready
-# and after and old Astribank device has been destroyed.
-#
-
-set -e
-
-me=`basename $0`
-INIT_DIR=`dirname $0`
-XPP_BASE=/proc/xpp
-export XPP_BASE
-LOGGER="logger -s -t $me"
-
-ZAPTEL_BOOT_DEBIAN=${ZAPTEL_BOOT_DEBIAN:-/etc/default/zaptel}
-ZAPTEL_BOOT_FEDORA=${ZAPTEL_BOOT_FEDORA:-/etc/sysconfig/zaptel}
-
-# read default configuration from /etc/default/zaptel
-if [ -r $ZAPTEL_BOOT_DEBIAN ]; then . $ZAPTEL_BOOT_DEBIAN; fi
-if [ -r $ZAPTEL_BOOT_FEDORA ]; then . $ZAPTEL_BOOT_FEDORA; fi
-
-if [ "$ASTRIBANK_HOOK_DISABLED" != '' ]; then
- $LOGGER -p kern.info "Exiting... ASTRIBANK_HOOK_DISABLED"
- exit 0
-fi
-
-# Always redirect stderr somewhere, otherwise the shell script will die
-# when it tries to do I/O related stuff on closed file descriptor.
-# Our default is to throw it down the bit-bucket.
-#exec 2> /dev/console
-## If you wish to trace this script:
-#exec 2> "/tmp/astribank_hook_$XBUS_NAME"
-
-# Maybe add some logging
-#$LOGGER -p kern.info "$0: $ACTION: $*."
-
-case "$ACTION" in
-add)
- # An Astribank was added and is initialized and ready.
- # Put your shell commands bellow
- :
- ;;
-remove)
- # An Astribank was Removed.
- # Put your shell commands bellow
- # You should not access /proc/xpp/... or run related utilities
- # like xpp_sync, since this is likely to cause very bad race
- # conditions during driver removal.
- :
- ;;
-*)
- ;;
-esac
-
-# Maybe add some logging
-#$LOGGER -p kern.info "$0: Done: $ACTION: $*."
diff --git a/xpp/dahdi_drivers b/xpp/dahdi_drivers
index d7904c0..add8374 100755
--- a/xpp/dahdi_drivers
+++ b/xpp/dahdi_drivers
@@ -1,9 +1,9 @@
#! /usr/bin/perl -w
use strict;
use File::Basename;
-BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/zconf"); }
+BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/perl_modules"); }
-use Zaptel::Hardware;
+use Dahdi::Hardware;
-my $hardware = Zaptel::Hardware->scan;
+my $hardware = Dahdi::Hardware->scan;
print join("\n", $hardware->drivers),"\n";
diff --git a/xpp/dahdi_genconf b/xpp/dahdi_genconf
index 7f94f6b..83fd0d4 100755
--- a/xpp/dahdi_genconf
+++ b/xpp/dahdi_genconf
@@ -9,11 +9,11 @@
#
use strict;
use File::Basename;
-BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/zconf"); }
+BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/perl_modules"); }
-use Zaptel;
-use Zaptel::Xpp;
-use Zaptel::Config::Defaults;
+use Dahdi;
+use Dahdi::Xpp;
+use Dahdi::Config::Defaults;
my %default_context = (
FXO => 'from-pstn',
@@ -47,14 +47,14 @@ my %default_group = (
my $fxs_default_start = 'ls';
-my %default_zaptel_signalling = (
+my %default_dahdi_signalling = (
FXO => 'fxsks',
FXS => "fxo{fxs_default_start}",
IN => "fxo{fxs_default_start}",
OUT => "fxo{fxs_default_start}",
);
-my %default_zapata_signalling = (
+my %default_chan_dahdi_signalling = (
FXO => 'fxs_ks',
FXS => "fxo_{fxs_default_start}",
IN => "fxo_{fxs_default_start}",
@@ -69,7 +69,7 @@ my $defaultzone = $lc_country;
my $bri_sig_style = 'bri_ptmp';
my $brint_overlap = 'no';
-my %zaptel_default_vars = (
+my %dahdi_default_vars = (
base_exten => \$base_exten,
fxs_immediate => \$fxs_immediate,
fxs_default_start => \$fxs_default_start,
@@ -87,15 +87,15 @@ my %zaptel_default_vars = (
\$default_group{OUT},
],
group_lines => \$default_group{FXO},
- ZAPBRI_SIGNALLING => \$bri_sig_style,
+ DAHDI_BRI_SIGNALLING => \$bri_sig_style,
brint_overlap => \$brint_overlap,
);
-sub map_zaptel_defaults {
+sub map_dahdi_defaults {
my %defaults = @_;
foreach my $name (keys %defaults) {
my $val = $defaults{$name};
- my $ref = $zaptel_default_vars{$name};
+ my $ref = $dahdi_default_vars{$name};
my $type = ref $ref;
my @vars = ();
# Some broken shells (msh) export even variables
@@ -115,21 +115,21 @@ sub map_zaptel_defaults {
}
-my $zapconf_file;
-my $zapatachannels_file;
+my $dahdiconf_file;
+my $chan_dahdi_channels_file;
my $users_file;
-my $zapataconf_file;
+my $chan_dahdi_conf_file;
my %files = (
- zaptel => { file => \$zapconf_file, func => \&gen_zaptelconf },
- zapata => { file => \$zapatachannels_file, func => \&gen_zapatachannelsconf },
+ dahdi => { file => \$dahdiconf_file, func => \&gen_dahdiconf },
+ chan_dahdi => { file => \$chan_dahdi_channels_file, func => \&gen_chan_dahdi_channelsconf },
users => { file => \$users_file, func => \&gen_usersconf },
- zapataconf => { file => \$zapataconf_file, func => \&gen_zapataconf },
+ chan_dahdi_full => { file => \$chan_dahdi_conf_file, func => \&gen_chan_dahdi_conf },
);
-my @default_files = ("zaptel", "zapata");
+my @default_files = ("dahdi", "chan_dahdi");
-my @spans = Zaptel::spans();
+my @spans = Dahdi::spans();
sub bchan_range($) {
my $span = shift || die;
@@ -156,7 +156,7 @@ sub bchan_range($) {
return join(',', @range);
}
-sub gen_zaptel_signalling($) {
+sub gen_dahdi_signalling($) {
my $chan = shift || die;
my $type = $chan->type;
my $num = $chan->num;
@@ -166,7 +166,7 @@ sub gen_zaptel_signalling($) {
printf "# channel %d, %s, no module.\n", $num, $chan->fqn;
return;
}
- my $sig = $default_zaptel_signalling{$type} || die "unknown default zaptel signalling for chan $chan type $type";
+ my $sig = $default_dahdi_signalling{$type} || die "unknown default dahdi signalling for chan $chan type $type";
if ($type eq 'IN') {
printf "# astbanktype: input\n";
} elsif ($type eq 'OUT') {
@@ -177,7 +177,7 @@ sub gen_zaptel_signalling($) {
my $bri_te_last_timing = 1;
-sub gen_zaptel_digital($) {
+sub gen_dahdi_digital($) {
my $span = shift || die;
my $num = $span->num() || die;
die "Span #$num is analog" unless $span->is_digital();
@@ -206,7 +206,7 @@ sub gen_zaptel_digital($) {
printf "dchan=%d\n", $dchan->num();
}
-sub gen_zaptelconf($) {
+sub gen_dahdiconf($) {
my $file = shift || die;
rename "$file", "$file.bak"
or $! == 2 # ENOENT (No dependency on Errno.pm)
@@ -215,15 +215,15 @@ sub gen_zaptelconf($) {
my $old = select F;
printf "# Autogenerated by %s on %s -- do not hand edit\n", $0, scalar(localtime);
print <<"HEAD";
-# Zaptel Configuration File
+# Dahdi Configuration File
#
-# This file is parsed by the Zaptel Configurator, ztcfg
+# This file is parsed by the Dahdi Configurator, ztcfg
#
HEAD
foreach my $span (@spans) {
printf "# Span %d: %s %s\n", $span->num, $span->name, $span->description;
if($span->is_digital()) {
- gen_zaptel_digital($span);
+ gen_dahdi_digital($span);
} else {
foreach my $chan ($span->chans()) {
if(1 || !defined $chan->type) {
@@ -233,7 +233,7 @@ HEAD
unless defined $type;
$chan->type($type);
}
- gen_zaptel_signalling($chan);
+ gen_dahdi_signalling($chan);
}
}
print "\n";
@@ -257,7 +257,7 @@ my %DefaultConfigs = (
txgain => 0,
);
-sub reset_zapata_values {
+sub reset_chan_dahdi_values {
foreach my $arg (@_) {
if (exists $DefaultConfigs{$arg}) {
print "$arg = $DefaultConfigs{$arg}\n";
@@ -267,7 +267,7 @@ sub reset_zapata_values {
}
}
-sub gen_zapata_digital($) {
+sub gen_chan_dahdi_digital($) {
my $span = shift || die;
my $num = $span->num() || die;
die "Span #$num is analog" unless $span->is_digital();
@@ -296,23 +296,23 @@ sub gen_zapata_digital($) {
printf "switchtype = %s\n", $span->switchtype;
printf "signalling = %s\n", $sig;
printf "channel => %s\n", bchan_range($span);
- reset_zapata_values(@to_reset);
+ reset_chan_dahdi_values(@to_reset);
}
-sub gen_zapata_channel($) {
+sub gen_chan_dahdi_channel($) {
my $chan = shift || die;
my $type = $chan->type;
my $num = $chan->num;
die "channel $num type $type is not an analog channel\n" if $chan->span->is_digital();
my $exten = $base_exten + $num;
- my $sig = $default_zapata_signalling{$type};
+ my $sig = $default_chan_dahdi_signalling{$type};
my $context = $default_context{$type};
my $group = $default_group{$type};
my $callerid;
my $immediate;
return if $type eq 'EMPTY';
- die "missing default_zapata_signalling for chan #$num type $type" unless $sig;
+ die "missing default_chan_dahdi_signalling for chan #$num type $type" unless $sig;
$callerid = ($type eq 'FXO')
? 'asreceived'
: sprintf "\"Channel %d\" <%04d>", $num, $exten;
@@ -347,7 +347,7 @@ sub gen_zapata_channel($) {
print "\n";
}
-sub gen_zapatachannelsconf($) {
+sub gen_chan_dahdi_channelsconf($) {
my $file = shift || die;
rename "$file", "$file.bak"
or $! == 2 # ENOENT (No dependency on Errno.pm)
@@ -356,20 +356,20 @@ sub gen_zapatachannelsconf($) {
my $old = select F;
printf "; Autogenerated by %s on %s -- do not hand edit\n", $0, scalar(localtime);
print <<"HEAD";
-; Zaptel Channels Configurations (zapata.conf)
+; Dahdi Channels Configurations (chan_dahdi.conf)
;
-; This is not intended to be a complete zapata.conf. Rather, it is intended
-; to be #include-d by /etc/zapata.conf that will include the global settings
+; This is not intended to be a complete chan_dahdi.conf. Rather, it is intended
+; to be #include-d by /etc/asterisk/chan_dahdi.conf that will include the global settings
;
HEAD
foreach my $span (@spans) {
printf "; Span %d: %s %s\n", $span->num, $span->name, $span->description;
if($span->is_digital()) {
- gen_zapata_digital($span);
+ gen_chan_dahdi_digital($span);
} else {
foreach my $chan ($span->chans()) {
- gen_zapata_channel($chan);
+ gen_chan_dahdi_channel($chan);
}
}
print "\n";
@@ -384,10 +384,10 @@ sub gen_users_channel($) {
my $num = $chan->num;
die "channel $num type $type is not an analog channel\n" if $chan->span->is_digital();
my $exten = $base_exten + $num;
- my $sig = $default_zapata_signalling{$type};
+ my $sig = $default_chan_dahdi_signalling{$type};
my $full_name = "$type $num";
- die "missing default_zapata_signalling for chan #$num type $type" unless $sig;
+ die "missing default_chan_dahdi_signalling for chan #$num type $type" unless $sig;
print << "EOF";
[$exten]
callwaiting = yes
@@ -406,7 +406,7 @@ threewaycalling = yes
vmsecret = 1234
secret = 1234
signalling = $sig
-zapchan = $num
+dahdichan = $num
registeriax = no
registersip = no
canreinvite = no
@@ -505,7 +505,7 @@ HEAD
select $old;
}
-sub gen_zapataconf($) {
+sub gen_chan_dahdi_conf($) {
my $file = shift || die;
open(F, ">>$file") || die "$0: Failed to open $file: $!\n";
my $old = select F;
@@ -514,8 +514,8 @@ sub gen_zapataconf($) {
my $current_sig = "";
for my $chan ($span->chans()) {
my $chan_num = $chan->num;
- if ($default_zapata_signalling{$chan->type} ne $current_sig) {
- $current_sig = $default_zapata_signalling{$chan->type};
+ if ($default_chan_dahdi_signalling{$chan->type} ne $current_sig) {
+ $current_sig = $default_chan_dahdi_signalling{$chan->type};
print "\nsignalling = $current_sig";
print "\nchannel => $chan_num";
} else {
@@ -531,16 +531,16 @@ sub gen_zapataconf($) {
sub set_defaults {
# Source default files
my ($default_file, %source_defaults) =
- Zaptel::Config::Defaults::source_vars(keys(%zaptel_default_vars));
- map_zaptel_defaults(%source_defaults);
+ Dahdi::Config::Defaults::source_vars(keys(%dahdi_default_vars));
+ map_dahdi_defaults(%source_defaults);
# Fixups
- foreach my $val (values %default_zaptel_signalling, values %default_zapata_signalling) {
+ foreach my $val (values %default_dahdi_signalling, values %default_chan_dahdi_signalling) {
$val =~ s/{fxs_default_start}/$fxs_default_start/g;
}
- $zapconf_file = $ENV{ZAPCONF_FILE} || "/etc/zaptel.conf";
- $zapatachannels_file = $ENV{ZAPATA_FILE} || "/etc/asterisk/zapata-channels.conf";
+ $dahdiconf_file = $ENV{DAHDI_CONF_FILE} || "/etc/dahdi.conf";
+ $chan_dahdi_channels_file = $ENV{CHAN_DAHDI_CHANNELS_FILE} || "/etc/asterisk/dahdi-channels.conf";
$users_file = $ENV{USERS_FILE} || "/etc/asterisk/users.conf";
- $zapataconf_file = $ENV{ZAPATACONF_FILE} || "/etc/asterisk/zapata.conf";
+ $chan_dahdi_conf_file = $ENV{CHAN_DAHDI_CONF_FILE} || "/etc/asterisk/chan_dahdi.conf";
}
sub parse_args {
@@ -565,39 +565,39 @@ __END__
=head1 NAME
-zapconf - Generate configuration for zaptel channels.
+dahdi_genconf - Generate configuration for dahdi channels.
=head1 SYNOPSIS
-zapconf [FILES...]
+dahdi_genconf [FILES...]
=head1 DESCRIPTION
-This script generate configuration files for Zaptel hardware.
-Currently it can generate three files: zaptel, zapata, users and zapataconf (see below).
-Without arguments, it generates only zaptel and zapata.
+This script generate configuration files for Dahdi hardware.
+Currently it can generate three files: dahdi, chan_dahdi, users and chan_dahdi_full (see below).
+Without arguments, it generates only dahdi and chan_dahdi.
=over 4
-=item zaptel - /etc/zaptel.conf
+=item dahdi - /etc/dahdi.conf
Configuration for ztcfg(1). It's location may be overriden by the
-environment variable ZAPCONF_FILE.
+environment variable DAHDI_CONF_FILE.
-=item zapata - /etc/asterisk/zapata-channels.conf
+=item chan_dahdi - /etc/asterisk/dahdi-channels.conf
-Configuration for asterisk(1). It should be included in the main /etc/asterisk/zapata.conf.
-It's location may be overriden by the environment variable ZAPATA_FILE.
+Configuration for asterisk(1). It should be included in the main /etc/asterisk/chan_dahdi.conf.
+It's location may be overriden by the environment variable CHAN_DAHDI_CHANNELS_FILE.
=item users - /etc/asterisk/users.conf
Configuration for asterisk(1) and AsteriskGUI.
It's location may be overriden by the environment variable USERS_FILE.
-=item zapataconf - /etc/asterisk/zapata.conf
+=item chan_dahdi_full - /etc/asterisk/chan_dahdi.conf
Configuration for asterisk(1) and AsteriskGUI.
-It's location may be overriden by the environment variable ZAPATACONF_FILE.
+It's location may be overriden by the environment variable CHAN_DAHDI_CONF_FILE.
=back
diff --git a/xpp/dahdi_hardware b/xpp/dahdi_hardware
index 004a44b..d869f32 100755
--- a/xpp/dahdi_hardware
+++ b/xpp/dahdi_hardware
@@ -10,13 +10,13 @@
use strict;
use File::Basename;
use Getopt::Std;
-BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/zconf"); }
+BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/perl_modules"); }
-use Zaptel;
-use Zaptel::Span;
-use Zaptel::Xpp;
-use Zaptel::Xpp::Xbus;
-use Zaptel::Hardware;
+use Dahdi;
+use Dahdi::Span;
+use Dahdi::Xpp;
+use Dahdi::Xpp::Xbus;
+use Dahdi::Hardware;
sub usage {
die "Usage: $0 [-v][-x]\n";
@@ -26,8 +26,8 @@ our ($opt_v, $opt_x);
getopts('vx') || usage;
@ARGV == 0 or usage;
-my $hardware = Zaptel::Hardware->scan;
-my @spans = Zaptel::spans;
+my $hardware = Dahdi::Hardware->scan;
+my @spans = Dahdi::spans;
sub show_xbus($) {
my $xbus = shift or die;
@@ -47,7 +47,7 @@ sub show_xbus($) {
}
my $master = '';
#$master = "XPP-SYNC" if $xpd->is_sync_master;
- $master .= " ZAPTEL-SYNC" if defined($span) && $span->is_zaptel_sync_master;
+ $master .= " DAHDI-SYNC" if defined($span) && $span->is_dahdi_sync_master;
printf "\t%-10s: %-8s %s %s\n", $xpd->fqn, $xpd->type, $spanstr, $master;
}
}
@@ -59,7 +59,7 @@ sub show_disconnected(%) {
my %seen = @_;
my $notified_lost = 0;
- foreach my $xbus (Zaptel::Xpp::xbuses('SORT_CONNECTOR')) {
+ foreach my $xbus (Dahdi::Xpp::xbuses('SORT_CONNECTOR')) {
if(!$seen{$xbus->name}) {
print "----------- XPP Spans with disconnected hardware -----------\n"
unless $notified_lost++;
@@ -95,11 +95,11 @@ __END__
=head1 NAME
-zaptel_hardware - Shows Zaptel hardware devices.
+dahdi_hardware - Shows Dahdi hardware devices.
=head1 SYNOPSIS
-zaptel_hardware [-v][-x]
+dahdi_hardware [-v][-x]
=head1 OPTIONS
@@ -118,9 +118,9 @@ Show disconnected Astribank unit, if any.
=head1 DESCRIPTION
-Show all zaptel hardware devices. Devices are recognized according to
-lists of PCI and USB IDs in Zaptel::Hardware::PCI.pm and
-Zaptel::Hardware::USB.pm . For PCI it is possible to detect by
+Show all dahdi hardware devices. Devices are recognized according to
+lists of PCI and USB IDs in Dahdi::Hardware::PCI.pm and
+Dahdi::Hardware::USB.pm . For PCI it is possible to detect by
sub-vendor and sub-product ID as well.
The first output column is the connector: a bus specific field that
@@ -130,7 +130,7 @@ The second field shows which driver should handle the device. a "-" sign
marks that the device is not yet handled by this driver. A "+" sign
means that the device is handled by the driver.
-For the Xorcom Astribank (and in the future: for other Zaptel devices)
+For the Xorcom Astribank (and in the future: for other Dahdi devices)
some further information is provided from the driver. Those extra lines
always begin with spaces.
diff --git a/xpp/dahdi_registration b/xpp/dahdi_registration
index 831f048..44352ab 100755
--- a/xpp/dahdi_registration
+++ b/xpp/dahdi_registration
@@ -9,12 +9,12 @@
#
use strict;
use File::Basename;
-BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/zconf"); }
+BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/perl_modules"); }
-use Zaptel;
-use Zaptel::Span;
-use Zaptel::Xpp;
-use Zaptel::Xpp::Xbus;
+use Dahdi;
+use Dahdi::Span;
+use Dahdi::Xpp;
+use Dahdi::Xpp::Xbus;
sub usage {
die "Usage: $0 [on|off|1|0]\n";
@@ -40,9 +40,9 @@ sub myprintf {
printf @_ if $should_output;
}
-my @spans = Zaptel::spans;
+my @spans = Dahdi::spans;
-foreach my $xbus (Zaptel::Xpp::xbuses('SORT_CONNECTOR')) {
+foreach my $xbus (Dahdi::Xpp::xbuses('SORT_CONNECTOR')) {
myprintf "%-10s\t%s\t%s\n", $xbus->name, $xbus->label, $xbus->connector;
next unless $xbus->status eq 'CONNECTED';
foreach my $xpd ($xbus->xpds()) {
@@ -66,7 +66,7 @@ __END__
=head1 NAME
-dahdi_registration - Handle registration of Xorcom XPD modules in zaptel.
+dahdi_registration - Handle registration of Xorcom XPD modules in dahdi.
=head1 SYNOPSIS
@@ -75,20 +75,20 @@ dahdi_registration [on|off]
=head1 DESCRIPTION
Without parameters, show all connected XPDs sorted by physical connector order.
-Each one is show to be unregistered (off), or registered to a specific zaptel
+Each one is show to be unregistered (off), or registered to a specific dahdi
span (the span number is shown).
All registerations/deregisterations are sorted by physical connector string.
Span registration should generally always succeed. Span unregistration may
fail if channels from the span are in use by e.g. asterisk. In such a case
-you'll also see those channels as '(In use)' in the output of lszaptel(8).
+you'll also see those channels as '(In use)' in the output of lsdahdi(8).
=head2 Parameters
-off -- deregisters all XPD's from zaptel.
+off -- deregisters all XPD's from dahdi.
-on -- registers all XPD's to zaptel.
+on -- registers all XPD's to dahdi.
=head2 Sample Output
diff --git a/xpp/genzaptelconf b/xpp/genzaptelconf
index 163f595..023bd73 100755
--- a/xpp/genzaptelconf
+++ b/xpp/genzaptelconf
@@ -1,7 +1,7 @@
#! /bin/bash
# genzaptelconf: generate as smartly as you can:
-# /etc/zaptel.conf
+# /etc/dahdi.conf
# /etc/asterisk/zapata-channels.conf (to be #include-d into zapata.conf)
# update:
# With '-M' /etc/modules (list of modules to load)
@@ -56,7 +56,7 @@ group_lines=0 # group for lines
# Set fxs_immediate to 'yes' to make all FXS lines answer immediately.
fxs_immediate=no
-ZAPCONF_FILE=${ZAPCONF_FILE:-/etc/zaptel.conf}
+ZAPCONF_FILE=${ZAPCONF_FILE:-/etc/dahdi.conf}
ZAPCONF_FILE_SYSTEM=$ZAPCONF_FILE
ZAPATA_FILE=${ZAPATA_FILE:-/etc/asterisk/zapata-channels.conf}
ZAPSCAN_FILE=${ZAPSCAN_FILE:-/etc/asterisk/zapscan.conf}
@@ -121,7 +121,7 @@ if [ ! -x "$ZTCFG" ]; then
if [ -x /usr/sbin/ztcfg ]; then
ZTCFG=/usr/sbin/ztcfg
else
- echo >&2 "ztcfg is not on found, do you have zaptel properly installed?"
+ echo >&2 "ztcfg is not on found, do you have dahdi properly installed?"
exit_cleanup 1
fi
fi
@@ -178,9 +178,9 @@ exit_cleanup() {
# Wait for udev to generate /dev/zap/ctl, if needed:
wait_for_zapctl() {
- # if device file already exists, or if zaptel has failed to load:
+ # if device file already exists, or if dahdi has failed to load:
# no point waiting.
- if [ -c /dev/zap/ctl ] || ! grep -q zaptel /proc/modules ; then
+ if [ -c /dev/zap/ctl ] || ! grep -q dahdi /proc/modules ; then
return
fi
say "Waiting for /dev/zap/ctl to be generated"
@@ -227,7 +227,7 @@ update_module_list_debian() {
}
update_module_list_fedora() {
- say "Updating modules list in zaptel init config $MODLIST_FILE_FEDORA."
+ say "Updating modules list in dahdi init config $MODLIST_FILE_FEDORA."
sed -i.bak -e "/^$modules_var=/d" "$MODLIST_FILE_FEDORA"
echo "$modules_var=\"$*\"" >> "$MODLIST_FILE_FEDORA"
}
@@ -251,10 +251,10 @@ zap_reg_xpp() {
# the USB connector. That order is rather arbitrary, but will not
# change without changes to the cabling.
xbusses=`sed -e '/STATUS=connected/!d' -e 's/ *STATUS=.*//' -e 's/ *CONNECTOR=//' /proc/xpp/xbuses | sort -t: -k 2 | cut -d: -f1`
- say "Zaptel registration order:"
+ say "Dahdi registration order:"
say "$xbusses"
- # get a list of XPDs that were not yet registered as zaptel spans.
+ # get a list of XPDs that were not yet registered as dahdi spans.
# this will be the case if you set the parameter zap_autoreg=0 to
# the module xpp
# Append /dev/null to provide a valid file name in case of an empty pattern.
@@ -289,7 +289,7 @@ xpp_startup() {
usage() {
program=`basename $0`
- echo >&2 "$program: generate zaptel.conf and zapata.conf"
+ echo >&2 "$program: generate dahdi.conf and zapata.conf"
echo >&2 "(version $VERSION, $rcsid)"
echo >&2 "usage:"
echo >&2 " $program [-sRdv] [-m k|l|g] [-c <country_code>] [-e <base_exten>] [-F]"
@@ -301,9 +301,9 @@ usage() {
echo >&2 " -c CODE: set the country code (default: $lc_country)"
echo >&2 " -e NUM: set the base extension number (default: $base_exten)"
echo >&2 " -F: Don't print FXSs in zapata.conf"
- echo >&2 " -l: output a list of detected channels instead of zaptel.conf"
+ echo >&2 " -l: output a list of detected channels instead of dahdi.conf"
echo >&2 " -d: Perform hardware detection"
- echo >&2 " -u: Unload zaptel modules (will not restart Asterisk)."
+ echo >&2 " -u: Unload dahdi modules (will not restart Asterisk)."
echo >&2 " -v: verbose"
echo >&2 " -s: Stop Asterisk before running, and start it at the end."
echo >&2 " -R: Don't restart asterisk in the end."
@@ -371,10 +371,10 @@ print_pattern() {
echo ";;; line=\"$line\"" >> $zapata_file
if [ "$astbank_type" != '' ];
- then echo "# astbanktype: $astbank_type" >>$zaptel_file;
+ then echo "# astbanktype: $astbank_type" >>$dahdi_file;
fi
- echo "${sig}$method=$chan" >>$zaptel_file
- # zap2amp will rewrite those from zaptel.conf and hints there
+ echo "${sig}$method=$chan" >>$dahdi_file
+ # zap2amp will rewrite those from dahdi.conf and hints there
if [ "$fxsdisable" = 'yes' ] && [ "$sig" = 'fxo' ]; then return; fi
echo "signalling=${sig}_$method" >>$zapata_file
@@ -476,14 +476,14 @@ print_pattern() {
}
-# the number of channels from /proc/zaptel
+# the number of channels from /proc/dahdi
# must always print a number as its output.
count_proc_zap_lines() {
- # if zaptel is not loaded there are 0 channels:
- if [ ! -d /proc/zaptel ]; then echo '0'; return; fi
+ # if dahdi is not loaded there are 0 channels:
+ if [ ! -d /proc/dahdi ]; then echo '0'; return; fi
(
- for file in `echo /proc/zaptel/* |grep -v '\*'`
+ for file in `echo /proc/dahdi/* |grep -v '\*'`
do sed -e 1,2d $file # remove the two header lines
done
) | wc -l # the total number of lines
@@ -498,7 +498,7 @@ load_modules() {
eval "args=\$$args"
# a module is worth listing if it:
# a. loaded successfully, and
- # b. added channels lines under /proc/zaptel/*
+ # b. added channels lines under /proc/dahdi/*
if /sbin/modprobe $i $args 2> /dev/null
then
check=0
@@ -545,8 +545,8 @@ unload_module() {
}
unload_modules() {
- say "Unloading zaptel modules:"
- unload_module zaptel
+ say "Unloading dahdi modules:"
+ unload_module dahdi
say ''
}
@@ -574,11 +574,11 @@ detect() {
if echo $modlist | grep -q xpp_usb; then wait_for_xpp; fi
}
-# The module configuration generated by zaptel includes a totally useless
+# The module configuration generated by dahdi includes a totally useless
# automatic run of ztcfg after modules loading. As a workaround for that,
-# we provide an empty zaptel.conf temporarily.
+# we provide an empty dahdi.conf temporarily.
#
-# At hardware detection time we shouldn't really touch zaptel.conf . So we
+# At hardware detection time we shouldn't really touch dahdi.conf . So we
# must keep a copy of it somewhere.
#
# I use ZAPCONF_FILE_SYSTEM rather than ZAPCONF_FILE, as the bogus modprobe
@@ -590,15 +590,15 @@ ZAPCONF_FILE_TMP=
temporary_zapconf() {
case "$1" in
save)
- say "Temporarily moving zaptel.conf aside to work around broken modprobe.conf"
- ZAPCONF_FILE_TMP=`mktemp /tmp/genzaptelconf-zaptel.conf-XXXXXX` || die "Error creating temporary zaptel.conf"
+ say "Temporarily moving dahdi.conf aside to work around broken modprobe.conf"
+ ZAPCONF_FILE_TMP=`mktemp /tmp/genzaptelconf-dahdi.conf-XXXXXX` || die "Error creating temporary dahdi.conf"
if [ -f $ZAPCONF_FILE_SYSTEM ]; then
cp -a $ZAPCONF_FILE_SYSTEM $ZAPCONF_FILE_TMP
fi
echo -n >$ZAPCONF_FILE_SYSTEM
;;
restore)
- # restore original zaptel.conf:
+ # restore original dahdi.conf:
if [ "$ZAPCONF_FILE_TMP" = '' ]; then return; fi
mv $ZAPCONF_FILE_TMP $ZAPCONF_FILE_SYSTEM
ZAPCONF_FILE_TMP=''
@@ -652,7 +652,7 @@ gen_tmp_conf() {
fi
}
-# Extract information from one digital channel (one line in a /proc/zaptel
+# Extract information from one digital channel (one line in a /proc/dahdi
# file). Information is saved to $tmp_dir/span_foo variables.
# FIXME: detection should move to when we know the number of channels
# and hence can tell between an E1 and a T1.
@@ -786,15 +786,15 @@ write_digital_config() {
esac
case "$mode" in
files)
- echo span=$span_num,$span_timing,$span_lbo,$span_framing,$span_coding$span_yellow >> $zaptel_file
- # leave a comment in zaptel.conf that allows to tell if
+ echo span=$span_num,$span_timing,$span_lbo,$span_framing,$span_coding$span_yellow >> $dahdi_file
+ # leave a comment in dahdi.conf that allows to tell if
# this span is TE or NT:
if [ "$span_termtype" != '' ]
- then echo "# termtype: $span_termtype" >>$zaptel_file
+ then echo "# termtype: $span_termtype" >>$dahdi_file
fi
- echo bchan=$bchans >>$zaptel_file
- echo dchan=$dchan >>$zaptel_file
+ echo bchan=$bchans >>$dahdi_file
+ echo dchan=$dchan >>$dahdi_file
if [ "$fxsdisable" = 'yes' ] && [ "$span_termtype" = 'nt' ]; then return; fi
# You should not send content to zapata.conf below this line
@@ -857,13 +857,13 @@ genconf() {
local mode=$1
local reset_values=""
-# spanlist=`echo /proc/zaptel/* | grep -v '\*'`
-# spanlist=$(for i in `for i in /proc/zaptel/*; do if [ -f $i ]; then echo $i | cut -f 4 -d / ; fi; done | sort -n`; do echo -n "/proc/zaptel/$i "; done)
-# spanlist=(cd /proc/zaptel; ls | sort -n | sed 's|^|/proc/zaptel/|')
- spanlist=`ls /proc/zaptel/ 2>/dev/null | sort -n | sed 's|^|/proc/zaptel/|'`
+# spanlist=`echo /proc/dahdi/* | grep -v '\*'`
+# spanlist=$(for i in `for i in /proc/dahdi/*; do if [ -f $i ]; then echo $i | cut -f 4 -d / ; fi; done | sort -n`; do echo -n "/proc/dahdi/$i "; done)
+# spanlist=(cd /proc/dahdi; ls | sort -n | sed 's|^|/proc/dahdi/|')
+ spanlist=`ls /proc/dahdi/ 2>/dev/null | sort -n | sed 's|^|/proc/dahdi/|'`
#if [ "$spanlist" == "" ]; then
- # die "No zapata interfaces in /proc/zaptel"
+ # die "No zapata interfaces in /proc/dahdi"
#fi
@@ -872,20 +872,20 @@ genconf() {
if [ "$do_gen_zapscan" = 'yes' ]; then
gen_tmp_conf "$ZAPSCAN_FILE" zapscan_file
cat <<EOF >$zapscan_file
-; zapscan.conf: information about detected zaptel channels
+; zapscan.conf: information about detected dahdi channels
; (currently: analog only)
;
; Automatically generated by $0 -- Please do not edit.
EOF
fi
- gen_tmp_conf "$ZAPTEL_FILE" zaptel_file
+ gen_tmp_conf "$ZAPTEL_FILE" dahdi_file
gen_tmp_conf "$ZAPATA_FILE" zapata_file
- cat <<EOF >$zaptel_file
+ cat <<EOF >$dahdi_file
# Autogenerated by $0 -- do not hand edit
-# Zaptel Configuration File
+# Dahdi Configuration File
#
-# This file is parsed by the Zaptel Configurator, ztcfg
+# This file is parsed by the Dahdi Configurator, ztcfg
#
# It must be in the module loading order
@@ -893,7 +893,7 @@ EOF
EOF
cat <<EOF >$zapata_file
; Autogenerated by $0 -- do not hand edit
-; Zaptel Channels Configurations (zapata.conf)
+; Dahdi Channels Configurations (zapata.conf)
;
; This is not intended to be a complete zapata.conf. Rather, it is intended
; to be #include-d by /etc/zapata.conf that will include the global settings
@@ -913,7 +913,7 @@ EOF
# Another problem with such an approach is how to include an existing
# configuration file. For instance: how to include some default settings.
#
- # Maybe an 'include' directive should be added to zaptel.conf ?
+ # Maybe an 'include' directive should be added to dahdi.conf ?
#cat $spanlist |
for procfile in $spanlist
do
@@ -925,8 +925,8 @@ EOF
case "$mode" in
list) echo "### $title";;
files)
- echo "" >>$zaptel_file
- echo "# $title" >>$zaptel_file
+ echo "" >>$dahdi_file
+ echo "# $title" >>$dahdi_file
echo "" >>$zapata_file
echo "; $title" >>$zapata_file
;;
@@ -975,7 +975,7 @@ EOF
# print nothing here.
case "$mode" in
list) echo "# channel $chan_num, WCTDM, no module.";;
- files) echo "# channel $chan_num, WCTDM, no module." >> $zaptel_file;;
+ files) echo "# channel $chan_num, WCTDM, no module." >> $dahdi_file;;
esac
continue
fi
@@ -986,7 +986,7 @@ EOF
*WCFXO/*)
# X100P
print_pattern $chan_num fxs $mode || \
- echo "# channel $chan_num, WCFXO, inactive." >>$zaptel_file
+ echo "# channel $chan_num, WCFXO, inactive." >>$dahdi_file
;;
*WCUSB/*)
print_pattern $chan_num fxo $mode
@@ -1030,7 +1030,7 @@ EOF
case "$mode" in
list) echo "# ??: $line";;
files)
- echo "# ??: $line" >>$zaptel_file
+ echo "# ??: $line" >>$dahdi_file
echo "; ??: $line" >>$zapata_file
esac
;;
@@ -1043,7 +1043,7 @@ EOF
if [ "$mode" = 'files' ]
then
- cat <<EOF >> ${zaptel_file}
+ cat <<EOF >> ${dahdi_file}
# Global data
@@ -1054,7 +1054,7 @@ EOF
if [ "$mode" = 'files' ]; then
mv ${ZAPCONF_FILE} ${ZAPCONF_FILE}.bak 2>/dev/null
- mv $zaptel_file ${ZAPCONF_FILE}
+ mv $dahdi_file ${ZAPCONF_FILE}
mv ${ZAPATA_FILE} ${ZAPATA_FILE}.bak 2>/dev/nullk
mv $zapata_file ${ZAPATA_FILE}
if [ "$do_gen_zapscan" = 'yes' ]; then
@@ -1105,7 +1105,7 @@ tmp_dir=`mktemp -d /tmp/genzaptelconf-dir-XXXXXX` || \
case "$lc_country" in
- # the list was generated from the source of zaptel:
+ # the list was generated from the source of dahdi:
#grep '{.*[0-9]\+,.*"[a-z][a-z]"' zonedata.c | cut -d'"' -f 2 | xargs |tr ' ' '|'
us|au|fr|nl|uk|fi|es|jp|no|at|nz|it|gr|tw|cl|se|be|sg|il|br|hu|lt|pl|za|pt|ee|mx|in|de|ch|dk|cz|cn):;;
*)
@@ -1150,7 +1150,7 @@ if [ "$zapconf_use_perl" = yes ]; then
#redefine genconf to use perl utilities:
genconf() {
case "$1" in
- list) zaptel_hardware ;;
+ list) dahdi_hardware ;;
files) zapconf ;;
esac
}
diff --git a/xpp/genzaptelconf.8 b/xpp/genzaptelconf.8
index c3f6f73..0725b6a 100644
--- a/xpp/genzaptelconf.8
+++ b/xpp/genzaptelconf.8
@@ -1,7 +1,7 @@
.TH GENZAPTELCONF 8 "July 18th, 2005" "Xorcom Rapid Asterisk" "Linux Programmer's Manual"
.SH "NAME"
.B genzaptelconf
--- generates zaptel configuration (TDM adaptors)
+-- generates dahdi configuration (TDM adaptors)
.SH SYNOPSIS
.PP
.B genzaptelconf
@@ -11,16 +11,16 @@
[-sRdv] -l -- only list to standard output
.B genzaptelconf
--su -- only unload zaptel modules
+-su -- only unload dahdi modules
.B genzaptelconf
-h -- Help screen
.SH DESCRIPTION
.B genzaptelconf
-is a script to detect zaptel devices (currently mostly TDM cards are
+is a script to detect dahdi devices (currently mostly TDM cards are
supported). It generates both
-.I /etc/zaptel.conf
+.I /etc/dahdi.conf
and
.I /etc/asterisk/zapata-channels.conf
@@ -36,7 +36,7 @@ configiration is a default that I only hope is sane. Looking for feedback
.RS
A two-letter country code. Sets the country-code for the zonezone
entries in
-.I zaptel.conf
+.I dahdi.conf
, The default is the value of
.I lc_country
from
@@ -46,7 +46,7 @@ and failing that, "us".
.B -d
.RS
-Also try to detect modules. Unloads all zaptel modules and loads them
+Also try to detect modules. Unloads all dahdi modules and loads them
one by one. Considers a module useful if it loaded successfully and if
loading it has generated at least one zapata channel.
@@ -109,7 +109,7 @@ Don't restart asterisk even if it was stopped using
.B -s
.RS
Stop asterisk for the duration of the test. The detection will only
-work if nobody uses the zaptel channels:
+work if nobody uses the dahdi channels:
* To allow unloading of modules
@@ -124,7 +124,7 @@ try to start it after the end of the test.
Be verbose. lists the detected modules if
.I -d
is used. Lists detected channls. In the end tries to connect to asterisk
-to get a list of configured zaptel channels.
+to get a list of configured dahdi channels.
.RE
.B -z
@@ -174,12 +174,12 @@ If set to 'yes', no context changes are made in zapata-channels.conf
.I context_lines
.RS
-The context into which calls will go from zaptel trunks.
+The context into which calls will go from dahdi trunks.
.RE
.I context_phones
.RS
-The context into which calls will go from zaptel phones.
+The context into which calls will go from dahdi phones.
.RE
.I context_manual
@@ -189,12 +189,12 @@ If set to 'yes', no group settings are made in zapata-channels.conf
.I group_lines
.RS
-The group number for zaptel trunks.
+The group number for dahdi trunks.
.RE
.I group_phones
.RS
-The group number for zaptel phones.
+The group number for dahdi phones.
.RE
.I ALL_MODULES
@@ -205,7 +205,7 @@ is the same for both.
.I ZAPCONF_FILE
.RS
-ztcfg's configuration file. The sane default is /etc/zaptel.conf .
+ztcfg's configuration file. The sane default is /etc/dahdi.conf .
.RE
.I ZAPATA_FILE
@@ -216,7 +216,7 @@ The generated partial zapata.conf snippet. Default:
.I ZAPTEL_BOOT_DEBIAN
.RS
-The Debian Zaptel defaults file. Normally
+The Debian Dahdi defaults file. Normally
.I /etc/default/zaptel
.
.RE
@@ -224,7 +224,7 @@ The Debian Zaptel defaults file. Normally
.I ZAPTEL_BOOT_FEDORA
.RS
-The Zaptel defaults file on various other distributions. Normally
+The Dahdi defaults file on various other distributions. Normally
.I /etc/sysconfig/zaptel
.
.RE
@@ -246,14 +246,14 @@ as a last resort.
.RE
.SH FILES
-.I /etc/zaptel.conf
+.I /etc/dahdi.conf
.RS
The configuration file used by
.I ztcfg
-to configure zaptel devices. re-written by
+to configure dahdi devices. re-written by
.I genzaptelconf
. A backup copy is saved to
-.I /etc/zaptel.conf.bak
+.I /etc/dahdi.conf.bak
.
.RE
@@ -287,7 +287,7 @@ configuration file that
This file holds configuration for both
.I genzaptelconf
and
-.I /etc/init.d/zaptel .
+.I /etc/init.d/dahdi .
It is sourced by both scripts and can thus be used to override settings
of variables from those scripts.
.RE
@@ -297,7 +297,7 @@ of variables from those scripts.
A debian-specific list of kernel modules to be loaded by modprobe at
boot time. When the option
.I -d
-(detect) is used, genzaptelconf will write in this file zaptel modules
+(detect) is used, genzaptelconf will write in this file dahdi modules
to be loaded. If you want to use a different file, set
.I MOD_FILELIST
. If it is rewritten, a backup copy is saved to
diff --git a/xpp/lsdahdi b/xpp/lsdahdi
index a836d98..5611ddd 100755
--- a/xpp/lsdahdi
+++ b/xpp/lsdahdi
@@ -9,18 +9,18 @@
#
use strict;
use File::Basename;
-BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/zconf"); }
+BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/perl_modules"); }
-use Zaptel;
-use Zaptel::Span;
-use Zaptel::Xpp;
-use Zaptel::Xpp::Xbus;
-use Zaptel::Xpp::Xpd;
+use Dahdi;
+use Dahdi::Span;
+use Dahdi::Xpp;
+use Dahdi::Xpp::Xbus;
+use Dahdi::Xpp::Xpd;
-my @xbuses = Zaptel::Xpp::xbuses("SORT_CONNECTOR");
+my @xbuses = Dahdi::Xpp::xbuses("SORT_CONNECTOR");
my @xpds = map { $_->xpds } @xbuses;
-foreach my $span (Zaptel::spans()) {
+foreach my $span (Dahdi::spans()) {
my $spanno = $span->num;
my $xpd = $span->xpd;
my @lines;
@@ -46,11 +46,11 @@ __END__
=head1 NAME
-lszaptel - List all zaptel channels with their types and spans.
+lsdahdi - List all dahdi channels with their types and spans.
=head1 SYNOPSIS
-lszaptel
+lsdahdi
=head1 DESCRIPTION
@@ -103,6 +103,6 @@ and the second one is the signalling (if set).
=head1 FILES
-lszaptel is a somewhat glorified 'cat /proc/zaptel/*' . Unlike that
+lsdahdi is a somewhat glorified 'cat /proc/dahdi/*' . Unlike that
command, it sorts the spans with the proper order. It also formats the
output slightly differently.
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;
}
diff --git a/xpp/print_modes.c b/xpp/print_modes.c
deleted file mode 100644
index 77e0e33..0000000
--- a/xpp/print_modes.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <stdio.h>
-
-#include "wctdm_fxomodes.h"
-
-int main() {
- size_t i;
-
- for (i=0; i<(sizeof(fxo_modes)/sizeof(struct fxo_mode)); i++) {
- if (fxo_modes[i].name == NULL) break;
- int reg16=0, reg26=0, reg30=0, reg31=0x20;
- char ring_osc[BUFSIZ]="", ring_x[BUFSIZ] = "";
-
- reg16 |= (fxo_modes[i].ohs << 6);
- reg16 |= (fxo_modes[i].rz << 1);
- reg16 |= (fxo_modes[i].rt);
-
- reg26 |= (fxo_modes[i].dcv << 6);
- reg26 |= (fxo_modes[i].mini << 4);
- reg26 |= (fxo_modes[i].ilim << 1);
-
- reg30 = (fxo_modes[i].acim);
-
- reg31 |= (fxo_modes[i].ohs2 << 3);
-
- if (fxo_modes[i].ring_osc)
- snprintf(ring_osc, BUFSIZ, "ring_osc=%04X", fxo_modes[i].ring_osc);
- if (fxo_modes[i].ring_x)
- snprintf(ring_x, BUFSIZ, "ring_x=%04X", fxo_modes[i].ring_x);
- printf("%-15s\treg16=%02X\treg26=%02X\treg30=%02X\treg31=%02X\t%s\t%s\n",
- fxo_modes[i].name, reg16, reg26, reg30, reg31, ring_osc, ring_x);
- }
- return 0;
-}
diff --git a/xpp/xpp.rules b/xpp/xpp.rules
index d3cc226..907e08a 100644
--- a/xpp/xpp.rules
+++ b/xpp/xpp.rules
@@ -4,11 +4,11 @@ KERNEL=="[0-9]*", GOTO="xpp_usb_add_end"
# Load firmware into the Xorcom Astribank device:
SYSFS{idVendor}=="e4e4", SYSFS{idProduct}=="11[345][01]", \
- RUN+="/usr/share/zaptel/xpp_fxloader udev $sysfs{idVendor}/$sysfs{idProduct}/$sysfs{bcdDevice}"
+ RUN+="/usr/share/dahdi/xpp_fxloader udev $sysfs{idVendor}/$sysfs{idProduct}/$sysfs{bcdDevice}"
LABEL="xpp_usb_add_end"
# Hotplug hook for Astribank up/down
-# By default XPP_INIT_DIR="/usr/share/zaptel"
+# By default XPP_INIT_DIR="/usr/share/dahdi"
KERNEL=="xbus*" RUN+="%E{XPP_INIT_DIR}/astribank_hook udev $kernel $sysfs{status} $sysfs{connector}"
diff --git a/xpp/xpp_blink b/xpp/xpp_blink
index 7d0d845..ff63ae7 100755
--- a/xpp/xpp_blink
+++ b/xpp/xpp_blink
@@ -9,12 +9,12 @@
#
use strict;
use File::Basename;
-BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/zconf"); }
+BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/perl_modules"); }
-use Zaptel;
-use Zaptel::Span;
-use Zaptel::Xpp;
-use Zaptel::Xpp::Xbus;
+use Dahdi;
+use Dahdi::Span;
+use Dahdi::Xpp;
+use Dahdi::Xpp::Xbus;
sub usage {
die "Usage: $0 {on|off|bzzt} {span <number> | chan <number> | xpd <bus num> [<xpd num>] | label <label>}\n";
@@ -32,9 +32,9 @@ my @channels;
if($selector =~ /^span$/i) {
my $number = shift;
usage unless defined($number) and $number =~ /^\d+/;
- my $span = Zaptel::Span::by_number($number);
+ my $span = Dahdi::Span::by_number($number);
die "Unkown Span $number\n" unless $span;
- $xpd = Zaptel::Xpp::xpd_of_span($span);
+ $xpd = Dahdi::Xpp::xpd_of_span($span);
die "Span $number is not an XPD\n" unless defined $xpd;
my $xpdname = $xpd->fqn;
my $connector = $xpd->xbus->connector;
@@ -46,7 +46,7 @@ if($selector =~ /^span$/i) {
} elsif($selector =~ /^chan$/i) {
my $channo = shift;
usage unless defined($channo) and $channo =~ /^\d+/;
- my @spans = Zaptel::spans();
+ my @spans = Dahdi::spans();
my @chans = map { $_->chans() } @spans;
my ($chan) = grep { $_->num eq $channo } @chans;
die "Channel $channo was not found\n" unless defined $chan;
@@ -58,7 +58,7 @@ if($selector =~ /^span$/i) {
my $xpdnum = shift;
my $linenum = shift;
usage unless defined($busnum) and $busnum =~ /^\d+/;
- my $xbus = Zaptel::Xpp::Xbus::by_number($busnum);
+ my $xbus = Dahdi::Xpp::Xbus::by_number($busnum);
die "Unkown XBUS number $busnum\n" unless defined $xbus;
if(defined $xpdnum) {
usage unless $xpdnum =~ /^\d+/;
@@ -80,7 +80,7 @@ if($selector =~ /^span$/i) {
} elsif($selector =~ /^label$/i) {
my $label = shift;
usage unless defined($label);
- my $xbus = Zaptel::Xpp::Xbus::by_label($label);
+ my $xbus = Dahdi::Xpp::Xbus::by_label($label);
die "Unkown XBUS label $label\n" unless defined $xbus;
@blinklist = $xbus->xpds;
die "XBUS label '$label' has no XPDS!\n" unless @blinklist;
@@ -134,14 +134,14 @@ Blink briefly for 1 second.
=item span
-Select by span number. This only work for XPD registered to zaptel.
+Select by span number. This only work for XPD registered to dahdi.
-will also print the zaptel channels of the span and the xbus/xpd this
+will also print the dahdi channels of the span and the xbus/xpd this
span represents.
=item chan
-Select by channel number. This only work for XPD registered to zaptel.
+Select by channel number. This only work for XPD registered to dahdi.
=item xpd
diff --git a/xpp/xpp_fxloader b/xpp/xpp_fxloader
index 5a26560..33afeff 100644
--- a/xpp/xpp_fxloader
+++ b/xpp/xpp_fxloader
@@ -5,7 +5,7 @@
# This script can be run manually or from hotplug/udev.
#
# Firmware files should be located in $FIRMWARE_DIR which defaults:
-# 1. /usr/share/zaptel
+# 1. /usr/share/dahdi
# 2. Can be overidden by setting $FIRMWARE_DIR in the environment
# 3. Can be overidden by setting $FIRMWARE_DIR in /etc/default/zaptel
#
@@ -77,7 +77,7 @@ USBFS_PREFIX=/proc/bus/usb
DEVUSB_PREFIX=/dev/bus/usb
USB_PREFIX=
-FIRMWARE_DIR="${FIRMWARE_DIR:-/usr/share/zaptel}"
+FIRMWARE_DIR="${FIRMWARE_DIR:-/usr/share/dahdi}"
FIRM_FXS=$FIRMWARE_DIR/FPGA_FXS.hex
diff --git a/xpp/xpp_modprobe b/xpp/xpp_modprobe
index e3bacc2..e972bc3 100644
--- a/xpp/xpp_modprobe
+++ b/xpp/xpp_modprobe
@@ -1,5 +1,5 @@
# Some debugging options for the brave of heart:
-#options zaptel debug=1
+#options dahdi debug=1
#options wcfxo debug=1
#options xpp debug=1
#options xpp_usb debug=1
diff --git a/xpp/xpp_sync b/xpp/xpp_sync
index 1438f50..59eb5f8 100755
--- a/xpp/xpp_sync
+++ b/xpp/xpp_sync
@@ -9,10 +9,10 @@
#
use strict;
use File::Basename;
-BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/zconf"); }
+BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/perl_modules"); }
-use Zaptel::Xpp;
-use Zaptel::Xpp::Xbus;
+use Dahdi::Xpp;
+use Dahdi::Xpp::Xbus;
my $sync;
my $autoselect;
@@ -22,7 +22,7 @@ sub usage() {
"$0: show / set Astribank sync source\n".
"\n".
"Usage: $0 Show sync source.\n".
- " $0 <auto|NN|zaptel> Set sync source.\n".
+ " $0 <auto|NN|dahdi> Set sync source.\n".
"";
}
@@ -39,10 +39,10 @@ if(@ARGV == 1) {
sub get_sorted_xpds() {
my @good_xpds;
- foreach my $xbus (Zaptel::Xpp::xbuses('SORT_CONNECTOR')) {
+ foreach my $xbus (Dahdi::Xpp::xbuses('SORT_CONNECTOR')) {
next unless $xbus->status eq 'CONNECTED';
foreach my $xpd ($xbus->xpds()) {
- my $isreg = $xpd->zt_registration();
+ my $isreg = $xpd->dahdi_registration();
if(!defined($isreg)) { # Failure
printf STDERR "%s: Failed %s\n", $xpd->fqn, $!;
next;
@@ -78,7 +78,7 @@ sub do_select(@) {
$busnum =~ s/XBUS-//;
die "bad bus name" unless $busnum =~ /^\d+$/;
#printf "Setting sync: %-10s (%s)\n", $xpd->fqn, $xpd->type;
- if(Zaptel::Xpp::sync($busnum)) {
+ if(Dahdi::Xpp::sync($busnum)) {
#print "SET $busnum\n";
$found = 1;
last;
@@ -90,7 +90,7 @@ sub do_select(@) {
sub do_set($) {
my $sync = shift;
- die "Failed to set sync to '$sync'" unless Zaptel::Xpp::sync($sync);
+ die "Failed to set sync to '$sync'" unless Dahdi::Xpp::sync($sync);
}
sub unique_xbus(@) {
@@ -99,7 +99,7 @@ sub unique_xbus(@) {
grep { !$seen{$_->xbus}++; } @_;
}
-my $curr_sync = Zaptel::Xpp::sync;
+my $curr_sync = Dahdi::Xpp::sync;
my @sync_xpds = unique_xbus(get_sorted_xpds());
sub show_sync() {
@@ -138,8 +138,8 @@ if($sync) {
$sync = uc($sync);
do_set($sync);
}
- $curr_sync = Zaptel::Xpp::sync;
- #print "New sync: ", Zaptel::Xpp::sync, "\n";
+ $curr_sync = Dahdi::Xpp::sync;
+ #print "New sync: ", Dahdi::Xpp::sync, "\n";
} else {
print "Current sync: ", $curr_sync, "\n";
print "Best Available Syncers:\n";
@@ -155,7 +155,7 @@ xpp_sync - Handle sync selection of Xorcom Astribanks.
=head1 SYNOPSIS
-xpp_sync [auto|zaptel|nn]
+xpp_sync [auto|dahdi|nn]
=head1 DESCRIPTION
@@ -163,11 +163,11 @@ On a normal operation one Astribank device provides timing for all the
other Astribank devices.
When run without parameters, xpp_sync will display a list of Astribanks
-(xbuses) that are connected and registered as Zaptel spans. The current
+(xbuses) that are connected and registered as Dahdi spans. The current
xpp sync master will be marked.
If you this an Astribank is connected and yet it does not appear on the
-output of xpp_sync, it may be unregistered. Try running zt_registration .
+output of xpp_sync, it may be unregistered. Try running dahdi_registration .
=head2 Parameters
@@ -177,9 +177,9 @@ output of xpp_sync, it may be unregistered. Try running zt_registration .
Automatically selects the best Astribank for syncing.
-=item zaptel
+=item dahdi
-Gets synchronization from the Zaptel sync master.
+Gets synchronization from the Dahdi sync master.
=item nn
@@ -207,10 +207,10 @@ In this example we see that the recommended xpp sync master is XBUS-02 -
it is the first on the list. It is also the actual syncer, as we can see
from the '+' beside it.
-xpp_sync is normally called from both the zaptel init.d script and the
+xpp_sync is normally called from both the dahdi init.d script and the
the Astribank udev script. The parameter it is called with defaults to
I<auto>, but it is possible to override that parameter (e.g: set it to
-I<zaptel>) through the value of XPP_SYNC in either /etc/defualt/zaptel
+I<dahdi>) through the value of XPP_SYNC in either /etc/defualt/zaptel
or /etc/sysconfig/zaptel .
=head1 FILES