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>    $&gt; cd /usr/local/freeswitch/mod/</div><div>    $&gt; /usr/local/freeswitch/bin/freeswitch</div><div>  <b>  [SUCCESS!, Demo.csx will run correctly]</b></div><div><br></div><div><div>    $&gt; cd / (or any other directory)</div>
<div>    $&gt; /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); ">    &quot;&quot;&quot;</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); ">    &lt;configuration&gt;</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>            &lt;dllmap dll=&quot;mod_managed.dll&quot; target=&quot;mod_managed.so&quot; os=&quot;!windows&quot;/&gt;</div>
<div>    &lt;/configuration&gt;</div><div>    &quot;&quot;&quot;</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> $&gt; mono  </div></span></div>