Hi all,
I've been playing with the new mono api on the development version of
Kamailio. I'm having some problems with it, perhaps there's something
someone here knows that would help. If there's a better place to post
this question please guide me to the right direction.
I'm using CentOS 6.2, installed mono with yum, the mono version is 2.4.3.1.
I had problems compiling the app_mono module, I got errors like:
Package mono-2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `mono-2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'mono-2' found
...
So I changed the makefile to the one below (replaced "mono-2" to
"mono" from the default). Then got it compiled and app_mono.so was
generated. I don't know much about makefiles but me guessing what to
do with it got the thing compiled.
#
#
include ../../Makefile.defs
auto_gen=
NAME=app_mono.so
BUILDER = $(shell which pkg-config)
ifeq ($(BUILDER),)
DEFS+=-D_REENTRANT -I/usr/include/mono
LIBS= -lmono -lm -lrt -ldl -lpthread
else
DEFS+= $(shell pkg-config --cflags mono)
LIBS = $(shell pkg-config --libs mono)
endif
DEFS+=-DOPENSER_MOD_INTERFACE
SERLIBPATH=../../lib
SER_LIBS+=$(SERLIBPATH)/kcore/kcore
include ../../Makefile.modules
Then I compiled Kamailio with the app_mono module included, during
compilation I got output like this:
[root@monotest kamailio]# make all
CC (gcc) [M app_mono.so] app_mono_api.o
app_mono_api.c: In function âsr_mono_logâ:
app_mono_api.c:318: warning: implicit declaration of function âmono_freeâ
CC (gcc) [M app_mono.so] app_mono_mod.o
make[2]: `libkcore.so.1.0' is up to date.
LD (gcc) [M app_mono.so] app_mono.so
...
I added my params on the config:
loadmodule "app_mono.so"
...
modparam("app_mono", "load",
"/usr/local/etc/kamailio/mono/MonoTest1.exe")
Everything compiled though and I did not notice any errors. However,
there must be something wrong with either my environment, mono
version, compiling something or something else, command kamailio -c
gives output with errors (note the warning before and the error below
about mono_free):
[root@monotest kamailio]# kamailio -c
loading modules under
/usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/
0(26471) ERROR: <core> [sr_module.c:572]: ERROR: load_module: could
not open module
</usr/local/lib/kamailio/modules/app_mono.so>:
/usr/local/lib/kamailio/modules/app_mono.so: undefined symbol:
mono_free
0(26471) : <core> [cfg.y:3565]: parse error in config file
/usr/local/etc/kamailio/modules.cfg, line 90, column
12-24: failed to load module
0(26471) ERROR: <core> [modparam.c:162]: set_mod_param_regex: No
module matching <app_mono> found
0(26471) : <core> [cfg.y:3568]: parse error in config file
/usr/local/etc/kamailio/modules.cfg, line 281,
column 74: Can't set module parameter
0(26471) ERROR: <core> [cfg.y:3429]: cfg. parser: failed to find
command mono_run
Any ideas on what's the problem?
I'll try the same on Ubuntu to compare but any suggestions and advice
would be appreciated!
cheers,
Pirjo Ahvenainen