Commit Graph

240 Commits

Author SHA1 Message Date
Oron Peled 0090086bce automake: handle "make dist"
* "make distcheck" still fails

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 19:54:11 +03:00
Oron Peled f21b592f68 automake: migrate dahdi_pcap from Makefile.legacy
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 19:54:11 +03:00
Oron Peled d63812bd73 automake: migrated "--enable-dev-mode"
* Fix small compile warnings (which are now errors):
  - hdlcgen.c
  - hdlcstress.c (remove return value which isn't checked)
  - patlooptest.c

* Also added dev-mode to xpp with relevant compile fixes.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 19:54:11 +03:00
Oron Peled bf9500ab32 automake: migrate tools from Makefile.legacy
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 19:54:11 +03:00
Oron Peled 703db3bcc3 automake: handle doc/ man-pages
* Install via doc/Makefile.am
* Remove relevant code from Makefile.legacy
* For now, leave the conversion to HTML in Makefile.legacy

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 19:54:11 +03:00
Oron Peled b5b32a438f automake: xpp: remove xpp/Makefile.legacy
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 19:54:11 +03:00
Oron Peled 4cc7df1089 automake: xpp: handle /usr/share/dahdi
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 19:54:11 +03:00
Oron Peled ac6f437317 automake: xpp: handle udev rules
* Set udev installation directory to $sysconfdir/udev/rules.d
* Add definitions to xpp/Makefile.am and remove them from xpp/Makefile.legacy
* TODO: add "--with-udev-rulesdir=" for packagers (/lib/udev/rules.d)

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 19:54:11 +03:00
Oron Peled b054abb7e9 automake: xpp: man-pages and perl-scripts
* Now man-pages and perl-script are handled by xpp/Makefile.am
* Removed from xpp/Makefile.legacy
* Detect perl and set perllibdir in configure.ac
* Handle modules in their own xpp/perl_modules/Makefile.am
* Enclose perl-related stuff in conditional
* Updates for "make dist"

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 19:52:15 +03:00
Oron Peled ee83afa669 automake: handle xpp/ compilation via Makefile.am:
* Added xpp/oct612x/Makefile.am:
  - Compile octasic sources into a convenience library (static, not installed)
  - Set OCTASIC_CFLAGS in configure.ac, as they are used in two
    Makefile.am's
  - Added relevant Makefile.in and Makefile into build_tools/make_dist

* In xpp/Makefile.am:
  - Have USE_OCTASIC conditional (currently configure.ac always set it to true)

* Added PBX_USB automake conditional, so we only build our tools if
  configure'd for libusb.

* Create two convenience libraries (libastribank and libecholoader)
  Statically link them into our tools.

* Handle man-pages for the tools.

* Remove all new functionality from xpp/Makefile.legacy -- it now
  contains:
  - All perl related tools and man-pages
  - Other misc stuff (udev files, etc.)

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 17:01:55 +03:00
Oron Peled 5ac7fef4b2 automake: full ppp/ support
* Remove ppp/Makefile.legacy
* The ppp/Makefile.am includes complete functionality

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 16:31:57 +03:00
Oron Peled 6df9a492a0 automake: add basic libtool support
* Also:
  - Add libtool-related files into "make dist"
  - Update .gitignore

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 16:27:34 +03:00
Oron Peled fc620819b6 automake: add basic framwork
* Added needed boilerplate to configure.ac

* Wrap original Makefile's with automake:
  - Renamed all original Makefile -> Makefile.legacy
  - Force automake generated Makefile to call Makefile.legacy:
    Currently handle: all, install, clean, distclean, dist, docs, config
  - Note: our temporary 'dist' target conflicts with automake 'dist' target.

* Temporarily added extra dist files into build_tools/make_dist
  (until we move "make dist" functionality into automake)

* For now, we don't try to compile ppp/ as it wasn't compiled
  from the top-level Makefile before.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 16:22:10 +03:00
Oron Peled 723b3ce87f autoconf: rename "dahdi" to "dahdi-tools"
Autoconf use this name as the "PACKAGE_NAME":
 * Available as a macro to compiled code and Makefile's
 * With automake, this determines the name of the tarball
   produced in "make dist"

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 15:55:04 +03:00
Oron Peled 5fd1ce5ca0 build: remove unused "update" target from Makefile
The 'update' makefile target seems unused as it has not been
updated to use git.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 15:52:35 +03:00
Oron Peled 41532ca8a1 build: generate version.c during configure
The TOOLSVERSION was inconsistent in configure.ac and Makefile:
* Rename the second parameter to AC_INIT() into short_version
* Calculate TOOLSVERSION during configure and use it to
  generate version.c from version.c.in
* For now, leave duplicate TOOLSVERSION in Makefile (for make dist)

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 14:32:44 +03:00
Oron Peled fbb6c1a17e build: xpp -- remove legacy usb-hotplug
Hotplug is the system that predated udev. No longer supported anywhere
sane.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 14:29:20 +03:00
Oron Peled 131d694054 build: fix ppp/Makefile CFLAGS
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 14:26:53 +03:00
Oron Peled 010c4d836c build: remove unused xpp/oct612x/Makefile
* Octasic sources are built from xpp/Makefile

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 14:25:30 +03:00
Oron Peled 025b9a5593 build: remove unused build_tools/menuselect-deps.in
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 14:24:37 +03:00
Oron Peled c863d1d2c2 build: remove autoconf generated files
* Remove autoconf related files
* Add needed ones to "dist"
* Ignore config.guess, config.sub (currently they aren't used)

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-05-19 14:20:45 +03:00
Tzafrir Cohen 77730a9059 xpp_fxloader: handle empty span-type.conf
If we have /etc/dahdi/span-types.conf but it doesn't have any
line, we should avoid using the option -S to astribank_hexload.
Fix the test for this.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-03-31 22:37:10 +03:00
Tzafrir Cohen 3f55dd78de no astribank_is_starting with hotplug asterisk
Don't run the final astribank_is_starting if asterisk is hotpluggable.

Likewise, if there's no xpp_order file, waiting is pointless as the hook
can't count Astribanks.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-01-21 20:47:36 +02:00
Tzafrir Cohen 283f01bd67 astribank_hook: remove useless 'time'
* 'time' was added here for debugging and never actually needed.
* It actually causes a minor bashism issue.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-12-07 11:53:07 +02:00
Oron Peled 631d32680f xpp: waitfor_xpds: Always remove Astribank semaphore
If we waited -- no Astribanks are "in initialization"

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-11-06 13:29:19 +02:00
Oron Peled 44fe560f3b xpp/astribank_hook: remove Astribank initialization
If this is the last seen Astribank

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-11-06 13:29:19 +02:00
Oron Peled 1a78b71fac xpp: waitfor_xpds: documentation
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-11-06 13:29:19 +02:00
Oron Peled f11b937659 xpp: can use modern Asterisk hotplug support
* New asynchronous behavior is used only when two conditions are met:
  - Finding new $ASTERISK_SUPPORTS_DAHDI_HOTPLUG=yes in /etc/dahdi/init.conf
    This should be set only when Asterisk support hotplug and configured
    to use it (no_failed_channels==1).
  - DAHDI auto_assign_spans==0

* Adapt /usr/share/dahdi/astribank_hook:
  - Refactor old twinstar behavior into functions
  - Add new behavior in a function (just enable the Asrribank watchdog)
  - Call the correct function.

* Adapt init script:
  If asynchronous behavior is on, don't wait for all Astribanks to
  finish initialization (it's enough that we saw all/some of them)

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-11-06 13:29:19 +02:00
Oron Peled cd6083b6ce xpp: waitfor_xpds: assume astribank_is_starting exists
It's in the same package (dahdi-tools) for a long time

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-11-06 13:29:19 +02:00
Oron Peled 0eb77e626e xpp: waitfor_xpds: expansion error with no ABs
Fix an exansion error in case there were no Astribanks on the system.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-11-06 13:29:19 +02:00
Oron Peled 2e1c15baa3 xpp: astribank_is_starting: improve '-v' output
Do print a message if no semaphore exists. It means that either there
are no Astribanks, or existing Astribanks were already initialized.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-11-06 13:29:19 +02:00
Russ Meyerriecks 094bb2c1e8 tonezone: Fix regression in Australian tone patch
Initialize db to 1.0 instead of doing it in a few, but not all, logic contexts.

Reported-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2014-09-16 19:07:17 -05:00
Oron Peled 9aee76a3a5 xpp: revert USB "clear_halt" change and better overrides.
Why:
 * Doing "clear_halt" is normally the right thing to do on startup.
 * The original observed problem is better fixed via USB bios settings.
 * Defaulting to no "clear_halt" cause more problems on other platform
   combinations (hardware/kernel).

The change:
 * We now reverted to do "clear_halt" by default.
 * The XTALK_OPTIONS may now contain either "use-clear-halt" (the default)
   or "no-use-clear-halt" to override for debugging/testing.

Original commit: ca7c04e9cb

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-08-18 15:15:06 +03:00
Tzafrir Cohen d4537e46ce xpp: astribank_hexload: allow empty span specs
DAHDI 2.9.2 added support for -S (span specs). However if this option
was not specified, it fails to run.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-08-04 09:35:52 +03:00
Tzafrir Cohen 60401c5f49 xpp_fxloader: rename variable: default_law -> law
The variable 'default_law' was the result of a partial renaming of the
original variable 'law'. Let's keep all of them in sync.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-08-04 09:35:52 +03:00
Armen Karlozian a109763160 tonezone: Fix congestion tone for Australia
The Congestion tone in Australia must be reduced by 10 to 15 dB
at every other cadence and the frequencies for both at cadences are 425 Hz.

From: Armen Karlozian <armeniki@hotmail.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-08-01 16:04:00 -05:00
Shaun Ruffell 6c40704fec zonedata: Ensure all zones have a default DAHDI_TONE_DIALRECALL.
The default 'us' tone is most likely better than silence when Asterisk tries to
generate the recall tone on a DAHDI channel.

Internal-Issue-ID: DAHTOOL-63
Reported-By: Igor Kravets
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-08-01 15:53:48 -05:00
Russ Meyerriecks 95e9dd71d8 dahdi_cfg: Reduce mass ioctls on non-existing channels
Logic was calling DAHDI_SPECIFY ioctl on all channels up to maximum channel
limit. Added a short circuit to prevent the ioctl on channels that aren't
configured.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
2014-07-23 16:53:38 -05:00
Russ Meyerriecks df47721962 dahdi_cfg: minor: Rename fo_real to dry_run
Minor readability change

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
2014-07-23 16:52:59 -05:00
Russ Meyerriecks 4e14561508 wcte43xp: Teach tools about te436 and te236 products
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2014-07-18 10:41:54 -05:00
Shaun Ruffell 49361e5ce7 dahdi_cfg: Warn if idle bits are set on invalid channel type.
Hopefully will save a little time in the future if anyone ever types into
/etc/dahdi/system.conf:

  bchan=1-15,17-30:1101

when they meant:

  cas=1-15,17-30:1101

in the future.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-07-09 15:55:37 -05:00
Shaun Ruffell 8045f7f493 dahdi_cfg: Unlink semaphore on early exit.
If dahdi_cfg is terminated while holding the named semaphore, it is possible to
leave it behind and all subsequenct invocations of dahdi_cfg will block waiting
for it.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-07-07 17:06:16 -05:00
Tzafrir Cohen 64e7c688d3 Makefile: A typo in a comment
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-06-30 13:47:23 +03:00
Oron Peled b28ec382bb added autoconfig.h to .gitignore
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-06-29 16:34:24 +03:00
Oron Peled 412c3f0fe3 xpp: support per-port E1/T1 EC
* Added optional '-S <span-spec>' argument to astribank_hexload:
  - Allow passing PRI span specification to EC firmware loader.
  - The span specifications is whitespace/comma separate list
    of items.
  - Each item is: <span>:<type> (Example: 3:T1)
  - The <span> may use shell-like globbing (e.g: *:E1 or [12]:T1)
  - Any span not matched in the span specification will be set
    as without the new '-S' option (i.e: depends on the '-A' option).

* Adapted xpp_fxloader:
  - Read specification for both device label and wildcard from
    /etc/dahdi/span-types.conf
  - If the result is non-empty, pass it as '-S <span-spec>' to
    the EC firmware loader.
2014-06-29 16:34:21 +03:00
Oron Peled fc459c374c xpp: set EC firmware according to PRI settings:
* Read first from modern configuration files
  (/etc/dahdi/span-types.conf)
  - Support either exact label match or complete '*' match in the
    configuration file.

* Fallback to legacy /etc/dahdi/xpp.conf

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-06-29 16:34:17 +03:00
Oron Peled ca09f327ed xpp: better dahdi_registration
Improvements to the xpp tool dahdi_registration:

* Use the new xpp driver with support for dahdi_registration sysfs
  attribute in each device.

* Wait for UDEV to finish handling span assignments (via
  dahdi_waitfor_span_assignments).

* Still supports legacy drivers without this, by falling back
  to old style iterative "registration" on each xpd.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-06-29 16:30:34 +03:00
Tzafrir Cohen b1d55683ae xpp: Don't generate .depends if there's no libusb
Creating the The .depends file requires libusb support.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-06-10 12:41:43 +03:00
Oron Peled 9285e86492 xpp: better error checking (echo_loader)
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-05-11 19:07:40 +03:00
Oron Peled ca7c04e9cb xpp: fix usb "clear_halt" problem
* Don't use "usb_clear_halt" by default anymore
   - It caused problems with specific devices in the past
   - Now it cause problems with specific servers as well (64 bits, USB3)

 * Add an "XTALK_OPTIONS" environment variable to pass options:
   - Use it to implement a "use-clear-halt" boolean option that
     restore original behavior.
   - Also use it for "no-lock" option which replace the legacy
     environment variable "XUSB_NOLOCK".
2014-05-11 18:03:11 +03:00