[sr-dev] Problem with app_mono module

Pirjo Ahvenainen pirjo.ahvenainen at gmail.com
Fri Mar 30 22:10:53 CEST 2012


Hi,

Thanks Daniel, good to know! I got it working wonderfully on Ubuntu,
only one warning I got when starting Kamailio:

Mar 30 20:31:04 monotest kamailio: WARNING: <core> [sr_module.c:627]:
/usr/local/lib/kamailio/modules/app_mono.so: exports dlflags interface
is deprecated and it will not be supported in newer versions; consider
using mod_register() instead

The example I tried works nicely though. I can use Ubuntu for playing
with the mono stuff, thanks for the advice!

cheers,
Pirjo




30. maaliskuuta 2012 11.56 Daniel-Constantin Mierla
<miconda at gmail.com> kirjoitti:
> Hello,
>
>
> On 3/28/12 3:13 PM, Pirjo Ahvenainen wrote:
>>
>> 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.
>
>
> the module was developed and tested on debian/ubuntu, however it should work
> with mono >2.8.
>
> The docs for embedding mono which were used are:
>  * http://www.mono-project.com/Embedding_Mono
>
> and the build params needed are for 'mono-2'. See:
>  * http://www.mono-project.com/Embedding_Mono#Compiling_and_Linking
>
> Cheers,
> Daniel
>
>>
>>
>>
>> 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 at 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 at 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
>>
>> _______________________________________________
>> sr-dev mailing list
>> sr-dev at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
>
> --
> Daniel-Constantin Mierla
> Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
> http://www.asipto.com/index.php/kamailio-advanced-training/
>



-- 

--
Pirjo Ahvenainen
+35844 559 7729



More information about the sr-dev mailing list