OpenWrt Forum Archive

Topic: Asterisk 1.4 on White Russian RC6 (with Digium GUI)

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Warning: The following is a filthy dirty hack.  Read at your own risk.

A few weeks ago at AstriCon, I saw two really cool things.  I saw Asterisk running on a wide range of < $100 routers (including one loaded on the back of a Roomab).  I also saw the new Digium Asterisk appliance running the new GUI framework.  This got me to wondering if version 1.4 with it's brand new GUI could be shoe-horned onto a WRT.

A quick perusal of the OpenWRT hardware list brought me to the Linksys WRTSL54GS, the unfortunately named but relatively powerful SOHO router with USB (ostensibly for storage).  The WRTSL54GS (hereafter the SL54 -- life is too short to type really long, awkward product names) appears to have complete OpenWRT support and the USB storage made it much easier to fit in ALL of Asterisk 1.4.  After a few days of playing with the (already outdated) SDK, I figured I could give Asterisk 1.4 a try.

From a build perspective, Asterisk 1.4 is completely different from its predecessors.  Previous versions used only  a makefile and required nothing more than the ancient mantra: 'make; make install'.  1.4 adds the features and complexities of autoconf and menuselect to the mix.  On standard Linux and standard hardware both additions are a step forward.  On the OpenWRT SDK they make things somewhat more complex.

Another confession: I've no real experience with the package management system and I still don't have the Makefile in the package folder properly packing everything into an ipk.  I followed the instructions in the SDK guide: I created a package folder and a Makefile which downloaded Asterisk 1.4 beta 3.  The initial download worked but things went down hill from there.  Autoconf worked (or at least appeared to work) and produced a makefile, but the compile died as soon as it tried to build menuselect.

The build fails as it attempts to generate the menuselect executable.  This makes some sense -- the executable needs to be built for the host, not the target.  Fortunately the system seems to be willing to continue where it left off, so all you really have to do is manually generate the executable.  First, change directory into the menuselect directory:

    /path/to/sdk/OpenWrt-SDK-Linux-i686/build_mipsel/asterisk-1.4.0-beta3/menuselect

Now execute the mantra here: './configure; make'  This will build the menuselect executable.  This actually creates all the basics but you can tweak your build now by dropping back to the asterisk-1.4.0-beta3 directory and executing 'make menuselect'.  I didn't make any massive changes: I turned off a number of channels (phone, mgcp, skinny), a number of codecs (specifically LPC10 and iLBC -- both of which require an FPU to work), and anything else I don't plan on using on my SL54.  I didn't use any optimizations (though I'm sure some of them would help -- something to try in the future).  I also nixed the sms application and the snmp resource modules (after discovering they had dependencies which made things fail).

Once the meuselect process is done, go back to the SDK folder and start the process rolling again with 'make'.  I found (after a big dump of error messages) that I had to go into the utils folder and remove smsq from the Makefile.  Surely there's a better way of handling this but I don't use sms, so it was not worth fighting over.  Again restart the build.  Mine ran until it hit res_crypto where it died missing OpenSSL.  Funny, it seemed to find OpenSSL during the configure stage...

It seems that much of the build process gets off track due to missing libraries (or apparently missing libraries).  I solved this probably the hard way: I edited the 'makeopts' file (located in the Asterisk source folder under build_mipsel) and added the full include path and library path to the various makeopts directives.  Here are the changes I made:

SSL_INCLUDE=
SSL_LIB=-lssl -lcrypto

changes to:

SSL_INCLUDE=-I/usr/src/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/include
SSL_LIB=-L/usr/src/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/lib -lssl -lcrypto

I had to do roughly the same thing for:

ZLIB_INCLUDE
ZLIB_LIB
CURL_LIB (which you have to build yourself if you really want it -- i just nixed func_curl)
CURSES_INCLUDE
CURSES_LIB

Things really get fun when you hit the next error: libedit in the Asterisk mail/editline folder.  For some reason the editlib's autoconf script fails to find the necessary header files and libs for termcap.  I wound up running the configure script in the host environment, then changing out a few options:

-CC = gcc
+CC = /usr/src/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc

-CFLAGS = -Wall -pipe -g3
+CFLAGS = -O6 -I/usr/src/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/include

Onec I got past this it was actually pretty much down hill.  Instead of trying to figure out the full ipk install, I just copied all of the binary files into a series of directories on my USB key.  I created an /etc/asterisk directory on the SL54 and created an asterisk.conf that pointed to the folders on my USB key.  I created a symlink for the Asterisk binary from the /usr/sbin folder.

After all that I had to go through and remove a number of modules that caused issues -- DUNDi seemed to hang things up.  I also learned the hard way that you can't create pipes on a Fat32 partition -- you have to map the run directory to a Linux native partition so that the asterisk.ctl pipe can be created.

More (and perhaps more coherent) later.  I'll give some thoughts on the GUI when i've had a chance to play with it a bit more.

Thanks,

Steve

ssokol wrote:

From a build perspective, Asterisk 1.4 is completely different from its predecessors.  Previous versions used only  a makefile and required nothing more than the ancient mantra: 'make; make install'.  1.4 adds the features and complexities of autoconf and menuselect to the mix.  On standard Linux and standard hardware both additions are a step forward.  On the OpenWRT SDK they make things somewhat more complex.

Actually the autoconf stuff makes it easier to cross-compile asterisk for other platforms, including host-based compilation of menuselect  and libedit configuration for OpenWRT.

ssokol wrote:

Another confession: I've no real experience with the package management system and I still don't have the Makefile in the package folder properly packing everything into an ipk.  I followed the instructions in the SDK guide: I created a package folder and a Makefile which downloaded Asterisk 1.4 beta 3.

I have created some preliminary make/configs patches for Asterisk 1.4.x against the OpenWRT WhiteRussian SVN branch. (NB: for compiling against dependency libraries it is easier to work from SVN than from the stand-alone SDK). I have put Asterisk 1.4.0-beta3 binary packages up at:

  http://zandbelt.dyndns.org/asterisk.html

I have only done the core packages so far; extra modules would eventually have to be compiled and configured with patches on the menuselect output.

I have (only) done some basic testing and things seem to work fine; in fact you can just copy over your conf directory from Asterisk 1.2 with the exception that you need to add the "astdatadir" directive in "asterisk.conf" and make it point to the same spot as "astvarlibdir" (being /usr/lib/asterisk by default).

The internal webserver works out-of-the-box with the sample call-display "ajamdemo" that comes with the core package. I have also installed the asterisk-gui stuff by manually copying over things and modifying configs, similar to a "make install". That GUI also works, although it doesn't read my config yet, probably because of a mistake in its config; in any case the tab where it shows the active channels does show activity.

Hans.

Is-it possible to install it on an RC5 ??

dolkin wrote:

Is-it possible to install it on an RC5 ??

Yes it is: I run it on RC5.

Hans.

HI Zandbelt,

I installed the 1.4.3 beta. Got an error when tring to run "asterisk", it says " can't load library libstdc++.so.6:

do you know whwy?

tks
peng

sorry,
it's on RC6, with busybox 1.2.

tks
peng

Would the Gui stuff intefere with Webif2?

tks
peng

Also, what's the major difference between asterisk-mini and asterisk in your package? if you can provide a list, that would be great.

Is your ipkg package is the same as openwrt.org's backport? are they created seperately ? or , you guys work together?

Why don't we put them in openwrt's package web?

It's good that this group can always the updated Asterisk into WRT. Great work!
thanks
peng

Thanks to Steve's early work on this I now have Asterisk 1.4.0 built on a "kamikaze" SVN-trunk release of a few days ago.

I have only installed it so far on a Netgear WGT634U.  I'll post my configuration information as soon as I've got things under a bit better control.

The discussion might have continued from here.