DAHDI_SPAN_ASSIGNMENTS(8)

πŸ’… DAHDI_SPAN_ASSIGNMENTS β€” handle DAHDI spans assignments ✨

okay bestie, so you know how DAHDI devices are just out here registering themselves and nobody's told them which span number to be? yeah. this is the page for dahdi_span_assignments, part of the DAHDI tools (section 8, system administration, for the sysadmin girlies 🫢).


🌸 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 πŸ’–

so, the channels in DAHDI devices (think DAHDI PCI cards and friends) get grouped into logical units called "spans" β€” like, a port on a digital card is a span, that's the whole vibe.

here's the tea: when the kernel module parameter dahdi.auto_assign_span is unset, DAHDI devices that register with DAHDI do not automatically get their spans assigned. they just sit there. unassigned. no cap.

and that's actually the point, because it lets user-space tell DAHDI exactly which spans go to which span and channel numbers. so a specific span on a specific DAHDI device can get a specific span and channel number regardless of the order the hardware registered in (or honestly, regardless of whether all the hardware is even present at all πŸ”₯).

dahdi_span_assignments is the tool for assigning those spans, and also for helping you build the config file that does the assigning:

/etc/dahdi/assigned-spans.conf


✨ SUB-COMMANDS ✨

there are several sub-commands, and here's the thing bestie β€”

all sub-commands take an optional list of paths to SysFS nodes of devices. if you give them, the command only operates on those DAHDI devices. the default is to operate on all devices (which, ngl, is normally the sane case when you're running from the command line).

  • add [devpath ...] β€” applies to all devices, or just the ones listed on the command line. the parameters are paths (in SysFS) to DAHDI devices with unassigned spans.

this one assigns spans with DAHDI according to the configuration in assigned-spans.conf.

if no line matches the span, or if the assignment for it fails (it's not available), it stays unassigned. it's giving "we tried, we failed, moving on" 😭.

if any of the span settings fails (because the span number or range of channels is already in use), the program prints a message but keeps going and applies the others. in that 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 just the ones listed on the command line. parameters are paths (in SysFS) to DAHDI devices with assigned spans.

this one un-assigns them. bye bye span πŸ‘‹.

  • auto [devpath ...] β€” applies to all devices, or just the ones listed on the command line. parameters are paths (in SysFS) to DAHDI devices with unassigned spans.

each span gets assigned to the first available span number and channel numbers, exactly as if dahdi.auto_assign_span was set. the configuration file does not affect these assignments. it's full auto-pilot, main character energy πŸ‘‘.

  • list β€” lists all spans in the system. that's it, that's the whole job.
  • dumpconfig β€” lists all assigned spans in the system in a format that's fit to be used in assigned-spans.conf. use this to generate a config file after you've (automatically or manually) assigned all the existing spans.

dahdi_genconf assignedspans uses this command internally, iykyk.


πŸŽ€ OPTIONS πŸŽ€

  • -v, --verbose β€” verbose output. more words, more fun.
  • -n, --dry-run β€” don't actually assign / un-assign spans. only print the commands used to do so. it's the "we're just practicing" setting πŸ’….
  • -k key β€” for dumpconfig: the key by which to identify the hardware in the generated configuration. legal values are:
    • 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 the assignment of spans.

empty lines, or lines beginning with #, are ignored (we love a comment bestie).

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 by the location in which it's 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. so cute, so thorough πŸ’–.

πŸ’œ 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. ate. πŸ”₯

  • 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. slay, licensing girlies πŸŽ€


and that's the whole page bestie β€” this was DAHDI_SPAN_ASSIGNMENTS(8) from the DAHDI tools, dated 23 Jan 2014. go forth and assign those spans, you've got this πŸ’–βœ¨πŸŒΈ
πŸ“¦ where this page comes from