Compiling DAHDI for Asterisk on Fedora Remix


15 posts
by navaismo » Fri Sep 14, 2012 3:47 am
Hi, here are some steps in order to compile the DAHDI module for use with Asterisk PBX

1) You need to know your kernel version:
Code: Select all
[root@FCRaspi ~]# rpm -qa | grep kernel
raspberrypi-kernel-3.1.9-11.20120727gitf958199.rpfr17.armv5tel

In my case the kernel running is: raspberrypi-kernel-3.1.9-11.20120727gitf958199.rpfr17.armv5tel

2) Go to the kernel sources directory, find & download your kernel: http://scotland.proximity.on.ca/~agreen ... es/source/
Code: Select all
[root@FCRaspi ~]# wget http://scotland.proximity.on.ca/~agreene/raspberrypi/raspberrypi-fedora-remix/17/packages/source/raspberrypi-kernel-3.1.9-11.20120727gitf958199.rpfr17.src.rpm

I have created a directory called source and then moved the rpm to it.

3) Extract the rpm
Code: Select all
[root@FCRaspi source]# rpm2cpio raspberrypi-kernel-3.1.9-11.20120727gitf958199.rpfr17.src.rpm | cpio -idmv

When its done, you will see some files:
Code: Select all
f958199774d8a52e1262089b6469e56cc6b162dc
first32k.bin.bz2
raspberrypi-kernel.spec
raspi-config-rpfr17-005.bz2

You need to expand the raspi-config-rpfr17-005.bz2, this is the .config file for use with the kernel-sources, and rename the f958199774d8a52e1262089b6469e56cc6b162dc to kernel-sources.tar.gz
Code: Select all
mv f958199774d8a52e1262089b6469e56cc6b162dc  kernel-sources.tar.gz

4) Extract the sources:
Code: Select all
[root@FCRaspi source]# tar zxvf kernel-sources.tar.gz

After some time you will see a folder called raspberrypi-linux-XXXXX in my case is raspberrypi-linux-f958199.

5) Copy the default config file to the kernel-source folder:
Code: Select all
[root@FCRaspi source]# cp raspi-config-rpfr17-005 raspberrypi-linux-f958199/.config

6) Change to the kernel-source folder and run:
Code: Select all
[root@FCRaspi raspberrypi-linux-f958199]# make silentoldconfig && make prepare && make scripts

7) Download the dahdi sources and extract:
Code: Select all
[root@FCRaspi source]# cd /usr/src/
[root@FCRaspi src]#wget http://downloads.asterisk.org/pub/telephony/dahdi-linux/dahdi-linux-current.tar.gz
[root@FCRaspi src]#wget http://downloads.asterisk.org/pub/telephony/dahdi-tools/dahdi-tools-current.tar.gz
[root@FCRaspi src]# tar zxvj dahdi-linux-current.tar.gz
[root@FCRaspi src]# tar zxvf dahdi-tools-current.tar.gz

8) Change to the dahdi linux folder and compile it:
Code: Select all
[root@FCRaspi dahdi-linux-2.6.1]# KSRC=/root/source/raspberrypi-linux-f958199/ make
[root@FCRaspi dahdi-linux-2.6.1]# KSRC=/root/source/raspberrypi-linux-f958199/ make install

9) Change to the dahdi tools folder and compile it:
Code: Select all
[root@FCRaspi dahdi-tools-2.6.1]# ./configure
[root@FCRaspi dahdi-tools-2.6.1]# KSRC=/root/source/raspberrypi-linux-f958199/ make
[root@FCRaspi dahdi-tools-2.6.1]# KSRC=/root/source/raspberrypi-linux-f958199/ make install
[root@FCRaspi dahdi-tools-2.6.1]# KSRC=/root/source/raspberrypi-linux-f958199/ make config


At this point your dahdi must be compiled without errors, but some warnings. And you can start as usual with: service dahdi start or systemctl start dahdi.service

10) Download your preferred version of Asterisk as usual and run the configure script and then execute the make menuselect

Now you can see available the application meetme:
Image

Then You can see the DAHDI channel running in Asterisk & you can test the Meetme Application.
Image

Image

Hope this helps.

Best Regards
Posts: 12
Joined: Fri Sep 14, 2012 2:54 am
by tgwaste » Thu Jan 31, 2013 7:17 pm
Hi,
I dont understand. How does the raspberry pi board receive calls? Connecting a digium card to it somehow?
Posts: 31
Joined: Thu Jan 31, 2013 7:15 pm
by navaismo » Thu Jan 31, 2013 11:50 pm
For receive calls You can:

--Use an ITSP( often know as SIP TRUNK).
--Use an ATA(FXO-SIP)

But you cant add telephony cards. I want to acquire a USBFXO by Sangoma to test with it.
Posts: 12
Joined: Fri Sep 14, 2012 2:54 am
by tgwaste » Fri Feb 01, 2013 12:59 am
Very interesting. I use my own home-made conference/bboard/vmail with digium products and am definitely gonna see what I can do with a Pi board. I want to write something custom for it and make it public.

This guy was working on an USB/FXO stick that looks like it would be AWESOME for a Pi board:

http://openusbfxo.wordpress.com/

But it looks like his work is stalled.
Posts: 31
Joined: Thu Jan 31, 2013 7:15 pm
by navaismo » Fri Feb 01, 2013 1:27 am
Sure you can do a lot of stuff using the pi and asterisk (you can take a look in my blogs if you want raspimods.blogspot.com asterisktools.blogspot.com) and the job for the guy about the usbfxo its amazing indeed.

Thanks for sharing the link.

Best regards.
Posts: 12
Joined: Fri Sep 14, 2012 2:54 am
by tgwaste » Fri Feb 01, 2013 1:41 am
awesome blog man, ill definitely be following it. looked at the U100. very cool. wish it were a bit cheaper though.
Posts: 31
Joined: Thu Jan 31, 2013 7:15 pm
by tanders12 » Wed Feb 13, 2013 4:10 am
Highly recommend snagging an Obi110 for ~$50 on amazon. Works great with Asterisk. This is what is used with the RPi for the BananaPhoneProject.
Posts: 2
Joined: Wed Feb 13, 2013 4:03 am
by tgwaste » Wed Feb 13, 2013 5:45 am
Ive decided to write a telco project from scratch focusing on SIP (with a DID). So far its going pretty good. not having to have any physical equipment except a pi is awesome.
Posts: 31
Joined: Thu Jan 31, 2013 7:15 pm
by navaismo » Wed Feb 13, 2013 6:20 am
Yes, since I have received my pi is working as my PBX using an ITSP(VoIP.ms) so far 6 calls have decent performance. Im using it with static real time(MySQL) and apache for the GUI(charisma template) and the Doubango's WebRTC2Sip media gateway to support webrtc calls.
Posts: 12
Joined: Fri Sep 14, 2012 2:54 am
by Samstown » Wed May 08, 2013 8:50 pm
@ navaismo , Thank you very much for this great tutotrial, I start Dev for USB-FXO device and your post is a great help, I hope FXO will be ready within 3-4 months, you will get one free if it works.
Last edited by Samstown on Wed May 08, 2013 9:30 pm, edited 1 time in total.
Posts: 1
Joined: Wed May 08, 2013 9:35 am
by tgwaste » Wed May 08, 2013 9:27 pm
the telco project im working on:

http://www.berryboard.net/

would love to play with an USB/FXO board for the pi :)
Posts: 31
Joined: Thu Jan 31, 2013 7:15 pm
by navaismo » Thu May 09, 2013 12:31 am
Samstown wrote:@ navaismo , Thank you very much for this great tutotrial, I start Dev for USB-FXO device and your post is a great help, I hope FXO will be ready within 3-4 months, you will get one free if it works.


:o :o :o

Sounds very good! :D
Thanks for the consideration.
Posts: 12
Joined: Fri Sep 14, 2012 2:54 am
by dsc3507 » Mon Feb 17, 2014 5:01 am
The source link to -

http://scotland.proximity.on.ca/~agreen ... es/source/

appears to not be working on 2/16/2014 - will it be back up or is there an alternative site?
Posts: 38
Joined: Sun Apr 28, 2013 5:08 am
by dsc3507 » Mon Feb 17, 2014 5:02 am
Also remix 17 is now old. Is there a location for source remix 18 and will it work the with DAHDI?
Posts: 38
Joined: Sun Apr 28, 2013 5:08 am
by navaismo » Sat Feb 22, 2014 6:58 pm
My first question is do you really need DAHDI support for your Pi?

Then you can check the official repositories for your distro and download the sources and follow the tutorial basically it *should* apply to any version.

--Added:

Here is the link for the Kernel Source of the Pidora 18: http://pidora.ca/pidora/releases/18/pac ... a6.src.rpm
Posts: 12
Joined: Fri Sep 14, 2012 2:54 am