Yes!<div><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace">public class LoadDemo : ILoadNotificationPlugin {</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> public bool Load() {</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> Log.WriteLine(LogLevel.Notice, "LoadDemo running.");</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> return true;</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> }</font></div><div><font class="Apple-style-span" face="'courier new', monospace">}</font></div><div><br></div><div>this example is from Michael Giagnocavo's Demo.csx which you can find into the mod_managed svn.</div>
<div><br></div><div>And let me add that works like a charm :)</div><div><br></div><div>Ciao,</div><div> Raffaele</div><br><div class="gmail_quote">On Sun, Sep 6, 2009 at 22:50, Josh Rivers <span dir="ltr"><<a href="mailto:josh@radianttiger.com">josh@radianttiger.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>Is there a way to start this when FreeSWITCH starts? The lua and perl modules have a 'startup-script' 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><quote author="Phillip Jones"></div><div><div></div><div class="h5"><div>Exactly what I was after - thank you!</div><div><br></div><div>On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk <<a href="mailto:jlenk@frontiernet.net" target="_blank">jlenk@frontiernet.net</a>> wrote:</div>
<div><br></div><div>></div><div>> try something like this</div><div>></div><div>> EventConsumer con = new EventConsumer("all", "");</div><div>> Event ev = con.pop(0);</div><div>></div>
<div>> see lua sample -</div><div>> <a href="http://wiki.freeswitch.org/wiki/Lua#freeswitch.EventConsumer" target="_blank">http://wiki.freeswitch.org/wiki/Lua#freeswitch.EventConsumer</a></div><div>></div><div>></div>
<div>> Phillip Jones-2 wrote:</div>
<div>> ></div><div>> > Hi there,</div><div>> ></div><div>> > mod_managed exposes EventReceivedFunction such that:</div><div>> ></div><div>> > Session.EventReceivedFunction = (e) =></div>
<div>> > {</div><div>> > Log.WriteLine(LogLevel.Alert, "Received Event {0}", e.ToString());</div><div>> > return "";</div><div>> > };</div><div>> ></div><div>
> > should trap all events to which i subscribe.</div><div>> ></div><div>> ></div><div>> > But how do I subscribe to events? What is the .NET / managed equivalent</div><div>> > of:</div><div>
> ></div><div>> > switch_event_bind(const char *id, switch_event_types_t event, const char</div><div>> > *subclass_name, switch_event_callback_t callback, void *user_data);</div><div>> ></div><div>
> ></div><div>> ></div><div>> > Thank you!</div><div>> ></div><div>> ></div><div>> ></div>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">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>