• Home
  • About
  • Metaphysical Farms

Asterisk on OpenWRT

Lest Blood Be Shed

Cultivating community so that we may join in our human family in a way that is sustainable and filled with love for all creation. More »

Asterisk on OpenWRT January 7. 2005


I have been using for my long-distance at home a VoIP connection provided by Vonage. The school had been paying for the service which gave me free long-distance. Fortunately the school finally wised up and cancelled their Vonage service (vonage is a horrible horrible VoIP company) but this left me with no long-distance (other than my .10 a min lan long-distance). The school (Brian Capouch) has been big in the VoIP scene and had switched to a company called NuFone. This company works great with the Asterisk open source PBX software and so I decided to setup my own PBX in my house! Asterisk requires a linux machine to work which since I didn't want to have a full machine up and running 24hrs a day just for a few phone calls, OpenWRT+Asterisk seemed like the best solution. OpenWRT is a linux distro that runs on the Linksys WRT-G/GS wireless G routers. These OpenWRT routers are fully functional linux installs without all the hassle or electrical cost of a full machine running.

I've since setup some pretty cool things with more on the way with Asterisk. I can now call (using a sip phone on campus) x7106 and it will ring my house internet. I can also call (from the house) any long-distance number and have it use the SJC NuFone account to place the call.

Here is how (how-to) I got it to work


Update 2005-03-10: A new and more verbose version of this entry can be found at Asterisk on OpenWRT part 2.


The first thing I needed to do was install the OpenWRT firmware. I didn't take the time (or bandwidth) to compile it myself. I just used the snapshot for the gs version of OpenWRT (I have the GS hardware). There is a wonderful howto

here.

I actually first tried to turn the OpenWRT router into a simple bridge but ran into some problems being able to use the package tools as well as the WAN port on the machine. I ended up converting my entire network address space to handle the new router instead of using OpenWRT as a bridge (my internal IP addresses were the same as the routers external IP address... you can very well "route" with the same network on both sides of a router).

Once I got the machine setup and talking on the internet (and routing my traffic) I started the process of installing Asterisk.

The first thing I did was add the following line to my /etc/ipkg.conf file:
src local http://12.176.248.4/ipkg
src nico http://nthill.free.fr/openwrt/ipkg/stable
src nico-t http://nthill.free.fr/openwrt/ipkg/testing
src ab0oo http://www.wildcatwireless.net/wrt54g

The first "local" package line comes from Brian Capouch. He is really big into Asterisk and has created a OpenWRT package of the Asterisk-cvs branch. I used the cvs version for my install instead of the default "asterisk" package that comes from nthill.free.fr.

The second thing was to install 'asterisk-cvs' and 'asterisk-sounds' The package manager installs a few other packages that are needed for asterisk. There is the ability to install other modules for asterisk but I didn't/don't need them.

This is where the documentation for what I was doing was absent. I had never worked with asterisk let alone asterisk on openwrt. There were a few things I needed to change to the asterisk install to get it up and running. The first thing was to not load some of the modules that were not installed on the machine. I had to change/put the following in my /etc/asterisk/modules.conf file:

;
; Asterisk configuration file
;
; Module Loader configuration file
;

[modules]
autoload=yes
;
; If you want, load the GTK console right away.
; Don't load the KDE console since
; it's not as sophisticated right now.
;
noload => pbx_gtkconsole.so
;load => pbx_gtkconsole.so
noload => pbx_kdeconsole.so
noload => pbx_dundi.so
;
; Intercom application is obsoleted by
; chan_oss. Don't load it.
;
noload => app_intercom.so
;
; Explicitly load the chan_modem.so early on to be sure
; it loads before any of the chan_modem* 's afte rit
;
; load => chan_modem.so
noload => res_musiconhold.so
noload => chan_modem.so
noload => cdr_pgsql.so
noload => cdr_mysql.so
;
; Load either OSS or ALSA, not both
; By default, load OSS only (automatically) and do not load ALSA
;
noload => chan_alsa.so
;noload => chan_oss.so
;
; Module names listed in "global" section will have symbols globally
; exported to modules loaded after them.
;
[global]
; chan_modem.so=yes


After I got the modules all squared away, I needed to setup my IAX configuration to talk to SJC (so they could talk to me too). I edited the /etc/asterisk/iax.conf file to accomplish that. The next thing I did was to get my ATA 186 SIP phone talking to my new Asterisk server. That was really simple. I just needed to edit my /etc/asterisk/sip.conf file to talk to the ATA. Changing those two files doesn't do much for actually making calls. The next thing I had to do (and what took me all day) was to edit my /etc/asterisk/extenstions.conf file. With the help of the BC over my shoulder, I was able to get the asterisk server to use NuFone as well as have the on campus asterisk server to be able to dial my asterisk server which in turn rings my ATA.

There is so much more I want to get setup with that box but what does one do when they run a phone company?... I have that many possibilities!
David  Friday, January 7. 2005 @ 12:55
Add Comment Link to entry

Trackbacks
Trackback specific URI for this entry

No Trackbacks

Comments
Display comments as (Linear | Threaded)

Bee-boo-bah-boo-bee-boo-bop.
#1 Luke (Homepage) on 2005-01-07 16:13
That's about right Luke (or is it McSchellmen)... this stuff is like eating star crunches to computer geeks!

:-)
#1.1 David (Homepage) on 2005-01-07 16:20
Hey. I've recently found out about this wonderfull new world of VoIP and Asterisk. So far I've just been reading and studying about it. I am not a computer professional, so this may be a sort of a problem... I am trying to set a VoIP PBX for our community here in northern Portugal. We have very limited resources for which I'm considering the WRT54G+openwrt+asterisk. Just a few doubts: Is the WRT54G with an internet connection really all I need? Don't I need a server? Can I connect a telco line to it? And GSM?
Sorry, this is the sort of basic doubts I have. Can you help me out in designing the full system. thanks
#1.1.1 Filipe on 2006-02-24 08:23
I have one WRT[B]P[/B]54G (2 voice ports). Can I use these [B]2 local voice ports[/B] in OpenWRT+Asterisk to make and receive calls from local TELCO ???

Thanks,
Evandro

[B][LINK]http://evandro.net/[/LINK][/B]
[B][LINK]http://evandro.net/poker/[/LINK][/B]
[B][LINK]http://www.poker-regras.com/[/LINK][/B]
#1.2 Evandro (Homepage) on 2007-10-29 20:18
What are the spec's on your Linksys WRT? processor, memory, flash storage? Just curious, I may be interested in trying that out, also depending on the cost of the hardware.

(Just as a linux router, not necessarily for VoIP at this point..)
#2 Justin (Homepage) on 2005-01-17 14:50
I have the Linksys WRT54GS:

[LINK]http://www.linksys.com/products/product.asp?grid=33&scid=35&prid=610[/LINK]

I believe it has a 4MB ROM and a 8 or 16MB RAM.
#2.1 David (Homepage) on 2005-01-17 16:54
So now that you have loaded * on your wrt, what is the performance like? Just curious, considering that your article was what caused me to kick sveasoft to the curb and move to openwrt...
#3 K. Callis on 2005-02-07 02:25
Rock on on booting sveasoft. There are some perfomance problems when running the voicemail app with asterisk but I have not noticed anything other than that. I'm making calls almost every day with NuFone and every once in awhile doing an iax connection to another asterisk box. I'm using gsm for my codec on all the calls I make. This seems to be working well with my box as well as my bandwidth.

As far as the voicemail is concerned. I think the problem has to do with the wrt not being able to handle the compression that takes place when saving a sound file. Another problem with the vociemail on these boxes is the fact that if the box loses power you lose all of your voicemail. There are a few ways around this problem but I found the simplest solution is to foward the call to a place that can handle voicemail. Another way would be to mount an nfs share (I haven't tried this yet so it's only a guess) and save the voicemails there.

Thanks for the great comment Callis!!
#3.1 David (Homepage) on 2005-02-07 09:56
I have been busy turing wshaper to see if I can get better performance through QoS. Of course, in looking at all of that, I ran across the pointer to the SER sip proxy that is running under openwrt....

When I moved to Mexico, I only had 2 machines to utilized for work. So I am unable to do a full * deployment. All I am looking to do is simple calls via FWD and Broadvoice. Easier to have the devices do the trancoding, and fortunately, I have a [B]Cisco 6970[/B], and several [B]SIPURA 2000[/B].

Although, I have an old [B]Netwinder 2100[/B], which is MIPS based, so I am going to see if I can load the asterisk image on there and see if that will work. The beauty of that is that it has 128M RAM and a 10G hard drive.
#3.1.1 Anonymous on 2005-02-07 15:48
Could adding an SD card reader to your Linksys WRT54G allow you to add more asterisk features?(go here for directions).
[LINK]http://kiel.kool.dk:27/[/LINK]
#4 Keith on 2005-09-08 12:28
[B]Asterisk also available for Linksys NSLU2 running unslung or openslug firmware[/B]
http://www.nslu2-linux.org/

The NLSU2 it's a Network Attached Storage device equipped with:
- an Intel IXP420 network processor at 133 Mhz (and can be set for 266MHz operation using a simple modification),
- 8MB of flash memory,
- 32MB of SDRAM
- 1 FastEthernet port
- 2 USB 2.0 ports

You can use it with an USB Flash disk or an external USB hard drive
and have much more space to install packages and even have a swap partition on the HD.

Regarding Asterisk, I'm using the unslung version as a home PBX for more than 6 months and it works fine with G711 and GSM codecs.
Voicemail also works perfect, including sending the messages in email.
I use a Sipura SPA 3000 as phone adapter and gateway to PSTN.

http://www.nslu2-linux.org/wiki/Unslung/Asterisk
#5 Corneliu Doban on 2005-09-09 18:00
How is the uptime on the slug w/ asterisk? Any problems with the unit powering down when not in use like i see in forums or is this a non-issue?
#5.1 jon on 2006-01-12 08:00
Hi,

This seems really cool that you can run asterisk off a WRT54gs box. Has anybody tried the G711u codec and does it work off this box? The reason I ask, I use VOIPSTUNT to make free calls worldwide but I think they only support G711u not GSM.

Does the IVR / Auto attendant / Hold music features still work?

I'm correctly new to Linux / Asterisk. Current playing around with Asterisk@home 2.5 image installed in VMWARE.. pretty cool for practice and no major timing issues. Call quality is pretty good to.. Running off my XP PC Pentium 4 - 1400 with 256mb / SDRAM. (128mb xp / 128mb Asterisk server)

I currently have WRT54G version 2.0 - would it work on this? I guess not because of 4mb flash?
#6 Ravi from UK on 2006-02-25 16:44
g711 is one of the only codecs really possible on these embedded devices. look to asterisk wiki on nslu2 and the info is pretty much the same for the wrt. g711 is one of the least processing intensive codecs.
#6.1 global_dev on 2006-02-25 17:53
Thanks for this. This is one of those things that makes me excited about what VoIP can do. I'm really excited about the possibilities of VoIP. I'm hoping that more and more companies get their act together, and we can start using VoIP in more areas of the world. Some of the traditional telephony companies really seem to have taken too long to wake up – they need to be careful, else their business might be snatched from under their nose.
#7 gifts (Homepage) on 2008-01-03 09:48
Hi David,
Just want to wish you a very happy birthday--one day late. Hope you had a great weekend and that your work goes well this coming week. Take time to enjoy all the pleasures of NYC--you seem like a big city kind of guy.
Peace,
Barb
#8 Barb on 2008-06-22 22:19

Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
 
 
 
 

Google Ads

YouTube Videos

Loading...

Archives

  • May 2013
  • April 2013
  • March 2013
  • Recent...
  • Older...

Creative Commons

Creative Commons License - Some Rights Reserved
Original content in this work is licensed under a Creative Commons License

Syndicate This Blog

  • XML RSS 2.0 feed
  • ATOM/XML ATOM 0.3 feed
  • ATOM/XML ATOM 1.0 feed
  • XML RSS 2.0 Comments
  • XML OPML 1.0 feed

© David DeLauro | Impressum Design by ceejay | Powered by Serendipity | Login