DAHDI_SPAN_TYPES(8)

πŸ“¦
version 3.4.0 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ DAHDI_SPAN_TYPES ✨

okay bestie, this is the dahdi_span_types page from section 8 of the manual β€” the whole thing about setting line modes on DAHDI spans before anybody assigns them a number. buckle up, it's actually so good πŸŽ€

πŸ’– NAME πŸ’–

dahdi_span_types β€” set line modes of DAHDI spans before assignment

πŸ¦‹ SYNOPSIS πŸ¦‹

dahdi_span_types [options] <list|dumpconfig|compare|set> [devpath ...]

🌸 DESCRIPTION 🌸

so here's the tea: the span type (that's the line mode β€” E1, T1 or J1) has to be set on a span before DAHDI assigns it a span number, because E1 spans use more channels. that's just how it is, no cap. and dahdi_span_types is literally the tool that applies your span type configuration to an un-assigned span. πŸ’…

lowkey important: this only makes sense when the kernel module parameter dahdi.auto_assign_span is unset. if you did set it, DAHDI just automatically assigns span numbers during device registration and this whole vibe is pointless. πŸ™ˆ

dahdi_span_types takes a command and an optional list of devices. if you don't give it any device, the command gets applied to all devices. main character energy, honestly.

the device is marked as a path in the SysFS tree. periodt.


πŸ‘‘ OPTIONS πŸ‘‘

  • -h|--help β€” spits out the usage message and dips. that's it, that's the whole thing ✨
  • -n|--dry-run β€” during the "set" operation, it only shows you what it would do, without actually changing anything. a little peek, no commitment 🫢
  • -v|--verbose β€” during the "set" operation, it shows the actions that are being performed. narrating its own slay.
  • --line-mode=<E1|T1|J1> β€” during the dumpconfig operation, this forces a special generation mode:
    • first, it generates a "wildcard" entry with the given line-mode. πŸ‘‘
    • then it comments out all span entries. each of them may be manually un-commented to override the "wildcard". so iconic.

🌈 SUB-COMMANDS 🌈

  • set β€” reads settings from span-types.conf and applies them to the device(s) specified in the command line (or all devices, if none specified). the classic.
  • compare β€” compares the settings on the system to those in the configuration file. for each line that applies to a device on the system, it prints it if the value to be set and the active value on the system differ.
    • the exit status is 0 if there is no difference, and non-zero if a difference was detected. πŸ’€
  • list β€” lists line modes for all spans in the system which may be set with dahdi_span_types (that's the E1/T1/J1 spans, iykyk).
  • dumpconfig β€” lists types for the spans in a format fit to be used in span-types.conf. use this to generate a configuration file after you have (perhaps manually) set all existing spans. so handy fr fr.
    • dahdi_genconf spantypes uses this command internally. πŸ‘€

πŸŽ€ CONFIGURATION πŸŽ€

general structure 🧚

span-types.conf is a file with lines specifying line modes of spans.

empty lines, or lines beginning with '#', are ignored. (yes bestie, you can comment your config, live your truth.)

each line is in the format of:

ID        spanspec ...

the ID field specifies the DAHDI device, and the spanspecs define the line modes of 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 command set is 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 not in "a-zA-Z0-9/:.-" is replaced by "_".

note that while span-types.conf allows an arbitrarily-complex combination of E1, J1 and T1 ports, it would normally have just a single wildcard line setting the line mode (the first line in the example below). keep it simple, babes.

span specification 🌟

each line should have one or more span specifications: this is the value used to set span type with DAHDI in the SysFS interface. a specification has two colon-separated fields:

rel_span_no:span_type

for instance, the following are four span specifications specify ports 1 and 2 as E1 and ports 3 and 4 as T1: [12]:E1 [34]:T1 .

  • rel_span_no β€” the relative number of the span in the device. E.g.: port number. this field may contain shell wildcards (*, ? and []).
  • span_type β€” E1/T1/J1

multiple matches πŸ”₯

during the set operation, dahdi_span_types applies all matching settings to a span. this is done in the order of lines in the configuration files.

so if there are multiple matches to a span β€” the last match wins. all of them get applied to the kernel in order, and the last one in the file is applied last. the final girl always wins. πŸ’…

example:

*             *:T1      # All spans on all devices will be T1
usb:X1234567  [34]:E1   # Except spans 3,4 on the device which will be E1

🌱 ENVIRONMENT 🌱

  • DAHDICONFDIR β€” the directory in which span-types.conf resides. /etc/dahdi if not overridden from the environment.
  • DAHDISPANTYPESCONF β€” the path to span-types.conf resides. /etc/dahdi/span-types.conf if not overridden from the environment.

πŸ“ FILES πŸ“

  • /etc/dahdi/span-types.conf β€” the default location for the configuration file.
  • /sys/bus/dahdi_devices/devices/device β€” the SysFS node for the device. in this directory reside the following files, among others:
    • spantype β€” read/write file. reading from it returns the current configuration for spans of the device. span-specifications can be written to it to change line modes (but only for a span that is not assigned yet). ⚠️

πŸ’« SEE ALSO πŸ’«

dahdi_span_assignments(8), dahdi_genconf(8), dahdi_cfg(8)


🫢 AUTHOR 🫢

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


and that's the whole page, bestie β€” this version of the manual is dated 23 Jan 2014 and it comes from DAHDI_SPAN_TYPES(8). go forth and set your line modes. slay. βœ¨πŸ‘‘πŸ’