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?
2
Answers
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 system
and check/proc/dahdi/1
again:We have seen that
dahdi_genconf
messes with the span. Is this a bug?Then run
dahdi_cfg
and check/proc/dahdi/1
again:Now we see that everything is properly configured.
Next,
dahdi_handle_device
is called by udev. It does nothing (becauseauto_assign_spans=1
is used).Then
dahdi_span_config
is called by udev. It does nothing also for the same reason.And this is the interesting part:
dahdi_cfg
is not called ifauto_assign_spans=1
is used. Is this a bug?------------------------------
On the contrary, if
auto_assign_spans=1
is not used,dahdi_cfg
is called bydahdi_span_config
.This is a bit confusing. Why is it prohibited to run
dahdi_cfg
ifauto_assign_spans=1
is used? If we have only one card, this is perfectly acceptable.auto_assign_spans=1
is even documented in dahdi-tools README as the use case for such scenario:Is it safe to add
dahdi_cfg
todahdi_span_config
manually?BTW,
system.conf
need not even be created - it is generated dynamically if it does not exist, but again, only ifauto_assign_spans=1
is not used. If this deficiency is corrected somehow, the only thing needed to configure DAHDI would be justUse the following patch for
/lib/udev/rules.d/60-dahdi.rules
: