MonoDevelop and libpjsipDll.so library on Ubuntu.

2020-07-20 03:37发布

问题:

i am trying to use a dll for Linux called: libpjsipDll_v44.so I got it from here http://code.google.com/p/sipeksdk/downloads/list

It's a port for Linux of the http://www.pjsip.org/ is a VOIP library

This site claims that is posible to use the library in Linux https://sites.google.com/site/sipekvoip/Home/documentation/pjsipwrapper/pjsipwrapper-for-linux

The code in MonoDevelop 4.0.12 with C# the code is like this:

internal const string PJSIP_DLL = "libpjsipDll.so"; 

[DllImportAttribute(PJSIP_DLL, EntryPoint = "onRegStateCallback")]
private static extern int onRegStateCallback(OnRegStateChanged cb);

But is not working! it throw System.DllNotFoundException

I'm working with Ubuntu x86 v14.04 lts This are the steps I did to install the library:

$ sudo cp libpjsipDll_v44.so /usr/lib/libpjsipDll.so 
$ sudo ldconfig

I even tried to copy the library to several more paths like

/usr/local/lib 
/lib`

and create links

   $ sudo ln -s /usr/lib/libpjsipDll.so /usr/lib/libpjsipDll_v44.so
   $ sudo ln -s /usr/lib/libpjsipDll.so /usr/lib/pjsipDll.so

Then trying to look for my .so installed i run this command:

$ sudo ldconfig -p |grep libpjsipDll

I also tryied to map the dll using App.config using as many combination i can think of wihtout success

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <dllmap dll="libpjsipDll.so" target="libpjsipDll.so"/>
  <!--
  <dllmap dll="libpjsipDll.so" target="/libpjsipDll.so"/>
  <dllmap dll="libpjsipDll.so" target="/usr/lib/libpjsipDll.so"/>
  <dllmap dll="libpjsipDll.so" target="/usr/local/lib/libpjsipDll.so"/>
  <dllmap dll="libpjsipDll.so" target="i:libpjsipDll.so"/>
  <dllmap dll="libpjsipDll.so" target="libpjsipDll.so" wordsize="32" cpu="x86"/>
  -->
</configuration>

I tried executing the .exe like this:

$ MONO_LOG_LEVEL=debug mono MyApp.exe

and i realice that the application needed an other dll libssl0

Then I installed the required dll, and everything run fine! but I still cant make any call.

$ sudo apt-get install libssl0.9.8:i386

I have used this same dll (extension .dll) with .NET in Windows without any problem! Any idea what am i doing wrong?

Thanks in advance