Installing Asterisk on a Linksys WRTG

A while back I wrote a small piece about installing OpenWRT on a Linksys WRTG. This part will be focussed on installing Asterisk on your WRTG.

Asterisk

Base Install
First we’ll be installing “OpenWRT” as our base “OS”. We’ll take the latest WhiteRussian for this. The flashing is done, when the progress indicator seems to hang.

Step-by-step

root@OpenWrt:/# cd /tmp/
root@OpenWrt:~# wget http://downloads.openwrt.org/whiterussian/0.9/default/openwrt-brcm-2.4-squashfs.trx
Connecting to downloads.openwrt.org[195.56.146.238]:80
openwrt-brcm-2.4-squ 100% |***************************************************************************| 1512 KB 00:00 ETA
root@OpenWrt:~# mtd -r write /tmp/openwrt-brcm-2.4-squashfs.trx linux
Unlocking linux …
Writing from /tmp/openwrt-brcm-2.4-squashfs.trx to linux … [w]

Packages
Now we’ll connect to our newly installed device, in orde to:

  • Setup a password
  • Update/Upgrade the packages
  • Install Asterisk


Step-by-step

kvaes@ubuntu:~$ telnet 192.168.1.1
Trying 192.168.1.1…
Connected to 192.168.1.1.
Escape character is ‘^]’.
=== IMPORTANT ============================
Use ‘passwd’ to set your login password
this will disable telnet and enable SSH
——————————————

BusyBox v1.00 (2007.01.30-11:42+0000) Built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

_______ ________ __
| |.—–.—–.—–.| | | |.—-.| |_
| – || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
WHITE RUSSIAN (0.9) ——————————-
* 2 oz Vodka Mix the Vodka and Kahlua together
* 1 oz Kahlua over ice, then float the cream or
* 1/2oz cream milk on the top.
—————————————————
root@OpenWrt:/# passwd
Changing password for root
Enter the new password (minimum of 5 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password:
Re-enter new password:
Password changed.
root@OpenWrt:/# ipkg update
Downloading http://downloads.openwrt.org/whiterussian/packages/Packages
Updated list of available packages in /usr/lib/ipkg/lists/whiterussian
Downloading http://downloads.openwrt.org/whiterussian/packages/non-free/Packages
Updated list of available packages in /usr/lib/ipkg/lists/non-free
Successfully terminated.
root@OpenWrt:/# ipkg upgrade
Nothing to be done
Successfully terminated.
root@OpenWrt:/# ipkg install asterisk
Installing asterisk (1.0.10-1) to root…
Downloading http://downloads.openwrt.org/whiterussian/packages/asterisk_1.0.10-1_mipsel.ipk
Installing libncurses (5.2-7) to root…
Downloading http://downloads.openwrt.org/whiterussian/packages/libncurses_5.2-7_mipsel.ipk
Installing libpthread (0.9.27-1) to root…
Downloading http://downloads.openwrt.org/whiterussian/packages/libpthread_0.9.27-1_mipsel.ipk
Configuring asterisk
Configuring libncurses
Configuring libpthread
Successfully terminated.

Configuration

  • Configure Asterisk to boot at startup, setup the variable “ENABLE_ASTERISK” to “yes” in “/etc/default/asterisk”.
  • Start up Asterisk (the first time) by issuing the following command:

    asterisk -vvvc

  • Stop by pressing CTRL-C
  • Start up in the background

    root@OpenWrt:/# /etc/init.d/asterisk start

  • Use ‘asterisk -r’ to reconnect

    root@OpenWrt:/# asterisk -r
    Asterisk 1.0.10, Copyright (C) 1999-2004 Digium.
    Written by Mark Spencer
    =========================================================================
    Connected to Asterisk 1.0.10 currently running on OpenWrt (pid = 642)
    OpenWrt*CLI> quit
    root@OpenWrt:/#

Tips&Tricks

  • Removing Asterisk (note: always best to reflash, as some packages aren’t cleaned up properly)

    ipkg remove asterisk

  • The WRT54GL has 4 MB of flash memory, which acts as an hard drive, and 16 MB of RAM
  • By installing Asterisk it will remain less than 1 MB free on the flash.
  • Obtain the list of the installed packages with the command.

    ipkg status | grep -i package

  • It’s advisable to disable the logging of Asterisk, by changing with your favourite text editor the file /etc/asterisk/logger.conf

References
CupoVoip

One thought on “Installing Asterisk on a Linksys WRTG

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.