DAHDI works with Rhino R1T1, but does not start after reboot; Do I need chkconfig?


(Nachbar) #1

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?


(Matt Brooks) #2

This is a tough question. First I just want to say that there is a lot of value in working code. If it’s working good for you then great! I don’t see anything wrong with this approach.

That being said, FreePBX typically likes to start things from an Asterisk perspective. What I don’t know exactly, is if FreePBX likes to start dahdi, or if that should be done like you did. What I do know, is if you’re using CentOS to start Asterisk, you’ll probably have a bad time at some point.

I don’t know if this helps, but good luck!


(TheJames) #3

If you have the dahdiconfig module it does start dahdi stuff

You need to also make sure you have…

echo ‘blacklist r1t1’ >> /etc/modprobe.d/dahdi.blacklist.conf
echo r1t1 >> /etc/dahdi/modules

This makes sure the kernel doesn’t attempt to autoload dahdi and the r1t1 allowing the scripts to do the loading.


(system) closed #4

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.