I have a new installation of FreePBX 15.0.16.49 using Asterisk Version 16.9.0 . I am using a Rhino R1T1 card with T1 PRI service from Cox. This is an upgrade from a previous Elastix system I had been running for several years.
The automatic DAHDI config in FreePBX worked fine, but the DAHDI Config page shows that DAHDI is not running, and suggested clicking the “Restart DAHDI and Asterisk” button. That worked, and the system then answered incoming calls. However, when I rebooted the system, Asterisk came up but DAHDI did not, and the system would not answer incoming calls.
Clicking “Restart DAHDI and Asterisk” again worked to fix that.
After reboot, sudo service dahdi status produceed no output because dahdi was not running. Running sudo service dahdi start started dahdi, and then sudo service dahdi status would output:
### Span 1: R1T1/0 "Rhino R1T1 T1/PRI Card 0" (MASTER) ESF/B8ZS
1 PRI Clear (In use)
2 PRI Clear (In use)
3 PRI Clear (In use)
4 PRI Clear (In use)
5 PRI Clear (In use)
6 PRI Clear (In use)
7 PRI Clear (In use)
8 PRI Clear (In use)
9 PRI Clear (In use)
10 PRI Clear (In use)
11 PRI Clear (In use)
12 PRI Clear (In use)
13 PRI Clear (In use)
14 PRI Clear (In use)
15 PRI Clear (In use)
16 PRI Clear (In use)
17 PRI Clear (In use)
18 PRI Clear (In use)
19 PRI Clear (In use)
20 PRI Clear (In use)
21 PRI Clear (In use)
22 PRI Clear (In use)
23 PRI Clear (In use)
24 PRI HDLCFCS (In use)
However, Asterisk did not yet answer incoming calls. fwconsole reload did not change that, but fwconsole restart did; after the restart, Asterisk answered incoming calls.
I had seen a post that there was a problem with the DAHDI configuration module within FreePBX, and that this problem would be fixed by disabling that module once DAHDI had been configured. However, I tried that and it did not work.
CentOS uses several interrelated subsystems for boot configuration, including chkconfig and systemd. The chkconfig system uses /etc/init.d/ and /etc/rcX.d/ to configure its startup, and systemd is designed to respect that.
There was an entry for asterisk within /etc/init.d/ and /etc/rcX.d/, and also an entry for dahdi in /etc/init.d/ but not in /etc/rcXd/. The chkconfig output contained entries for both asterisk and dahdi, but only asterisk had been set to be started by chkconfig.
$ chkconfig --list dahdi
…
service dahdi supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add dahdi')
$ chkconfig --list asterisk
…
asterisk 0:off 1:off 2:on 3:on 4:on 5:on 6:off
systemd appears to include a lot of support for dependency, making sure that units start in the correct order, but chkconfig does not; the order of service starting in chkconfig has traditionally been set by the name of the links within /etc/rcX.d/, but newer systems can and do start services in parallel, without a guarantee that one will be complete before the next one starts, according to the man pages.
I was able to get dahdi to start on reboot with
$ sudo chkconfig dahdi on
Now, DAHDI does start on reboot, and Asterisk answers incoming calls. /var/logs/messages shows that dahdi is starting before asterisk (indeed, asterisk starts the very second that dahdi is finished starting) which suggests that the load dependency is being resolved correctly.
My question is, given the complexity of FreePBX and CentOS, was that the right solution? Is that the way I am supposed to get DAHDI to start before Asterisk when the system boots?