Subscribing to events in managed C# / .NET
Hi there, mod_managed exposes EventReceivedFunction such that: Session.EventReceivedFunction = (e) => { Log.WriteLine(LogLevel.Alert, "Received Event {0}", e.ToString()); return ""; }; should trap all events to which i subscribe. But how do I subscribe to events? What is the .NET / managed equivalent of: switch_event_bind(const char *id, switch_event_types_t event, const char *subclass_name, switch_event_callback_t callback, void *user_data); Thank you! Phillip Jones
You can call switch_event_bind directly, but I doubt that'll achieve what you want. My guess is that it works the same as LUA or any of the other plugins - whatever higher level API is exposed for setting up events should make things just work. -Michael From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Phillip Jones Sent: Thursday, September 03, 2009 8:27 AM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Subscribing to events in managed C# / .NET Hi there, mod_managed exposes EventReceivedFunction such that: Session.EventReceivedFunction = (e) => { Log.WriteLine(LogLevel.Alert, "Received Event {0}", e.ToString()); return ""; }; should trap all events to which i subscribe. But how do I subscribe to events? What is the .NET / managed equivalent of: switch_event_bind(const char *id, switch_event_types_t event, const char *subclass_name, switch_event_callback_t callback, void *user_data); Thank you! Phillip Jones
Check out EventConsumer Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca On 3-Sep-09, at 8:05 AM, Michael Giagnocavo wrote:
You can call switch_event_bind directly, but I doubt that’ll achieve what you want.
My guess is that it works the same as LUA or any of the other plugins – whatever higher level API is exposed for setting up events should make things just work.
-Michael
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org ] On Behalf Of Phillip Jones Sent: Thursday, September 03, 2009 8:27 AM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Subscribing to events in managed C# / .NET
Hi there,
mod_managed exposes EventReceivedFunction such that:
Session.EventReceivedFunction = (e) => { Log.WriteLine(LogLevel.Alert, "Received Event {0}", e.ToString()); return ""; };
should trap all events to which i subscribe.
But how do I subscribe to events? What is the .NET / managed equivalent of:
switch_event_bind(const char *id, switch_event_types_t event, const char *subclass_name, switch_event_callback_t callback, void *user_data);
Thank you!
Phillip Jones _______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Where can I find EventConsumer?? I search the wiki and contrib\ Thanks On Thu, Sep 3, 2009 at 11:12 AM, Mathieu Rene <mrene_lists@avgs.ca> wrote:
Check out EventConsumer Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca
On 3-Sep-09, at 8:05 AM, Michael Giagnocavo wrote:
You can call switch_event_bind directly, but I doubt that’ll achieve what you want.
My guess is that it works the same as LUA or any of the other plugins – whatever higher level API is exposed for setting up events should make things just work.
-Michael
*From:* freeswitch-users-bounces@lists.freeswitch.org [ mailto:freeswitch-users-bounces@lists.freeswitch.org<freeswitch-users-bounces@lists.freeswitch.org> ] *On Behalf Of *Phillip Jones *Sent:* Thursday, September 03, 2009 8:27 AM *To:* freeswitch-users@lists.freeswitch.org *Subject:* [Freeswitch-users] Subscribing to events in managed C# / .NET
Hi there,
mod_managed exposes EventReceivedFunction such that:
Session.EventReceivedFunction = (e) => { Log.WriteLine(LogLevel.Alert, "Received Event {0}", e.ToString()); return ""; };
should trap all events to which i subscribe.
But how do I subscribe to events? What is the .NET / managed equivalent of:
switch_event_bind(const char *id, switch_event_types_t event, const char *subclass_name, switch_event_callback_t callback, void *user_data);
Thank you!
Phillip Jones _______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
try something like this EventConsumer con = new EventConsumer("all", ""); Event ev = con.pop(0); see lua sample - http://wiki.freeswitch.org/wiki/Lua#freeswitch.EventConsumer Phillip Jones-2 wrote:
Hi there,
mod_managed exposes EventReceivedFunction such that:
Session.EventReceivedFunction = (e) => { Log.WriteLine(LogLevel.Alert, "Received Event {0}", e.ToString()); return ""; };
should trap all events to which i subscribe.
But how do I subscribe to events? What is the .NET / managed equivalent of:
switch_event_bind(const char *id, switch_event_types_t event, const char *subclass_name, switch_event_callback_t callback, void *user_data);
Thank you!
Phillip Jones
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- View this message in context: http://n2.nabble.com/Subscribing-to-events-in-managed-C-NET-tp3573619p357494... Sent from the freeswitch-users mailing list archive at Nabble.com.
Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk <jlenk@frontiernet.net> wrote:
try something like this
EventConsumer con = new EventConsumer("all", ""); Event ev = con.pop(0);
see lua sample - http://wiki.freeswitch.org/wiki/Lua#freeswitch.EventConsumer
Phillip Jones-2 wrote:
Hi there,
mod_managed exposes EventReceivedFunction such that:
Session.EventReceivedFunction = (e) => { Log.WriteLine(LogLevel.Alert, "Received Event {0}", e.ToString()); return ""; };
should trap all events to which i subscribe.
But how do I subscribe to events? What is the .NET / managed equivalent of:
switch_event_bind(const char *id, switch_event_types_t event, const char *subclass_name, switch_event_callback_t callback, void *user_data);
Thank you!
Phillip Jones
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- View this message in context: http://n2.nabble.com/Subscribing-to-events-in-managed-C-NET-tp3573619p357494... Sent from the freeswitch-users mailing list archive at Nabble.com.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (4)
-
Jeff Lenk
-
Mathieu Rene
-
Michael Giagnocavo
-
Phillip Jones