Making asterisk+Dahdi work on ubuntu 14.04
Asterisk and Dahdi Setup
I installed asterisk and the dahdi packages
apt-get install asterisk asterisk-config asterisk-core-sounds-en asterisk-core-sounds-en-gsm asterisk-dahdi asterisk-modules asterisk-moh-opsound-gsm asterisk-vocemail dahdi dahdi-dkms dahdi-linux
I rebooted at this point because it seems as though dahdi and asterisk act a bit different from a reload than from a reboot.
I confirmed that the dahdi modules were all loaded and then I ran:
dahdi_hardware #to confirm that my wcte12xp+ hardware was visible dahdi_genconf # to automatically setup my /etc/dahdi/system.conf file dahdi_scan # to make sure that my hardware was setup to run a PRI / T1 (it wasn't so I had to change the jumper from e1 to t1 and start over)
At this poing I am ready to run the config and make sure that my channels are all configured correctly
dahdi_cfg -vv # this display all of the channels that are were setup by dahdi_genconf, if dahdi_genconf set up your span wrong edit /etc/dahdi/system.conf
I also confirmed that in my ‘ /etc/modprobe.d/dahdi.conf’ file I had a couple of entries
options dahdi auto_assign_spans=1 options wcte12xp default_linemode=t1
(the linemode may have been unnecessary, and left over from when I was screwing around with figuring out the jumper)
After everything is setup again, I reboot (Rebooting is always good idea when verifying configuration changes, as it confirms that your changes will survive a reboot)
The Issue – Errors with the PRI
When the reboot came back up , I was able to confrim again that dahdi_scan and dahdi_cfg -vv came back as expected. Since the dahdi_genconf command autoatmically setup my dahdi-channels.conf file (included by chan_dahdi.conf) Then now calls that come in through the pri should now start showing up on the asterisk console.
asterisk -rvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv #attach to the asterisk console with a good amount of debugging
This is where I start to see errors:
[Apr 24 10:07:07] ERROR chan_dahdi.c: PRI Span: 1 Write to 36 failed: Invalid argument [Apr 24 10:07:07] ERROR chan_dahdi.c: PRI Span: 1 Short write: 0/5 (Invalid argument)
These errors occur 1000s of times an hour.
After digging around a bit more I found a couple more errors
#dmesg|grep dahdi [ 12.024807] dahdi: module verification failed: signature and/or required key missing - tainting kernel [ 12.025077] dahdi: unknown parameter 'auto_assign_spans' ignored
I did not know what these meant, but it seemed worth some research. It seems that when a kernel is tainted “It is in a state that is not supported by the community“. [http://unix.stackexchange.com/questions/118116/linux-what-is-a-tainted-kernel]. However that just seems to show that there is a problem but does not help me figure out what it means. However the ‘unknown parameter’ auto_assign_spans leads me to believe that I somehow have an old version of dahdi installed
# cat /sys/module/dahdi/version 126.96.36.199
A quick check shows that the dahdi installed from the binary is seriously out of date.
Install Latest versions from source
So, I had to remove asterisk and dahdi as a set of packages and install from source.
#apt-get remove asterisk dahdi #apt-get autoremove
Removed about 70 packages and I was left with an asterisk-less system, then this article helped me to get asterisk and dahdi installed from source
#apt-get update && apt-get -y upgrade #apt-get -y install linux-headers-$(uname -r) #apt-get -y install build-essential subversion git
libncurses5-dev uuid-dev libjansson-dev libxml2-dev libsqlite3-dev#cd /usr/local/src #wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz #tar zxvf dahdi-linux-complete-current.tar.gz #cd dahdi-linux-complete*/ #I changed this from the article since the latest version was 2.11 when I installed #make all #make install #make config #cd /usr/local/src #wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz #tar zxvf libpri* #cd libpri* #make install && cd .. # wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz #tar xvzf asterisk* #cd asterisk* #contrib/scripts/get_mp3_source.sh #contrib/scripts/install_prereq install # make && make install && make config
Then I restart everything
/etc/init.d/dahdi start /etc/init.d/asterisk start
And my phone system is working, there are no more errors and all phone traffic (in and out of the PRI) is working.
Of course, I reboot, just to confirm that dahdi and asterisk do start on their own.