Provided by: dahdi_2.10.2-2ubuntu1_amd64 bug

NAME

       dahdi_span_assignments - handle DAHDI spans assignments

SYNOPSIS

       dahdi_span_assignments [-v|--verbose] [-n|--dry-run] <add|remove|auto> [devpath...]

       dahdi_span_assignments [-v|--verbose] list [devpath...]

       dahdi_span_assignments [-v|--verbose] [-k|--key key] dumpconfig

       dahdi_span_assignments -h|--help

DESCRIPTION

       Channels  in  DAHDI  devices  (such as DAHDI PCI cards) are groups to logical units called
       "spans" (for example: a port in a digital  card  is  a  span).   When  the  kernel  module
       parameter  dahdi.auto_assign_span  is  unset, DAHDI devices that register with DAHDI don't
       cause their spans to be automatically assigned.

       This allows user-space to order DAHDI to assign them to specific span and channel numbers.
       That  way, specific spans on specific DAHDI devices may be assigned with specific span and
       channel numbers regardless of the registration order of the hardware (or if  all  hardware
       is present at all).

       dahdi_span_assignments is used to assign those spans or to help creating the configuration
       file used in their assignment: /etc/dahdi/assigned-spans.conf .

SUB-COMMANDS

       There are several sub-commands.

       All sub-commands take an optional list of paths to SysFS nodes of devices. If  given,  the
       command will only operate on those DAHDI devices. The default is to operate on all devices
       (which would normally be the sane case when running from the command-line).

       add [devpath ...]
              Applies to all devices or to those listed on  the  command  line.   Parameters  are
              paths (in SysFS) to DAHDI devices with unassigned spans.

              The   command   will   assign  spans  with  DAHDI  according  to  configuration  in
              assigned-spans.conf.

              If no line matches the span,  or  if  the  assignment  for  it  fails  (it  is  not
              available) it will remain unassigned.

              If  any of the span settings fails (the span number or range of channels is already
              in use), the program will print a message, but continue  applying  the  others.  In
              such  a case you should fix assigned-spans.conf and re-run add (or run auto to give
              those  channels  the  first  available  range  and   regenerate   the   file   with
              'dahdi_genconf assignedspans').

       remove [devpath ...]
              Applies  to  all  devices  or  to those listed on the command line.  Parameters are
              paths (in SysFS) to DAHDI devices with assigned spans.

              The command will un-assign them.

       auto [devpath ...]
              Applies to all devices or to those listed on  the  command  line.   Parameters  are
              paths (in SysFS) to DAHDI devices with unassigned spans.

              Each  span  is  assigned  to first available span number and channel numbers, as if
              dahdi.auto_assign_span  was  set.  The  configuration  file  doesn't  affect  these
              assignments.

       list
              List all spans in the system.

       dumpconfig
              List   all   assigned  spans  in  the  system  in  a  format  fit  to  be  used  in
              assigned-spans.conf. Use this to generate  a  configuration  file  after  you  have
              (automatically or manually) assigned all existing spans.

              dahdi_genconf assignedspans uses this command internally.

OPTIONS

       -v --verbose
              Verbose output.

       -n --dry-run
              Don't assign / un-assign spans. Only print commands used to do so.

       -k key
              For  dumpconfig  -  The  key  by  which  to  identify the hardware in the generated
              configuration. Legal values:

              hwid
                     Hardware identifier (e.g.: software-readable serial  number).  This  is  the
                     default. If the device has no hwid, devpath is used.

              location
                     The location field (file) in the SysFS device node (directory) for the DAHDI
                     device. If not available (typically: DAHDI version  <=  2.7.x),  devpath  is
                     used.

              devpath
                     Path in SysFS to the device node.

CONFIGURATION

       /etc/dahdi/assigned-spans.conf is a file with lines specifying assignment of spans.

       Empty lines or lines beginning with '#' are ignored.

       Each line is in the format of:

       ID        spanspec ...

       The  ID field specifies the DAHDI device and the spanspecs define how to assign its spans.
       A line may have multiple spanspecs  in  a  single  line  (though  dumpconfig  generates  a
       configuration with one per line).

   Span Identifier
       A  DAHDI  device  may  be  specified  either by a hardware identifier (a software readable
       serial number or whatever) or the location in which it is installed  on  the  system.  The
       former  makes it simpler to change connector / slot whereas the latter makes it simpler to
       replace a unit.

       The value in this field is matched (when the commands add and remove)  are  used)  to  the
       following values:

        hwid
        @location
        devpath

       See  above  for  their  descriptions.  The value may include shell wildcards: *, ? and [],
       which are used in the match. The values to  be  matched  are  first  cleaned  up:  '!'  is
       replaced with '/' and any character beyond "a-zA-Z0-9/:.-" is removed.

   Span Specification
       Each  line should have one or more span specifications: this is the value used to assign a
       span with DAHDI in the SysFS interface. A specification has three colon-separated numbers:

       rel_span_no:span_no:first_chan

       for instance, the following are four span specifications  for  a  quad-E1  device:  1:6:53
       2:7:84 3:8:115 4:9:146 occupying spans 6-9 and channels 53-176.

       rel_span_no
              The relative number of the span in the device. E.g.: port number.

       span_no
              The desired DAHDI span number. Must be available.

       first_chan
              The  desired  DAHDI  channel  number  for the first DAHDI channel in the span.  All
              channels of the span will be assigned following it and hence  that  space  must  be
              available.

ENVIRONMENT

       DAHDICONFDIR
              The  directory  in  which assigned-spans.conf resides. /etc/dahdi if not overridden
              from the environment.

       DAHDISASSIGNEDSPANSCONF
              The path to  assigned-spans.conf  resides.  /etc/dahdi/assigned-spans.conf  if  not
              overridden from the environment.

       SPAN_ASSIGNMENTS_KEY
              The  default  value  for  -k  .  Defaults  to  "hwid"  if  not  overridden from the
              environment.

FILES

       /etc/dahdi/assigned-spans.conf
              The default location for the configuration file.

       /sys/bus/dahdi_devices/devices/device
              SysFS node for the device. In this directory  reside  the  following  files,  among
              others:

              location
                     The value of the device's location field.

              assign_span, unassign_span, auto_assign
                     Write  only  files  for  the  operations.  Used  by  add,  remove  and auto,
                     respectively.

SEE ALSO

       dahdi_span_types(8), dahdi_genconf(8), dahdi_cfg(8)

AUTHOR

       dahdi_span_assignments was written by Oron Peled.  This manual page was written by Tzafrir
       Cohen.  Permission  is  granted  to copy, distribute and/or modify this document under the
       terms of the GNU General Public License, Version 2 any  later  version  published  by  the
       Free Software Foundation.

                                           23 Jan 2014                  DAHDI_SPAN_ASSIGNMENTS(8)