<div>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?</div>
<div><br></div><div>&lt;quote author=&quot;Phillip Jones&quot;&gt;</div><div>Exactly what I was after - thank you!</div><div><br></div><div>On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk &lt;<a href="mailto:jlenk@frontiernet.net">jlenk@frontiernet.net</a>&gt; wrote:</div>
<div><br></div><div>&gt;</div><div>&gt; try something like this</div><div>&gt;</div><div>&gt; EventConsumer con = new EventConsumer(&quot;all&quot;, &quot;&quot;);</div><div>&gt; Event ev = con.pop(0);</div><div>&gt;</div>
<div>&gt; see lua sample -</div><div>&gt; <a href="http://wiki.freeswitch.org/wiki/Lua#freeswitch.EventConsumer">http://wiki.freeswitch.org/wiki/Lua#freeswitch.EventConsumer</a></div><div>&gt;</div><div>&gt;</div><div>&gt; Phillip Jones-2 wrote:</div>
<div>&gt; &gt;</div><div>&gt; &gt; Hi there,</div><div>&gt; &gt;</div><div>&gt; &gt; mod_managed exposes EventReceivedFunction such that:</div><div>&gt; &gt;</div><div>&gt; &gt;  Session.EventReceivedFunction = (e) =&gt;</div>
<div>&gt; &gt;  {</div><div>&gt; &gt;        Log.WriteLine(LogLevel.Alert, &quot;Received Event {0}&quot;, e.ToString());</div><div>&gt; &gt;        return &quot;&quot;;</div><div>&gt; &gt;  };</div><div>&gt; &gt;</div><div>
&gt; &gt; should trap all events to which i subscribe.</div><div>&gt; &gt;</div><div>&gt; &gt;</div><div>&gt; &gt; But how do I subscribe to events? What is the .NET / managed equivalent</div><div>&gt; &gt; of:</div><div>
&gt; &gt;</div><div>&gt; &gt; switch_event_bind(const char *id, switch_event_types_t event, const char</div><div>&gt; &gt; *subclass_name, switch_event_callback_t callback, void *user_data);</div><div>&gt; &gt;</div><div>
&gt; &gt;</div><div>&gt; &gt;</div><div>&gt; &gt; Thank you!</div><div>&gt; &gt;</div><div>&gt; &gt;</div><div>&gt; &gt;</div>