Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » VOIP etc » Voice Over IP - VOIP » VOIP Tech Chat » [How to] Install Asterisk on an Asus WL-520GU router
Search Topic:
Uniqs:
17778
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
SIPsorcery and VoIP.ms » are down. Can others confirm thi »
« [Other] OOMA & Canadian Snowbirds  
page: 1 · 2 · 3 · 4 ...7 · 8 · 9
AuthorAll Replies

Mango
toao.net

join:2008-12-25
Vancouver, BC
·Shaw
·voip.ms
·Callcentric
·LINGO
·Netfone
·Digital Voice


1 edit
[How to] Install Asterisk on an Asus WL-520GU router

As promised, here's how I built an Asterisk box out of a $37 router. This will likely eventually turn into a post on my blog but I figured I'd subject everyone here to the rough draft first I am not going to go into a great deal of detail with this post. You should be comfortable with basic networking and VoIP concepts such as how to configure a static IP, how to use Telnet/SSH, and how to configure a VoIP phone or ATA. Having said that, if anything does turn out to be particularly vague, I'd be happy to clairfy.

I chose the WL-520GU because it was one of the few routers I could find with a USB port. I read about techniques for modifying a WRT54GL to use an SD card but I decided that plugging in a USB device was easier than getting out the soldering iron. I decided Tomato would be my firmware of choice. Tomato is the most popular firmware I see VoIP users use and it has a great reputation for its QoS features.

I have heard it is possible to install Asterisk on a router without any additional storage space. The reason I chose the USB technique is that I wanted extra space for things like sounds and music-on-hold files. I also wanted space for logging, if necessary (though usually I leave logging off.)

Before we start, you may want to attach the WL-520GU to another router connected to the Internet. Some modems, such as my Motorola cable modem, don't particularly like issuing IP addresses and you will need to reboot the WL-520GU a few times during this process. In order to do this, you will need to be sure both routers have different IP addresses.

Now for the first step, which is obtaining DD-WRT. No, that's not a typo; you should install DD-WRT before installing Tomato. There is a good reason for this but I cannot remember what it is, and since this is a "How To" and not "Why", suffice to say "you need to install DD-WRT first."

First, download the latest stable version of DD-WRT. Visit »www.dd-wrt.com/ , click the Downloads tab, navigate to the stable folder, navigate to the latest version, then the Consumer folder, then the Asus folder, then the WL520GU folder, and finally to the file dd-wrt.vXX_mini_asus.trx. (Whew!) I have heard rumors that you should not save this file in any directory that has a space in it. I haven't tested this, but I'd recommend you do this to be on the safe side.

Now, you need to flash the DD-WRT firmware to the router. I would recommend setting your computer up with a static IP. I discovered that while flashing, the router did not always issue an IP address. As with flashing any firmware, be sure to do this over a wired connection and not a wireless one. You may also need to disable any software firewalls. After setting the static IP, test to be sure that you can access the router's setup page over a wired connection.

To flash firmware, you should use Asus' Firmware Restoration Utility. Note: do not use the latest version from Asus' website as it probably won't work. The best version to use is the one on the CD that came with the router. If you have lost it, be sure download the right version of the Firmware Restoration Utility for your specific router. Load the Firmware Restoration Utility and browse to find the trx file you just downloaded. Don't upload it yet!

Unplug the power from the router and consider the two buttons on the back. Using a small screwdriver or a ballpoint pen, press the reset button. Hold down the reset button and plug the router back in. When the Power LED begins to flash, release the reset button, and upload the firmware.

If all goes well, DD-WRT will be installed. To be sure everything worked, navigate to the setup page and log in. One set of instructions I was following told me to log in with blank username and password admin. Another told me username admin and blank password. Actually, I had to log in with admin/admin.

Next, take a look at this forum thread: »www.linksysinfo.org/forums/showt···?t=60185 . This is the thread that talks about a modification of Tomato that has USB support. Navigate to the download link. Note that there are a few flavours available. I chose the ext flavour because I needed tools to partition and format the USB drive. If you have a Linux box that you can use instead, you can download the smaller Standard build, or if you do not require Samba, you can download the even smaller Lite build. Download and unrar the file.

The password after we flash Tomato will be different and it is necessary to find out what it will be. In order to do this, telnet into the router. Use the username root and whatever password you used to access the setup page. Type nvram get http_passwd and copy the password that it returns.

Now, return to the DD-WRT setup page. Navigate to Administration and then to Firmware Upgrade. Browse to the Tomato firmware you just downloaded and upgrade. Attempt to log in to the Tomato setup page. When I did it, the username was root, and the password was what I found in the previous step.

Congratulations! You have just installed Tomato on your router! As with any new router install, before you continue, be sure to do the following:

1) Change the password on the router to something difficult to guess.
2) Secure the wireless connection, or disable it if you don't plan to use it.
3) You may want to disable wireless access to the Tomato setup page.
4) You may want to properly configure such settings as Time Zone.

Mango
toao.net

join:2008-12-25
Vancouver, BC
·Shaw
·voip.ms
·Callcentric
·LINGO
·Netfone
·Digital Voice


3 edits
The next thing I would recommend doing is setting up SSH. SSH is a more secure way of accessing the router. If you're on a private internal network and do not allow remote access to the router, this may not matter, but it's good practice to do anyway.

First, download PuTTY and PuTTYGen if you don't have them already. If you're not using Windows, you can use any other flavour of SSH client you prefer. The way I like to access SSH is with an RSA key.

Start PuTTYGen. The default settings of SSH-2 RSA and 1024 bits will typically be fine to use. Click the Generate button and follow any prompts that appear. Click 'Save Private Key' and save the file in a safe place.

Next, load the Tomato setup page. Navigate to Administration and then Admin Access. Enable the SSH Daemon, and paste the public key in the Authorized Keys box. I recommend disabling Remote Access. Save your settings.

Now, load PuTTY. Enter the Host Name or IP Address of your router and select the SSH protocol. Navigate to the Connection category from the list at the left. Select Data and, if you like, enter root as the auto-login username. Next, select SSH, and then select Auth. Browse to find the private key file you just created with PuTTYGen. Return to the Session category, enter a name in the Saved Sessions box, and press the Save button. You should now be able to log into the router using SSH.

Now is a good time to set up a script I wrote. This script disables or enables access to the router when the button on the back is pressed. There are two advantages to this. One is that if access is disabled, the router is more secure. The other advantage is that less memory is used, and with 16MB of RAM, every little bit helps. Return to the Tomato setup page. Navigate to Administration and then Buttons / LED. Change the first two dropdown menus to Run Custom Script. Here is the script, which you may paste into the text box below:


Save your settings and test a few times to be sure the script works. At this point you may disable the Telnet service. Note that this script depends on the program "buttons" running. If for any reason buttons is killed, the script will not work. For this reason, I recommend you leave "Enable at startup" turned on for the SSH daemon so that if the button does not work, all you need to do is reboot the router.

Mango
toao.net

join:2008-12-25
Vancouver, BC
·Shaw
·voip.ms
·Callcentric
·LINGO
·Netfone
·Digital Voice


1 edit
We're almost ready to install Asterisk. But first, we need something to install it on. If you've already formatted your USB drive as EXT2, you may skip the next few steps. If not, attach your USB drive and read on.

The first drive I used for this project was an OCZ Roadster drive. I discovered however that it ran very very very hot - too hot to touch after only a few hours of use. While this would be no problem for making a quick backup, this would not do for an appliance that is supposed to be on 24/7. The other drive that I had was a Dane-Elec drive which I purchased at the grocery store of all places. It was a great deal because it was labeled 1GB and it's actually a 2GB drive. It runs very cool and is ideal for my purposes.

Return to the Tomato setup page, navigate to USB and NAS, and then to USB Support. Enable Core USB Support, USB 2.0 Support, USB Storage Support, and Ext2 / Ext3 File System Support. If the drive automatically mounted itself, unmount it before continuing.

Now it is time to partition and format the drive. Note that anything on the drive will be erased during this process. SSH into the router and type fdisk /dev/discs/disc0/disc. To be sure you've selected the correct drive, use the command p. The first line will tell you the size of the drive. The system column will tell you the format. If the drive is currently formatted as FAT32, under the System column should be Win95 FAT32.

Type d to delete the current partition, if one exists. Then, type n to create a new partition. Follow the prompts to create a primary partition. If it asks for a partition number, enter 1. Use the defaults for cylinders. Next, enter w to write the partition table and exit fdisk. If you've made a mistake, instead exit by pressing CTRL+C and start over.

Congratulations! You have created a partition. Now we need to format it. If you are a beginner such that you require this guide, you should use the ext2 filesystem. Type mkfs.ext2 /dev/discs/disc0/part1 -L USB
Note that "USB" may be anything you like. -L specifies a volume label and I decided "USB" would be easy to remember.

Finally, run a check on the new partition by typing fsck.ext2 -f -y /dev/discs/disc0/part1

Next, you should configure the drive to automatically mount. Return to the Tomato setup page and turn "Automount" on. In the "Run after mounting" box, enter [ -d /mnt/USB ] && mount /mnt/USB /opt . Why? You'll see Save your settings.

Mango
toao.net

join:2008-12-25
Vancouver, BC
·Shaw
·voip.ms
·Callcentric
·LINGO
·Netfone
·Digital Voice


2 edits
Now you're finally ready to install Asterisk. The way I installed it was with Optware. First, unmount and mount your USB drive to be sure that /opt was properly created.

Next, download the Optware install script...
...and run it.

Installing Asterisk is as simple as

ipkg may recommend some other packages to install such as sound and music-on-hold files. Install them if you want. I only installed the uLaw versions because I only use the G.711 codec.

If all goes well (and when I did this it did) you will now have Asterisk installed on your WL-520GU. Start it by typing asterisk -vvvc. Or configure it to start automatically by adding /opt/sbin/asterisk to the "Run after mounting" box on the Tomato setup page.

At this point you will probably want to play with Asterisk's configuration. When I used the sample configuration files, Asterisk ran, but the audio quality was poor because memory usage was very very high. The sample modules.conf loads a great deal of modules, many which you will not need. I was able to drastically reduce Asterisk's memory usage with the following modules.conf. For a description of these modules, type module show at the console.


Reducing logging also improved my call quality as it meant less writing to the USB drive. My logger.conf is now a blank file. I also disabled Tomato's bandwidth monitoring and logging on the Tomato setup page. Also, press the button on the back of the router to disable remote access, if you're not currently using it.

Congratulations! You are now the proud owner of a $37 Asterisk box that uses only a few watts of power. Bet you spent less than the Digium Asterisk Appliance, didn't you? That's all for now, but later on I'll post my extensions.conf, as well as my technique for propagating Message Waiting Indicator from your VoIP provider.

Happy VoIPing!

m.

mazilo
From Mazilo
Premium
join:2002-05-30
Lilburn, GA

reply to Mango
Mango,

Can you confirm the Tomato firmware can support USB2 on WL-520GU router? If so, how stable is the USB2 driver? I read the from the OpenWRT Table of Hardware list for Asus WL-520GU that even Asus has USB2 support disabled on its firmware.

Mango
toao.net

join:2008-12-25
Vancouver, BC
The modified Tomato firmware does indeed support USB2. I've only been using it for a few days, but fortunately it has been very stable.

m.

hoolahoous

join:2004-08-25
Red Valley, AZ
reply to Mango
do you know if g729 will work ? if yes is there a 'test' g729 codec available for this chipset to test it out ?

MartyT

join:2004-09-03
Georgetown, SC

reply to Mango
The WL-520GU is one of my favorite routers. I use it on all my VOIP installs. Just be sure to get rid of the stock firmware. It really sucks in my experience. Tomato 1.25 is a dream.

Asterisk? My favorite PBX, but FreeSwitch with FreePBX might change that.

With Mazilo lurking around, I see a new convert to the WL-520GU platform.

mazilo
From Mazilo
Premium
join:2002-05-30
Lilburn, GA


1 edit
reply to hoolahoous
said by hoolahoous See Profile :

do you know if g729 will work ?
If there is a GPLed G729 source codes, then one should be able to port it to any platform. Unfortunately, I have yet to see a GPLed G729 source codes. However, I believe ITU once had posted some sort of G729 source code on its site and allowed anyone to download it for free.

For asterisk, you can configure both your asterisk + ATA devices to use G729 as a default CoDec and they will both work just fine to provide services with G729 calls.
--
Mazilo always prays for FREEBIES!
US Phone: +1-678-601-0907
UK Phone: +44-703-194-2574


HumanG

@verizon.net

reply to Mango
Mango2,

Thanks for the write-up. Very nice. Just one question though. Why do you need tomato firmware at all? I think some beta version of DD-WRT also support USB2 drives, and via optware-install and ipkg, you can install asterisk. See wiki »www.dd-wrt.com/wiki/index.php/Optware and »www.dd-wrt.com/wiki/index.php/USB_storage. I am just wondering if you have tried this method or not.

said by Mango See Profile :

As promised, here's how I built an Asterisk box out of a $37 router. This will likely eventually turn into a post on my blog but I figured I'd subject everyone here to the rough draft first
... ...


edmidor
6th Kyu

join:2008-05-19
Montreal, QC
AFAIK Tomato has much smaller memory footprint, which is a good thing for Asterisk. It has QoS that actually works; and it just easier to operate.
If I was to install * on a router, I would only go Tomato or OpenWRT

hoolahoous

join:2004-08-25
Red Valley, AZ

reply to mazilo
said by mazilo See Profile :

I believe ITU once had posted some sort of G729 source code on its site and allowed anyone to download it for free.

For asterisk, you can configure both your asterisk + ATA devices to use G729 as a default CoDec and they will both work just fine to provide services with G729 calls.
do you know which chipset wl-520gu has (broadcomm??) ? I have one of these routers flashed to dd-wrt.

i need to do transcoding since my VOIP provider does not provide G729 and I want all my extensions to use G729.

Mango
toao.net

join:2008-12-25
Vancouver, BC
·Shaw
·voip.ms
·Callcentric
·LINGO
·Netfone
·Digital Voice

reply to HumanG
said by HumanG :

Why do you need tomato firmware at all? I think some beta version of DD-WRT also support USB2 drives
Emphasis mine.

Well, there was talk about having to hack the USB driver on DD-WRT to make it even work with my router. That didn't seem like a good idea. Tomato is also the most popular firmware amongst VoIP users that I know, I assume because of it's highly effective QoS, which edmidor mentioned.

I haven't tried QoS on any other open source firmware, but I can attest to QoS in Tomato working, and working very very well.

On that note. Oddly, it didn't work at all when using port-based QoS. But, it worked a treat when I used IP-based QoS. I have no idea why.

m.
--
Mango's recommended PAP2T settings: »www.toao.net/25/linksys-pap2t-vo···-review/
Linksys/Cisco dial plan tips and tricks: »www.toao.net/108/cisco-dial-plan···-tricks/

Mango
toao.net

join:2008-12-25
Vancouver, BC
·Shaw
·voip.ms
·Callcentric
·LINGO
·Netfone
·Digital Voice

reply to hoolahoous
said by hoolahoous See Profile :

i need to do transcoding since my VOIP provider does not provide G729 and I want all my extensions to use G729.
I'm incredibly curious. Why on earth would you use G.729 if not to save bandwidth?

m.
--
Mango's recommended PAP2T settings: »www.toao.net/25/linksys-pap2t-vo···-review/
Linksys/Cisco dial plan tips and tricks: »www.toao.net/108/cisco-dial-plan···-tricks/

Fisamo
Premium
join:2004-02-20
Apex, NC
·VOIPo
·AT&T CallVantage

reply to Mango
Very, very, very nice! I just purchased (and installed) a WL-520GU router at home, and I've already replaced the f/w with DD-wrt, so this upgrade should be pretty straightforward. The next challenge(s) will be to get my dialplan, which I 'perfected' using FreePBX imported to this system.

I'm extremely interested in the how-to propagate MWI from the provider to my internal extensions. From what I've heard, it "can't be done" with Asterisk. (Do you have a separate script monitoring SIP packets?)

mazilo
From Mazilo
Premium
join:2002-05-30
Lilburn, GA

reply to hoolahoous
said by hoolahoous See Profile :

said by mazilo See Profile :

I believe ITU once had posted some sort of G729 source code on its site and allowed anyone to download it for free.

For asterisk, you can configure both your asterisk + ATA devices to use G729 as a default CoDec and they will both work just fine to provide services with G729 calls.
do you know which chipset wl-520gu has (broadcomm??) ? I have one of these routers flashed to dd-wrt.
You should be able to find the information you are looking for on the link I provided in my post above.

i need to do transcoding since my VOIP provider does not provide G729 and I want all my extensions to use G729.
Even though you can manage to port the G729 CoDec source to any open-source firmware, I presume the CPU on the router will probably not have enough resources to perform a G729 transcoding. On my Asterisk PBX system, it is just configured with a G729 as the default CoDec and it doesn't do any transcoding.
--
Mazilo always prays for FREEBIES!
US Phone: +1-678-601-0907
UK Phone: +44-703-194-2574

MartyT

join:2004-09-03
Georgetown, SC

reply to Fisamo
If you are successful in getting your FreePBX generated files into a router based Asterisk system, let us know. I'm not a hardcoder like Mazilo on Asterisk, and would love to simply transfer FreePBX stuff over, but I'm not sure it works that way, at least it didn't when I tried it.

It would be nice to see some kind of AJAX based FreePBX interface for Asterisk when it runs on such a small system, unless someone has succeeded in getting FreePBX to run off the USB drive on a system like this on the WL-520GU.

Fisamo
Premium
join:2004-02-20
Apex, NC
·VOIPo
·AT&T CallVantage

said by MartyT See Profile :

If you are successful in getting your FreePBX generated files into a router based Asterisk system, let us know. I'm not a hardcoder like Mazilo on Asterisk, and would love to simply transfer FreePBX stuff over, but I'm not sure it works that way, at least it didn't when I tried it.

It would be nice to see some kind of AJAX based FreePBX interface for Asterisk when it runs on such a small system, unless someone has succeeded in getting FreePBX to run off the USB drive on a system like this on the WL-520GU.
Don't hold your breath... I'm very interested in programming and getting things like this work, but I wasn't interested enough at that important 'career choice' time (college) and haven't been able to invest the time since. The other limiting factor for me at this point is that I have to be wary of taking our gateway (the ASUS router) down when my wife's home. I may just have to hook up the old TrendNET while I play.

fareedf

join:2008-01-25
Portland, OR

reply to Mango
Thanks for instruction, after Asterisk installed on the router one needs modify some of the Conf files (extension.conf, iax.conf, modules.conf, sip.conf....) in order to work with your voip provider. Is there a possibility to screen shoots of these files that include couple of providers?

pandora
Premium
join:2001-06-01
Outland
·ooma
·Future Nine Corpor..
·Comcast

 reply to Mango
At Newegg about 6 weeks ago, I looked at the WL-520GU and it was $49 with free shipping. The WL-500gp was $69 and there are mega versions of DD-WRT which already have Asterisk installed. Wouldn't it have been easier to pop for another $20 and install the mega version of DD-WRT with Asterisk?
--
"People demand freedom of speech as a compensation for the freedom of thought which they seldom use."
-
Forums » VOIP etc » Voice Over IP - VOIP » VOIP Tech ChatSIPsorcery and VoIP.ms » are down. Can others confirm thi »
« [Other] OOMA & Canadian Snowbirds  
page: 1 · 2 · 3 · 4 ...7 · 8 · 9


Friday, 20-Nov 17:35:41 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.
page compression OFF
Most commented news this week
· [111] Verizon Again Hints At Metered Billing
· [82] Spain Declares Broadband A Legal Right
· [78] There's Still No Evidence That Metered Billing Is Necessary
· [74] Verizon To Be Tested By Unofficial Droid Tethering
· [73] Femtocells Are A No Show
· [71] Will AOL's Implosion Ever End?
· [69] Deploying FTTH Without Digging Things Up
· [66] Verizon To AT&T: The Truth Hurts
· [60] Chicago Tribune Visits 'Comcast University'
· [53] Feds Crack Down On Gift Card Trickery
Most people now reading
· 3.x Feral Druid - Bear Tanking Guide [World of Warcraft]
· Town to photograph EVERY car that enters and leaves [Security]
· Windows 7 boot manager editing questions [Microsoft Help]
· Stuck in Dragonblight, as a ghost [World of Warcraft]
· $1000 bills are so expensive [General Questions]
· Seems like a good deal [Home Repair & Improvement]