Friday, 11 December 2009

Getting and building FreeSwitch (Part 2)

This is not right.


/usr/src/freeswitch/src/mod/endpoints/mod_alsa/mod_alsa.c:1454: error: 'struct ' has no member named 'flags'
make[5]: *** [mod_alsa.lo] Error 1
make[4]: *** [all] Error 1
make[3]: *** [mod_alsa-all] Error 1
make[2]: *** [all-recursive] Error 1
Making all in build
 +-------- FreeSWITCH Build Complete -----------+
 + FreeSWITCH has been successfully built.      +
 + Install by running:                          +
 +                                              +
 +               make install                   +
 +----------------------------------------------+
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

It certainly was not  successfully built !


Getting and building FreeSwitch (Part 1)

Time for some excitement. I'm all prepped. Beer on the desk. Let's go for it.

Going to play with the latest trunk. Dev's seem happier when people are on trunk ;) Is there any time that trunk is badly broken, or is it relatively stable ?

ok. Enough rambling. From the website (http://wiki.freeswitch.org/wiki/Installation_Guide#Obtaining_the_Source_Code)


svn checkout http://svn.freeswitch.org/svn/freeswitch/trunk freeswitch


17:04 - and off it goes, downloading all the FS source goodness ;)
17:10 - done. Wow. Lot more source than Asterisk. Let's see what it does ...

Ok, need to bootstrap.


./bootstrap.sh


Actually, what does this do ? Is it the same as ./configure in Asterisk ? Can't seem to find any "this is what it does" on the web. Aha, looking at the source of bootstrap.sh, we have


 bootstrap: Build the support scripts needed to compile from a
#            checked-out version of the source code.

So, there you have it.

17:13 - Bootstrapping now ...

#1 is configure.ac:66: warning: AC_CANONICAL_BUILD invoked multiple times  a problem  ? ]
#2 got a couple of these  - is this a problem, or not ? Is there something I should be doing ?


configure.in: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.in: You should verify that configure.in invokes AM_INIT_AUTOMAKE,
configure.in: that aclocal.m4 is present in the top-level directory,
configure.in: and that aclocal.m4 was recently regenerated (using aclocal).

#3 configure.ac:84: warning: AC_LIBTOOL_SETUP was called before AC_LIBTOOL_WIN32_DLL

win32 ? on Linux ? Yikes ;)


17:22 - Done.

What now. Hmm.


./configure


Ooookkayyy. So what did bootstrap.sh do then ? Noob question, I know. Just trying to figure out the difference between the Asterisk and FS builds . Does Asterisk have the build scripts as part of the source, but FS builds the build scripts as it needs ? Anyhow, on with it ...

17:31 - ./configure
17:31 - done. Wow. A *lot* more work goes on here than in asterisk.

Heh. A quote from the website

"If you are unsure, leave this to the defaults. FreeSWITCH™ comes with a good set of modules as the default, until you become more familiar with FreeSWITCH™ it is advised that you not edit modules.conf."


Well, I'm going to build all of the modules - a good test for FS and me. :)


update: Mike from FS comments "generally do not recommend just building everything, for example, mod_alsa is a module written specifically for the n800 due to mod_portaudio not working there.  This module is barely touched and I would not use it unless you have a good reason to."


vi modules.conf. Ooo, need mod_curl, for sure . Ok, ignoring all mod_say_xx except for mod_en. And I'm not going to try the Experimental modules . I think that the comment "(don't cry if they're broken)" says it all ;)


Next step:

"If you intend on building mod_fax you may want to do the following to avoid some potential problems (once its stabilized the build system will automagically do this for you)"


So, is the build system stabilized, or not ? And how would I know ? As I'm building mod_fax, guess I'm going to have to take the risk and do the commands:



pushd libs/spandsp
 ./configure --prefix=/usr/local/freeswitch
 make all
 popd


Aw crap. Missing libtiff-devel.  yum install libtiff-devel. Start again :)

I am going to condense all of my findings into an easy howto. This is the "this is what happened when" blog ;)

WooHoo! Time for the big build !


make all install sounds-install moh-install


17:54 - Started

Mmmm. "Well's Bombardier Burning Gold" is going down very nicely, thankyouverymuch ;) (http://www.ratebeer.com/beer/wells-bombardier-burning-gold/71876/)

Oh crap. That sucks. I've just scrolled down to the the "Prerequisites"section. Surely this should be at the very top of the installation page, so we get to install all of the right packages *before* we start building. Yeah, yeah, I know - read the page before doing anything. As if ;)

Oh. Fail !


making all mod_alsa
Compiling /usr/src/freeswitch/src/mod/endpoints/mod_alsa/mod_alsa.c...
mkdir .libs
Compiling /usr/src/freeswitch/src/mod/endpoints/mod_alsa/mod_alsa.c ...
/usr/src/freeswitch/src/mod/endpoints/mod_alsa/mod_alsa.c:38:28: error: alsa/asoundlib.h: No such file or directory
/usr/src/freeswitch/src/mod/endpoints/mod_alsa/mod_alsa.c:114: error: expected specifier-qualifier-list before 'snd_pcm_t'


Need to install all Prerequisites now, just to check.

Onto Part 2

Annoying firewall !

Hmm. Had to run system-config-securitylevel and manually add port 10000 can anyone tell me why the iptables command



iptables -A INPUT -p tcp --dport 22 -j ACCEPT



didn't work ?


Anyhows. 


Disabled bluetooth, cups, and hidd. Enabled httpd.


Right, time to start on freeswitch !!

Installing more of "my" stuff

I always have a set of programs / utilities that makes my life easier. One of those is webmin (http:/www.webmin.com).

Just got a call from the wife asking if I need some beer. Oh, yum. Old Peculiar is a favorite right now ;) Although it may mean that my progress is a little slower tonight ;)

I deliberately left selinux and firewall on to see what problems I encounter. Trying to be security-conscious. However, now my webmin doesn't respond on port 10000. Time to add a rule, I guess.

Grr. Adding "iptables -A INPUT -p tcp --dport 10000 -j ACCEPT" doesn't seem to make a difference. I know it's the firewall blocking, because "service iptables stop" allows a connection to webmin. Frustrating.

/me goes off to peruse the web for iptables :(

Troublesome setup

Ouch. That was quite painful. I have a Zotac ION mobo, with an Nvidia chipset. Quite problematical - because the network card was not detected :(

Found a driver called kmod-forcedeth-0.62-1.25.2.el5.elrepo.i686.rpm , downloaded from http://elrepo.org/linux/elrepo/el5/i386/RPMS/


Rebooted, eth0 now connected. Yay.

Doing my yum upgrade now - should take my 5.2 Centos to 5.4. Need to download another 344MB.

Away we go.

Thursday, 10 December 2009

Installation done

Wow. That was quick. ;)

Well, perhaps too quick. Centos has not found the network card. That's a little bit of an issue. However, sleep calls. This will wait for tomorrow.

Tune in tomorrow for another exciting episode of "Julian MakesFS" ;)

Goodnight all

Choosing an Operating System

I'm biased. I like CentOS - I already use it for my Asterisk installations. So, a simple choice for me.

This means wiping out my Ubuntu box. Heh. That's no real loss. I *hate* sudo :)

Package choices. Hmm. I'll start with the standard development set, and add what I need when I find I don't have the right ones ;)

Ok.

Machine: Check
CentosDVD: Bugger. Only have a 5.2. Never mind - install 5.2, upgrade to 5.4. *Must* be quicker than downloading the 5.4 DVD, right ?

where the hell is that USB cable for the dvd drive ?. I mean, really. One day you've got thousands of the little buggers clogging up drawers, boxes and cupboards, and the next - none. *gone*. Crap. hope the wife hasn't thrown 'em all away ....

Stolen one from the study PC ...

Right. Here we go.

A) UK installation

Problem #1: Centos does not find the installation media. Although it booted from it. Gotta love linux. Gets more like windows every day ;)
Solution #1: Select the usb-storage driver

B) Selected "remove all partitions". Bye Bye Ubuntu. We're going to miss you when you're gone. Not.

C) I want to compile FS from source. Call me a masochist, but I think that you only truly understand a system when you lovingly coax it into life by building it from scratch. That doesn't include Linux. Sod that. Install from dvd every time ;)

So, customize the package selection. No desktop packages. Want this to be a CLI server only. I've chosen

Editors
Text Based Internet
Development Libraries, Tools and Java Development.
Server config tools. [No db tools or servers - I'm going to use curl / xml to get data from my external DB]
System tools

that's it. Installation on it's way. Time to tell the wife I'm going to be busy for the next 30 minutes or so :(