dahdi/tools.git
3 years agoautomake: full ppp/ support
Oron Peled [Sun, 21 Dec 2014 14:11:11 +0000 (09:11 -0500)]
automake: full ppp/ support

* Remove ppp/Makefile.legacy
* The ppp/Makefile.am includes complete functionality

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

3 years agoautomake: add basic libtool support
Oron Peled [Sun, 7 Dec 2014 19:00:42 +0000 (14:00 -0500)]
automake: add basic libtool support

* Also:
  - Add libtool-related files into "make dist"
  - Update .gitignore

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

3 years agoautomake: add basic framwork
Oron Peled [Sun, 21 Dec 2014 20:07:59 +0000 (15:07 -0500)]
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>

3 years agoautoconf: rename "dahdi" to "dahdi-tools"
Oron Peled [Mon, 18 May 2015 17:22:47 +0000 (17:22 +0000)]
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>

3 years agobuild: remove unused "update" target from Makefile
Oron Peled [Sun, 21 Dec 2014 20:06:07 +0000 (15:06 -0500)]
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>

3 years agobuild: generate version.c during configure
Oron Peled [Sun, 14 Dec 2014 22:37:33 +0000 (17:37 -0500)]
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>

3 years agobuild: xpp -- remove legacy usb-hotplug
Oron Peled [Mon, 8 Dec 2014 15:24:50 +0000 (10:24 -0500)]
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>

3 years agobuild: fix ppp/Makefile CFLAGS
Oron Peled [Sun, 7 Dec 2014 18:36:37 +0000 (13:36 -0500)]
build: fix ppp/Makefile CFLAGS

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

3 years agobuild: remove unused xpp/oct612x/Makefile
Oron Peled [Sun, 7 Dec 2014 11:53:01 +0000 (06:53 -0500)]
build: remove unused xpp/oct612x/Makefile

* Octasic sources are built from xpp/Makefile

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

3 years agobuild: remove unused build_tools/menuselect-deps.in
Oron Peled [Sun, 18 May 2014 12:41:21 +0000 (08:41 -0400)]
build: remove unused build_tools/menuselect-deps.in

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

3 years agobuild: remove autoconf generated files
Oron Peled [Mon, 28 Apr 2014 12:21:34 +0000 (08:21 -0400)]
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>

4 years agoxpp_fxloader: handle empty span-type.conf
Tzafrir Cohen [Tue, 31 Mar 2015 19:37:10 +0000 (22:37 +0300)]
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>

4 years agono astribank_is_starting with hotplug asterisk v2.10.1 v2.10.1-rc2
Tzafrir Cohen [Wed, 21 Jan 2015 16:43:19 +0000 (18:43 +0200)]
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>

4 years agoastribank_hook: remove useless 'time' v2.10.1-rc1
Tzafrir Cohen [Sun, 7 Dec 2014 09:51:19 +0000 (11:51 +0200)]
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>

4 years agoxpp: waitfor_xpds: Always remove Astribank semaphore
Oron Peled [Tue, 28 Oct 2014 17:56:10 +0000 (13:56 -0400)]
xpp: waitfor_xpds: Always remove Astribank semaphore

If we waited -- no Astribanks are "in initialization"

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

4 years agoxpp/astribank_hook: remove Astribank initialization
Oron Peled [Tue, 28 Oct 2014 17:43:48 +0000 (13:43 -0400)]
xpp/astribank_hook: remove Astribank initialization

If this is the last seen Astribank

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

4 years agoxpp: waitfor_xpds: documentation
Oron Peled [Tue, 28 Oct 2014 17:50:30 +0000 (13:50 -0400)]
xpp: waitfor_xpds: documentation

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

4 years agoxpp: can use modern Asterisk hotplug support
Oron Peled [Wed, 22 Oct 2014 19:02:58 +0000 (15:02 -0400)]
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>

4 years agoxpp: waitfor_xpds: assume astribank_is_starting exists
Oron Peled [Tue, 28 Oct 2014 17:48:16 +0000 (13:48 -0400)]
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>

4 years agoxpp: waitfor_xpds: expansion error with no ABs
Oron Peled [Tue, 28 Oct 2014 15:53:29 +0000 (11:53 -0400)]
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>

4 years agoxpp: astribank_is_starting: improve '-v' output
Oron Peled [Tue, 28 Oct 2014 17:28:04 +0000 (13:28 -0400)]
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>

4 years agotonezone: Fix regression in Australian tone patch v2.10.0.1
Russ Meyerriecks [Tue, 19 Aug 2014 20:22:30 +0000 (15:22 -0500)]
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>

4 years agoxpp: revert USB "clear_halt" change and better overrides.
Oron Peled [Sun, 17 Aug 2014 14:07:19 +0000 (17:07 +0300)]
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: ca7c04e9cbdfc182c9c9672dec884f5ac87f90b9

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

4 years agoxpp: astribank_hexload: allow empty span specs v2.10.0 v2.10.0-rc1
Tzafrir Cohen [Thu, 31 Jul 2014 14:57:32 +0000 (17:57 +0300)]
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>

4 years agoxpp_fxloader: rename variable: default_law -> law
Tzafrir Cohen [Thu, 31 Jul 2014 11:54:49 +0000 (14:54 +0300)]
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>

4 years agotonezone: Fix congestion tone for Australia
Armen Karlozian [Tue, 13 May 2014 17:46:31 +0000 (12:46 -0500)]
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>

4 years agozonedata: Ensure all zones have a default DAHDI_TONE_DIALRECALL.
Shaun Ruffell [Tue, 18 Dec 2012 19:21:04 +0000 (13:21 -0600)]
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>

4 years agodahdi_cfg: Reduce mass ioctls on non-existing channels
Russ Meyerriecks [Wed, 23 Jul 2014 18:20:14 +0000 (13:20 -0500)]
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>

4 years agodahdi_cfg: minor: Rename fo_real to dry_run
Russ Meyerriecks [Tue, 22 Jul 2014 21:24:26 +0000 (16:24 -0500)]
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>

4 years agowcte43xp: Teach tools about te436 and te236 products
Russ Meyerriecks [Thu, 24 Apr 2014 20:18:35 +0000 (15:18 -0500)]
wcte43xp: Teach tools about te436 and te236 products

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

4 years agodahdi_cfg: Warn if idle bits are set on invalid channel type. v2.9.2 v2.9.2-rc2
Shaun Ruffell [Tue, 8 Jul 2014 21:41:04 +0000 (16:41 -0500)]
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>

4 years agodahdi_cfg: Unlink semaphore on early exit.
Shaun Ruffell [Mon, 7 Jul 2014 20:12:57 +0000 (15:12 -0500)]
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>

4 years agoMakefile: A typo in a comment
Tzafrir Cohen [Mon, 30 Jun 2014 10:47:23 +0000 (13:47 +0300)]
Makefile: A typo in a comment

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

4 years agoadded autoconfig.h to .gitignore
Oron Peled [Wed, 28 May 2014 10:44:17 +0000 (06:44 -0400)]
added autoconfig.h to .gitignore

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

4 years agoxpp: support per-port E1/T1 EC
Oron Peled [Wed, 28 May 2014 12:58:54 +0000 (08:58 -0400)]
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.

4 years agoxpp: set EC firmware according to PRI settings:
Oron Peled [Tue, 27 May 2014 13:50:21 +0000 (09:50 -0400)]
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>

4 years agoxpp: better dahdi_registration
Oron Peled [Sun, 6 Apr 2014 18:33:12 +0000 (14:33 -0400)]
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>

4 years agoxpp: Don't generate .depends if there's no libusb v2.9.2-rc1
Tzafrir Cohen [Thu, 5 Jun 2014 10:20:36 +0000 (13:20 +0300)]
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>

4 years agoxpp: better error checking (echo_loader)
Oron Peled [Sun, 11 May 2014 15:48:07 +0000 (11:48 -0400)]
xpp: better error checking (echo_loader)

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

4 years agoxpp: fix usb "clear_halt" problem
Oron Peled [Sun, 11 May 2014 13:41:46 +0000 (09:41 -0400)]
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".

4 years agoxpp: safer compilation
Oron Peled [Sun, 4 May 2014 15:09:05 +0000 (11:09 -0400)]
xpp: safer compilation

* Compile with "-Wall -Werror"
* Better dependency calculation:
  - Explicit listing of sources, don't use wildcards.
  - Pass various CFLAGS to dependency calculation as well.
  - Make sure a failure is propagated

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

4 years agosystem.conf.sample: Remove reference to single frequency signalling.
Shaun Ruffell [Mon, 5 May 2014 14:42:38 +0000 (09:42 -0500)]
system.conf.sample: Remove reference to single frequency signalling.

Single frequency signalling has not been supported in dahdi_cfg since the switch
to DAHDI. Before DAHDI, in the Zaptel days, it was only suported in the
ztcfg_dude utility which wasn't mainlined. So this removes references to those
signalling modes unless support is added back into the driver.

Internal-Issue-ID: DAHLIN-335
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

4 years agodahdi_genconf: remove hard-coded E1 default
Oron Peled [Sun, 6 Apr 2014 17:01:32 +0000 (13:01 -0400)]
dahdi_genconf: remove hard-coded E1 default

* The "spantypes" generator had E1 default if no 'line-mode' parameter
  was passed.

* As a result the new logic in "dahdi_span_types dumpconfig" had no
  effect when called from dahdi_genconf, as it was always called
  with "--line-mode=" argument.

* Now "dahdi_genconf spantype" behaves just like
  "dahdi_span_types dumpconfig":
  - The "--line-mode=" forces generation of provided line-mode (E1/J1/T1)
  - Without this option, the generated config matches the current spans
    state according to new dahd_span_types default logic:
    - Wildcard rule if all spans have same line-mode.
    - Uncommented specific matches if spans have different line-modes.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

4 years agoxpp: waitfor_xpds: handle missing serial numbers
Oron Peled [Mon, 31 Mar 2014 10:35:34 +0000 (13:35 +0300)]
xpp: waitfor_xpds: handle missing serial numbers

Fixes a regression since 949ea4ca9f9c9050811af9e80d44530beb10fd8f
(2.7.0) - allows using an Astribank with no serial.

* Some of the olderst Astribanks don't have a serial number burned in
  them. Thus there is no serial attribute for the sysfs USB device node.

* waitfor_xpds identifies the Astribanks by their serial numbers.

* An lone Astribank without serial number would thus block waitfor_xpds
  (until timeout).

* Now we warn about them.

* We also try to handle it gracefully. As long as there's only one
  of thease, it would be counted as "NO-SERIAL".

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

4 years agoxpp: dahdi_registration: force re-assignment
Oron Peled [Sun, 30 Mar 2014 18:38:52 +0000 (21:38 +0300)]
xpp: dahdi_registration: force re-assignment

* The system state causing the bug:
  - DAHDI has auto_assign_spans==1
  - No /etc/dahdi/assigned-spans.conf

* The bug scenario:
  - During initial device detection, they are assigned by
    DAHDI driver.
  - Later we run "dahdi_span_assignment remove"
  - Then, a "dahdi_registration on" would not assign any span.

* The fix:
  - Using the '-R' option, force "dahdi_registration on" to also
    do "dahdi_span_assignment auto" on relevant devices.
  - This is the way it's called by /usr/share/dahdi/dahdi_auto_assign_compat

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>

5 years agoimproved dahdi_span_types dumpconfig
Oron Peled [Mon, 31 Mar 2014 16:48:30 +0000 (19:48 +0300)]
improved dahdi_span_types dumpconfig

* Better defaults:
  - A wildcard match:
    - If '--line-mode' option is given, generate a wildcard entry.
      (existing behavior).

    - Otherwise, if *all spans* are of the same type (E1/T1),
      generate a wildcard entry for this type.
      This is the most common use-case and now it work without
      any command line flags.

    - Otherwise (mixed E1/T1 spans), do not generate a wildcard entry.
      This isn't common case (except from our labs), but regardless
      without '--line-mode' any guess could be wrong.

  - Specific device matches:
    - If all spans are of the same type, generate commented out
      specific entries (for manual overrides).

    - If spans have mixed E1/T1 types, generate specific entries
      In this case, specific entries MUST NOT be commented out
      otherwise, the configuration file is wrong!

* Generated header with better organization:
  - Shows what is generated:
    - Generating wildcard / Not generating wildcard
    - Generating specific lines / Generating *commented-out* specific lines

  - For each decision, show *why* it was taken.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agoregistration-order: Added dahdi_auto_assign_compat v2.9.1 v2.9.1-rc2
Oron Peled [Sun, 9 Mar 2014 12:20:17 +0000 (14:20 +0200)]
registration-order: Added dahdi_auto_assign_compat

Maintains the original registration order as was before span
assignments. Should allow seemless trannsition to
dahdi.auto_assign_spans=0

* The idea:
  - We stop handling in udev the case of missing
    /etc/dahdi/assigned-spans.conf
  - Instead we rely on "registration_time" dahdi_device attribute from
    DAHDI-linux
  - Then, we can sort the devices and assign their spans in
    /etc/init.d/dahdi
* Mechanics:
  - From /etc/init.d/dahdi, we run a new 'dahdi_auto_assign_compat'
    script (after "waitfor_xpds" etc.)
  - In this script we "auto" assign spans of non-Astribank devices
  - In the end of the script we run "dahdi_registration" which
    does the same for Astribank devices.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agohotplug: call handle_device.d/ actions for remove
Oron Peled [Sun, 9 Mar 2014 12:03:00 +0000 (14:03 +0200)]
hotplug: call handle_device.d/ actions for remove

* Original actions didn't care about remove (10-span-types, 20-span-assignments)
* But others need to know about removals too.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_cfg: error()->perror() when sem_open fails. v2.9.1-rc1
Shaun Ruffell [Wed, 12 Feb 2014 17:49:39 +0000 (11:49 -0600)]
dahdi_cfg: error()->perror() when sem_open fails.

This fixes a confusing error message. When sem_open failed, the system.conf line
number was being printed and the system error code was not.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

5 years agowaitfor_xpds: handle the case of a failing AB
Aslan Laoz [Tue, 14 Jan 2014 15:34:24 +0000 (15:34 +0000)]
waitfor_xpds: handle the case of a failing AB

If an Astribank failed initialization, don't keep waiting for it.

5 years agoauto_assign_spans may be true even if not '1'
Tzafrir Cohen [Thu, 6 Feb 2014 16:46:00 +0000 (18:46 +0200)]
auto_assign_spans may be true even if not '1'

auto_assign_spans is an int and may have legal values other than 1. It
is legal (though pointless) to use: modprobe dahdi auto_assign_spans=3.
Any value != 0 is true.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agohotplug: Check for auto_assign_spans only when ACTION is add.
Shaun Ruffell [Sat, 21 Dec 2013 06:17:01 +0000 (00:17 -0600)]
hotplug: Check for auto_assign_spans only when ACTION is add.

Removes a potentially confusing error message. This is a reapplication of
(4f259cd569f6 "dahdi_handle_device, dahdi_span_config: Check for
auto_assign_spans only when ACTION is add.") which appears to have been
accidentally removed when moving the hotplug scripts into a subdirectory.

From the original commit:

When dahdi.ko is unloaded, it may be possible for the driver to be removed from
the kernel before the udev scripts are run.  When this happens, you'll see
messages like the following which are not accurate:

    'dahdi_handle_device'[24567]: Old driver (no auto_assign_spans parameter). Skip /devices/pci0000:00/0000:00:1e.0/0000:11:01.0/pci:0000:11:01.0

Now instead you will see:

    'dahdi_handle_device'[28008]: remove: /devices/pci0000:00/0000:00:1e.0/0000:11:01.0/pci:0000:11:01.0

Also, all the udev events will be logged in the system log even when they are
ignored because of legacy auto span assignment. This will help show what is
going on during the transition period to full udev configuration of spans.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Oron Peled <oron.peled@xorcom.com>

5 years agohotplug: Do not run auto span configuration if spans are auto assigned. v2.9.0.1
Shaun Ruffell [Fri, 31 Jan 2014 16:31:20 +0000 (10:31 -0600)]
hotplug: Do not run auto span configuration if spans are auto assigned.

This reapplies the change made in commit (6ed0adc08 "dahdi_span_config: Do not run auto
span configuration if spans are auto assigned.") which appears to have been
accidentally removed in (7f826a7d35 "hotplug modularization: split logic to
scriptlets").

To rationale from commit 6ed0adc08:

I have seen cases were users run:

  # modprobe <driver>; dahdi_cfg -c <custom config file>

and the spans end up misconfigured because dahdi_span_assignments ends up
running, via udev, after the user configured the span the way it wanted.

dahdi_span_assignments now looks at auto_assign_spans module parameter on
dahdi.ko, like dahdi_handle_device already does, to determine if legacy or udev
based configuration is being done.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

5 years agoREADME: udev hooks run scripts from directories v2.9.0 v2.9.0-rc2
Tzafrir Cohen [Tue, 28 Jan 2014 09:42:33 +0000 (11:42 +0200)]
README: udev hooks run scripts from directories

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agohotplug: document asterisk scriptlet
Tzafrir Cohen [Tue, 28 Jan 2014 09:32:31 +0000 (11:32 +0200)]
hotplug: document asterisk scriptlet

A well-behaving distribution may choose not to install
span_config.d/50-asterisk as part of dahdi-tools, as it belongs in
asterisk. Still, it would be nice to be able to keep it as a documented
usage example. So just writ where this file needs to go and what it
does.

No other change: it is still installed by default.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agohyphen/minus fixes in man pages
Tzafrir Cohen [Mon, 27 Jan 2014 18:27:09 +0000 (20:27 +0200)]
hyphen/minus fixes in man pages

in groff '-' creates a hyphen and for a minus (path, option, or similar)
you need '\-'.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi.init: Don't exit on lack of /etc/dahdi/system.conf v2.9.0-rc1
Russ Meyerriecks [Thu, 23 Jan 2014 20:50:04 +0000 (14:50 -0600)]
dahdi.init: Don't exit on lack of /etc/dahdi/system.conf

auto_spans and dahdi_cfg -c are valid config methods which may not have a
/etc/dahdi/system.conf. We already check for the existance of the dahdi modules
before the case start, so I think it's safe to remove this section.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agobash_completion: fix dahdi_genconf
Tzafrir Cohen [Thu, 23 Jan 2014 21:16:55 +0000 (23:16 +0200)]
bash_completion: fix dahdi_genconf

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_perl: fix regression with an AB with no modules
Tzafrir Cohen [Mon, 30 Dec 2013 13:09:28 +0000 (15:09 +0200)]
dahdi_perl: fix regression with an AB with no modules

Fixes a regression introduced in
3572bb5a137e1fef85e30805c6811ae74a619b2a (before 2.7.0) - most of the
dahdi_perl tools will fail for an Astribank with no modules claiming
"No XPDs for '/sys/bus/astribanks/devices/xbus-00'"

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoprogrammable bash completion for some commands
Tzafrir Cohen [Thu, 26 Dec 2013 19:43:22 +0000 (21:43 +0200)]
programmable bash completion for some commands

Programmable bash completion for dahdi_span_assignments,
dahdi_span_types and dahdi_genconf.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_span_types: hush warning of missing attribute
Tzafrir Cohen [Thu, 23 Jan 2014 15:55:38 +0000 (17:55 +0200)]
dahdi_span_types: hush warning of missing attribute

Don't warn when a sysfs attribute does not exist.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agoChange span-type.conf generation policy
Oron Peled [Mon, 20 Jan 2014 18:10:56 +0000 (20:10 +0200)]
Change span-type.conf generation policy

* Add '--line-mode=<E1|T1|J1>' option to dahdi_span_types:
  - Will first generate a wildcard entry (* *:<type>)
  - All later entries will be commented-out.
  - Manually uncommenting any of them will create an "override"
    (e.g: mixed system with all spans T1, but some E1)

* Now dahdi_genconf does not generate span-types.conf by default:
  - Added '--line-mode=<E1|T1|J1>' option to trigger generation
  - This parameter will be passed to "dahdi_span_types dumpconfig"
  - Also explicit specification of 'spantypes' as an argument will
    trigger a similar generation (with a default of 'E1').
  - The line-mode may also be passed to the generator directly
    with identical results. Example:
          dahdi_genconf spantypes=line-mode=T1

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_span_types: allow defaults + overrides
Oron Peled [Mon, 20 Jan 2014 18:10:55 +0000 (20:10 +0200)]
dahdi_span_types: allow defaults + overrides

* Allow wildcards for both device and span number (as before).
  Example:
     *        *:T1

* But now we are carefull to follow strict order in the configuration
  file. This means, if there are multiple matches -- last one wins.

* So we can use specialisation:
     *        *:T1 # Everything is T1
     FOO      [34]:T1 # Except spans 3,4 on the FOO device

* Added --dry-run and --verbose options.

* Updated the man-page:
  - Fixed "registered" => "assigned".
  - Use "line mode" for E1/J1/T1.
  - Document current changes.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_span_assignments.8: s/register/assign/
Tzafrir Cohen [Thu, 23 Jan 2014 13:07:31 +0000 (15:07 +0200)]
dahdi_span_assignments.8: s/register/assign/

* Use the term "assignment" instead of "registration" (for spans).
* Further fixes.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agonew "dahdi_waitfor_span_assignments" tool
Oron Peled [Thu, 16 Jan 2014 13:03:22 +0000 (08:03 -0500)]
new "dahdi_waitfor_span_assignments" tool

* Allows waiting until all spans are "assigned" or "unassigned"
* Current implementation use a polling loop with sleep
* Future implementation may block on sysfs attribute
  (like waitfor_xpds is blocking on sysfs Astribanks attribute)

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agohotplug modularization: split logic to scriptlets
Oron Peled [Thu, 16 Jan 2014 10:31:17 +0000 (12:31 +0200)]
hotplug modularization: split logic to scriptlets

* Device related operations are ordered in /usr/share/dahdi/handle_device.d/
* Span related operations are ordered in /usr/share/dahdi/span_config.d/
* In the future, span_config.d/50-asterisk should be moved to Asterisk.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agohotplug modularization: move sources to a subdir
Oron Peled [Thu, 16 Jan 2014 10:29:04 +0000 (12:29 +0200)]
hotplug modularization: move sources to a subdir

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agowcte13xp: Teach tools about te131 te132 products
Russ Meyerriecks [Wed, 18 Dec 2013 21:57:44 +0000 (15:57 -0600)]
wcte13xp: Teach tools about te131 te132 products

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_cfg: Allow dynamic spans to handle udev based span assignment.
Shaun Ruffell [Wed, 8 Jan 2014 20:11:03 +0000 (14:11 -0600)]
dahdi_cfg: Allow dynamic spans to handle udev based span assignment.

Prior to this commit, if auto_assign_spans was set to 0, it was possible to
get in an endless loop creating and destroying spans. The primary reason was
that all dynamic spans are destroyed and recreated each time dahdi_cfg runs, BUT
dahdi_cfg was run each time a new span showed up in udev when auto_assign_spans
was set to 0.

Now dahdi_cfg will only destroy and recreate dynamic spans if dahdi_cfg is run
without a specifc span number. Also, while creating dynamic spans, dahdi_cfg
will pause for up to one second for the span to be assigned in order to ensure
that the spans are numbered consistently when auto span assignment is
configured.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_cfg: Add semaphore to prevent parallel execution.
Shaun Ruffell [Thu, 2 Jan 2014 23:31:19 +0000 (17:31 -0600)]
dahdi_cfg: Add semaphore to prevent parallel execution.

When dahdi is configured for fully dynamic configuration on a device and
span basis via sysfs and udev it is possible for multiple instances of
dahdi_cfg to be run in parallel on different spans. If this happens it
is possible to see errors on the console that tone zones are already
registered since the check for the existence of a tone zone and the
re-registering needs to be atomic.

dahdi_cfg will now prevent itself from running in parallel.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_handle_device: Auto assign only the device being added.
Shaun Ruffell [Thu, 9 Jan 2014 00:14:05 +0000 (18:14 -0600)]
dahdi_handle_device: Auto assign only the device being added.

Eliminates trying to add spans multiple times as seen below:

    'dahdi_handle_device'[21993]: add: /devices/dynamic:loc:1
    'dahdi_handle_device'[21991]: add: /devices/dynamic:loc:0
    'dahdi_handle_device'[22001]: auto-assign /sys/bus/dahdi_devices/devices/dynamic:loc:0
    'dahdi_handle_device'[22001]: auto-assign /sys/bus/dahdi_devices/devices/dynamic:loc:1
    'dahdi_handle_device'[21999]: auto-assign /sys/bus/dahdi_devices/devices/dynamic:loc:0
    'dahdi_handle_device'[21999]: auto-assign /sys/bus/dahdi_devices/devices/dynamic:loc:1
    kernel: [ 3348.312534] dahdi_devices dynamic:loc:0: local span 1 is already assigned span 1
    kernel: [ 3348.312552] dahdi_devices dynamic:loc:1: local span 1 is already assigned span 2

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_span_types: Show location of configuration file in help message.
Shaun Ruffell [Thu, 9 Jan 2014 00:14:04 +0000 (18:14 -0600)]
dahdi_span_types: Show location of configuration file in help message.

Makes similar in for the dahdi_span_assignments in that the location of the
default configuration file is shown in the help screen.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_genconf: Add 'modules', 'spantypes', and 'assignedspans' to list of available...
Shaun Ruffell [Thu, 9 Jan 2014 00:14:03 +0000 (18:14 -0600)]
dahdi_genconf: Add 'modules', 'spantypes', and 'assignedspans' to list of available generators.

This is a documentation change, that hopefully will help until I can remember
the names of the new generators.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_genconf: don't generate spantypes by default
Tzafrir Cohen [Mon, 20 Jan 2014 13:23:43 +0000 (15:23 +0200)]
dahdi_genconf: don't generate spantypes by default

A sane value for span-types.conf is either "all E1" or "all T1". Either
way it is not hardware-dependent, and hence no point in regenerating on
when the hardware changes.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agospan_types/assignments: no * in device list
Tzafrir Cohen [Thu, 2 Jan 2014 09:14:38 +0000 (11:14 +0200)]
span_types/assignments: no * in device list

If there are no dahdi devices, $devbase/* expans to have a literal '*',
which leads to warnings such as:
/usr/sbin/dahdi_span_types: 1: cd: can't cd to /sys/bus/dahdi_devices/devices/*

Let's just avoid those.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_handle_device, dahdi_span_config: Check for auto_assign_spans only when ACTION...
Shaun Ruffell [Sat, 21 Dec 2013 06:17:01 +0000 (00:17 -0600)]
dahdi_handle_device, dahdi_span_config: Check for auto_assign_spans only when ACTION is add.

When dahdi.ko is unloaded, it may be possible for the driver to be removed from
the kernel before the udev scripts are run.  When this happens, you'll see
messages like the following which are not accurate:

    'dahdi_handle_device'[24567]: Old driver (no auto_assign_spans parameter). Skip /devices/pci0000:00/0000:00:1e.0/0000:11:01.0/pci:0000:11:01.0

Now instead you will see:

    'dahdi_handle_device'[28008]: remove: /devices/pci0000:00/0000:00:1e.0/0000:11:01.0/pci:0000:11:01.0

Also, all the udev events will be logged in the system log even when they are
ignored because of legacy auto span assignment. This will help show what is
going on during the transition period to full udev configuration of spans.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Oron Peled <oron.peled@xorcom.com>

5 years agoREADME: Update the install targets
Tzafrir Cohen [Mon, 30 Dec 2013 17:24:23 +0000 (19:24 +0200)]
README: Update the install targets

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoREADME: document initialization
Tzafrir Cohen [Mon, 30 Dec 2013 12:38:49 +0000 (14:38 +0200)]
README: document initialization

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoREADME: indentation level for config samples
Tzafrir Cohen [Sun, 29 Dec 2013 11:43:05 +0000 (13:43 +0200)]
README: indentation level for config samples

Indent the configuration samples one level deeper

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years ago.gitignore: more generated files
Tzafrir Cohen [Sun, 29 Dec 2013 11:51:28 +0000 (13:51 +0200)]
.gitignore: more generated files

Ignore test binaries and files generated by 'make docs'

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_span_config: Do not run auto span configuration if spans are auto assigned.
Shaun Ruffell [Thu, 19 Dec 2013 22:37:15 +0000 (16:37 -0600)]
dahdi_span_config: Do not run auto span configuration if spans are auto assigned.

I have seen cases were users run:

  # modprobe <driver>; dahdi_cfg -c <custom config file>

and the spans end up misconfigured because dahdi_span_assignments ends up
running, via udev, after the user configured the span the way it wanted.

dahdi_span_assignments now looks at auto_assign_spans module parameter on
dahdi.ko, like dahdi_handle_device already does, to determine if legacy or udev
based configuration is being done.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Oron Peled <oron.peled@xorcom.com>

5 years agodahdi.rules: use += for RUN
Tzafrir Cohen [Thu, 12 Dec 2013 13:45:14 +0000 (15:45 +0200)]
dahdi.rules: use += for RUN

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi.rules: Replace SYSFS with ATTRS
Tzafrir Cohen [Wed, 11 Dec 2013 10:35:49 +0000 (12:35 +0200)]
dahdi.rules: Replace SYSFS with ATTRS

SYSFS has been deprecated. Use ATTRS.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_cfg: Wait for all spans to be assigned.
Shaun Ruffell [Mon, 9 Dec 2013 23:19:23 +0000 (17:19 -0600)]
dahdi_cfg: Wait for all spans to be assigned.

When auto span assignment is disabled, it's possible that simply running

  # /etc/init.d/dahdi restart

Will fail since dahdi_cfg can run in parallel with udev scripts that are
assigning spans, which results in /etc/dahdi/system.conf describing spans that
do not exist in the system.

This change sets up dahdi_cfg, when run without the -C or -S options, to look in
sysfs and make sure all spans for each device are assigned.  dahdi_cfg will wait
5 seconds for span assignment to happen before proceeding normally.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agoMakefile: do install all man-pages
Oron Peled [Sun, 8 Dec 2013 13:52:26 +0000 (15:52 +0200)]
Makefile: do install all man-pages

Fixes a regression in 2.8 (ffced0ca) in the main Makefile:
MAN_PAGES gets assigned twice and thus most man pages will not get
installed.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agoMakefile: new 'make-dist' target v2.8.0 v2.8.0-rc5
Oron Peled [Mon, 25 Nov 2013 21:37:38 +0000 (23:37 +0200)]
Makefile: new 'make-dist' target

Creates a tar.gz:
* Identical results to Digium's distributed tarballs
* Named "dahdi-tools-<version>.tar.gz"
* Only from committed files (uses git-archive)
* Adds a .version file

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_span_assignments, dahdi_span_types: Allow conf file to be overridden.
Shaun Ruffell [Tue, 26 Nov 2013 18:55:09 +0000 (12:55 -0600)]
dahdi_span_assignments, dahdi_span_types: Allow conf file to be overridden.

The environment variables that specified the full path the the configuration
files for dahdi_span_types and dahdi_span_assignments was documented, but they
were not actually set from the environment.

Also, the case of the variable was changed to match the one for the directory
where the rest of the config files are located.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

5 years agoAdd dahdi_ prefix to handle_device, span_types, span_assignments, and span_config.
Shaun Ruffell [Tue, 26 Nov 2013 15:15:13 +0000 (09:15 -0600)]
Add dahdi_ prefix to handle_device, span_types, span_assignments, and span_config.

All new dahdi tools and utilities will be prefixed with "dahdi_" in order to
avoid any future conflicts with other packages.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Oron Peled <oron.peled@xorcom.com>

5 years agospan_types: Fix bug that would prevent matching on devpath.
Shaun Ruffell [Tue, 26 Nov 2013 02:21:14 +0000 (20:21 -0600)]
span_types: Fix bug that would prevent matching on devpath.

If a configuration file was specified that used the devpath, like:

  # Device: [] @Board_ID_Switch_0 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0
  /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 1:E1
  /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 2:E1
  /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 3:E1
  /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 4:E1

Then the span_types script would silently fail to match the configuration lines
for the device and silently fail to change the linemodes.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Oron Peled <oron.peled@xorcom.com>

5 years agoconfigure: regenerate for 6d10525
Tzafrir Cohen [Sun, 24 Nov 2013 16:09:16 +0000 (18:09 +0200)]
configure: regenerate for 6d10525

Regenerate configure script following changes in commit
6d10525863d91335cd09b0400ddfb85433e107ed.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi.init: Remove spurious "Missing '/sys/bus/astribanks/drivers/xppdrv/sync'".
Shaun Ruffell [Fri, 22 Nov 2013 21:08:29 +0000 (15:08 -0600)]
dahdi.init: Remove spurious "Missing '/sys/bus/astribanks/drivers/xppdrv/sync'".

The xpp_sync will fail if there are not any Astribank devices loaded. Check for
existence of the tools before trying to sync.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoREADME: include pinned spans config files
Tzafrir Cohen [Fri, 18 Oct 2013 06:27:30 +0000 (09:27 +0300)]
README: include pinned spans config files

Include pinned-spans.conf and span-types.conf in the generated
README.html. Reformat them to render properly.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoTerminology rename: "pinned" -> "assigned"
Oron Peled [Mon, 18 Nov 2013 16:14:34 +0000 (11:14 -0500)]
Terminology rename: "pinned" -> "assigned"

* File names fixed
* File contents fixed

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi.rules: add persistent channel names as well
Oron Peled [Mon, 21 Oct 2013 15:04:39 +0000 (18:04 +0300)]
dahdi.rules: add persistent channel names as well

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi.rules: don't process "add" events unless needed
Oron Peled [Mon, 21 Oct 2013 15:03:26 +0000 (18:03 +0300)]
dahdi.rules: don't process "add" events unless needed

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agohotplug: run fxotune from span_config:
Oron Peled [Mon, 21 Oct 2013 10:06:18 +0000 (12:06 +0200)]
hotplug: run fxotune from span_config:

* Use fxotune -b/-e options to run on wanted channel range

5 years agofxotune: Now options '-b/-e' also apply with '-s'
Oron Peled [Mon, 21 Oct 2013 10:54:58 +0000 (12:54 +0200)]
fxotune: Now options '-b/-e' also apply with '-s'

* Now we can limit fxotune "set" mode to specific channel range.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi.rules: use tools_rootdir from driver
Oron Peled [Mon, 21 Oct 2013 15:02:04 +0000 (18:02 +0300)]
dahdi.rules: use tools_rootdir from driver

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agospan_types: fix for white-space in hardware_id
Oron Peled [Mon, 4 Nov 2013 15:25:25 +0000 (10:25 -0500)]
span_types: fix for white-space in hardware_id

* Sanitize hardware_id/location attributes, just like span_assignments
* Allow control of keys via SPAN_ASSIGNMENTS_KEY or '-k <key>' option
* In general, import most features/options from span_assignments

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agoudev scripts now read /etc/dahdi/init.conf
Oron Peled [Tue, 15 Oct 2013 17:09:30 +0000 (20:09 +0300)]
udev scripts now read /etc/dahdi/init.conf

Added two override variables in init.conf:
* DAHDI_UDEV_DISABLE_DEVICES
* DAHDI_UDEV_DISABLE_SPANS

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>