Sunday, April 11, 2010

17 Steps to Openwrt Setup With Asterisk 1.4 on WRTSL54GS or Similar Routers - 30 Minutes

This is my recent experience in getting Asterisk 1.4 on WRTSL54GS routers. It is much easier than my previous installations on the routers.

We will go from the scratch in getting the router running in Openwrt and in Asterisk.


Step 1: Select the right image of Openwrt for your router.
Step 2: Telnet into the router with root and empty password.
Step 3:  Change password with passed command and exit.
Step 4: Login to router with SSH login.
Step 5: Install the latest Stable webif(2) from xwrt.
Step 6: Reboot and Login to router from the browser. (This is to tweak some settings if you want)
Step 7:  ipkg install  kmod-usb-uhci kmod-usb2 kmod-usb-storage kmod-ext3 fdisk e2fsprogs
Step 8: Format the external USB Disk to ext3 file system you don't need multipartition, single partition is enough.
Step 9: Attach usb disk to the router
Step 10: Mount the USB Disk to /opt directory. Even if it is already automounted to different directory you can mount it to different directory too. Use the following command to do it.
           mount -t ext3 -o noatime /dev/scsi/host0/bus0/target0/lun0/part1 /opt & Add it to the Startup script using the webif from browser.
Step 11: Reboot.
Step 12: Let us install additional softwares to the USB Disk. Poor manufacturers gave us with only MB of memory in the routers. Let us add 2GB of data to it. :)
Step 13: wget http://www.3iii.dk/linux/optware/optware-install-ddwrt.sh -O - | tr -d '\r' > /tmp/optware-install.sh
Step 14: sh /tmp/optware-install.sh
Step 15: Let us install asterisk and additional voice files to
               /opt/bin/ipkg-opt install asterisk14-core-sounds-en-alaw asterisk14-core-sounds-en-g729 asterisk14-core-sounds-en-gsm asterisk14-core-sounds-en-ulaw asterisk14-extra-sounds-en-alaw asterisk14-extra-sounds-en-g729 asterisk14-extra-sounds-en-gsm asterisk14-extra-sounds-en-ulaw asterisk14-moh-freeplay-alaw asterisk14-moh-freeplay-g729 asterisk14-moh-freeplay-gsm asterisk14-moh-freeplay-ulaw asterisk14 asterisk14-gui libogg radiusclient-ng sqlite2 unixodbc iksemel net-snmp

Step 16: To the Startup Script Mount the USB Disk and startup asterisk.

/opt/etc/init.d/S99Asterisk:
#!/bin/sh
if [ -f /opt/var/run/asterisk.pid ] ; then
  kill `cat /opt/var/run/asterisk.pid`
else
  killall asterisk
fi
rm -f /opt/var/run/asterisk.pid
umask 077
/opt/sbin/asterisk

Step 17: Configure your voip clients and Start Making Calls.

No comments: