dahdi/tools.git
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>

5 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>

5 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>

5 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".

5 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>

5 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>

5 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>

5 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>

5 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>

5 years agosysfs: restored legacy names /etc/dahdi/<channo>:
Oron Peled [Tue, 15 Oct 2013 18:01:01 +0000 (21:01 +0300)]
sysfs: restored legacy names /etc/dahdi/<channo>:

Update dahdi.rules to create again the old fashioned device files
(/dev/dahdi/<channo>), but as symlinks to modern names.

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

5 years agoadded udev rules and their install target:
Oron Peled [Tue, 15 Oct 2013 18:00:17 +0000 (21:00 +0300)]
added udev rules and their install target:

* Added missing Makefile install rule for dahdi.rules
* Pulled xpp.rules from dahdi-linux and added install rules for it

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

5 years agopinned-spans: remove '--enable-pinned' from configure
Oron Peled [Tue, 15 Oct 2013 14:45:38 +0000 (17:45 +0300)]
pinned-spans: remove '--enable-pinned' from configure

pinned-spans utilities are now essential:
* Called by udev rules
* Called by dahdi_genconf

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

5 years agopinned-spans: fix examples in configuration files
Oron Peled [Tue, 15 Oct 2013 17:56:31 +0000 (20:56 +0300)]
pinned-spans: fix examples in configuration files

* Correctly use the new "location" attribute
* Document the possibility to match against sysfs devpath
  (used to be the "location")

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

5 years agopinned-spans: fix configuration file names
Oron Peled [Tue, 15 Oct 2013 17:54:54 +0000 (20:54 +0300)]
pinned-spans: fix configuration file names

* Install them as *.conf.sample -- that's what they are
* Correctly rename spantype.conf to span-types.conf (new name)

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

5 years agodahdi_genconf: Do not fail if pinned/assigned span utilities were not installed. v2.8.0-rc2 v2.8.0-rc3 v2.8.0-rc4
Shaun Ruffell [Thu, 14 Nov 2013 18:19:45 +0000 (12:19 -0600)]
dahdi_genconf: Do not fail if pinned/assigned span utilities were not installed.

If you installed dahdi tools and did not specify DAHDI_PINNED=yes on the
makefile, when you run dahdi_genconf you would get an error like the following:

  # dahdi_genconf
  sh: span_types: command not found
  Command failed (status=32512): 'span_types dumpconfig > /etc/dahdi/span-types.conf' at ...

This change allows the generator for span-types.conf and span-assignements.conf
check for the existence of the utilities before attempting to call them.

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

5 years agowcte43x: Teach tools about the wcte43x driver. v2.8.0-rc1
Shaun Ruffell [Mon, 11 Nov 2013 21:39:20 +0000 (15:39 -0600)]
wcte43x: Teach tools about the wcte43x driver.

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

5 years agowcaxx: Teach tools about the wcaxx driver.
Shaun Ruffell [Mon, 11 Nov 2013 21:35:56 +0000 (15:35 -0600)]
wcaxx: Teach tools about the wcaxx driver.

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

5 years agoxpp_fxloader: support loading AB with ID > 201
Tzafrir Cohen [Mon, 21 Oct 2013 12:16:14 +0000 (15:16 +0300)]
xpp_fxloader: support loading AB with ID > 201

Support loading firmware for Astribanks with bcdDevice > 2.01, as we'll
have 2.02 soon.

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

5 years agofix typos in man-page
Oron Peled [Mon, 14 Oct 2013 09:15:49 +0000 (11:15 +0200)]
fix typos in man-page

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

5 years agoMan pages for span_types and span_assignments
Tzafrir Cohen [Sun, 13 Oct 2013 20:28:29 +0000 (23:28 +0300)]
Man pages for span_types and span_assignments

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

5 years agoRemove dahdi_map, obsoleted by span_assignments
Tzafrir Cohen [Wed, 2 Oct 2013 18:54:58 +0000 (21:54 +0300)]
Remove dahdi_map, obsoleted by span_assignments

dahdi_map can be replaced by span_assignments list / dumpconfig

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

5 years agodahdi_registration: adapt to pinned-spans
Oron Peled [Sun, 29 Sep 2013 16:24:08 +0000 (18:24 +0200)]
dahdi_registration: adapt to pinned-spans

* If xpp.dahdi_autoreg parameter is 'Y' -- Skip actuall registration.
* If dahdi.auto_assign_spans is '0' and there's no /etc/dahdi/pinned-spans.conf
  Than use 'span_assignments auto ...' to assign device spans.
* Since dahdi_registration iterate in correct xpp_order, the span
  assignment logic provides migration path for users who did not
  generate their pinned-spans.conf configuration yet.

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

5 years agospan_assignments: -k / --keys and more
Oron Peled [Sun, 29 Sep 2013 08:09:56 +0000 (10:09 +0200)]
span_assignments: -k / --keys and more

* New functionality (documented in the script header):
  - Alternative "keys" for device matching
  - Added new command line options: --help, --dry-run, --verbose, --key

* Clean sysfs attribute contents from special characters in every use-case.

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

5 years agoDo the Right Thing when there's no config
Tzafrir Cohen [Tue, 1 Oct 2013 19:13:43 +0000 (22:13 +0300)]
Do the Right Thing when there's no config

Do the "right thing" (hopefully. At least for a system with a single
device) if there is are no configuration files:

* No span-types.conf: just ignore it as before. It is optional.
* No pinned-spans.conf: use span_assignments auto (same as having
  dahdi.auto_assign_spans=1).
* No system.conf: generate a temporary one with dahdi_genconf.

This will hopefully allow having a partially-working system, and help
making ut usable with 'span_assignments dumpconfig'. Or maybe just work
as-is.

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

5 years agodahdi_cfg: can optionally read config from stdin
Oron Peled [Sun, 6 Oct 2013 13:10:48 +0000 (16:10 +0300)]
dahdi_cfg: can optionally read config from stdin

Allow for the convention of '-' marking stdin:

  dahdi_cfg -c -

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

5 years agoAugment dahdi_genconf default generators list
Oron Peled [Mon, 23 Sep 2013 15:11:36 +0000 (17:11 +0200)]
Augment dahdi_genconf default generators list

Run Add spantypes and pinnedspans generators by default.

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

5 years agoadd new dahdi_genconf generators
Oron Peled [Mon, 23 Sep 2013 15:08:49 +0000 (17:08 +0200)]
add new dahdi_genconf generators

* pinnedspas: For /etc/dahdi/pinned-spans.conf
* spantypes: For /etc/dahdi/span-types.conf

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

5 years agoremove unused dahdi_cfg_device_args
Oron Peled [Mon, 23 Sep 2013 15:19:03 +0000 (17:19 +0200)]
remove unused dahdi_cfg_device_args

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

5 years agohandle_device: don't fail if no config files
Tzafrir Cohen [Mon, 23 Sep 2013 17:43:25 +0000 (20:43 +0300)]
handle_device: don't fail if no config files

Allow the udev rule to work well even if there's no span-types.conf

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

5 years agoNewer version of DAHDI hotplug scripts
Oron Peled [Mon, 23 Sep 2013 11:59:14 +0000 (13:59 +0200)]
Newer version of DAHDI hotplug scripts

A newer version of the scripts fully adapted to pinned spans:
* handle_device does not run dahdi_cfg.
* A separate UDEV rule script for that: span_config. Should also work
  for the non-pinned case.
* span_assignments, span_types: add actions 'auto' (manually enable all)
  and 'dumpconfig' (dump current status in the format of configuration
  file).
* Fixed name of span_types and span_assignments (no '-').
* spantype.conf renamed span-types.conf: configuration files do have a
  dash.
* Those two are useful programs, insstalled to /usr/sbin.

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

6 years agobuild_tools/make_version: Teach version string about git. v2.7.0.1 v2.7.0.2
Shaun Ruffell [Wed, 12 Jun 2013 17:03:55 +0000 (12:03 -0500)]
build_tools/make_version: Teach version string about git.

This copies in the make_version script from DAHDI-Linux to allow the version to
be properly reported from builds in git checkouts.

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

6 years agoAdd support for Digium's new te13x line of cards v2.7.0 v2.7.0-rc1
Russ Meyerriecks [Tue, 28 May 2013 22:06:10 +0000 (17:06 -0500)]
Add support for Digium's new te13x line of cards

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

6 years agofxotune: Use DAHDI_SPECIFY when opening by integer channel number.
Shaun Ruffell [Thu, 9 May 2013 15:34:20 +0000 (10:34 -0500)]
fxotune: Use DAHDI_SPECIFY when opening by integer channel number.

In DAHDI-Linux 2.7 the layout of the /dev/dahdi files changes so that they are
grouped by span. When opening channels by number all utilities need to use
DAHDI_SPECIFY now.

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

6 years agodahdi_cfg: Make -S option based on spannumber instead of order in config file.
Shaun Ruffell [Thu, 9 May 2013 19:03:46 +0000 (14:03 -0500)]
dahdi_cfg: Make -S option based on spannumber instead of order in config file.

If the config file has two spans defined:

  span=1,1,0,esf,b8zs
  bchan=1-23
  dchan=24
  echocanceller=mg2,1-23
  span=2,2,0,esf,b8zs
  bchan=25-47
  dchan=48

And you only want to configure span-2, you would need to pass -S 1 to
dahdi_cfg. Now make the -S option take the span number as assigned in the
config file.

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

6 years agofxstest: Use DAHDI_SPECIFY when opening by integer channel number.
Shaun Ruffell [Thu, 9 May 2013 15:34:20 +0000 (10:34 -0500)]
fxstest: Use DAHDI_SPECIFY when opening by integer channel number.

In DAHDI-Linux 2.7 the layout of the /dev/dahdi files changes so that they are
grouped by span. When opening channels by number all utilities need to use
DAHDI_SPECIFY now.

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

6 years agoUpdate the configure script as well.
Tzafrir Cohen [Thu, 23 May 2013 23:06:29 +0000 (02:06 +0300)]
Update the configure script as well.

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

6 years agooptionally install pinned files: --enable-pinned
Tzafrir Cohen [Thu, 23 May 2013 22:52:43 +0000 (01:52 +0300)]
optionally install pinned files: --enable-pinned

Add installation of the pinned-spans support to the Makefile. For the
moment, however, they are not installed unless you use ./configure
--enable-pinned or build with 'make DAHDI_PINNED=yes'

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