I install DAHDI on Debian stable (Buster) via module-assistant like this:
apt-get install dahdi dahdi-source module-assistant
module-assistant auto-install dahdi
I also create /etc/dahdi/system.conf and /etc/dahdi/assigned-spans.conf.
I cannot figure out who calls dahdi_cfg during system boot. I can confirm that it does get called by something, because if I remove dahdi_cfg and reboot, echo and dahdi_echocan_oslec modules are missing from lsmod (echo cancellation is specified in system.conf).
I found /usr/share/dahdi/span_config.d/10-dahdi-cfg, but I have no idea what may run this.
So, where is dahdi_cfg called from during system boot?
UPDATE
I found out that if system.conf is missing, echo cancellation modules are loaded anyways. Mandatory conditions are:
- presence of
dahdi_cfg - /etc/dahdi/assigned-spans.conf
UPDATE2
One more observation: if /etc/dahdi/assigned-spans.conf is removed and options dahdi auto_assign_spans=1 is added to /etc/modprobe.d/dahdi.conf, echo cancellation modules are not loaded (system.conf is still removed). So it seems auto_assign_spans=1 is not working.
Can anybody answer new questions in my answer?
First of all, let's deal with
auto_assign_spans=1:Remove
auto_assign_spans=1. Result:/proc/dahdi/is empty. Useauto_assign_spans=1. Result:/proc/dahdi/is not empty.So, this is the way how to check the effect of
auto_assign_spans=1.This is the example:
Now run
dahdi_genconf systemand check/proc/dahdi/1again:We have seen that
dahdi_genconfmesses with the span. Is this a bug?Then run
dahdi_cfgand check/proc/dahdi/1again:Now we see that everything is properly configured.
Next,
dahdi_handle_deviceis called by udev. It does nothing (becauseauto_assign_spans=1is used).Then
dahdi_span_configis called by udev. It does nothing also for the same reason.And this is the interesting part:
dahdi_cfgis not called ifauto_assign_spans=1is used. Is this a bug?------------------------------
On the contrary, if
auto_assign_spans=1is not used,dahdi_cfgis called bydahdi_span_config.This is a bit confusing. Why is it prohibited to run
dahdi_cfgifauto_assign_spans=1is used? If we have only one card, this is perfectly acceptable.auto_assign_spans=1is even documented in dahdi-tools README as the use case for such scenario:Is it safe to add
dahdi_cfgtodahdi_span_configmanually?BTW,
system.confneed not even be created - it is generated dynamically if it does not exist, but again, only ifauto_assign_spans=1is not used. If this deficiency is corrected somehow, the only thing needed to configure DAHDI would be just