users-boun...@lists.freeswitch.org] On Behalf Of Josh Rivers
Sent: Sunday, September 27, 2009 9:36 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
Where does 'somePtr' come from?
On Sun, Sep 27, 2009 at 4:06 PM, Michael
t;
>
> *From:* freeswitch-users-boun...@lists.freeswitch.org [mailto:
> freeswitch-users-boun...@lists.freeswitch.org] *On Behalf Of *Josh Rivers
> *Sent:* Saturday, September 26, 2009 11:29 PM
>
> *To:* freeswitch-users@lists.freeswitch.org
> *Subject:* Re: [Freeswitch-users]
2009 11:29 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
The ability to directly create swigtypes...that's huge! I'd love to see some
examples of how to use that.
I've update my refactoring to include the changes to
t; freeswitch-users-boun...@lists.freeswitch.org] *On Behalf Of *Michael
>> Jerris
>> *Sent:* Thursday, September 24, 2009 10:26 PM
>>
>> *To:* freeswitch-users@lists.freeswitch.org
>> *Subject:* Re: [Freeswitch-users] Subscribing to events in managed C# /
>> .
h.org [mailto:
> freeswitch-users-boun...@lists.freeswitch.org] *On Behalf Of *Michael
> Jerris
> *Sent:* Thursday, September 24, 2009 10:26 PM
>
> *To:* freeswitch-users@lists.freeswitch.org
> *Subject:* Re: [Freeswitch-users] Subscribing to events in managed C# /
> .NET
&g
eswitch.org] *On Behalf Of *Josh Rivers
> *Sent:* Thursday, September 24, 2009 12:32 AM
> *To:* freeswitch-users@lists.freeswitch.org
> *Subject:* Re: [Freeswitch-users] Subscribing to events in managed C# /
> .NET
>
>
>
> On Wed, Sep 23, 2009 at 7:31 PM, Michael Giagnocavo
> wrote:
Sorry for fading off for a few days. Having too much fun doing stuff!
A few responses:
On Thu, Sep 24, 2009 at 1:01 AM, Michael Giagnocavo wrote:
> A few questions I have:
>
> Testability – is this even remotely practical?
>
I've seen three areas of testability:
1) Interop
2) Module Extensibilit
half Of Michael
Jerris
Sent: Thursday, September 24, 2009 10:26 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
There are a few other things I can think would be nice additions to
mod_managed. Maybe an event handler that doe
!
-Michael
From: freeswitch-users-boun...@lists.freeswitch.org
[mailto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of
Josh Rivers
Sent: Thursday, September 24, 2009 12:32 AM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed
C
lto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of Josh Rivers
Sent: Thursday, September 24, 2009 12:32 AM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
On Wed, Sep 23, 2009 at 7:31 PM, Michael Giagnocavo
m
On Wed, Sep 23, 2009 at 7:31 PM, Michael Giagnocavo wrote:
> Right off the bat: there can be tons of cleanup and refactoring, no doubt
> about that. Much of the current code is to satisfy my needs in production,
> which it does very well.
>
The current base doesn't have anything wrong with it for
boun...@lists.freeswitch.org] On Behalf Of Josh Rivers
Sent: Wednesday, September 23, 2009 5:00 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
I've been having the same idea, except completely different. I'd probably start
rol loading,
>> we’ll probably reflect on the individual plugins looking for attributes or
>> perhaps some sort of static load function.
>>
>>
>>
>> How’s that sound?
>>
>>
>>
>>
>>
>> *From:* freeswitch-users-boun...@lists.fr
t does something important, like
> billing or so on. That thread fails – do you really want it to go on?
>
>
>
> Anyways, the solution is simple enough, handle your exceptions J. Every
> plugin can decide what it wants to do here.
>
>
>
> -Michael
>
>
>
> *
attributes or perhaps
some sort of static load function.
How's that sound?
From: freeswitch-users-boun...@lists.freeswitch.org
[mailto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of Josh Rivers
Sent: Thursday, September 10, 2009 12:48 PM
To: freeswitch-users@lists.freeswitch.org
e property getter and that’ll do a null check. If that
> isn’t happening, that’d be an interesting optimization somewhere along the
> line.
>
>
>
> -Michael
>
>
>
>
>
> *From:* freeswitch-users-boun...@lists.freeswitch.org [mailto:
> freeswitch-users-boun...@lists
Surely this is because you are calling ev.serialized_string and ev is null
if there is not event waiting?
i.e. con.pop(0); returns null if no event is waiting.
Therefore
if(ev != null)
Log.WriteLine(LogLevel.Notice, "Event: " + ev.serialized_string);
would work, alternatively calling
: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
Thanks Michael,
I was seeing some strange behavior in a static compiled dll versus
dynamically loaded and compiled scripts.
This code when used in a dll was blowing up when a thread was
-users-boun...@lists.freeswitch.org
> [mailto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of Jeff
> Lenk
> Sent: Wednesday, September 09, 2009 1:57 PM
> To: freeswitch-users@lists.freeswitch.org
> Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
&g
ers
Sent: Wednesday, September 09, 2009 6:39 PM
To:
freeswitch-users@lists.freeswitch.org<mailto:freeswitch-users@lists.freeswitch.org>
Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
I have a new thought on the crashes...I'm able to crash FreeSWITCH any ti
eeswitch-users-boun...@lists.freeswitch.org [mailto:
> freeswitch-users-boun...@lists.freeswitch.org] *On Behalf Of *Josh Rivers
> *Sent:* Wednesday, September 09, 2009 3:01 PM
>
>
> *To:* freeswitch-users@lists.freeswitch.org
>
> *Subject:* Re: [Frees
hael
From: freeswitch-users-boun...@lists.freeswitch.org
[mailto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of Josh Rivers
Sent: Wednesday, September 09, 2009 6:39 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
I have a n
-Michael
>
>
>
>
>
> *From:* freeswitch-users-boun...@lists.freeswitch.org [mailto:
> freeswitch-users-boun...@lists.freeswitch.org] *On Behalf Of *Josh Rivers
> *Sent:* Wednesday, September 09, 2009 3:01 PM
>
> *To:* freeswitch-users@lists.freeswitch.org
> *Subject:
itch-users] Subscribing to events in managed C# / .NET
A new discovery:
public bool Load()
{
ThreadPool.QueueUserWorkItem((o) =>
{
Log.WriteLine(LogLevel.Notice, "Thread Starting. ");
EventConsumer con = new EventCon
ginal Message-
From: freeswitch-users-boun...@lists.freeswitch.org
[mailto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of Jeff Lenk
Sent: Wednesday, September 09, 2009 1:57 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in mana
It does from a fresh start of FreeSWITCH. I've noticed, although not really
confirmed, a race condition between the unload and reload of managed code.
It seems that threads started in the newly submodule are terminated along
with the threads for the old, unloading submodule. Is that what you are
se
Yeah I noticed that but the thread was still terminating after a few seconds
anyway for me. Does it stay running for you?
Josh Rivers-2 wrote:
>
> A new discovery:public bool Load()
> {
> ThreadPool.QueueUserWorkItem((o) =>
> {
> Log.Write
A new discovery:public bool Load()
{
ThreadPool.QueueUserWorkItem((o) =>
{
Log.WriteLine(LogLevel.Notice, "Thread Starting. ");
EventConsumer con = new EventConsumer("all", "");
while (true)
{
gt;>
>>>
>>> Thanks,
>>>
>>> Michael
>>>
>>>
>>> *From:* freeswitch-users-boun...@lists.freeswitch.org [mailto:
>>> freeswitch-users-boun...@lists.freeswitch.org] *On Behalf Of *Josh
>>> Rivers
>>> *Sent:* Tues
I think the problem here is that the loader only keeps this method in scope
until completion then it drops the remoted connection. Therefore you should
not use threads in this method. Michael please correct me if I am wrong
here.
As an example of the failure simply just put a Sleep(1) call in
n pop
0 or not.
From: freeswitch-users-boun...@lists.freeswitch.org [mailto:freeswitch-users-boun...@lists.freeswitch.org
] On Behalf Of Phillip Jones
Sent: Tuesday, September 08, 2009 3:50 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in m
>> Thanks,
>>
>> Michael
>>
>>
>> *From:* freeswitch-users-boun...@lists.freeswitch.org [mailto:
>> freeswitch-users-boun...@lists.freeswitch.org] *On Behalf Of *Josh Rivers
>> *Sent:* Tuesday, September 08, 2009 12:22 AM
>> *To:* freeswitch-users@li
eeswitch-users-boun...@lists.freeswitch.org [mailto:
> freeswitch-users-boun...@lists.freeswitch.org] *On Behalf Of *Phillip
> Jones
> *Sent:* Tuesday, September 08, 2009 3:50 PM
>
> *To:* freeswitch-users@lists.freeswitch.org
> *Subject:* Re: [Freeswitch-users] Subscribing to
You are probably right, but commenting out the msleep doesn't prevent the
crash. -Josh
On Tue, Sep 8, 2009 at 11:12 AM, Phillip Jones wrote:
> What is:
>
> freeswitch.msleep(100);
>
> Why aren't you using Thread.Sleep?
>
>
> On Tue, Sep 8, 2009 at 2:21 AM, Josh Rivers wrote:
>
>> Thanks for the
-boun...@lists.freeswitch.org [mailto:freeswitch-users-boun...@lists.freeswitch.org
] On Behalf Of Josh Rivers
Sent: Tuesday, September 08, 2009 12:22 AM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed
C# / .NET
Thanks for the response!
I have tried putt
>
> Thanks,
>
> Michael
>
>
>
> *From:* freeswitch-users-boun...@lists.freeswitch.org [mailto:
> freeswitch-users-boun...@lists.freeswitch.org] *On Behalf Of *Josh Rivers
> *Sent:* Tuesday, September 08, 2009 12:22 AM
> *To:* freeswitch-users@lists.freeswitch.org
> *Subject
esday, September 08, 2009 3:50 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
I build this out.
This seems to work fine:
ThreadPool.QueueUserWorkItem((o) =>
{
Log.WriteLine(LogLevel.Notice,
nocavo
> wrote:
>
> That’s what his sample does, but he says it crashes.
>
>
>
> *From:* freeswitch-users-boun...@lists.freeswitch.org [mailto:
> freeswitch-users-boun...@lists.freeswitch.org] *On Behalf Of *Raffaele P.
> Guidi
> *Sent:* Tuesday, September 08, 2009 10:08 A
freeswitch.org] On Behalf Of Raffaele P.
Guidi
Sent: Tuesday, September 08, 2009 12:22 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
Well, I can't see any delegate in josh sample, just a
ThreadPool.QueueUserWorkItem. Here
Yeah, probably just using con.pop(1) - that waits for an event to be caught,
instead than con.pop(0), thus avoiding "sleeps" would do the trick
On Tue, Sep 8, 2009 at 20:12, Phillip Jones wrote:
> What is:
>
> freeswitch.msleep(100);
>
> Why aren't you using Thread.Sleep?
>
>
> On Tue, Sep 8, 20
oun...@lists.freeswitch.org [mailto:
> freeswitch-users-boun...@lists.freeswitch.org] *On Behalf Of *Raffaele P.
> Guidi
> *Sent:* Tuesday, September 08, 2009 10:08 AM
>
> *To:* freeswitch-users@lists.freeswitch.org
> *Subject:* Re: [Freeswitch-users] Subscribing to events in managed C#
What is:
freeswitch.msleep(100);
Why aren't you using Thread.Sleep?
On Tue, Sep 8, 2009 at 2:21 AM, Josh Rivers wrote:
> Thanks for the response!
> I have tried putting a long-running loop here, but then it blocks anything
> else managed from happening:
>
>public class TestLoop : ILoadNoti
t: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
Hi, you just have to use delegates to asynchronously call the function
containing the loop and return back the control to the calling thread. Here an
example (don't have my code at hand, hope it doesn't contain typos).
Regar
Hi, you just have to use delegates to asynchronously call the function
containing the loop and return back the control to the calling thread. Here
an example (don't have my code at hand, hope it doesn't contain typos).
Regards,
Raffaele
public class TestLoop : ILoadNotificationPlugin
{
:22 AM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
Thanks for the response!
I have tried putting a long-running loop here, but then it blocks anything else
managed from happening:
public class TestLoop
Thanks for the response!
I have tried putting a long-running loop here, but then it blocks anything
else managed from happening:
public class TestLoop : ILoadNotificationPlugin
{
public bool Load()
{
EventConsumer con = new EventConsumer("all", "");
w
Yes!
public class LoadDemo : ILoadNotificationPlugin {
public bool Load() {
Log.WriteLine(LogLevel.Notice, "LoadDemo running.");
return true;
}
}
this example is from Michael Giagnocavo's Demo.csx which you can find into
the mod_managed svn.
And let me add that works like
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?
Exactly what I was after - thank you!
On Thu, Sep 3, 2009 at
Exactly what I was after - thank you!
On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk 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 Jone
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.EventRece
itch-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, &q
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.Al
-boun...@lists.freeswitch.org
[mailto:freeswitch-users-boun...@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 ex
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 .
54 matches
Mail list logo