Re: [Freeswitch-users] Fwd: hook to event or startup script which will hook to events?
On 14.02.2016 02:38, Abdul Hakeem wrote:
Hello Mimiko, Did you find any resolution to the issue ? Cheers, AH
No, no answers to my questions. I use start-up script in lua.conf and bind to event in order to avoid segfault. -- Mimiko desu.
I'ved created a Perl daemon for capturing specific events. You can filter to do so. Ido On Feb 14, 2016 9:37 AM, "Mimiko" <vbvbrj@gmail.com> wrote:
On 14.02.2016 02:38, Abdul Hakeem wrote:
Hello Mimiko, Did you find any resolution to the issue ? Cheers, AH
No, no answers to my questions.
I use start-up script in lua.conf and bind to event in order to avoid segfault.
-- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.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
On 14.02.2016 16:16, ik wrote:
I'ved created a Perl daemon for capturing specific events.
You can filter to do so.
Do you capture all events in your perl script? Do you need to restart perl script to capture new events after modifying the script? If think you do and while perl script is restarting events may be missed. I prefer to use lua, because it is integrated in FS code and is much faster. -- Mimiko desu.
On my case, I listen only for specific events, so I use the filter api call, but without it, you will get all events. On Feb 14, 2016 7:41 PM, "Mimiko" <vbvbrj@gmail.com> wrote:
On 14.02.2016 16:16, ik wrote:
I'ved created a Perl daemon for capturing specific events.
You can filter to do so.
Do you capture all events in your perl script?
Do you need to restart perl script to capture new events after modifying the script? If think you do and while perl script is restarting events may be missed.
I prefer to use lua, because it is integrated in FS code and is much faster.
-- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.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
I've asked this a year ago and did go on with script start-up. But I'm still wandering: Did someone compared performance on capturing events using with different hook types: 1) Run start-up scripts and do eventconsumer=freeswitch.EventConsumer("CUSTOM","callcenter::info") 2) <hook event="CUSTOM" subclass="callcenter::info" script="catch-event.lua"/> In case of first method, the lua script is read once into memory and is in executing state all time the FS is running. To reload script you need to restart FS. In case of second method, the lua script is read and executed for every event. No need to restart FS if script is changed. But it is read from file system every time an event, it is hooked, arise. If events came rarely, then hook event is better in my opinion. If events come lots, then the script should run always. But if events come, for example, 10-20 per sec, what will be better method to use from performance point of view? -- Mimiko desu.
The second one needs to init a whole new lua env for each event. It will be much heavier. On Sun, Mar 26, 2017 at 2:02 PM Mimiko <vbvbrj@gmail.com> wrote:
I've asked this a year ago and did go on with script start-up.
But I'm still wandering:
Did someone compared performance on capturing events using with different hook types:
1) Run start-up scripts and do eventconsumer=freeswitch.EventConsumer("CUSTOM","callcenter::info") 2) <hook event="CUSTOM" subclass="callcenter::info" script="catch-event.lua"/>
In case of first method, the lua script is read once into memory and is in executing state all time the FS is running. To reload script you need to restart FS.
In case of second method, the lua script is read and executed for every event. No need to restart FS if script is changed. But it is read from file system every time an event, it is hooked, arise.
If events came rarely, then hook event is better in my opinion. If events come lots, then the script should run always. But if events come, for example, 10-20 per sec, what will be better method to use from performance point of view?
-- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.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
On 27.03.2017 05:59, Michael Jerris wrote:
The second one needs to init a whole new lua env for each event. It will be much heavier.
Thank you for answer Michael. Thinking of it. 10-20 events per sec, if the events only needs to be parsed and populate a DB, for nowadays servers could be easily handled. The bottleneck could be the disk system. But if it will be stable this number of events per sec, then first method is preferred, as you pointed out. -- Mimiko desu.
Is there a ticket open on this segfault you are avoiding and how to reproduce it? -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Mimiko Sent: Sunday, February 14, 2016 1:35 AM To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> Subject: Re: [Freeswitch-users] Fwd: hook to event or startup script which will hook to events? On 14.02.2016 02:38, Abdul Hakeem wrote:
Hello Mimiko, Did you find any resolution to the issue ? Cheers, AH
No, no answers to my questions. I use start-up script in lua.conf and bind to event in order to avoid segfault. -- Mimiko desu. _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.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
On 14.02.2016 17:44, Ken Rice wrote:
Is there a ticket open on this segfault you are avoiding and how to reproduce it?
No, I didn't open any ticket, because my FS version is 1.3.13b cad607d72e compiled at 2013.01.18, so the bug may be fixed or may be not. I can't update right now the version. My main question is what is best to capture event? 1) Using <hook event="RECORD_STOP" script="script.lua"/> in lua.conf. 2) or using <param name="startup-script" value="script.lua"/> in lua.conf and hook to event like for e in (function() return con:pop(1) end) do.... Comparing performance and stability. Using 1st method has the advantage that I can change script without restarting FS. But at my version running it for several hours FS stops with segfault. If using 1st method to capture events is better, then I'll update FS and see if segfault persists or not. If 2nd method is better - then there is no need for me to update FS right now. To reproduce see my first message on this. -- Mimiko desu.
participants (4)
-
ik
-
Ken Rice
-
Michael Jerris
-
Mimiko