Hey Everyone,<div><br></div><div>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.</div>
<div><br></div><div>Following the instructions at <a href="http://wiki.freeswitch.org/wiki/Mod_managed">http://wiki.freeswitch.org/wiki/Mod_managed</a> 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 <b>successfully execute Demo.csx</b>.</div>
<div><br></div><div>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:</div><div><br></div><div> EG.</div>
<div><br></div><div> $> cd /usr/local/freeswitch/mod/</div><div> $> /usr/local/freeswitch/bin/freeswitch</div><div> <b> [SUCCESS!, Demo.csx will run correctly]</b></div><div><br></div><div><div> $> cd / (or any other directory)</div>
<div> $> /usr/local/freeswitch/bin/freeswitch</div></div><div> [FAIL, The server starts, calls work, everything is fine EXCEPT Demo.csx now throws </div><div> <b>NullReferenceExceptions when I hit it with a call that is routed to the script by the dial plan]</b></div>
<div><br></div><div>- I have tried changing the <b>dllmap</b> default to the mono installation, I have tried adding /usr/local/freeswitch/mod/<span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; line-height: 19px; background-color: rgb(255, 255, 255); "><b>FreeSWITCH.Native.dll.config</b> with the following text inside:</span></div>
<div><span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; line-height: 19px; background-color: rgb(255, 255, 255); "> """</span></div><div><span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; line-height: 19px; background-color: rgb(255, 255, 255); "> <configuration></span></div>
<div><span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; line-height: 19px; background-color: rgb(255, 255, 255); "><div> <dllmap dll="mod_managed.dll" target="mod_managed.so" os="!windows"/></div>
<div> </configuration></div><div> """</div><div><br></div><div>- I have tried adding /usr/local/freeswitch/mod/ to the system ld path (/etc/ld.so.conf). I also reloaded the ld cache (ldconfig)</div>
<div><br></div><div>- I have tried copying FreeSWITCH.Managed.dll to the existing ld path (/usr/local/lib/FreeSWITCH.Managed.dll)</div><div><br></div><div>- I even created a Console HelloWorld.exe that imports the Freeswitch libraries and ran it by simply executing:</div>
<div> $> mono </div></span></div>