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 inassigned-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β fordumpconfig: 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 nohwid,devpathis used.locationβ thelocationfield (file) in the SysFS device node (directory) for the DAHDI device. if not available (typically: DAHDI version <= 2.7.x),devpathis 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 whichassigned-spans.confresides./etc/dahdiif not overridden from the environment.DAHDISASSIGNEDSPANSCONFβ the path toassigned-spans.confresides./etc/dahdi/assigned-spans.confif 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'slocationfield.assign_span,unassign_span,auto_assignβ write-only files for the operations. used byadd,removeandauto, 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
- debian bookworm: dahdi 1:3.1.0-2
- debian trixie: dahdi 1:3.1.0-2.1
- epel 9: dahdi-tools 2.11.1-28.el9 Β· GPLv2 and LGPLv2
- fedora 43: dahdi-tools 2.11.1-37.fc43 Β· GPL-2.0-only AND LicenseRef-Callaway-LGPLv2
- fedora 44: dahdi-tools 2.11.1-39.fc44 Β· GPL-2.0-only AND LicenseRef-Callaway-LGPLv2
- ubuntu jammy: dahdi 1:3.1.0-2
- ubuntu noble: dahdi 1:3.1.0-2build1
- ubuntu questing: dahdi 1:3.1.0-2.1
- ubuntu resolute: dahdi 1:3.1.0-2.1build1
- ubuntu stonking: dahdi 1:3.4.0-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms