Re: [Freeswitch-users] Using mod_managed to create full FreeSWITCH modules
I suppose you are working in windows with the binary distribution (that doesn't contain the mod_managed binaries, sources and examples. A bit weird, I think). You can get them from here http://fisheye.freeswitch.org/browse/FreeSWITCH/src/mod/languages/mod_managed. The package contains a Demo.csx file featuring three examples: api, app and load notification plugin - very simple to understand and that will be easy to extend. Once mod_managed is installed you can put that file into the managed dir and will be automatically deployed. The csx (wich is csharp script) can also be compiled into an exe file and will work the same way. Regards, Raffaele On Tue, Sep 8, 2009 at 07:41, Josh Rivers j...@radianttiger.com wrote: The wiki says: mod_managed exposes nearly the entire FreeSWITCH C API (courtesy of SWIG). This allows creation of not just API functions and call apps, but any type of module that FreeSWITCH supports (codecs, endpoints, etc.). The types are in the FreeSWITCH.Native namespace. FreeSWITCH.Native. The FreeSWITCH.Native.freeswitch type contains static members to access all the functions. Does anybody have a starting point they can share for a non-API/APP managed module. I'd like to build something that runs in the SWITCH_MODULE_SHUTDOWN_FUNCTION/SWITCH_MODULE_SHUTDOWN_FUNCTION/SWITCH_MODULE_SHUTDOWN_FUNCTION lifecycle. How can this be done? Thanks! Josh ___ 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
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.com wrote: 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? quote author=Phillip Jones Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk jl...@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! ___ 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
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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() { ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } }); return true; } } It doesn't look like this is a good place to start a long-running process? Thanks! Josh On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: 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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.com wrote: 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? quote author=Phillip Jones Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk jl...@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! ___ 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 ___ 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
Re: [Freeswitch-users] Using mod_managed to create full FreeSWITCH modules
Thanks for the response Raffaele, I've successfully gotten the plugins to work. What I'm looking for is a way to write a lower-level FreeSWITCH module, as is implied by the wiki document. Mostly I'm trying to get something that runs stably in it's own thread from switch startup. Josh On Mon, Sep 7, 2009 at 11:00 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: I suppose you are working in windows with the binary distribution (that doesn't contain the mod_managed binaries, sources and examples. A bit weird, I think). You can get them from here http://fisheye.freeswitch.org/browse/FreeSWITCH/src/mod/languages/mod_managed. The package contains a Demo.csx file featuring three examples: api, app and load notification plugin - very simple to understand and that will be easy to extend. Once mod_managed is installed you can put that file into the managed dir and will be automatically deployed. The csx (wich is csharp script) can also be compiled into an exe file and will work the same way. Regards, Raffaele On Tue, Sep 8, 2009 at 07:41, Josh Rivers j...@radianttiger.com wrote: The wiki says: mod_managed exposes nearly the entire FreeSWITCH C API (courtesy of SWIG). This allows creation of not just API functions and call apps, but any type of module that FreeSWITCH supports (codecs, endpoints, etc.). The types are in the FreeSWITCH.Native namespace. FreeSWITCH.Native. The FreeSWITCH.Native.freeswitch type contains static members to access all the functions. Does anybody have a starting point they can share for a non-API/APP managed module. I'd like to build something that runs in the SWITCH_MODULE_SHUTDOWN_FUNCTION/SWITCH_MODULE_SHUTDOWN_FUNCTION/SWITCH_MODULE_SHUTDOWN_FUNCTION lifecycle. How can this be done? Thanks! Josh ___ 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 ___ 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] switch_core_io.c:118 sofia/internal/XXXXX has no read codec.
Hello, I have a problem when trying to put a call on hold: I get the above message and the call is disconnected. Any idea where to look for the source of the problem? One thing I've tried is limiting all phones to use only one codec, but it doesn't help... Thanks! __Yehavi: ___ 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
Re: [Freeswitch-users] switch_core_io.c:118 sofia/internal/XXXXX has no read codec.
Yehavi Bourvine yehavi.bourv...@gmail.com wrote: I have a problem when trying to put a call on hold: I get the above message and the call is disconnected. Any idea where to look for the source of the problem? My next step in your situation would be to obtain a Sip trace and post relevant details from it to the list. ___ 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
Re: [Freeswitch-users] freeswitch - q: originate calls from database
On Sun, Sep 6, 2009 at 6:43 AM, tom tomabr...@gmail.com wrote: hi, is this scenario doable? let the system call people , they talk do an ivr, and can dependend on their selection end up in a real call-queue. 1) how would i tell FS to call xyz-people from the databse? thx You have some learning to do. Most likely you will need to build an application that can connect to FS via the event socket and issue originate commands. If you just need to fire and forget then it won't be too hard. You'll need to come up with a way to build dialstrings, i.e. originate sofia/gateway/mygw/1234567890 as well as a dialplan to handle the call flow. Then there's the matter of what to do with busy/no answer/invalid/hangup in mid-process/message machines/etc. Start by searching wiki.freeswitch.org for these concepts: originate command event socket (and ESL - the event socket layer) bridge application mod_fifo (for queue) Also, look at the demo IVR in the source tree because it has some handy examples of how to do things. -MC ___ 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
Re: [Freeswitch-users] Passing custom Dial Plans in perl
On Mon, Sep 7, 2009 at 1:51 AM, Ahmed Munir ahmedmunir...@gmail.com wrote: Hi, I've set some variables in dialplan XML and I want to call these variables in perl, i.e. dialplan.xml action application=set data=DIALEXCUTED=NO/ Also after executing in perl the value of this variable pass to dialplan.xml Kindly tell me how to do this. If you execute the set app prior to calling your script then the variable will be available with $session-getVariable(DIALEXECUTED); If you modify the value inside your script then it will be available in dialplan but only if you transfer the call back through the dialplan again. -MC ___ 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
Re: [Freeswitch-users] Bind extention to a different Dialplan and cdr php?
On Sun, Sep 6, 2009 at 8:43 AM, Frank @ Impact fr...@impactfax.com wrote: Is there a way to bind a particular extension to a different dialplan phpand a different cdr php script than the default one? Could you re-phrase this question with a bit more detail? Thanks. -MC ___ 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
Re: [Freeswitch-users] ESL C questions
Thanks. Indeed it's a bit 'spartan' but it does describe the esl functions and structures. Remko Van: freeswitch-users-boun...@lists.freeswitch.org [mailto:freeswitch-users-boun...@lists.freeswitch.org] Namens João Mesquita Verzonden: maandag 7 september 2009 19:21 Aan: freeswitch-users@lists.freeswitch.org Onderwerp: Re: [Freeswitch-users] ESL C questions Remko, I wrote the documentation that is on docs.freeswitch.org Take a look there, it is far from being complete but it might help. jmesquita On Mon, Sep 7, 2009 at 10:26 AM, Remko Kloosterman r.klooster...@mtel.nl wrote: Hi there, I wonder, is ESL documentation available for C or does someone have something in draft? I'm trying to write an outbound socket application for some generic IVR features. I didn't find exactly that on the wiki except TODO J. The perl/ruby/javascript pages help a bit and the libs/esl source code provides examples that seem useful for trial and error, but I'd rather understand a bit more first. Right now I have a socket server that forks a process, answers a call, generates beep and plays voice. How can I retrieve digits? Place an outbound call and bridge both legs or retrieve a cause if the call failed? Send/receive SIP INFO? Disconnect the call with some cause code? And all that (and some more) in C. Any help or pointers is appreciated. Thanks, Remko ___ 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
Re: [Freeswitch-users] select batchfile after call
Hi, the script looks good. But I never use scripts directly in FS. Can you help, where and how I have to do what?!?!? My way with a linux script works. But only one option doesn´t work. If I have a call to a outside phone throuth a sip-gateway and I hang up (not the party who is called hang up) the channel is closed without any reaction. If the called party hang up, the script works. How can I call the script on NORMAL_CLEARING, session ended or CS_DESTROY? Thanks Diego Viola wrote: I have a script that will do just that, and it's pretty simple, it's written in ruby :). http://fisheye.freeswitch.org/browse/FreeSWITCH/contrib/diegoviola/ruby/callcard/cdr.rb Best regards, Diego On Tue, Sep 8, 2009 at 12:18 AM, Michael S Collins m...@freeswitch.orgwrote: I get the feeling that you are trying to use the wrong tool for the job. If you need to launch a script after the call ends AND you need access to the CSV file then you either should switch to XML CDR or just write a Perl script that runs as a daemon that sits and waits for CSV files to appear and process them accordingly. Don't use api_hang_hook when you need to post process calls and work with CDR data. -MC Sent from my iPhone On Sep 7, 2009, at 4:47 AM, NOx-WHV enno.egb...@googlemail.com wrote: I just see, that i have a second problem. If I have a call and this call is without any response on the called side, the FS doesn´t call the script. NOx-WHV wrote: Thanks for help! I works, but now i have a new problem. The script works with the csv file from /FS/log/cdr-csv/XXX.csv. The problem is that the action application first starts and then the FS write the entry in the csv file. Does anybody have a tipp, how to call the script after writing the csv file? Thanks NOx mercutioviz wrote: Sent from my iPhone On Sep 3, 2009, at 6:08 AM, NOx-WHV enno.egb...@googlemail.com wrote: Hi, does anybody have a tip how to start a batchfile after hanging up. After ext. 1000 calls 1001 and hang up, i need a request to call: /../../FS/batchfile 1000 if 1001 calls 1000 i need: /../../FS/batchfile 1001 and so on... Try something like this in your Dialplan: action application=set data=api_hangup_hook=system batchfile $ {sip_from_user}/ -MC Thanks for help -- View this message in context: http://www.nabble.com/select-batchfile-after-call-tp25275633p25275633.html 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 ___ 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://www.nabble.com/select-batchfile-after-call-tp25275633p25329259.html 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 ___ 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 -- View this message in context: http://www.nabble.com/select-batchfile-after-call-tp25275633p25343243.html 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
Re: [Freeswitch-users] mod_managed ILoadNotificationPlugin
It's to notify your plugin that it's being loaded, and allow your plugin to opt out of being loaded. From: freeswitch-users-boun...@lists.freeswitch.org [mailto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of Josh Rivers Sent: Monday, September 07, 2009 1:50 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] mod_managed ILoadNotificationPlugin What is the purpose if the ILoadNotificationPlugin? I thought it could be used to start off background code, but code run from that point seems to be terminated when the method returns. Does it only exist to check dependencies? ___ 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
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
Hi, Can you please elaborate on the crash you receive when you queue a thread during load? 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: 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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() { ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } }); return true; } } It doesn't look like this is a good place to start a long-running process? Thanks! Josh On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.commailto:raffaele.p.gu...@gmail.com wrote: 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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.commailto:j...@radianttiger.com wrote: 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? quote author=Phillip Jones Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk jl...@frontiernet.netmailto:jl...@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! ___ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.orgmailto: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.orgmailto: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
Re: [Freeswitch-users] Using mod_managed to create full FreeSWITCH modules
Are you looking to run when mod_managed shuts down? Or when your managed plugin reloads, or something else? (mod_managed is not unloadable, so I don't believe it gets any notification of shutting down.) As far as interop in general, it's usually possible. However, a lot of the FreeSWITCH code uses macros, and they aren't available via SWIG. So in those cases, you'll either need to manually reconstruct the macro, or write some interop code in C/C++ to do what you want, then expose that via SWIG (or, if you do it nicely, just P/Invoke it directly). Some of the native code generates some pretty ugly structures; you will probably need to become friends with the Marshal class and pass around a lot of IntPtrs to get things going. As far as I know, no one has built a non API/App with mod_managed. -Michael From: freeswitch-users-boun...@lists.freeswitch.org [mailto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of Josh Rivers Sent: Monday, September 07, 2009 11:41 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Using mod_managed to create full FreeSWITCH modules The wiki says: mod_managed exposes nearly the entire FreeSWITCH C API (courtesy of SWIG). This allows creation of not just API functions and call apps, but any type of module that FreeSWITCH supports (codecs, endpoints, etc.). The types are in the FreeSWITCH.Native namespace. FreeSWITCH.Native. The FreeSWITCH.Native.freeswitch type contains static members to access all the functions. Does anybody have a starting point they can share for a non-API/APP managed module. I'd like to build something that runs in the SWITCH_MODULE_SHUTDOWN_FUNCTION/SWITCH_MODULE_SHUTDOWN_FUNCTION/SWITCH_MODULE_SHUTDOWN_FUNCTION lifecycle. How can this be done? Thanks! Josh ___ 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] Mod xml cdr
hi, reading the wiki tells me i need that module to make cdr happen. please correct me if i outline wrong steps here: - enable module - make install - create file called xml_cdr.conf.xml - based on the parameters make a http post does anyone have a xml file + a php file to make the appropriate mysql-isnerts? thx ___ 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
Re: [Freeswitch-users] Usefull option for mod_cdr_csv
Its there now. Cheers, Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mr...@avgs.ca On 8-Sep-09, at 5:20 AM, Anatoliy Kounitskiy wrote: There is another useful option for the module Mod_cdr_csv, that is not described in the default configuration file: param name=master-file-only value=true/ If you use the default configuration file and you're using the variable accountcode, probably you've seen for every accountcode you have separate cdr file for it. But if you need only one file with all cdr - use the option above. Possible values are true or false. Cheers, -- Anatoliy Kounitskiy - E-mail: anato...@kounitskiy.com Mobile: +359898913540 ___ 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
Re: [Freeswitch-users] 482 Request merged, in serial forking
Looks like FS is behind nat. You need to set local-network-acl and the ext-rtp-ip and ext-sip-ip so FreeSWITCH properly puts in the right IP's in the via headers and sdp. Please refer to internal.xml in the latest SVN for an example of how to do this. /b On Sep 8, 2009, at 9:00 AM, Humberto Quintana wrote: Hi Brian, Yes , the Call-Id is the same for the 2nd and 3rd transaction but the branch parameter in the Via header is different. Please check the capture below. Thanks, Humberto ___ 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] mod_cdr_csv and mysql
Hello, I saw an sql option in mod_cdr_csv. For my surprise it wrote sql code in Master.csv file instead of recording to mysql database (already setup as ODBC) Is that normal or I'm missing something? I read on the wiki that there is additional perl script to load csv to mysql. Should I do it in that way? Thanks, ___ 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
Re: [Freeswitch-users] 482 Request merged, in serial forking
Hi Brian, Thank you very much for your answer but both, Freeswitch and Kamailio have public IPs, it's my NAT'd IP phone who has private IP but this is fixed by Kamailio. The problem is not the 1st call is failing ( the test is set that way), the problem is FS answers back 482 when Kamailio tries a 2nd route ( or 3rd ) for the same call... Freeswitch is configured to use the Requested-URI sent by Kamailio: action application=bridge data=sofia/external/${sip_req_uri}/ I noticed that there is no Log message in Freeswitch when receiving the INVITE for the 2nd route. The process in FS seems to be destroyed (11:46:21.396593) before the 2nd INVITE is received (11:46:21.401419 ). U 2009/09/08 11:46:21.395702 freeswitch:5060 - kamailio:5060 SIP/2.0 503 Service Unavailable. Call-ID: ba748cd27cd16...@192.168.2.13 U 2009/09/08 11:46:21.395897 kamailio:5060 - freeswitch:5060 ACK sip:514...@gw1:5060 SIP/2.0. Call-ID: ba748cd27cd16...@192.168.2.13 U 2009/09/08 11:46:21.401419 kamailio:5060 - freeswitch:5060 INVITE sip:1514...@gw2:5061 SIP/2.0. Call-ID: ba748cd27cd16...@192.168.2.13 U 2009/09/08 11:46:21.401845 freeswitch:5060 - kamailio:5060 SIP/2.0 482 Request merged. Call-ID: ba748cd27cd16...@192.168.2.13 2009-09-08 11:46:21.395503 [DEBUG] mod_sofia.c:417 Responding to INVITE with: 503 2009-09-08 11:46:21.395503 [DEBUG] switch_core_state_machine.c:46 sofia/external/10092...@freeswitch Standard HANGUP, cause: NORMAL_TEMPORARY_FAILURE 2009-09-08 11:46:21.396593 [DEBUG] switch_core_state_machine.c:434 (sofia/external/10092...@freeswitch) State HANGUP going to sleep 2009-09-08 11:46:21.396593 [DEBUG] switch_core_state_machine.c:476 (sofia/external/10092...@freeswitch) State Change CS_HANGUP - CS_REPORTING 2009-09-08 11:46:21.396593 [DEBUG] switch_core_session.c:932 Send signal sofia/external/10092...@freeswitch [BREAK] 2009-09-08 11:46:21.396593 [DEBUG] switch_core_state_machine.c:398 (sofia/external/10092...@freeswitch) Running State Change CS_REPORTING 2009-09-08 11:46:21.396593 [DEBUG] switch_core_state_machine.c:612 (sofia/external/10092...@freeswitch) State REPORTING 2009-09-08 11:46:21.396593 [DEBUG] switch_core_state_machine.c:53 sofia/external/10092...@freeswitch Standard REPORTING, cause: NORMAL_TEMPORARY_FAILURE 2009-09-08 11:46:21.396593 [DEBUG] switch_core_state_machine.c:612 (sofia/external/10092...@freeswitch) State REPORTING going to sleep 2009-09-08 11:46:21.396593 [DEBUG] switch_core_state_machine.c:411 (sofia/external/10092...@freeswitch) State Change CS_REPORTING - CS_DESTROY 2009-09-08 11:46:21.396593 [DEBUG] switch_core_session.c:1068 Session 3 (sofia/external/10092...@freeswitch) Locked, Waiting on external entities 2009-09-08 11:46:21.396593 [NOTICE] switch_core_session.c:1086 Session 3 (sofia/external/10092...@freeswitch) Ended 2009-09-08 11:46:21.396593 [NOTICE] switch_core_session.c:1088 Close Channel sofia/external/10092...@freeswitch [CS_DESTROY] 2009-09-08 11:46:21.396593 [DEBUG] switch_core_state_machine.c:564 (sofia/external/10092...@freeswitch) State DESTROY 2009-09-08 11:46:21.396593 [DEBUG] mod_sofia.c:255 sofia/external/10092...@freeswitch SOFIA DESTROY 2009-09-08 11:46:21.396593 [DEBUG] switch_core_state_machine.c:60 sofia/external/10092...@freeswitch Standard DESTROY 2009-09-08 11:46:21.396593 [DEBUG] switch_core_state_machine.c:564 (sofia/external/10092...@freeswitch) State DESTROY going to sleep Note: I'm using only the external sofia profile. Thanks, Humberto == Looks like FS is behind nat. You need to set local-network-acl and the ext-rtp-ip and ext-sip-ip so FreeSWITCH properly puts in the right IP's in the via headers and sdp. Please refer to internal.xml in the latest SVN for an example of how to do this. /b _ New! Open Messenger faster on the MSN homepage http://go.microsoft.com/?linkid=9677405___ 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
Re: [Freeswitch-users] Custom Variables
true should suffice. On Tue, Sep 8, 2009 at 11:27 AM, Tina Martinez t...@a2unlimited.com wrote: Yes, it is a conference event. In looking at the mod_conference wiki, I see verbose-events mentioned, but the example value is ???. What is an appropriate setting for this param? (i.e., is it numeric, boolean, latin?) -T ___ 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 -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_miness...@hotmail.com msn%3aanthony_miness...@hotmail.com GTALK/JABBER/PAYPAL:anthony.miness...@gmail.compaypal%3aanthony.miness...@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:8...@conference.freeswitch.org sip%3a...@conference.freeswitch.org iax:gu...@conference.freeswitch.org/888 googletalk:conf+...@conference.freeswitch.orggoogletalk%3aconf%2b...@conference.freeswitch.org pstn:213-799-1400 ___ 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
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). Regards, Raffaele public class TestLoop : ILoadNotificationPlugin { Delegate void DoStuffDelegate(); public void doStuff() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } public bool Load() { DoStuffDelegate dsdlg = new DoStuffDelegate(doStuff); dsdlg.BeginInvoke(); } } On Tue, Sep 8, 2009 at 08:21, Josh Rivers j...@radianttiger.com 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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() { ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } }); return true; } } It doesn't look like this is a good place to start a long-running process? Thanks! Josh On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: 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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.comwrote: 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? quote author=Phillip Jones Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk jl...@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! ___ 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 ___ 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
[Freeswitch-users] Custom Variables
Yes, it is a conference event. In looking at the mod_conference wiki, I see verbose-events mentioned, but the example value is ???. What is an appropriate setting for this param? (i.e., is it numeric, boolean, latin?) -T ___ 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
Re: [Freeswitch-users] ESL: DTMF event is not coming
I'm pretty new at this, but please let me ask you a question: Is your FreeSwitch running on a dual-homed host? On Mon, Sep 7, 2009 at 2:47 AM, Nagalenoj nagale...@gmail.com wrote: Dear friends, I am using freeswitch-1.0.4. When I execute the sample script(/libs/esl/perl/server2.pl), it is not receiving the DTMF events. When I execute the same program in freeswitch-1.0.3, it's receiving the event. Do I miss something to configure/upgrade.? ___ 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
Re: [Freeswitch-users] Minimum/Recommended Freeswitch SystemConfiguration
Mitul, Thank you for your reply. Freeswitch is new to me, so I am not yet able to take measurements of FS under a load of traffic. I was just asking for future planning purposes. After I do some more development with it perhaps I can record some of these measurements. Thanks and Regards, Jerry -Original Message- From: Mitul Limbani [mailto:mi...@enterux.com] Sent: Friday, September 04, 2009 2:21 PM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] Minimum/Recommended Freeswitch SystemConfiguration Jerry, As far as I understand freeswitch, it using kernel to thread and this operation eats good amount of RAM, but since the internal strructure of fs is to store all these sip details in runtime sqlite db, which is compressed text data earlier written in XML but while fs loads this configs it gets it in sqlite and that's what it used instead of asterisks astdb. Although what you see as recommended config for 500 users is true but it also depends on which processor you are trying this on. Intel or AMD is still ok but if you trying it on arm I don't have any data as such, interestingly if you have some test hardware scenario you can actually test and let us all know about it, it's quite useful bit of info that can be positioned on the FS Wiki, in case you want to take this experiment offlist do write to me, im interested to document :) Look forward to hear from you, Thanks Regards, Mitul Limbani, Founder CEO, Enterux Solutions Pvt. Ltd., The Enterprise Linux Company (r), http://www.enterux.com http://www.entVoice.com On 05-Sep-2009, at 12:03 AM, Jerry Richards jerry.richa...@teotech.com wrote: Under the Minimum/Recommended System Requirements, what is meant by We recommend you plan for 50% duty cycle? What is this duty cycle? Also, I see that the system requirements indicate Freeswitch recommends 1GB RAM and 50MB disk space. I guess I'm wondering how the number of extensions and external interfaces drive size of RAM and disk space? For example, would these recommendations support 100 extensions and one external interface? 500 extensions and 10 external interfaces? Etc.? Best Regards, Jerry ___ 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
[Freeswitch-users] 482 Request merged, in serial forking
Hi Brian, Yes , the Call-Id is the same for the 2nd and 3rd transaction but the branch parameter in the Via header is different. Please check the capture below. Thanks, Humberto -- Route 1 U 2009/09/08 09:17:38.759129 kamailio:5060 - freeswitch:5060 INVITE sip:514...@gw1:5060 SIP/2.0. Record-Route: sip:kamailio;lr=on;ftag=8c90b1379825fa62;nat=yes;vsf=QllAAwMAAglyAgIIbgoHFhwIGRwDAC4yMTA6NDUwNjA-;did=0b8.111bca94. Via: SIP/2.0/UDP kamailio;branch=z9hG4bKede5.5c558357.0. Via: SIP/2.0/UDP 192.168.2.13:52060;rport=52060;received=UserIP;branch=z9hG4bK4d46edc4e1623ae5. From: hq160 10092...@kamailio;tag=8c90b1379825fa62. To: sip:1514...@kamailio. Contact: sip:10092...@userip:52060. Supported: replaces, timer, path. Call-ID: 04d14ab631843...@192.168.2.13. CSeq: 31348 INVITE. Max-Forwards: 68. Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK. Content-Type: application/sdp. Content-Length: 396. . v=0. o=10092020 8000 8001 IN IP4 192.168.2.13. s=SIP Call. c=IN IP4 MediaServer. t=0 0. m=audio 50362 RTP/AVP 0 101. a=sendrecv. a=rtpmap:0 PCMU/8000. a=ptime:20. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-11. m=video 50366 RTP/AVP 99. a=sendrecv. a=rtpmap:99 H264/9. a=fmtp:99 profile-level-id=42801E; packetization-mode=0; sprop-parameter-sets=J0KAFJWgUH5A,KM4CfIC=. a=framerate:15. U 2009/09/08 09:17:38.861646 freeswitch:5060 - kamailio:5060 SIP/2.0 100 Trying. Via: SIP/2.0/UDP kamailio;branch=z9hG4bKede5.5c558357.0. Via: SIP/2.0/UDP 192.168.2.13:52060;rport=52060;received=UserIP;branch=z9hG4bK4d46edc4e1623ae5. Record-Route: sip:kamailio;lr=on;ftag=8c90b1379825fa62;nat=yes;vsf=QllAAwMAAglyAgIIbgoHFhwIGRwDAC4yMTA6NDUwNjA-;did=0b8.111bca94. From: hq160 10092...@kamailio;tag=8c90b1379825fa62. To: sip:1514...@kamailio. Call-ID: 04d14ab631843...@192.168.2.13. CSeq: 31348 INVITE. UserIP-Agent: FreeSWITCH-mod_sofia/1.0.4-exported. Content-Length: 0. . U 2009/09/08 09:17:39.000958 freeswitch:5060 - gw1:5060 INVITE sip:514...@gw1:5060 SIP/2.0. Via: SIP/2.0/UDP freeswitch;rport;branch=z9hG4bK151FSXQmjX4KH. Max-Forwards: 67. From: hq160 sip:10092...@freeswitch;tag=3mrtKm2rma0De. To: sip:514...@gw1:5060. Call-ID: d2bda062-171c-122d-c787-005056aa5fb7. CSeq: 120089593 INVITE. Contact: sip:mod_so...@kamailio. UserIP-Agent: FreeSWITCH-mod_sofia/1.0.4-exported. Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO. Supported: timer, precondition, path, replaces. Allow-Events: talk, refer. Content-Type: application/sdp. Content-Disposition: session. Content-Length: 372. X-rsbc: 04d14ab631843...@192.168.2.13. Remote-Party-ID: hq160 sip:10092...@freeswitch;party=calling;screen=yes;privacy=off. . v=0. o=10092020 8000 8001 IN IP4 192.168.2.13. s=SIP Call. c=IN IP4 MediaServer. t=0 0. m=audio 50362 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-11. a=ptime:20. m=video 50366 RTP/AVP 99. a=rtpmap:99 H264/9. a=fmtp:99 profile-level-id=42801E; packetization-mode=0; sprop-parameter-sets=J0KAFJWgUH5A,KM4CfIC=. a=framerate:15. U 2009/09/08 09:17:39.056082 gw1:5060 - freeswitch:5060 SIP/2.0 100 Trying. Call-ID: d2bda062-171c-122d-c787-005056aa5fb7. Content-Length: 0. CSeq: 120089593 INVITE. From: hq160sip:10092...@freeswitch;tag=3mrtKm2rma0De. To: sip:514...@gw1:5060;tag=d05714dc-26334. UserIP-Agent: Quintum/1.0.0 SN/0030E100A224 SW/P106-12-00. Via: SIP/2.0/UDP freeswitch;rport;branch=z9hG4bK151FSXQmjX4KH. Quintum: 0b0634303234. . U 2009/09/08 09:17:39.058998 gw1:5060 - freeswitch:5060 SIP/2.0 503 Service Unavailable. Call-ID: d2bda062-171c-122d-c787-005056aa5fb7. Content-Length: 0. CSeq: 120089593 INVITE. From: hq160sip:10092...@freeswitch;tag=3mrtKm2rma0De. To: sip:514...@gw1:5060;tag=d05714dc-26334. UserIP-Agent: Quintum/1.0.0 SN/0030E100A224 SW/P106-12-00. Via: SIP/2.0/UDP freeswitch;rport;branch=z9hG4bK151FSXQmjX4KH. . U 2009/09/08 09:17:39.059341 freeswitch:5060 - gw1:5060 ACK sip:514...@gw1:5060 SIP/2.0. Via: SIP/2.0/UDP freeswitch;rport;branch=z9hG4bK151FSXQmjX4KH. Max-Forwards: 67. From: hq160 sip:10092...@freeswitch;tag=3mrtKm2rma0De. To: sip:514...@gw1:5060;tag=d05714dc-26334. Call-ID: d2bda062-171c-122d-c787-005056aa5fb7. CSeq: 120089593 ACK. Content-Length: 0. . U 2009/09/08 09:17:39.061148 freeswitch:5060 - kamailio:5060 SIP/2.0 503 Service Unavailable. Via: SIP/2.0/UDP kamailio;branch=z9hG4bKede5.5c558357.0. Via: SIP/2.0/UDP 192.168.2.13:52060;rport=52060;received=UserIP;branch=z9hG4bK4d46edc4e1623ae5. From: hq160 10092...@kamailio;tag=8c90b1379825fa62. To: sip:1514...@kamailio;tag=2BZ1HSHNQ19tj. Call-ID: 04d14ab631843...@192.168.2.13. CSeq: 31348 INVITE. UserIP-Agent: FreeSWITCH-mod_sofia/1.0.4-exported. Accept: application/sdp. Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO. Supported: timer, precondition, path, replaces. Allow-Events: talk, refer. Reason:
Re: [Freeswitch-users] patch for debian init script
Please post this patch to http://jira.freeswitch.org in the build system project and I will get this merged in Mike On Sep 8, 2009, at 10:28 AM, Christian Löschenkohl wrote: hi just a quick patch for the debian init script debian/freeswitch.init i do use the reload function and the script complains about the -C option it also would be perfect if the reload option is enabled by default (usefull for logrotating) - combined in second patch br * --- debian/freeswitch.init-old 2009-09-08 16:18:49.0 +0200 +++ debian/freeswitch.init 2009-09-08 16:19:13.0 +0200 @@ -103,7 +103,7 @@ # restarting (for example, when it is sent a SIGHUP), # then implement that here. # - start-stop-daemon -C $USER --stop --signal 1 --quiet -- pidfile $PIDFILE --name $NAME + start-stop-daemon -c $USER --stop --signal 1 --quiet -- pidfile $PIDFILE --name $NAME return 0 } * --- debian/freeswitch.init-old 2009-09-08 16:26:01.0 +0200 +++ debian/freeswitch.init 2009-09-08 16:19:13.0 +0200 @@ -103,7 +103,7 @@ # restarting (for example, when it is sent a SIGHUP), # then implement that here. # - start-stop-daemon -C $USER --stop --signal 1 --quiet -- pidfile $PIDFILE --name $NAME + start-stop-daemon -c $USER --stop --signal 1 --quiet -- pidfile $PIDFILE --name $NAME return 0 } @@ -124,15 +124,15 @@ 2) [ $VERBOSE != no ] log_end_msg 1 ;; esac ;; - reload|force-reload) + #reload|force-reload) # # If do_reload() is not implemented then leave this commented out # and leave 'force-reload' as an alias for 'restart'. # - log_daemon_msg Reloading $DESC $NAME - do_reload - log_end_msg $? - ;; + #log_daemon_msg Reloading $DESC $NAME + #do_reload + #log_end_msg $? + #;; restart|force-reload) # # If the reload option is implemented then remove the @@ -156,8 +156,8 @@ esac ;; *) - echo Usage: $SCRIPTNAME {start|stop|restart|reload|force- reload} 2 - #echo Usage: $SCRIPTNAME {start|stop|restart|force-reload} 2 + #echo Usage: $SCRIPTNAME {start|stop|restart|reload|force- reload} 2 + echo Usage: $SCRIPTNAME {start|stop|restart|force-reload} 2 exit 3 ;; esac -- Ing. Christian Löschenkohl Technische Leitung, Forschung Entwicklung VoIP xpirio Telekommunikation Service GmbH Lakeside B04 9020 Klagenfurt Austria T +43 (0) 5 77 11 - 1000 F +43 (0) 5 77 11 - 1002 E christian.loeschenk...@xpirio.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
Re: [Freeswitch-users] Custom Variables
does that happen to be the conference event you are talking about? there is a separate verbose-events param in the conference profile to do that. On Tue, Sep 8, 2009 at 8:58 AM, Tina Martinez t...@a2unlimited.com wrote: Hello, I have created custom variables that I pass to my FreeSWITCH dialplan. In my code I am monitoring the events and using the variables (now using ESL, very nice). The custom variables appear in events such as CHANNEL_ORIGINATE, but I do not see the variable in the CUSTOM event. For example, in CHANNEL_ORIGINATE, I see the custom variables as: variable_sip_h_X-custom_variable1 : ABC variable_sip_h_X-custom_variable2 : XYZ Is there a way for me to see the variables in the CUSTOM event as well? In my dialplan, I do have action application=verbose_events data=true. But it does not seem to help. Any thoughts? - T ___ 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 -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_miness...@hotmail.com msn%3aanthony_miness...@hotmail.com GTALK/JABBER/PAYPAL:anthony.miness...@gmail.compaypal%3aanthony.miness...@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:8...@conference.freeswitch.org sip%3a...@conference.freeswitch.org iax:gu...@conference.freeswitch.org/888 googletalk:conf+...@conference.freeswitch.orggoogletalk%3aconf%2b...@conference.freeswitch.org pstn:213-799-1400 ___ 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
Re: [Freeswitch-users] Conference DTMFs heard by participants
you must have some tdm equipment somewhere that is decoding the dtmf tones and passing them w/o removing them from the audio stream. On Tue, Sep 8, 2009 at 12:26 PM, Bradley Brashier bjbrash...@gmail.comwrote: I have a FreeSWITCH conference with a list of DTMFs, some of which are handled through the event socket (like mute-all), some of which are handled by FreeSWITCH itself (like mute-self). There are a number of commands available and all of them are 2 digits in length. The issue is that when a command is pressed on one phone in the conference, all users hear the tones of the first key pressed. My expectation is that no other users should hear any of the keys, at least not unless they do not correspond to any command. This happens regardless of whether it's a command processed by the event app or if it's processed by FS. I have tried using single-digit commands and the same thing happens -- that single digit is heard by all conference members. Questions: 1) Is this expected behavior (ie. is there some reason you would want this)? 2) Is this something that I can change with some parameter somewhere? BB ___ 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 -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_miness...@hotmail.com msn%3aanthony_miness...@hotmail.com GTALK/JABBER/PAYPAL:anthony.miness...@gmail.compaypal%3aanthony.miness...@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:8...@conference.freeswitch.org sip%3a...@conference.freeswitch.org iax:gu...@conference.freeswitch.org/888 googletalk:conf+...@conference.freeswitch.orggoogletalk%3aconf%2b...@conference.freeswitch.org pstn:213-799-1400 ___ 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
Re: [Freeswitch-users] Conference DTMFs heard by participants
Good thought. I'll look into that. BB On Tue, Sep 8, 2009 at 11:48 AM, Anthony Minessaleanthony.miness...@gmail.com wrote: you must have some tdm equipment somewhere that is decoding the dtmf tones and passing them w/o removing them from the audio stream. On Tue, Sep 8, 2009 at 12:26 PM, Bradley Brashier bjbrash...@gmail.com wrote: I have a FreeSWITCH conference with a list of DTMFs, some of which are handled through the event socket (like mute-all), some of which are handled by FreeSWITCH itself (like mute-self). There are a number of commands available and all of them are 2 digits in length. The issue is that when a command is pressed on one phone in the conference, all users hear the tones of the first key pressed. My expectation is that no other users should hear any of the keys, at least not unless they do not correspond to any command. This happens regardless of whether it's a command processed by the event app or if it's processed by FS. I have tried using single-digit commands and the same thing happens -- that single digit is heard by all conference members. Questions: 1) Is this expected behavior (ie. is there some reason you would want this)? 2) Is this something that I can change with some parameter somewhere? BB ___ 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 -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_miness...@hotmail.com GTALK/JABBER/PAYPAL:anthony.miness...@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:8...@conference.freeswitch.org iax:gu...@conference.freeswitch.org/888 googletalk:conf+...@conference.freeswitch.org pstn:213-799-1400 ___ 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
Re: [Freeswitch-users] Conference DTMFs heard by participants
Its your gateway provider not squelching the DTMF I suspect. /b On Sep 8, 2009, at 12:26 PM, Bradley Brashier wrote: The issue is that when a command is pressed on one phone in the conference, all users hear the tones of the first key pressed. My expectation is that no other users should hear any of the keys, at least not unless they do not correspond to any command. This happens regardless of whether it's a command processed by the event app or if it's processed by FS. I have tried using single-digit commands and the same thing happens -- that single digit is heard by all conference members. ___ 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] Conference DTMFs heard by participants
I have a FreeSWITCH conference with a list of DTMFs, some of which are handled through the event socket (like mute-all), some of which are handled by FreeSWITCH itself (like mute-self). There are a number of commands available and all of them are 2 digits in length. The issue is that when a command is pressed on one phone in the conference, all users hear the tones of the first key pressed. My expectation is that no other users should hear any of the keys, at least not unless they do not correspond to any command. This happens regardless of whether it's a command processed by the event app or if it's processed by FS. I have tried using single-digit commands and the same thing happens -- that single digit is heard by all conference members. Questions: 1) Is this expected behavior (ie. is there some reason you would want this)? 2) Is this something that I can change with some parameter somewhere? BB ___ 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
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 is an example that, at least on my system (I reached my home pc in the meanwhile), works fine. public class LoadPluginDemo : ILoadNotificationPlugin { delegate void Listener(); private void EventListener() { EventConsumer con = new EventConsumer(all, null); while (true){ Event ev = con.pop(1); Log.WriteLine(LogLevel.Notice, Got event + ev.GetHeader(Event-Name)); } } public bool Load() { Log.WriteLine(LogLevel.Notice, LoadDemo running.); new Listener(EventListener).BeginInvoke(null,null); return true; } } On Tue, Sep 8, 2009 at 18:43, Michael Giagnocavo m...@giagnocavo.net 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 AM *To:* freeswitch-users@lists.freeswitch.org *Subject:* 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). Regards, Raffaele public class TestLoop : ILoadNotificationPlugin { Delegate void DoStuffDelegate(); public void doStuff() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } public bool Load() { DoStuffDelegate dsdlg = new DoStuffDelegate(doStuff); dsdlg.BeginInvoke(); } } On Tue, Sep 8, 2009 at 08:21, Josh Rivers j...@radianttiger.com 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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() { ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } }); return true; } } It doesn't look like this is a good place to start a long-running process? Thanks! Josh On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: 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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.com wrote: 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? quote author=Phillip Jones Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk jl...@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
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
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 pjinthe...@gmail.com wrote: What is: freeswitch.msleep(100); Why aren't you using Thread.Sleep? On Tue, Sep 8, 2009 at 2:21 AM, Josh Rivers j...@radianttiger.com 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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() { ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } }); return true; } } It doesn't look like this is a good place to start a long-running process? Thanks! Josh On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: 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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.com wrote: 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? quote author=Phillip Jones Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk jl...@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! ___ 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 ___ 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 ___ 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
Re: [Freeswitch-users] ESL: DTMF event is not coming
I'm currently playing around with ESL myself. By default events are not sent to the application. You should enable this by with for example the myevents command. For a better understanding, try catching the IO with nc -l -p 8084 for outbound socket applications. See http://wiki.freeswitch.org/wiki/Mod_event_socket for more info. Remko Van: freeswitch-users-boun...@lists.freeswitch.org [mailto:freeswitch-users-boun...@lists.freeswitch.org] Namens Michael Gende Verzonden: dinsdag 8 september 2009 5:28 Aan: freeswitch-users@lists.freeswitch.org Onderwerp: Re: [Freeswitch-users] ESL: DTMF event is not coming I'm pretty new at this, but please let me ask you a question: Is your FreeSwitch running on a dual-homed host? On Mon, Sep 7, 2009 at 2:47 AM, Nagalenoj nagale...@gmail.com wrote: Dear friends, I am using freeswitch-1.0.4. When I execute the sample script(/libs/esl/perl/server2.pl), it is not receiving the DTMF events. When I execute the same program in freeswitch-1.0.3, it's receiving the event. Do I miss something to configure/upgrade.? ___ 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
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
ThreadPool.QueueUserWorkItem((o) = That starts a lambda, which is compiled to a delegate, same as anonymous methods. Guess I'll wait for him to respond on the crash he gets. 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 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 is an example that, at least on my system (I reached my home pc in the meanwhile), works fine. public class LoadPluginDemo : ILoadNotificationPlugin { delegate void Listener(); private void EventListener() { EventConsumer con = new EventConsumer(all, null); while (true){ Event ev = con.pop(1); Log.WriteLine(LogLevel.Notice, Got event + ev.GetHeader(Event-Name)); } } public bool Load() { Log.WriteLine(LogLevel.Notice, LoadDemo running.); new Listener(EventListener).BeginInvoke(null,null); return true; } } On Tue, Sep 8, 2009 at 18:43, Michael Giagnocavo m...@giagnocavo.netmailto:m...@giagnocavo.net wrote: That's what his sample does, but he says it crashes. From: freeswitch-users-boun...@lists.freeswitch.orgmailto:freeswitch-users-boun...@lists.freeswitch.org [mailto:freeswitch-users-boun...@lists.freeswitch.orgmailto: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.orgmailto:freeswitch-users@lists.freeswitch.org Subject: 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). Regards, Raffaele public class TestLoop : ILoadNotificationPlugin { Delegate void DoStuffDelegate(); public void doStuff() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } public bool Load() { DoStuffDelegate dsdlg = new DoStuffDelegate(doStuff); dsdlg.BeginInvoke(); } } On Tue, Sep 8, 2009 at 08:21, Josh Rivers j...@radianttiger.commailto:j...@radianttiger.com 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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() { ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } }); return true; } } It doesn't look like this is a good place to start a long-running process? Thanks! Josh On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.commailto:raffaele.p.gu...@gmail.com wrote: 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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.commailto:j...@radianttiger.com wrote: 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? quote author=Phillip Jones Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM,
Re: [Freeswitch-users] Call Forwarding Question
I`ve already tried the legs variable in cdr_csv.conf.xml, I have also tried to use the loopback endpoint and to bridge the call to the internal interface(so it can go out and in again generating the 2cdr-s I need) and still haven`t achieved any success. Can anyone please share some experience in doing CallForwarding in FreeSwitch. I beleive I`m not the only guy tryiig to achieve this, what`s the Best Practices for this task? Regards, NG On Mon, Sep 7, 2009 at 2:54 AM, Nandy Dagondon nandy1...@gmail.com wrote: nik, please try the legs variable http://www.nabble.com/CDR-accounting-question-td19212516.html /nandy On Sun, Sep 6, 2009 at 6:40 PM, Nikolai Geordzhev n.geordz...@gmail.comwrote: Hi, I`m trying to implement Call Forwarding in my FS setup. I set a user variable managing the type of forwarding (busy,no answer,unconditional) and the destination the phone is forwarded to: user id='102' variables variable name='fwd_type' value='unconditional'/ variable name='fwd_unconditional_number' value='103/ /variables /user Then in my dialplan I check if the called user has ${fwd_type} set and if so I set the destination_number to ${fwd_unconditional_number}. After this operation I bridge the call to the new destination_number. The issue in this scenario is that I get a cdr in which A (101) calls C(103) and I need to have two cdrs, one from A(101) to B(102) and one from B(102) to C(103). Does anyone know how can this be implemented. 10x, NG ___ 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 ___ 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
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
Oh, I see... all those years wasted doing java stuff! :D On Tue, Sep 8, 2009 at 22:46, Michael Giagnocavo m...@giagnocavo.net wrote: “ ThreadPool.QueueUserWorkItem((o) =” That starts a lambda, which is compiled to a delegate, same as anonymous methods. Guess I’ll wait for him to respond on the crash he gets. *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 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 is an example that, at least on my system (I reached my home pc in the meanwhile), works fine. public class LoadPluginDemo : ILoadNotificationPlugin { delegate void Listener(); private void EventListener() { EventConsumer con = new EventConsumer(all, null); while (true){ Event ev = con.pop(1); Log.WriteLine(LogLevel.Notice, Got event + ev.GetHeader(Event-Name)); } } public bool Load() { Log.WriteLine(LogLevel.Notice, LoadDemo running.); new Listener(EventListener).BeginInvoke(null,null); return true; } } On Tue, Sep 8, 2009 at 18:43, Michael Giagnocavo m...@giagnocavo.net 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 AM *To:* freeswitch-users@lists.freeswitch.org *Subject:* 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). Regards, Raffaele public class TestLoop : ILoadNotificationPlugin { Delegate void DoStuffDelegate(); public void doStuff() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } public bool Load() { DoStuffDelegate dsdlg = new DoStuffDelegate(doStuff); dsdlg.BeginInvoke(); } } On Tue, Sep 8, 2009 at 08:21, Josh Rivers j...@radianttiger.com 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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() { ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } }); return true; } } It doesn't look like this is a good place to start a long-running process? Thanks! Josh On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: 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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.com wrote: 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? quote author=Phillip Jones Exactly what I was after - thank you!
[Freeswitch-users] Custom Variables
Using the verbose-events definitely improved my ability to see the custom variables, but now I noticed that the Member-ID variable does not appear in the DTMF event. Would this be related, or did I screw something else up? - T ___ 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
Re: [Freeswitch-users] patch for debian init script
is done br On 2009-09-08 18:26, Michael Jerris wrote: Please post this patch to http://jira.freeswitch.org in the build system project and I will get this merged in Mike On Sep 8, 2009, at 10:28 AM, Christian Löschenkohl wrote: hi just a quick patch for the debian init script debian/freeswitch.init i do use the reload function and the script complains about the -C option it also would be perfect if the reload option is enabled by default (usefull for logrotating) - combined in second patch br * --- debian/freeswitch.init-old 2009-09-08 16:18:49.0 +0200 +++ debian/freeswitch.init 2009-09-08 16:19:13.0 +0200 @@ -103,7 +103,7 @@ # restarting (for example, when it is sent a SIGHUP), # then implement that here. # - start-stop-daemon -C $USER --stop --signal 1 --quiet -- pidfile $PIDFILE --name $NAME + start-stop-daemon -c $USER --stop --signal 1 --quiet -- pidfile $PIDFILE --name $NAME return 0 } * --- debian/freeswitch.init-old 2009-09-08 16:26:01.0 +0200 +++ debian/freeswitch.init 2009-09-08 16:19:13.0 +0200 @@ -103,7 +103,7 @@ # restarting (for example, when it is sent a SIGHUP), # then implement that here. # - start-stop-daemon -C $USER --stop --signal 1 --quiet -- pidfile $PIDFILE --name $NAME + start-stop-daemon -c $USER --stop --signal 1 --quiet -- pidfile $PIDFILE --name $NAME return 0 } @@ -124,15 +124,15 @@ 2) [ $VERBOSE != no ] log_end_msg 1 ;; esac ;; - reload|force-reload) + #reload|force-reload) # # If do_reload() is not implemented then leave this commented out # and leave 'force-reload' as an alias for 'restart'. # - log_daemon_msg Reloading $DESC $NAME - do_reload - log_end_msg $? - ;; + #log_daemon_msg Reloading $DESC $NAME + #do_reload + #log_end_msg $? + #;; restart|force-reload) # # If the reload option is implemented then remove the @@ -156,8 +156,8 @@ esac ;; *) - echo Usage: $SCRIPTNAME {start|stop|restart|reload|force- reload}2 - #echo Usage: $SCRIPTNAME {start|stop|restart|force-reload} 2 + #echo Usage: $SCRIPTNAME {start|stop|restart|reload|force- reload}2 + echo Usage: $SCRIPTNAME {start|stop|restart|force-reload} 2 exit 3 ;; esac -- Ing. Christian Löschenkohl Technische Leitung, Forschung Entwicklung VoIP xpirio Telekommunikation Service GmbH Lakeside B04 9020 Klagenfurt Austria T +43 (0) 5 77 11 - 1000 F +43 (0) 5 77 11 - 1002 E christian.loeschenk...@xpirio.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 -- Ing. Christian Löschenkohl Technische Leitung, Forschung Entwicklung VoIP xpirio Telekommunikation Service GmbH Lakeside B04 9020 Klagenfurt Austria T +43 (0) 5 77 11 - 1000 F +43 (0) 5 77 11 - 1002 E christian.loeschenk...@xpirio.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
Re: [Freeswitch-users] ESL: DTMF event is not coming
did you specify the async keyword to the socket app in your dialplan? On Mon, Sep 7, 2009 at 2:47 AM, Nagalenoj nagale...@gmail.com wrote: Dear friends, I am using freeswitch-1.0.4. When I execute the sample script(/libs/esl/perl/server2.pl), it is not receiving the DTMF events. When I execute the same program in freeswitch-1.0.3, it's receiving the event. Do I miss something to configure/upgrade.? -- View this message in context: http://www.nabble.com/ESL%3A-DTMF-event-is-not-coming-tp25326328p25326328.html 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 -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_miness...@hotmail.com msn%3aanthony_miness...@hotmail.com GTALK/JABBER/PAYPAL:anthony.miness...@gmail.compaypal%3aanthony.miness...@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:8...@conference.freeswitch.org sip%3a...@conference.freeswitch.org iax:gu...@conference.freeswitch.org/888 googletalk:conf+...@conference.freeswitch.orggoogletalk%3aconf%2b...@conference.freeswitch.org pstn:213-799-1400 ___ 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
Re: [Freeswitch-users] Recording Only 1 Leg of a Call
As a work around, record to stereo, and use sox to split channes ? On Sep 9, 2009, at 12:44 AM, Anthony Minessale wrote: that would have to be filed as a feature request as we do not currently have a way to do that. On Mon, Sep 7, 2009 at 11:50 PM, Matthew Fong mattdf...@gmail.com wrote: I want to record without the telephone user's interaction. I think uuid_record should have the option to only record the audio of the uuid channel that is being specified, and as a secondary option combine the audio of the b leg (since uuid_record only specifies one uuid anyway--this seems logical). Anyway, just my wish list :) --matt http://www.hellohunter.com voice broadcasting hosted dialer On Tue, Sep 8, 2009 at 2:12 AM, Milena testeado...@gmail.com wrote: Hello, What about this?: !-- bind_meta_app can have these args key [a|b|ab] [a|b|o|s] app -- action application='bind_meta_app' data='2 a s record_session::$$ {base_dir}/recordings/${strftime(%Y-%m-%d_%H-%M-%S)}.$ {caller_id_number}.wav'/ the person would have to press *2 during the call to start the recording. 2009/9/7 Matthew Fong mattdf...@gmail.com Whats the best way to record only one leg of a call? uuid_record records both channels session_record does the same (but has a stereo option) is there any way to record only an a-leg of the call? Thanks so much. --matt http://www.hellohunter.com hosted dialer voice broadcasting ___ 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 ___ 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 -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_miness...@hotmail.com GTALK/JABBER/PAYPAL:anthony.miness...@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:8...@conference.freeswitch.org iax:gu...@conference.freeswitch.org/888 googletalk:conf+...@conference.freeswitch.org pstn:213-799-1400 ___ 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
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
I'm not sure how EventConsumer is supposed to work - maybe one of the real devs can explain how pop works and if it should fail on 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 managed C# / .NET I build this out. This seems to work fine: ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(1); Log.WriteLine(LogLevel.Alert, Event: + ev.GetHeader(Event-Name)); //freeswitch.msleep(100); } }); With Event ev = con.pop(0) however FS crashes with a System.NullReferenceException (attached) On Tue, Sep 8, 2009 at 5:20 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.commailto:raffaele.p.gu...@gmail.com wrote: Oh, I see... all those years wasted doing java stuff! :D On Tue, Sep 8, 2009 at 22:46, Michael Giagnocavo m...@giagnocavo.netmailto:m...@giagnocavo.net wrote: ThreadPool.QueueUserWorkItem((o) = That starts a lambda, which is compiled to a delegate, same as anonymous methods. Guess I'll wait for him to respond on the crash he gets. From: freeswitch-users-boun...@lists.freeswitch.orgmailto:freeswitch-users-boun...@lists.freeswitch.org [mailto:freeswitch-users-boun...@lists.freeswitch.orgmailto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of Raffaele P. Guidi Sent: Tuesday, September 08, 2009 12:22 PM To: freeswitch-users@lists.freeswitch.orgmailto: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 is an example that, at least on my system (I reached my home pc in the meanwhile), works fine. public class LoadPluginDemo : ILoadNotificationPlugin { delegate void Listener(); private void EventListener() { EventConsumer con = new EventConsumer(all, null); while (true){ Event ev = con.pop(1); Log.WriteLine(LogLevel.Notice, Got event + ev.GetHeader(Event-Name)); } } public bool Load() { Log.WriteLine(LogLevel.Notice, LoadDemo running.); new Listener(EventListener).BeginInvoke(null,null); return true; } } On Tue, Sep 8, 2009 at 18:43, Michael Giagnocavo m...@giagnocavo.netmailto:m...@giagnocavo.net wrote: That's what his sample does, but he says it crashes. From: freeswitch-users-boun...@lists.freeswitch.orgmailto:freeswitch-users-boun...@lists.freeswitch.org [mailto:freeswitch-users-boun...@lists.freeswitch.orgmailto: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.orgmailto:freeswitch-users@lists.freeswitch.org Subject: 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). Regards, Raffaele public class TestLoop : ILoadNotificationPlugin { Delegate void DoStuffDelegate(); public void doStuff() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } public bool Load() { DoStuffDelegate dsdlg = new DoStuffDelegate(doStuff); dsdlg.BeginInvoke(); } } On Tue, Sep 8, 2009 at 08:21, Josh Rivers j...@radianttiger.commailto:j...@radianttiger.com 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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() {
Re: [Freeswitch-users] Mod_nibblebill for CDR billing
I love FS! it shows all the info I need. Thanks guys. On Sep 4, 2009, at 10:28 PM, Diego Viola wrote: If you do event plain all from the FS CLI you should see the variable exported on the CHANNEL_HANGUP_COMPLETE event, with the other CDR variables as well. These information should be available on mod_xml_cdr and mod_cdr_csv as well. Diego On Fri, Sep 4, 2009 at 11:28 PM, Rogelio Perez rogelio.pe...@gmail.com wrote: From the mod_nibblebill documentation: At the end of a call, the module sets a variable named nibble_total_billed. You can use mod_cdr to record this variable to your CDR log. Is it possible to do the same with mod_xml_cdr? I'm looking for a simple way of billing my CDRs and this one looks like a good solution. Has anyone tried doing anything similar? Thanks, Rogelio ___ 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 ___ 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
Re: [Freeswitch-users] ESL: DTMF event is not coming
Yes.!! I missed async keyword in dialplan in freeswitch-1.0.4. Thanks.. Anthony Minessale-2 wrote: did you specify the async keyword to the socket app in your dialplan? On Mon, Sep 7, 2009 at 2:47 AM, Nagalenoj nagale...@gmail.com wrote: Dear friends, I am using freeswitch-1.0.4. When I execute the sample script(/libs/esl/perl/server2.pl), it is not receiving the DTMF events. When I execute the same program in freeswitch-1.0.3, it's receiving the event. Do I miss something to configure/upgrade.? -- View this message in context: http://www.nabble.com/ESL%3A-DTMF-event-is-not-coming-tp25326328p25326328.html 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 -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_miness...@hotmail.com msn%3aanthony_miness...@hotmail.com GTALK/JABBER/PAYPAL:anthony.miness...@gmail.compaypal%3aanthony.miness...@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:8...@conference.freeswitch.org sip%3a...@conference.freeswitch.org iax:gu...@conference.freeswitch.org/888 googletalk:conf+...@conference.freeswitch.orggoogletalk%3aconf%2b...@conference.freeswitch.org pstn:213-799-1400 ___ 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://www.nabble.com/ESL%3A-DTMF-event-is-not-coming-tp25326328p25358074.html 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
[Freeswitch-users] mod_opal segmentation fault error
Hi guys, My FS setup was working smoothly with mod_opal enabled until I had to rebuild everything from scratch. Now I have compiled everything following the same procedure (I even have a script for that) and mod_opal stopped working. The SVN commands are: svn co https://opalvoip.svn.sourceforge.net/svnroot/opalvoip/ptlib/ trunk ptlib svn co https://opalvoip.svn.sourceforge.net/svnroot/opalvoip/opal/branches/v3_6 opal ...and the compilation commands follow the documentation isntructions and there are no output errors. I start FS with mod_opal disabled and then when I run load mod_opalI get the error: Segmentation fault (core dumped). The log output shows nothing, and I see there are core.x files on the FS directory but I dont know how to read them. Any ideas? Thanks, Rogelio ___ 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] nibblebill zero balance
We've been testing mod_nibblebill, it's a great module, cheers to the author! A couple questions regarding nibblebill: 1) We noticed that when an account is below the minimum balance and a call is attempted with that account, FS begins to connect the B leg for the call but then cancels the INVITE. Why is FS sending the INVITE for the B leg only to CANCEL it immediately, if the account is below the minimum balance? I would think it would just send the 404 immediately back to the user without sending any INVITEs to establish the B leg? 2) Any progress on implementing minimum billing increments (ie 60/60) ? Cheers, Gabe ___ 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
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
Here is the error I get with the loop I mentioned. -Josh [image: Capture.PNG] On Tue, Sep 8, 2009 at 5:05 AM, Michael Giagnocavo m...@giagnocavo.netwrote: Hi, Can you please elaborate on the crash you receive when you queue a thread during load? 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:* 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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() { ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } }); return true; } } It doesn't look like this is a good place to start a long-running process? Thanks! Josh On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: 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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.com wrote: 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? quote author=Phillip Jones Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk jl...@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! ___ 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 ___ 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 Capture.PNG___ 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
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
Click Break, then go in Window, Debug, Stack Trace (or something similar, I don't have any VS nearby), then copy paste that. Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mr...@avgs.ca On 8-Sep-09, at 10:30 PM, Josh Rivers wrote: Here is the error I get with the loop I mentioned. -Josh Capture.PNG On Tue, Sep 8, 2009 at 5:05 AM, Michael Giagnocavo m...@giagnocavo.net wrote: Hi, Can you please elaborate on the crash you receive when you queue a thread during load? 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: 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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() { ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } }); return true; } } It doesn't look like this is a good place to start a long-running process? Thanks! Josh On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: 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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.com wrote: 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? quote author=Phillip Jones Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk jl...@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! ___ 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 ___ 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
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
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 pjinthe...@gmail.com wrote: What is: freeswitch.msleep(100); Why aren't you using Thread.Sleep? On Tue, Sep 8, 2009 at 2:21 AM, Josh Rivers j...@radianttiger.com 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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() { ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } }); return true; } } It doesn't look like this is a good place to start a long-running process? Thanks! Josh On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: 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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.com wrote: 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? quote author=Phillip Jones Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk jl...@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! ___ 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 ___ 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 ___ 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
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
I confirmed that pop(1) works for me. since it's spinning in it's own thread, that's probably the right solution. These are the relevant pieces of core code, though: APU_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data) { apr_status_t rv; if (queue-terminated) { return APR_EOF; /* no more elements ever again */ } rv = apr_thread_mutex_lock(queue-one_big_mutex); if (rv != APR_SUCCESS) { return rv; } if (apr_queue_empty(queue)) { rv = apr_thread_mutex_unlock(queue-one_big_mutex); return APR_EAGAIN; } *data = queue-data[queue-out]; queue-nelts--; queue-out = (queue-out + 1) % queue-bounds; if (queue-full_waiters) { Q_DBG(signal !full, queue); rv = apr_thread_cond_signal(queue-not_full); if (rv != APR_SUCCESS) { apr_thread_mutex_unlock(queue-one_big_mutex); return rv; } } rv = apr_thread_mutex_unlock(queue-one_big_mutex); return rv; } AND APU_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data) { apr_status_t rv; if (queue-terminated) { return APR_EOF; /* no more elements ever again */ } rv = apr_thread_mutex_lock(queue-one_big_mutex); if (rv != APR_SUCCESS) { return rv; } /* Keep waiting until we wake up and find that the queue is not empty. */ if (apr_queue_empty(queue)) { if (!queue-terminated) { queue-empty_waiters++; rv = apr_thread_cond_wait(queue-not_empty, queue-one_big_mutex); queue-empty_waiters--; if (rv != APR_SUCCESS) { apr_thread_mutex_unlock(queue-one_big_mutex); return rv; } } /* If we wake up and it's still empty, then we were interrupted */ if (apr_queue_empty(queue)) { Q_DBG(queue empty (intr), queue); rv = apr_thread_mutex_unlock(queue-one_big_mutex); if (rv != APR_SUCCESS) { return rv; } if (queue-terminated) { return APR_EOF; /* no more elements ever again */ } else { return APR_EINTR; } } } *data = queue-data[queue-out]; queue-nelts--; queue-out = (queue-out + 1) % queue-bounds; if (queue-full_waiters) { Q_DBG(signal !full, queue); rv = apr_thread_cond_signal(queue-not_full); if (rv != APR_SUCCESS) { apr_thread_mutex_unlock(queue-one_big_mutex); return rv; } } rv = apr_thread_mutex_unlock(queue-one_big_mutex); return rv; } Is the trypop method returning without unlocking the mutex? rv = apr_thread_mutex_lock(queue-one_big_mutex); if (rv != APR_SUCCESS) { return rv; } On Tue, Sep 8, 2009 at 7:06 PM, Michael Giagnocavo m...@giagnocavo.netwrote: I’m not sure how EventConsumer is supposed to work – maybe one of the real devs can explain how pop works and if it should fail on 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 managed C# / .NET I build this out. This seems to work fine: ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { * Event ev = con.pop(1);* Log.WriteLine(LogLevel.Alert, Event: + ev.GetHeader(Event-Name)); //freeswitch.msleep(100); } }); With Event ev = con.pop(0) however FS crashes with a System.NullReferenceException (attached) On Tue, Sep 8, 2009 at 5:20 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: Oh, I see... all those years wasted doing java stuff! :D On Tue, Sep 8, 2009 at 22:46, Michael Giagnocavo m...@giagnocavo.net wrote: “ ThreadPool.QueueUserWorkItem((o) =” That starts a lambda, which is compiled to a delegate, same as anonymous methods. Guess I’ll wait for him to respond on the crash he gets. *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 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 is an example that, at least on my system (I reached my home pc in the meanwhile), works fine. public class LoadPluginDemo :
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
I'm running of the binary release, so I don't have debug symbols for the freeswitch core. I can do a build...but does somebody else already have one handy? -Josh On Tue, Sep 8, 2009 at 10:33 PM, Mathieu Rene mrene_li...@avgs.ca wrote: Click Break, then go in Window, Debug, Stack Trace (or something similar, I don't have any VS nearby), then copy paste that. Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mr...@avgs.ca On 8-Sep-09, at 10:30 PM, Josh Rivers wrote: Here is the error I get with the loop I mentioned. -Josh Capture.PNG On Tue, Sep 8, 2009 at 5:05 AM, Michael Giagnocavo m...@giagnocavo.netwrote: Hi, Can you please elaborate on the crash you receive when you queue a thread during load? 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:* 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 : ILoadNotificationPlugin { public bool Load() { EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } } } However, if I fork off a thread here, freeswitch crashes: public class TestLoop : ILoadNotificationPlugin { public bool Load() { ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(0); Log.WriteLine(LogLevel.Notice, Event: + ev.serialized_string); freeswitch.msleep(100); } }); return true; } } It doesn't look like this is a good place to start a long-running process? Thanks! Josh On Mon, Sep 7, 2009 at 11:05 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: 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 a charm :) Ciao, Raffaele On Sun, Sep 6, 2009 at 22:50, Josh Rivers j...@radianttiger.com wrote: 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? quote author=Phillip Jones Exactly what I was after - thank you! On Thu, Sep 3, 2009 at 1:54 PM, Jeff Lenk jl...@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! ___ 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 ___ 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
Re: [Freeswitch-users] Subscribing to events in managed C# / .NET
Is the trypop method returning without unlocking the mutex? No, since the condition returns if a lock could NOT be acquired. (hence the try). Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mr...@avgs.ca On 8-Sep-09, at 10:46 PM, Josh Rivers wrote: I confirmed that pop(1) works for me. since it's spinning in it's own thread, that's probably the right solution. These are the relevant pieces of core code, though: APU_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data) { apr_status_t rv; if (queue-terminated) { return APR_EOF; /* no more elements ever again */ } rv = apr_thread_mutex_lock(queue-one_big_mutex); if (rv != APR_SUCCESS) { return rv; } if (apr_queue_empty(queue)) { rv = apr_thread_mutex_unlock(queue-one_big_mutex); return APR_EAGAIN; } *data = queue-data[queue-out]; queue-nelts--; queue-out = (queue-out + 1) % queue-bounds; if (queue-full_waiters) { Q_DBG(signal !full, queue); rv = apr_thread_cond_signal(queue-not_full); if (rv != APR_SUCCESS) { apr_thread_mutex_unlock(queue-one_big_mutex); return rv; } } rv = apr_thread_mutex_unlock(queue-one_big_mutex); return rv; } AND APU_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data) { apr_status_t rv; if (queue-terminated) { return APR_EOF; /* no more elements ever again */ } rv = apr_thread_mutex_lock(queue-one_big_mutex); if (rv != APR_SUCCESS) { return rv; } /* Keep waiting until we wake up and find that the queue is not empty. */ if (apr_queue_empty(queue)) { if (!queue-terminated) { queue-empty_waiters++; rv = apr_thread_cond_wait(queue-not_empty, queue- one_big_mutex); queue-empty_waiters--; if (rv != APR_SUCCESS) { apr_thread_mutex_unlock(queue-one_big_mutex); return rv; } } /* If we wake up and it's still empty, then we were interrupted */ if (apr_queue_empty(queue)) { Q_DBG(queue empty (intr), queue); rv = apr_thread_mutex_unlock(queue-one_big_mutex); if (rv != APR_SUCCESS) { return rv; } if (queue-terminated) { return APR_EOF; /* no more elements ever again */ } else { return APR_EINTR; } } } *data = queue-data[queue-out]; queue-nelts--; queue-out = (queue-out + 1) % queue-bounds; if (queue-full_waiters) { Q_DBG(signal !full, queue); rv = apr_thread_cond_signal(queue-not_full); if (rv != APR_SUCCESS) { apr_thread_mutex_unlock(queue-one_big_mutex); return rv; } } rv = apr_thread_mutex_unlock(queue-one_big_mutex); return rv; } Is the trypop method returning without unlocking the mutex? rv = apr_thread_mutex_lock(queue-one_big_mutex); if (rv != APR_SUCCESS) { return rv; } On Tue, Sep 8, 2009 at 7:06 PM, Michael Giagnocavo m...@giagnocavo.net wrote: I’m not sure how EventConsumer is supposed to work – maybe one of the real devs can explain how pop works and if it should fail on 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 managed C# / .NET I build this out. This seems to work fine: ThreadPool.QueueUserWorkItem((o) = { Log.WriteLine(LogLevel.Notice, Thread Starting. ); EventConsumer con = new EventConsumer(all, ); while (true) { Event ev = con.pop(1); Log.WriteLine(LogLevel.Alert, Event: + ev.GetHeader(Event-Name)); //freeswitch.msleep(100); } }); With Event ev = con.pop(0) however FS crashes with a System.NullReferenceException (attached) On Tue, Sep 8, 2009 at 5:20 PM, Raffaele P. Guidi raffaele.p.gu...@gmail.com wrote: Oh, I see... all those years wasted doing java stuff! :D On Tue, Sep 8, 2009 at 22:46, Michael Giagnocavo m...@giagnocavo.net wrote: “ ThreadPool.QueueUserWorkItem((o) =” That starts a lambda, which is compiled to a delegate, same as anonymous methods. Guess I’ll wait for him to respond on the crash he gets. 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 12:22 PM To: freeswitch-users@lists.freeswitch.org Subject: Re: