I've successfully installed other FS modules before, but this one I cannot fix. I'll produce as many details as possible and this question may not be a FreeSwitch-specific question. Any general troubleshooting suggestions would be appreciated.
Environment is like below, and I'm using freeswitch-1.6.19 source.
$ cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
$ ls /usr/lib64/ilbc2/ -lh
total 64K
lrwxrwxrwx. 1 root root 16 Oct 24 20:18 libilbc.so -> libilbc.so.0.0.2
lrwxrwxrwx. 1 root root 16 Sep 18 18:03 libilbc.so.0 -> libilbc.so.0.0.2
-rwxr-xr-x. 1 root root 64K Jun 23 2015 libilbc.so.0.0.2
$ nm -D /usr/lib64/ilbc2/libilbc.so
--- omitted many lines ----
0000000000007590 T ilbc_decode
0000000000007790 T ilbc_decode_init
0000000000007c30 T ilbc_encode
0000000000008f80 T ilbc_encode_init
--- omitted many lines ----
I took these steps to compile mod_ilbc
:
- Uncomment the line
codecs/mod_ilbc
inmodules.conf
./configure --prefix=/opt/freeswitch/
make
make install
- Modify
/opt/freeswitch/etc/freeswitch/vars.xml
to addiLBC@30i
toglobal_codec_prefs
. - Start freeswitch.
Here are the evidences that I see things are going smoothly:
make install
successfully installs mod_ilbc. Themake
process successfully detectslibilbc
and useslibtool
to link. Outputs ofmake install
, note the-L/usr/lib64/ilbc2 -lilbc
part.
making install mod_ilbc make[4]: Entering directory `/home/cenzhe.zhu/freeswitch-1.6.19/src/mod/codecs/mod_ilbc' make[5]: Entering directory `/home/cenzhe.zhu/freeswitch-1.6.19/src/mod/codecs/mod_ilbc' make[5]: Nothing to be done for `install-exec-am'. test -z "/opt/freeswitch/lib/freeswitch/mod" || /usr/bin/mkdir -p "/opt/freeswitch/lib/freeswitch/mod" /bin/sh /home/cenzhe.zhu/freeswitch-1.6.19/libtool --mode=install /usr/bin/install -c mod_ilbc.la '/opt/freeswitch/lib/freeswitch/mod' libtool: install: (cd /home/cenzhe.zhu/freeswitch-1.6.19/src/mod/codecs/mod_ilbc; /bin/sh /home/cenzhe.zhu/freeswitch-1.6.19/libtool --silent --tag CC --mode=relink gcc -I/usr/include/uuid -I/home/cenzhe.zhu/freeswitch-1.6.19/src/include -I/home/cenzhe.zhu/freeswitch-1.6.19/src/include -I/home/cenzhe.zhu/freeswitch-1.6.19/libs/libteletone/src -fPIC -Werror -Wno-unused-result -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb -DHAVE_OPENSSL -Wall -std=c99 -pedantic -Wdeclaration-after-statement -I/usr/include/ilbc2 -g -O2 -avoid-version -module -no-undefined -shared -o mod_ilbc.la -rpath /opt/freeswitch/lib/freeswitch/mod mod_ilbc_la-mod_ilbc.lo /home/cenzhe.zhu/freeswitch-1.6.19/libfreeswitch.la -L/usr/lib64/ilbc2 -lilbc -lssl -lcrypto ) libtool: install: /usr/bin/install -c .libs/mod_ilbc.soT /opt/freeswitch/lib/freeswitch/mod/mod_ilbc.so libtool: install: /usr/bin/install -c .libs/mod_ilbc.lai /opt/freeswitch/lib/freeswitch/mod/mod_ilbc.la libtool: finish: PATH="/sbin:/bin:/usr/sbin:/usr/bin:/sbin" ldconfig -n /opt/freeswitch/lib/freeswitch/mod ---------------------------------------------------------------------- Libraries have been installed in: /opt/freeswitch/lib/freeswitch/mod
mod_ilbc
is compiled properly. It expects symbols likeilbc_decode
fromlibilbc
. Analyzingmod_ilbc.so
:
$ nm -D /opt/freeswitch/lib/freeswitch/mod/mod_ilbc.so --- omitted many lines ---- 0000000000001060 T _fini w __gmon_start__ U ilbc_decode U ilbc_decode_init U ilbc_encode U ilbc_encode_init --- omitted many lines ----
- Upon starting freeswitch, it tries to load the module using
dlfcn
but failed. Output offreeswitch.log
:
2017-10-25 13:54:24.243208 [CRIT] switch_loadable_module.c:1528 Error Loading module /opt/freeswitch/lib/freeswitch/mod/mod_ilbc.so **/opt/freeswitch/lib/freeswitch/mod/mod_ilbc.so: undefined symbol: ilbc_decode**
It appears to me that this is because freeswitch failed to link /usr/lib64/ilbc2/libilbc.so
, but why? How to further troubleshoot the problem?