<div> <span class="Apple-tab-span" style="white-space:pre">        </span>kernel32.dll!77e4bef7() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div>Here&#39;s that call stack.</div><div><br></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>kernel32.dll!77e4bef7() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>msvcr80.dll!78158e89() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e7a17a() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79ea0fa8() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79ea0eff() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e976cc() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e976b3() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e9e3bd() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e970c8() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79f782f1() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79eaa5c5() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79eaad29() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e9a15d() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e9a15d() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e7a1f1() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e7a1f1() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e7a17a() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e88cca() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e96571() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e965a4() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e965c2() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79f59330() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79f59492() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorlib.ni.dll!792d5348() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorlib.ni.dll!792d514f() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorlib.ni.dll!792d4fde() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorlib.ni.dll!79799714() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e813e4() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>mscorwks.dll!79e813ec() <span class="Apple-tab-span" style="white-space:pre">        </span></div><div>&gt;<span class="Apple-tab-span" style="white-space:pre">        </span>FreeSwitch.dll!switch_loadable_module_load_file(char * path=0x01181250, char * filename=0x01181240, switch_bool_t global=SWITCH_FALSE, switch_loadable_module * * new_module=0x0012d9e0)  Line 846 + 0xd bytes<span class="Apple-tab-span" style="white-space:pre">        </span>C</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>FreeSwitch.dll!switch_loadable_module_load_module_ex(char * dir=0x003994a8, char * fname=0x01081d59, switch_bool_t runtime=SWITCH_FALSE, switch_bool_t global=SWITCH_FALSE, const char * * err=0x0012da5c)  Line 942 + 0x15 bytes<span class="Apple-tab-span" style="white-space:pre">        </span>C</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>FreeSwitch.dll!switch_loadable_module_init()  Line 1174 + 0x23 bytes<span class="Apple-tab-span" style="white-space:pre">        </span>C</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>FreeSwitch.dll!switch_core_init_and_modload(unsigned int flags=129, switch_bool_t console=SWITCH_TRUE, const char * * err=0x0012fdec)  Line 1469 + 0x5 bytes<span class="Apple-tab-span" style="white-space:pre">        </span>C</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>FreeSwitch.exe!main(int argc=1, char * * argv=0x00394f80)  Line 748 + 0x23 bytes<span class="Apple-tab-span" style="white-space:pre">        </span>C</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>FreeSwitch.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes<span class="Apple-tab-span" style="white-space:pre">        </span>C</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>FreeSwitch.exe!mainCRTStartup()  Line 403<span class="Apple-tab-span" style="white-space:pre">        </span>C</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>kernel32.dll!77e6f23b() <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-style-span" style="white-space: pre;"><br></span></div>The breakpoint is:<div><span class="Apple-tab-span" style="white-space:pre">                </span>status = load_func_ptr(&amp;module_interface, pool);</div>
<div>Line 846 in switch_loadable_module.c</div><div><br></div><div>--Josh</div><div><br><div class="gmail_quote">On Tue, Sep 8, 2009 at 10:50 PM, Josh Rivers <span dir="ltr">&lt;<a href="mailto:josh@radianttiger.com">josh@radianttiger.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I&#39;m running of the binary release, so I don&#39;t have debug symbols for the freeswitch core. I can do a build...but does somebody else already have one handy? -Josh<div>
<div></div><div class="h5"><br><br><div class="gmail_quote">On Tue, Sep 8, 2009 at 10:33 PM, Mathieu Rene <span dir="ltr">&lt;<a href="mailto:mrene_lists@avgs.ca" target="_blank">mrene_lists@avgs.ca</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Click Break, then go in Window, Debug, Stack Trace (or something similar, I don&#39;t have any VS nearby), then copy paste that.<div>

<div><br><font color="#888888"><div> <span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">

<div><span style="font-size:12px"><div>Mathieu Rene</div><div>Avant-Garde Solutions Inc</div><div>Office: + 1 (514) 664-1044 x100</div><div>Cell: +1 (514) 664-1044 x200</div><div><a href="mailto:mrene@avgs.ca" target="_blank">mrene@avgs.ca</a></div>

<div><br></div><div><br></div></span></div></div></span><br> </div><br></font><div><div><div>On 8-Sep-09, at 10:30 PM, Josh Rivers wrote:</div><br></div><blockquote type="cite"><div><div>Here is the error I get with the loop I mentioned. -Josh</div>

</div><div><div></div><div><span>&lt;Capture.PNG&gt;</span><br><br><div class="gmail_quote">On Tue, Sep 8, 2009 at 5:05 AM, Michael Giagnocavo <span dir="ltr">&lt;<a href="mailto:mgg@giagnocavo.net" target="_blank">mgg@giagnocavo.net</a>&gt;</span> wrote:<br>

 <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div lang="EN-US" link="blue" vlink="purple"> <div><p><span style="font-size:11.0pt;color:#1F497D">Hi,</span></p><div>

<span style="font-size:11.0pt;color:#1F497D"> </span><br></div><p><span style="font-size:11.0pt;color:#1F497D">                Can you please elaborate on the crash you receive when you queue a thread during load?</span></p>

<div><span style="font-size:11.0pt;color:#1F497D"> </span><br></div><p><span style="font-size:11.0pt;color:#1F497D">Thanks,</span></p><p><span style="font-size:11.0pt;color:#1F497D">Michael                </span></p><div>

<span style="font-size:11.0pt;color:#1F497D"> </span><br></div> <div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in"><p><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>On Behalf Of </b>Josh Rivers<br>

 <b>Sent:</b> Tuesday, September 08, 2009 12:22 AM<br> <b>To:</b> <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br> <b>Subject:</b> Re: [Freeswitch-users] Subscribing to events in managed C# / .NET</span></p>

 </div><div><div></div><div><div> <br></div><p>Thanks for the response!</p> <div><div> <br></div> </div> <div><p>I have tried putting a long-running loop here, but then it blocks anything else managed from happening:</p>
 </div>
 <div><div> <br></div> </div> <div> <div><p>   public class TestLoop : ILoadNotificationPlugin</p> </div> <div><p>    {</p> </div> <div><p>        public bool Load()</p> </div> <div><p>        {</p> </div> <div><p>            EventConsumer con = new EventConsumer(&quot;all&quot;, &quot;&quot;);</p>

 </div> <div><p>            while (true)</p> </div> <div><p>            {</p> </div> <div><p>                Event ev = con.pop(0);</p> </div> <div><p>                Log.WriteLine(LogLevel.Notice, &quot;Event: &quot; + ev.serialized_string);</p>

 </div> <div><p>                freeswitch.msleep(100);</p> </div> <div><p>            }</p> </div> <div><p>        }</p> </div> <div><p>    }</p> </div> <div><div> <br></div> </div> <div><p>However, if I fork off a thread here, freeswitch crashes:</p>

 </div> <div> <div><p>    public class TestLoop : ILoadNotificationPlugin</p> </div> <div><p>    {</p> </div> <div><p>        public bool Load()</p> </div> <div><p>        {</p> </div> <div><p>            ThreadPool.QueueUserWorkItem((o) =&gt;</p>

 </div> <div><p>            {</p> </div> <div><p>                Log.WriteLine(LogLevel.Notice, &quot;Thread Starting. &quot;);</p> </div> <div><p>                EventConsumer con = new EventConsumer(&quot;all&quot;, &quot;&quot;);</p>

 </div> <div><p>                while (true)</p> </div> <div><p>                {</p> </div> <div><p>                    Event ev = con.pop(0);</p> </div> <div><p>                    Log.WriteLine(LogLevel.Notice, &quot;Event: &quot; + ev.serialized_string);</p>

 </div> <div><p>                    freeswitch.msleep(100);</p> </div> <div><p>                }</p> </div> <div><p>            });</p> </div> <div><p>            return true;</p> </div> <div><p>        }</p> </div> <div>

<p>    }</p> </div> <div><div> <br></div> </div> <div><p>It doesn&#39;t look like this is a good place to start a long-running process?</p> </div> <div><div> <br></div> </div> <div><p>Thanks!</p> </div> <div><p>Josh</p> </div>

 <div><div> <br></div> </div> </div> </div> <div> <div><p>On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi &lt;<a href="mailto:raffaele.p.guidi@gmail.com" target="_blank">raffaele.p.guidi@gmail.com</a>&gt; wrote:</p><p>

Yes!</p> <div><div> <br></div> </div> <div> <div><p><span style="font-family:&quot;Courier New&quot;">public class LoadDemo : ILoadNotificationPlugin {</span></p> </div> <div><p><span style="font-family:&quot;Courier New&quot;">    public bool Load() {</span></p>

 </div> <div><p><span style="font-family:&quot;Courier New&quot;">        Log.WriteLine(LogLevel.Notice, &quot;LoadDemo running.&quot;);</span></p> </div> <div><p><span style="font-family:&quot;Courier New&quot;">        return true;</span></p>

 </div> <div><p><span style="font-family:&quot;Courier New&quot;">    }</span></p> </div> <div><p><span style="font-family:&quot;Courier New&quot;">}</span></p> </div> <div><div> <br></div> </div> <div><p>this example is from Michael Giagnocavo&#39;s Demo.csx which you can find into the mod_managed svn.</p>

 </div> <div><div> <br></div> </div> <div><p>And let me add that works like a charm :)</p> </div> <div><div> <br></div> </div> <div><p>Ciao,</p> </div> <div><p>   Raffaele</p> </div><div> <br></div> <div> <div> <div><p>On Sun, Sep 6, 2009 at 22:50, Josh Rivers &lt;<a href="mailto:josh@radianttiger.com" target="_blank">josh@radianttiger.com</a>&gt; wrote:</p>

 </div> </div> <blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"> <div> <div> <div><p>Is there a way to start this when FreeSWITCH starts? The lua and perl modules have a &#39;startup-script&#39; configuration preference. Is there something similar in mod_managed? Or is there a way to have an api command executed at a startup?</p>

 </div> <div><div> <br></div> </div> <div><p>&lt;quote author=&quot;Phillip Jones&quot;&gt;</p> </div> <div> <div> <div><p>Exactly what I was after - thank you!</p> </div> <div><div> <br></div> </div> <div><p>On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk &lt;<a href="mailto:jlenk@frontiernet.net" target="_blank">jlenk@frontiernet.net</a>&gt; wrote:</p>

 </div> <div><div> <br></div> </div> <div><p>&gt; </p> </div> <div><p>&gt; try something like this</p> </div> <div><p>&gt; </p> </div> <div><p>&gt; EventConsumer con = new EventConsumer(&quot;all&quot;, &quot;&quot;);</p>

 </div> <div><p>&gt; Event ev = con.pop(0);</p> </div> <div><p>&gt; </p> </div> <div><p>&gt; see lua sample -</p> </div> <div><p>&gt; <a href="http://wiki.freeswitch.org/wiki/Lua#freeswitch.EventConsumer" target="_blank">http://wiki.freeswitch.org/wiki/Lua#freeswitch.EventConsumer</a></p>

 </div> <div><p>&gt; </p> </div> <div><p>&gt; </p> </div> <div><p>&gt; Phillip Jones-2 wrote:</p> </div> <div><p>&gt; &gt;</p> </div> <div><p>&gt; &gt; Hi there,</p> </div> <div><p>&gt; &gt;</p> </div> <div><p>&gt; &gt; mod_managed exposes EventReceivedFunction such that:</p>

 </div> <div><p>&gt; &gt;</p> </div> <div><p>&gt; &gt;  Session.EventReceivedFunction = (e) =&gt;</p> </div> <div><p>&gt; &gt;  {</p> </div> <div><p>&gt; &gt;        Log.WriteLine(LogLevel.Alert, &quot;Received Event {0}&quot;, e.ToString());</p>

 </div> <div><p>&gt; &gt;        return &quot;&quot;;</p> </div> <div><p>&gt; &gt;  };</p> </div> <div><p>&gt; &gt;</p> </div> <div><p>&gt; &gt; should trap all events to which i subscribe.</p> </div> <div><p>&gt; &gt;</p>

 </div> <div><p>&gt; &gt;</p> </div> <div><p>&gt; &gt; But how do I subscribe to events? What is the .NET / managed equivalent</p> </div> <div><p>&gt; &gt; of:</p> </div> <div><p>&gt; &gt;</p> </div> <div><p>&gt; &gt; switch_event_bind(const char *id, switch_event_types_t event, const char</p>

 </div> <div><p>&gt; &gt; *subclass_name, switch_event_callback_t callback, void *user_data);</p> </div> <div><p>&gt; &gt;</p> </div> <div><p>&gt; &gt;</p> </div> <div><p>&gt; &gt;</p> </div> <div><p>&gt; &gt; Thank you!</p>

 </div> <div><p>&gt; &gt;</p> </div> <div><p>&gt; &gt;</p> </div> <div><p>&gt; &gt;</p> </div> </div> </div><div> <br></div> </div> </div><p style="margin-bottom:12.0pt">_______________________________________________<br>

 FreeSWITCH-users mailing list<br> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>

 UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></p>

 </blockquote> </div><div> <br></div> </div><p style="margin-bottom:12.0pt"><br> _______________________________________________<br> FreeSWITCH-users mailing list<br> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>

 <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>

 <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></p> </div><div> <br></div> </div> </div></div></div> </div> <br>_______________________________________________<br> FreeSWITCH-users mailing list<br>

 <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>

 UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>

 <br></blockquote></div><br> _______________________________________________<br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>

<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>

<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></div></div></blockquote></div><br></div></div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
</div></div></blockquote></div><br></div>