Running Asterisk on Flash memory


I have Openwrt installed on TP-MR3020 router. Due to limited memory(using other stuff on the main memory of the router), I decided to install Asterisk18 on an external usb connected to the router. I mounted the usb to /aster. I know by default that the files are configured to point to the main memory, i.e.
"/etc/" not “/aster/etc/”
"/init.d/" not "/aster/init.d"
What files should be modified to make Asterisk run fully from the usb.

Thank you,

/etc/init.d cannot be relocated; its location is set by the OS. You will need to start Asterisk manually.

/etc/asterisk/asterisk.conf specifies where all the asterisk files are. You can, in turn, specify the location if this file on the command line when starting Asterisk.

Note you should disable as much logging and CDR collection as possible, to maximise time before your media exceeds its maximum number of erase/write cycles. Actually getting the information to allow you to calculate when that will be can be difficult to impossible, except that it is likely to be much shorter for cheap media.

Supporting utilities may need separate configuration, e.g. safe_asterisk may need to be told where Asterisk is, if you want to continue to use it.

Thanks david55. I will take the minimize logging into consideration.
So what I did till now is copied /aster/etc/init.d/asterisk to /etc/init.d and changed everthing in it to point to /aster/…
I also modified the /aster/etc/asterisk/asterisk.conf to let everything point to /aster/…
When I try to start asterisk with /etc/init.d/asterisk start
I get the following error:
/aster/usr/sbin/asterisk: can’t load library ‘’

I have libncurses installed on the router:
opkg -d aster install libncurses
Package libncurses (5.7-5) installed in aster is up to date.

Any suggestion?

Add the flash lib directory to the LDLIBRARYPATH environment variable (spelling may be wrong).

Thanks, problem solved. It is running now. I can access the console and everything. I want it to run at boot time. I wrote /etc/init.d/asterisk enable. However, it is not booting automatically. Any suggestion?

root@TP-21:~# asterisk -r
Asterisk, Copyright (C) 1999 - 2012 Digium, Inc. and others.
Created by Mark Spencer <>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)

Note: I can access it if I run it manually using /etc/init.d/asterisk start

That’s OS dependent, but for CentOS/Red Hat, you use chkcfg.(spelling?).

the asterisk packages on OpenWRT should normally come with the correct init scripts.

It may be ‘enable’ is not defined in your init script. I suggest you check out a couple of other init scripts to figure out what is missing.
But I believe you can manually link /etc/init.d/asterisk to /etc/rc.d/S99-asterisk
don’t know is 99 in S99 is correct. make sure the number is higher than your network init script.