Asterisk on NGW100

Last post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have been eying the NGW100 and was wondering if it would be possible to install a cut down version of asterisk on it. I realize that I will only be able to squeeze 2-4 lines out of it but that will suite my home needs.

I did take a look at Astlinux and also at this forum. I see 3 people say they are going to do it and one person reporting they gave up.

Is there a reason why there are not more success stories on here about this combo?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ISTR the main problems were just getting the audio codecs compiled. This is occasionally a problem because the bright spark who wrote them assumed that everyone is running x86 so you may find either "accelerations" using x86 ASM or simply little-endian byte order assumptions which break on the big endianness of an AVR32.

There's no reason I can think of why it can't work in theory, it just turns out that in practice that particular set of software doesn't play nice with cross compilers. If you're ruthless with the --disable- and --without- switches on the command line, limiting the build to exactly what you need, you should be able to get there.

-S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

excellent...well, i've been on Linux for 15 yrs and have been playing with smaller devices for 3-4 yrs. I'll give it a shot and see what I can come up with.

Worse case scenario...I have 50 other projects I could use the NGW100 for. Thanks for the input.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not AVR32, but shows that it is possible on limited resources...

http://blackfin.uclinux.org/gf/project/asterisk/

Tim

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi thakidd!

I'm currently building a new kernel using Buildroot and I can't compile asterisk... when the buildroot kernel calls make to compile asterisk it says that i should configure asterisk before running make...

Have you been able to compile it for the NGW100?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey guys,

So a few days ago I was looking for this exact thing. I know it's a bit late, but I was able to successfully compile Asterisk (albeit slimmed down) for my NGW100. It is now working just fine. That said, the default install (with a lot of excess voice files) is at least 20MB, so I have it running off an SD card, at least until I get some time to go in there and hack out what I don't need.

As squidgit said, there are in fact a couple of problems with certain audio codecs due to "optimizations" :) -- the GSM codec is written entirely in assembly. The µLaw codec however (the one I needed) worked just fine. Step by steps follow.

0. AVR32 libtermcap.
Asterisk requires libtermcap. This is a statically linked library which I added to my buildroot (it won't get copied over). However, if you simply download libtermcap from ftp.gnu.org and configure it as follows, it will get put into your /opt.

AR=avr32-linux-ar AS=avr32-linux-as LD=avr32-linux-ld NM=avr32-linux-nm CC=avr32-linux-gcc CPP=avr32-linux-cpp \
GCC=avr32-linux-gcc CXX=avr32-linux-g++ RANLIB=avr32-linux-ranlib STRIP=avr32-linux-strip \
./configure --build=i386-pc-linux-gnu --host=avr32-linux-gnu \
--target=avr32-linux --prefix=/opt

Then make/make install it and you should be ready to proceed to the next step.

1. Begin by configuring properly.
Your --with-z should point to the staging directory of your buildroot, and your --prefix should point to where you want to install. In my case this was the SD card mount point. REMEMBER: I was unable to "sudo make install", it wouldn't find avr32-linux-gcc. So I had to make sure that the --prefix was chmod/chown'd and writable. Your --with-termcap may vary. If its in your buildroot it's problably not going to be /opt.

AR=avr32-linux-ar AS=avr32-linux-as LD=avr32-linux-ld NM=avr32-linux-nm CC=avr32-linux-gcc CPP=avr32-linux-cpp \
GCC=avr32-linux-gcc CXX=avr32-linux-g++ RANLIB=avr32-linux-ranlib STRIP=avr32-linux-strip \
./configure --build=i386-pc-linux-gnu --host=avr32-linux-gnu \
--target=avr32-linux --disable-nls --disable-static \
--without-pwlib --without-ssl \
--with-z=/home/martin/Desktop/Downloads/buildroot-avr32-v2.3.0/build_avr32/staging_dir/ \
--with-termcap=/opt \
--without-curl --without-popt --without-ogg --without-tds --without-sqlite --without-postgres \
--prefix=/media/disk

2. Make menuconfig:
Disable at LEAST:
Codec Translators/codec_gsm (Intel ASM)
Dialplan Functions/func_iconv (No iconv support)
PBX Modules/pbx_dundi (I couldn't make it work)

Disable at your option:
Anything you think you won't use.

Recommend Enabling:
Compiler Flags/LOW_MEMORY

3. Set the right architecture:
Edit makeopts
Change PROC=avr32 to PROC=ap on line 39 col 6
This affects the -march= flag.

4. IF you didn't add res_close to uClibc
edit main/dns.c
I commented out dns.c:292:11 res_close

Since uClibc doesn't include it by default it probably isn't needed right? Just throwing it out there... If I am wrong please feel free to let me know. I just couldn't for the life of me figure out how to add it to the buildroot properly. Linkage errors ensued.

5. Compile and Install
make
make install
[optionally] make samples

6. Stripping asterisk and friends.
As you may have noticed, the "strip" command probably failed. I noticed that this was because it was calling /usr/bin/strip instead of avr32-linux-strip like you told it to. 2 solutions.

a. Run avr32-linux-strip on all the binaries anyway was the default stripping probably would not have been aggressive enough for our tastes.

b. Edit build_tools/strip_nonapi and change line 33 such that it reads as follows, and [re] make/make install. That should work.

sed -e "s/^/-N /" striplist | xargs -n 40 avr32-linux-strip ${1}

That is the sum of all the knowledge that I acquired over the last 4 days in my spare time :P Hope that it ends up helping someone. My NGW100 is now running my incoming VOIP line :) Asterisk requires 2MB base RAM + (100kb RAM and 10-15% CPU)/SIPchannel@muLaw.
===========

Edit: This worked for Asterisk 1.6.1.1

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks a lot for your post.

I've compile succefully and tomarrow I test it in my NGW100.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I try to compile asterisk for NGW100 but
in the compiling process it say that miss -ltermcap.

In th config.log there is:

configure:33502: result: no
configure:34203: checking for avr32-linux-gnu-gmime-config
configure:34233: result: no
configure:34243: checking for gmime-config
configure:34273: result: no
configure:34719: checking for tgetent in -ltermcap
configure:34754: /home/mattei/buildroot-avr32-v2.3.0/build_avr32/staging_dir/bin/avr32-linux-gcc -o conftest -g -O2 conftest.c -ltermcap -L/home/mattei/bu\
ildroot-avr32-v2.3.0/build_avr32/staging_dir//lib -lm >&5
/home/mattei/buildroot-avr32-v2.3.0/build_avr32/staging_dir//lib/libtermcap.a(termcap.o): warning: input is not relaxable
configure:34760: $? = 0
configure:34779: result: yes

configure:34974: checking for tgetent in -ltinfo
configure:35009: /home/mattei/buildroot-avr32-v2.3.0/build_avr32/staging_dir/bin/avr32-linux-gcc -o conftest -g -O2 conftest.c -ltinfo -lm >&5
/home/mattei/buildroot-avr32-v2.3.0/build_avr32/staging_dir/usr/bin/avr32-linux-uclibc-ld: cannot find -ltinfo
collect2: ld returned 1 exit status

Thanks in advance
Have a good day

Luigi