Hey Everyone,
I have recently been asked to set up a FreeSwitch server on a company development server and the development management wants to use Mono C# as our language for adding logic to the platform.
Following the instructions at
http://wiki.freeswitch.org/wiki/Mod_managed I have been able to successfully compile freeswitch on a Suse 11.4 box, with a custom installation of Mono 2.8 and I can
successfully execute Demo.csx.
But here is the problem, the only way I can get Demo.csx to run correctly without getting a NullReferenceException is to start the server from the freeswitch mod directory:
EG.
$> cd /usr/local/freeswitch/mod/
$> /usr/local/freeswitch/bin/freeswitch
[SUCCESS!, Demo.csx will run correctly]
$> cd / (or any other directory)
$> /usr/local/freeswitch/bin/freeswitch
[FAIL, The server starts, calls work, everything is fine EXCEPT Demo.csx now throws
NullReferenceExceptions when I hit it with a call that is routed to the script by the dial plan]
- I have tried changing the dllmap default to the mono installation, I have tried adding /usr/local/freeswitch/mod/FreeSWITCH.Native.dll.config with the following text inside:
"""
<configuration>
<dllmap dll="mod_managed.dll" target="mod_managed.so" os="!windows"/>
</configuration>
"""
- I have tried adding /usr/local/freeswitch/mod/ to the system ld path (/etc/ld.so.conf). I also reloaded the ld cache (ldconfig)
- I have tried copying FreeSWITCH.Managed.dll to the existing ld path (/usr/local/lib/FreeSWITCH.Managed.dll)
- I even created a Console HelloWorld.exe that imports the Freeswitch libraries and ran it by simply executing:
$> mono