User:Jpeterson275

From FreeSWITCH Wiki
Jump to: navigation, search

Contents

NetBSD/i386 5.0 build of FreeSWITCH 1.0.4pre10 (r14307)

(Built around July 2009)

This build seemed to go much more smoothly. These distilled steps are all that I really needed to complete. No patching (a few manual steps) or other arcane modifications necessary!

  1. Make sure the pre-requisites are installed (see Michael's very helpful bootstrapping instructions for which packages to install).
  2. Download and extract FreeSWITCH 1.0.4pre10
  3. Again, I wanted Python support so I had to enable it in modules.conf (I also disabled spidermonkey as I won't be using it).
  4. Execute the ./configure
  5. Fix the freeswitch-1.0.4pre10/libs/sqlite/Makefile by adding -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lreadline to the READLINE_FLAGS line in the Makefile.
  6. Fix the freeswitch-1.0.4pre10/src/mod/languages/mod_python/Makefile
    1. Add -I/usr/pkg/include/python2.5 to the LOCAL_CFLAGS variable in the Makefile.
    2. Add -L/usr/pkg/lib -Wl,-R/usr/pkg/lib to the LOCAL_LDFLAGS variable in the Makefile.
  7. Fix the mod_sofia build (brute force method). Ideally the warnings in the build should be fixed but we're just a' blazing saddles here.
    1. This is SFSIP-170 which is alternatively fixed via the patch in that issue.
    2. Remove all -Wall references from the freeswitch-1.0.4pre10/libs/sofia-sip/configure file.
    3. Go into the freeswitch-1.0.4pre10/libs/sofia-sip directory and re-run ./configure && gmake. This should complete without any errors/failures (but with some warnings).
  8. Execute the gmake command. This should complete with no errors.
  9. Fix the freeswitch-1.0.4pre10/src/mod/languages/mod_python/Makefile by changing the PYTHON_SITE_DIR variable to /usr/pkg/lib/python2.5/site-packages. This allows the installation of the Python library to complete.
  10. Execute the sudo gmake install to install the software and the make the gmake install sounds-install moh-install if desired (probable).

I was able to then run /usr/local/freeswitch/bin/freeswitch -waste and was up and running with FreeSWITCH!

Notes/Running

  • Just right off the bat I've had an issue where calls take 2 seconds to initiate. I have not investigated this at all so this is likely a configuration issue on my end.
  • I created this rc.subr(8) script (to put into /etc/rc.d/) and enabled in /etc/rc.conf such that I can just /etc/rc.d/freeswitch stop and so that FreeSWITCH will start automatically at startup:
#!/bin/sh
#
# $Id$
#
# PROVIDE: freeswitch
# REQUIRE: DAEMON

. /etc/rc.subr

name="freeswitch"
rcvar=$name
fs_base_dir="/usr/local/freeswitch"
freeswitch_user=$name
freeswitch_group=$name
pidfile="${fs_base_dir}/log/${name}.pid"
command="${fs_base_dir}/bin/${name}"
command_args="-waste -nc"

load_rc_config $name
run_rc_command "$1"

NetBSD/amd64 4.0_RC4 build of FreeSWITCH r10558M

With Michael's very helpful bootstrapping I've been able to compile FreeSwitch using these modifications to his build notes (detailed on his user page).

I didn't use his exact source checkout so unforunately the patches didn't apply cleanly and I wasn't proficient enough to figure out fuzzy patching (I'm sure quite simple, but..) so I just manually patched the source files per his patches. During the "Compile and install" step (right after all the patching) I had to apply these modifications to get FreeSwitch to compile on this system:

  1. Added -fPIC to CFLAGS of libs/libresample/Makefile
    1. cd libs/libresample && gmake clean && gmake & cd ../..
  2. Added -I/usr/pkg/include to CFLAGS of libs/spandsp/src/Makefile (for tiffio.h)
  3. Added -I/usr/pkg/include to LOCAL_CFLAGS of src/mod/applications/mod_fax/Makefile (for tiffio.h)
  4. Added -fPIC to CFLAGS of libs/codec/ilbc/Makefile
    1. cd libs/codec/ilbc && gmake clean && gmake & cd ../../..
  5. Added -L/usr/pkg/lib to LOCAL_CFLAGS of src/mod/languages/mod_lua/Makefile
  6. As a diversion from his configuration I wanted to try mod_python and so... (no pun intended)
    1. (Before even the configuration I had uncommented mod_python from the modules.conf -- during the same step of disabling mod_spidermonkey per Michael's instructions)
    2. Added -I/usr/pkg/include/python2.4 -L/usr/pkg/lib to LOCAL_CFLAGS of src/mod/languages/mod_python/Makefile
    3. After trying the mod_python module it failed with errors like /usr/local/freeswitch/mod/mod_python.so: Undefined PLT symbol "PyInt_FromLong" (symnum = 55). Adding -lpython2.4 to LOCAL_LDFLAGS in the Makefile seemed to fix the issue.
  7. Continue to follow Michael's instructions to a successful build (at least in my case!)

Notes/Running

  • Apparently the rpath is not set somewhere and some linking of libncurses shows up as "not found" (via ldd(1)). My simple fix is to set the environment variable LD_LIBRARY_PATH to /usr/lib:/usr/local/lib:/usr/pkg/lib though a more permanent solution should be found (perhaps adding the rpath to the CFLAGS).
  • IAX2 channels are extremely choppy. This appears to be a NetBSD-related issue as an Asterisk server running on this same machine communicates with another FreeSwitch server (running Linux with a standard FreeSwitch IAX configuration) just fine.
  • An issue I had not seen with previous (much more messy) builds on NetBSD is bridging channels between two SIP devices has some intermittent issues. It appears that when calls are answered FreeSwitch doesn't sent RTP media to either device sometimes. Oddly MOH to either device in separate calls works just fine. After updating to r10640M this issue appears to be fixed or is not showing somehow.


See also

The NetBSD should be the coordination point for NetBSD-related issues.